mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 15:01:23 +08:00
Split the punch card assembly
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form ref="ruleForm" :rules="rules" :model="form" :label-width="formLabelWidth">
|
<el-form ref="ruleForm" :rules="rules" :model="form" :label-width="formLabelWidth">
|
||||||
<el-form-item label="用户名" prop="userId">
|
<el-form-item label="用户" prop="userId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.userId"
|
v-model="form.userId"
|
||||||
filterable
|
filterable
|
||||||
80
ui/src/components/attendance/EditOneAttendance.vue
Normal file
80
ui/src/components/attendance/EditOneAttendance.vue
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<template>
|
||||||
|
<el-form ref="ruleForm" :model="form" :label-width="formLabelWidth">
|
||||||
|
<el-form-item label="考勤时间" prop="attTime">
|
||||||
|
<el-date-picker v-model="form.attTime" type="datetime" disabled style="width: 200px" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm()">确认</el-button>
|
||||||
|
<el-button @click="cancel">取消</el-button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import _ from 'lodash'
|
||||||
|
import request from '@/services'
|
||||||
|
import { DATABASE_SAVE_OK } from '@/constants/Common.constants'
|
||||||
|
export default {
|
||||||
|
name: 'EditOneAttendance',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formLabelWidth: '80px',
|
||||||
|
form: {
|
||||||
|
attTime: new Date()
|
||||||
|
},
|
||||||
|
nowTime: new Date()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
formData: {}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submitForm() {
|
||||||
|
this.doSave()
|
||||||
|
},
|
||||||
|
// 点击取消
|
||||||
|
cancel() {
|
||||||
|
ElMessage({
|
||||||
|
message: '取消操作',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
this.$emit('setDialogVisible', false)
|
||||||
|
},
|
||||||
|
alarm() {
|
||||||
|
setInterval(() => {
|
||||||
|
this.form.attTime = new Date()
|
||||||
|
}, 500)
|
||||||
|
},
|
||||||
|
doSave() {
|
||||||
|
request
|
||||||
|
.post('/attendance/saveOneAttendance', this.form)
|
||||||
|
.then((response) => {
|
||||||
|
if (response.data.code === DATABASE_SAVE_OK) {
|
||||||
|
ElMessage({
|
||||||
|
message: '签到成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
this.$emit('setDialogVisible', false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((reportError) => {
|
||||||
|
ElMessage({
|
||||||
|
message: '签到成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.alarm()
|
||||||
|
if (this.formData) {
|
||||||
|
this.form = _.cloneDeep(this.formData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
@@ -130,6 +130,7 @@
|
|||||||
width="25% "
|
width="25% "
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
|
style="min-width: 320px"
|
||||||
>
|
>
|
||||||
<edit-attendance
|
<edit-attendance
|
||||||
:users="users"
|
:users="users"
|
||||||
@@ -144,6 +145,7 @@
|
|||||||
width="25% "
|
width="25% "
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
|
style="min-width: 320px"
|
||||||
>
|
>
|
||||||
<edit-attendance
|
<edit-attendance
|
||||||
:users="users"
|
:users="users"
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="dialogFormVisible"
|
v-model="dialogFormVisible"
|
||||||
title="考勤信息"
|
title="考勤信息"
|
||||||
@@ -80,18 +81,7 @@
|
|||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
>
|
>
|
||||||
<el-form ref="ruleForm" :model="form" :label-width="formLabelWidth">
|
<edit-one-attendance @setDialogVisible="setDialogVisible"></edit-one-attendance>
|
||||||
<el-form-item label="考勤时间" v-model="attTime" prop="attTime">
|
|
||||||
<el-date-picker v-model="nowTime" type="datetime" disabled style="width: 200px" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm()">确认</el-button>
|
|
||||||
<el-button @click="cancel">取消</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -113,11 +103,7 @@ export default {
|
|||||||
attTime: [],
|
attTime: [],
|
||||||
attTimeB: [],
|
attTimeB: [],
|
||||||
status: '',
|
status: '',
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0,
|
|
||||||
nowTime: new Date(),
|
nowTime: new Date(),
|
||||||
formLabelWidth: '80px',
|
|
||||||
dataLoading: true,
|
dataLoading: true,
|
||||||
value1: '',
|
value1: '',
|
||||||
form: {
|
form: {
|
||||||
@@ -152,6 +138,10 @@ export default {
|
|||||||
newFormat = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
|
newFormat = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
|
||||||
return newFormat
|
return newFormat
|
||||||
},
|
},
|
||||||
|
setDialogVisible(dialogVisible) {
|
||||||
|
this.dialogFormVisible = dialogVisible
|
||||||
|
this.getAttendancesByUserId()
|
||||||
|
},
|
||||||
|
|
||||||
// 重置参数
|
// 重置参数
|
||||||
resetParam() {
|
resetParam() {
|
||||||
@@ -215,44 +205,9 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.dialogFormVisible = true
|
this.dialogFormVisible = true
|
||||||
// this.getNowDate()
|
// this.getNowDate()
|
||||||
this.nowTime = new Date()
|
|
||||||
this.form.attTime = this.nowTime
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.userId = this.userId + ''
|
this.form.userId = this.userId + ''
|
||||||
})
|
})
|
||||||
},
|
|
||||||
doSave() {
|
|
||||||
request
|
|
||||||
.post('/attendance/saveOneAttendance', this.form)
|
|
||||||
.then((response) => {
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.getAttendancesByUserId()
|
|
||||||
})
|
|
||||||
.catch((reportError) => {})
|
|
||||||
},
|
|
||||||
|
|
||||||
submitForm() {
|
|
||||||
this.$refs.ruleForm.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.doSave()
|
|
||||||
ElMessage({
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
ElMessage.error('操作失败')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 点击取消
|
|
||||||
cancel() {
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
ElMessage({
|
|
||||||
message: '取消操作',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
this.getAttendancesByUserId()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user