1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

attendance

This commit is contained in:
gzw
2023-05-06 02:46:23 +08:00
parent 2fa80301e2
commit b6bc16582f
6 changed files with 73 additions and 52 deletions

View File

@@ -5,9 +5,4 @@
#attendanceMain1{
margin-bottom:10px ;
}
/*
#attendanceMain{
width: 100vw;
height: 100vh;
}*/

View File

@@ -157,12 +157,13 @@
</div>
</template>
<script lang="ts">
import axios from 'axios'
import { SIZE_ICON_SM, SIZE_ICON_XL } from '@/constants/Common.constants.js'
import { ElMessage } from 'element-plus'
import 'element-plus/theme-chalk/el-message.css'
import _ from 'lodash'
import '@/assets/css/attendance.css'
import _ from 'lodash'
import request from '@/services'
export default {
name: 'AttendanceHome',
data() {
@@ -220,8 +221,8 @@ export default {
},
// 获取所有考勤信息
getAttendances() {
axios
.get('http://localhost:8621/attendance/findAllAttendance')
request
.get('/attendance/findAllAttendance')
.then((response) => {
console.log(response.data.data)
this.tableData = response.data.data
@@ -235,12 +236,10 @@ export default {
const start = this.handleDateFormatUTC(this.attTime[0])
const end = this.handleDateFormatUTC(this.attTime[1])
console.log(start + '\t' + end)
axios
.get('http://localhost:8621/attendance/findAttendanceByTime', {
params: {
startTime: start,
endTime: end
}
request
.get('/attendance/findAttendanceByTime', {
startTime: start,
endTime: end
})
.then((response) => {
console.log(response.data.data)
@@ -294,8 +293,8 @@ export default {
},
// 处理保存
doSave() {
axios
.post('http://localhost:8621/attendance/saveAttendance', this.form)
request
.post('/attendance/saveAttendance', this.form)
.then((response) => {
this.dialogFormVisible = false
this.getAttendances()
@@ -340,8 +339,8 @@ export default {
// 操作删除
handleDelete(id) {
console.log(id)
axios
.delete('http://localhost:8621/attendance/delAttendance/' + id)
request
.delete('/attendance/delAttendance/' + id)
.then((response) => {
if (response) {
ElMessage({
@@ -368,8 +367,8 @@ export default {
// 批量删除
delBatch() {
const map = this.multipleSelection.map((v) => v.id)
axios
.post('http://localhost:8621/attendance/delBatchAttendance', map)
request
.post('/attendance/delBatchAttendance', map)
.then((response) => {
if (response) {
ElMessage({

View File

@@ -88,15 +88,6 @@
<div>
<el-dialog v-model="dialogFormVisible" title="考勤信息" width="25%">
<el-form ref="ruleForm" :rules="rules" :model="form" :label-width="formLabelWidth">
<el-form-item label="用户编号" prop="userId">
<el-input
v-model="form.userId"
autocomplete="off"
style="width: 200px"
disabled
/>
</el-form-item>
<el-form-item label="考勤时间" v-model="attTime" prop="attTime">
<div class="block">
<el-date-picker
@@ -121,11 +112,12 @@
</template>
<script lang="ts">
import axios from 'axios'
import { SIZE_ICON_SM, SIZE_ICON_XL } from '@/constants/Common.constants.js'
import { ElMessage } from 'element-plus'
import 'element-plus/theme-chalk/el-message.css'
import _ from 'lodash'
import '@/assets/css/attendance.css'
import request from '@/services'
export default {
name: 'UserAttendance',
@@ -133,7 +125,7 @@ export default {
return {
attendance: '',
id: '',
userId: 1,
userId: '',
username: '',
attTime: '',
attTimeB: [],
@@ -197,13 +189,10 @@ export default {
const start = this.handleDateFormatUTC(this.attTimeB[0])
const end = this.handleDateFormatUTC(this.attTimeB[1])
console.log(start + '\t' + end)
axios
.get('http://localhost:8621/attendance/findOneAttendanceByTime', {
params: {
startTime: start,
endTime: end,
userId: this.userId
}
request
.get('/attendance/findOneAttendanceByTime', {
startTime: start,
endTime: end
})
.then((response) => {
console.log(response.data.data)
@@ -223,8 +212,8 @@ export default {
})
},
getAttendancesByUserId() {
axios
.get('http://localhost:8621/attendance/selectAttendance/' + this.userId)
request
.get('/attendance/selectAttendance')
.then((response) => {
console.log(response.data.data)
this.tableData = response.data.data
@@ -246,8 +235,8 @@ export default {
})
},
doSave() {
axios
.post('http://localhost:8621/attendance/saveOneAttendance', this.form)
request
.post('/attendance/saveOneAttendance', this.form)
.then((response) => {
this.dialogFormVisible = false
this.getAttendancesByUserId()

View File

@@ -31,7 +31,7 @@ const router = createRouter({
{
path: 'manage',
component: async () => await import('@/pages/work/Manage.vue'),
name: 'manage',
name: 'workManage',
meta: {
title: '工作管理',
requiresScrollbar: false,
@@ -69,6 +69,40 @@ const router = createRouter({
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: '/attendance',
name: 'attendance',
children: [
{
path: 'manage',
component: async () =>
await import('@/pages/attendance/AttendanceHome.vue'),
name: 'attendanceManage',
meta: {
title: '考勤管理',
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: 'user',
component: async () =>
await import('@/pages/attendance/UserAttendance.vue'),
name: 'user',
meta: {
title: '员工考勤',
requiresScrollbar: false,
requiresPadding: true
}
}
],
meta: {
title: '考勤',
icon: IconPinnacleAttendance,
requiresScrollbar: false,
requiresPadding: true
}
}
]
},