From da89c2499b1f0ead39310e53d47feaf8e95be550 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Sun, 17 Aug 2025 18:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E7=94=B3=E8=AF=B7=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E8=B0=83=E8=AF=95=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../card-replacement-apply.js | 56 +++ src/components/AttendanceCalendar/index.vue | 427 +++++++++--------- .../attendance-count/attendance-details.vue | 6 +- .../card-replacement-apply/add-apply-form.vue | 272 +++++++++++ .../card-replacement-apply/config.js | 52 +++ .../card-replacement-apply/index.vue | 265 ++++++++++- .../select-person-and-date.vue | 303 +++++++++++++ 7 files changed, 1153 insertions(+), 228 deletions(-) create mode 100644 src/api/construction-person/attendance-manage/card-replacement-apply.js create mode 100644 src/views/construction-person/attendance-manage/card-replacement-apply/add-apply-form.vue create mode 100644 src/views/construction-person/attendance-manage/card-replacement-apply/config.js create mode 100644 src/views/construction-person/attendance-manage/card-replacement-apply/select-person-and-date.vue diff --git a/src/api/construction-person/attendance-manage/card-replacement-apply.js b/src/api/construction-person/attendance-manage/card-replacement-apply.js new file mode 100644 index 0000000..53f89f7 --- /dev/null +++ b/src/api/construction-person/attendance-manage/card-replacement-apply.js @@ -0,0 +1,56 @@ +import request from '@/utils/request' +import requestFormData from '@/utils/request_formdata' + +// 新增补卡申请 +export const addCardReplacementApplyAPI = (data) => { + return requestFormData({ + url: '/bmw/cardApply/saveRepairCardApply', + method: 'POST', + data, + }) +} + +// 获取补卡人员列表接口 +export const getCardReplacementPersonListAPI = (data) => { + return request({ + url: '/bmw/cardApply/workPersonList', + method: 'GET', + params: data, + }) +} + +// 获取补卡人员考勤记录 +export const getCardReplacementPersonCheckRecordAPI = (data) => { + return request({ + url: '/bmw/cardApply/getCheckRecord', + method: 'GET', + params: data, + }) +} + +// 修改补卡申请 +export const editCardReplacementApplyAPI = (data) => { + return request({ + url: '/bmw/pmAttDevice/updatePmAttDevice', + method: 'POST', + data, + }) +} + +// 删除补卡申请 +export const deleteCardReplacementApplyAPI = (data) => { + return request({ + url: '/bmw/pmAttDevice/delPmAttDevice', + method: 'POST', + data, + }) +} + +// 获取补卡申请列表 +export const getCardReplacementApplyListAPI = (data) => { + return request({ + url: '/bmw/cardApply/list', + method: 'GET', + params: data, + }) +} diff --git a/src/components/AttendanceCalendar/index.vue b/src/components/AttendanceCalendar/index.vue index 225fa31..beea920 100644 --- a/src/components/AttendanceCalendar/index.vue +++ b/src/components/AttendanceCalendar/index.vue @@ -1,76 +1,78 @@ + + diff --git a/src/views/construction-person/attendance-manage/card-replacement-apply/config.js b/src/views/construction-person/attendance-manage/card-replacement-apply/config.js new file mode 100644 index 0000000..4286a1b --- /dev/null +++ b/src/views/construction-person/attendance-manage/card-replacement-apply/config.js @@ -0,0 +1,52 @@ +export const formLabel = [ + { + isShow: false, // 是否展示label + f_type: 'ipt', + f_label: '姓名', + f_model: 'deviceCode', + }, + { + isShow: false, // 是否展示label + f_type: 'ipt', + f_label: '工程', + f_model: 'deviceName', + }, + { + isShow: false, // 是否展示label + f_type: 'ipt', + f_label: '状态', + f_model: 'proName', + }, +] + +export const columnsList = [ + { t_props: 'deviceCode', t_label: '工程名称' }, + { t_props: 'deviceName', t_label: '补卡人数' }, + { t_props: 'proName', t_label: '补卡天数' }, + { t_slot: 'isShanghai', t_label: '补卡说明' }, + { + t_label: '申请人', + t_slot: 'onLine', + }, + { t_label: '绑定人', t_props: '申请时间' }, + { + t_label: '审核状态', + t_props: 'updateTime', + }, + { + t_label: '审核人', + t_props: 'updateTime', + }, + { + t_label: '审核时间', + t_props: 'updateTime', + }, +] + +export const dialogConfig = { + outerTitle: '', + minHeight: '', + maxHeight: '', + outerWidth: '40%', + outerVisible: false, +} diff --git a/src/views/construction-person/attendance-manage/card-replacement-apply/index.vue b/src/views/construction-person/attendance-manage/card-replacement-apply/index.vue index 3d034a0..ee7866e 100644 --- a/src/views/construction-person/attendance-manage/card-replacement-apply/index.vue +++ b/src/views/construction-person/attendance-manage/card-replacement-apply/index.vue @@ -1,11 +1,268 @@ +import TableModel from '@/components/TableModel' +import DialogModel from '@/components/DialogModel' - +import AddApplyForm from './add-apply-form.vue' +import { formLabel, columnsList, dialogConfig } from './config' +import { + deleteAttendanceMachineAPI, + getCardReplacementApplyListAPI, +} from '@/api/construction-person/attendance-manage/card-replacement-apply' + +import { getLotProjectSelectListCommonFun } from '@/utils/getCommonData' +export default { + name: 'CardReplacementApply', + components: { + TableModel, + DialogModel, + + AddApplyForm, + }, + + data() { + return { + formLabel, + columnsList, + dialogConfig, + editFormData: {}, // 修改时回显的数据 + getCardReplacementApplyListAPI, + + lotProjectOptions: [], + selectProjectId: '', + selectProjectName: '', + } + }, + methods: { + // 导出按钮 + onHandleExportAttendanceMachine(queryParams) { + this.download( + '/bmw/pmAttDevice/export', + { + ...queryParams, + }, + `考勤机列表.xlsx`, + ) + }, + + // 新增或修改 + onHandleAddOrBindAttendanceMachine(type, data) { + this.dialogConfig.outerTitle = + type === 1 ? '新增考勤机' : '绑定考勤机' + + if (type === 2) { + const { proId, deviceCode, deviceName } = data + + this.editFormData = { + isUpdate: true, + proId, + deviceCode, + deviceName, + } + } else { + this.editFormData = {} + } + this.dialogConfig.outerVisible = true + }, + + // 新增补卡申请 + onHandleAddCardReplacementApply(type, data) { + this.dialogConfig.outerTitle = '选择补卡工程' + this.dialogConfig.outerWidth = '30%' + this.dialogConfig.minHeight = '' + this.dialogConfig.maxHeight = '' + this.dialogConfig.outerVisible = true + }, + + // 删除 + onHandleDeleteSubBaseInfo(data) { + this.$confirm('确定删除该考勤机吗?', '温馨提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }) + .then(async () => { + const res = await deleteAttendanceMachineAPI({ + deviceCode: data.deviceCode, + }) + if (res.code === 200) { + this.$modal.msgSuccess('删除成功') + this.$refs.attendanceMachineTableRef.getTableList() // 更新列表 + } + }) + .catch(() => { + // console.log('取消') + }) + }, + + // 确定按钮 + onHandleConfirm() { + console.log('确定') + }, + + // 最终的确定按钮 + async onHandleConfirmFinish() { + this.$refs.addApplyFormRef.onHandleConfirmFinishFun() + // try { + // await + // this.handleCloseDialogOuter() + // // this.$refs.attendanceMachineTableRef.getTableList() + // } catch (error) { + // // console.log('表单提交失败', error) + // } + }, + + // 关闭弹框 + handleCloseDialogOuter() { + this.dialogConfig.outerVisible = false + }, + + // 下一步 + onHandleNextStep() { + if (!this.selectProjectId) { + this.$modal.msgError('请选择补卡工程') + return + } + + this.dialogConfig.outerTitle = '新增补卡申请' + this.dialogConfig.outerWidth = '80%' + this.dialogConfig.minHeight = '80vh' + this.dialogConfig.maxHeight = '80h' + this.dialogConfig.outerVisible = true + }, + + // 选择补卡工程 + handleSelectProject() { + this.selectProjectName = this.lotProjectOptions.find( + (item) => item.value === this.selectProjectId, + ).label + }, + }, + + async created() { + const lot = await getLotProjectSelectListCommonFun() + this.lotProjectOptions = lot.map((item) => ({ + value: item.id, + label: item.proName, + })) + }, +} + diff --git a/src/views/construction-person/attendance-manage/card-replacement-apply/select-person-and-date.vue b/src/views/construction-person/attendance-manage/card-replacement-apply/select-person-and-date.vue new file mode 100644 index 0000000..9f5a034 --- /dev/null +++ b/src/views/construction-person/attendance-manage/card-replacement-apply/select-person-and-date.vue @@ -0,0 +1,303 @@ + + + + +