diff --git a/src/views/dataManage/envMonitoring/index.vue b/src/views/dataManage/envMonitoring/index.vue index f4c546a..4d6f1de 100644 --- a/src/views/dataManage/envMonitoring/index.vue +++ b/src/views/dataManage/envMonitoring/index.vue @@ -239,8 +239,8 @@ diff --git a/src/views/dataManage/projectManage/index.vue b/src/views/dataManage/projectManage/index.vue index 588f102..7edfe85 100644 --- a/src/views/dataManage/projectManage/index.vue +++ b/src/views/dataManage/projectManage/index.vue @@ -76,7 +76,11 @@ label="计划状态" prop="planStatus" align="center" - /> + > + + - - - - + + + + @@ -827,6 +831,11 @@ export default { todayRisk: false, bidCode: '', } + this.$nextTick(() => { + if (this.$refs.riskFormRef) { + this.$refs.riskFormRef.clearValidate() + } + }) this.riskDialogVisible = true }, @@ -834,15 +843,29 @@ export default { onHandleEditRisk(row) { this.riskDialogTitle = '编辑' this.riskEditId = row.id + // 处理planStatus字段:确保是字符串类型 + let planStatus = '' + if ( + row.planStatus !== null && + row.planStatus !== undefined && + row.planStatus !== '' + ) { + planStatus = String(row.planStatus) + } this.riskForm = { workContent: row.workContent || '', riskLevel: row.riskLevel || '', workStartTime: row.workStartTime || '', workEndTime: row.workEndTime || '', - planStatus: row.planStatus || '', + planStatus: planStatus, todayRisk: row.todayRisk || false, bidCode: row.bidCode || '', } + this.$nextTick(() => { + if (this.$refs.riskFormRef) { + this.$refs.riskFormRef.clearValidate() + } + }) this.riskDialogVisible = true }, @@ -876,6 +899,13 @@ export default { this.riskSubmitting = true try { const params = { ...this.riskForm } + // 确保planStatus是字符串类型 + if ( + params.planStatus !== null && + params.planStatus !== undefined + ) { + params.planStatus = String(params.planStatus) + } if (this.riskEditId) { params.id = this.riskEditId } @@ -1178,6 +1208,19 @@ export default { this.projectList = res.data } }, + + // 获取计划状态文本 + getPlanStatusText(status) { + const statusMap = { + 1: '已完成', + 2: '进行中', + 3: '未完成', + 4: '延期', + } + // 处理数字类型和字符串类型 + const statusStr = String(status) + return statusMap[statusStr] || status || '-' + }, }, } diff --git a/src/views/dataManage/projectProgress/components/addAndEditForm.vue b/src/views/dataManage/projectProgress/components/addAndEditForm.vue index e61954a..09b1191 100644 --- a/src/views/dataManage/projectProgress/components/addAndEditForm.vue +++ b/src/views/dataManage/projectProgress/components/addAndEditForm.vue @@ -42,7 +42,7 @@ placeholder="请选择工序" > - + @@ -131,6 +131,23 @@ + + + + + + + + + + + + @@ -161,10 +178,10 @@ export default { gx: '', planStartTime: '', planEndTime: '', - endTime: '', inUser: '', inDevice: '', + status: '', }, addAndEditFormRules: { bidCode: [ @@ -224,6 +241,13 @@ export default { trigger: 'blur', }, ], + status: [ + { + required: true, + message: '请选择状态', + trigger: 'change', + }, + ], }, projectList: [], } @@ -277,16 +301,45 @@ export default { inUser, inDevice, bidCode, + status, } = newVal this.addAndEditForm.gxType = gxType this.addAndEditForm.gx = gx this.addAndEditForm.planStartTime = planStartTime this.addAndEditForm.planEndTime = planEndTime - this.addAndEditForm.endTime = endTime this.addAndEditForm.inUser = inUser this.addAndEditForm.inDevice = inDevice this.addAndEditForm.bidCode = bidCode + // 处理status字段:确保是字符串类型 + if ( + status !== null && + status !== undefined && + status !== '' + ) { + this.addAndEditForm.status = String(status) + } else { + this.addAndEditForm.status = '' + } + } else { + // 新增时重置表单 + this.addAndEditForm = { + bidCode: '', + gxType: '', + gx: '', + planStartTime: '', + planEndTime: '', + endTime: '', + inUser: '', + inDevice: '', + status: '', + } + // 清除表单验证 + this.$nextTick(() => { + if (this.$refs.addAndEditFormRef) { + this.$refs.addAndEditFormRef.clearValidate() + } + }) } }, immediate: true, diff --git a/src/views/dataManage/projectProgress/index.vue b/src/views/dataManage/projectProgress/index.vue index 89d6287..55105a6 100644 --- a/src/views/dataManage/projectProgress/index.vue +++ b/src/views/dataManage/projectProgress/index.vue @@ -70,8 +70,7 @@