From 4d894bb3cf3150eedde1d468d8293595c666e327 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 18 Aug 2025 17:12:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../person-entry/add-or-edit-form.vue | 58 +++++++++++++++++-- .../person-exit/index.vue | 8 +-- .../person-exit/person-exit-form.vue | 3 +- 3 files changed, 60 insertions(+), 9 deletions(-) diff --git a/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue b/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue index 331320f..7842abd 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue @@ -272,6 +272,8 @@ @@ -307,6 +309,7 @@ label-width="140px" ref="contractInfoFormRef" :model="contractInfoForm" + :rules="contractInfoFormRules" :disabled="isEditContract && formType === 2" > @@ -417,6 +422,8 @@ @@ -498,6 +505,8 @@ @@ -507,6 +516,8 @@ @@ -537,6 +548,8 @@ @@ -582,6 +595,19 @@ export default { UploadFileFormData, }, data() { + const validateContractStartDate = (rule, value, callback) => { + if (value >= this.contractInfoForm.contractStopDate) { + callback(new Error('合同签订日期不能大于合同终止日期')) + } + callback() + } + + const validateContractStopDate = (rule, value, callback) => { + if (value <= this.contractInfoForm.contractStartDate) { + callback(new Error('合同终止日期不能小于合同签订日期')) + } + callback() + } return { // 身份证读卡器表单 idCardReaderForm: { @@ -806,13 +832,13 @@ export default { { required: true, trigger: 'blur', - message: '请输入入场工程', + message: '请选择入场工程', }, ], postId: [ { required: true, - trigger: 'change', + trigger: 'blur', message: '请选择工种', }, ], @@ -820,7 +846,7 @@ export default { { required: true, trigger: 'blur', - message: '请输入入场分包', + message: '请选择入场分包', }, ], phone: [ @@ -839,7 +865,23 @@ export default { { required: true, trigger: 'blur', - message: '请输入入场班组', + message: '请选择入场班组', + }, + ], + }, + + // 合同信息表单校验 + contractInfoFormRules: { + contractStartDate: [ + { + validator: validateContractStartDate, + trigger: 'blur', + }, + ], + contractStopDate: [ + { + validator: validateContractStopDate, + trigger: 'blur', }, ], }, @@ -1046,6 +1088,14 @@ export default { } }) }) + + this.$refs.contractInfoFormRef.validate( + (valid) => { + if (!valid) { + reject(new Error('合同信息未完善')) + } + }, + ) } if (status_2 === 'partial') { diff --git a/src/views/construction-person/entry-and-exit-manage/person-exit/index.vue b/src/views/construction-person/entry-and-exit-manage/person-exit/index.vue index 151d936..81efe7a 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-exit/index.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-exit/index.vue @@ -216,13 +216,13 @@ export default { this.isExitUpload = type const { name, - idNumber, + id, + proId, proName, subName, - teamName, - id, + idNumber, workerId, - proId, + teamName, } = data this.exitFormData = { diff --git a/src/views/construction-person/entry-and-exit-manage/person-exit/person-exit-form.vue b/src/views/construction-person/entry-and-exit-manage/person-exit/person-exit-form.vue index 7c638f4..e70321e 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-exit/person-exit-form.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-exit/person-exit-form.vue @@ -118,7 +118,8 @@ export default { onHandleConfirmAddOrEditFun() { return new Promise(async (resolve, reject) => { if (this.isExitUpload === 1) { - const { id, workerId, fileList } = this.personExitFormData + const { id, workerId, fileList, proId } = + this.personExitFormData const params = { id, proId,