From 1751c8cb167e2c3619b24fc81ec06e5763b61bd9 Mon Sep 17 00:00:00 2001 From: zhangdi <15053473693@163.com> Date: Mon, 2 Mar 2026 14:46:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E7=AE=A1=E7=90=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/flowManagement/addDialog.vue | 89 +++++++++++++---- .../flowManagement/managementOfKeyTasks.vue | 41 +++++--- src/views/flowManagement/milestoneDialog.vue | 95 +++++++++++++------ 3 files changed, 166 insertions(+), 59 deletions(-) diff --git a/src/views/flowManagement/addDialog.vue b/src/views/flowManagement/addDialog.vue index eef2b3e..7f4a602 100644 --- a/src/views/flowManagement/addDialog.vue +++ b/src/views/flowManagement/addDialog.vue @@ -206,7 +206,7 @@ align="center" :width="isDetail ? '120' : ''" label="里程碑负责人" - prop="milestoneMan" + prop="milestoneMemo" > @@ -302,7 +305,12 @@ label="执行类型" prop="executeType" :width="isDetail ? '120' : ''" - > + > + + + > + + + > + + > + + @@ -392,6 +411,7 @@ export default { }, data() { return { + loadingShow:false, formError: '', addRules: { projectName: [{ required: true, message: '请填写项目名称', trigger: ['blur', 'submit'] }], @@ -440,7 +460,7 @@ export default { milestonePlan: [ { required: true, message: '请填写里程碑计划', trigger: ['blur', 'submit'] }, ], - milestoneMan: [ + milestoneMemo: [ { required: true, message: '请选择里程碑负责人', trigger: ['change', 'submit'] }, ], outputMaterial: [ @@ -457,6 +477,7 @@ export default { addForm: { stoneList: [], }, + executeResultList: [], // 执行类型 }; }, computed: { @@ -472,9 +493,26 @@ export default { this.getDeplList(); if (this.title === '详情' || this.title === '修改') { this.getDetails(); + this.getExecuteResultList(); } }, methods: { + executeTypeFn(type) { + const item = this.executeResultList.find(item => item.dictKey === type); + return item ? item.dictValue : ''; + }, + getExecuteTypeText(type) { + const item = this.executeResultList.find(item => item.dictKey === type); + console.log('item', item); + return item ? item.dictValue : ''; + }, + + handleStoneListChange(index, row, type) { + if (type === 'milestoneMemo') { + let sel = this.memberList.filter(item => item.id == row.milestoneMemo)[0]; + this.addForm.stoneList[index].milestoneMan = sel.realName; + } + }, handleChange(type) { // 制单部门 if (type == 'touchingDeptId') { @@ -506,11 +544,22 @@ export default { this.projectType = res.data.data; }); }, + // 获取执行类型字典 + getExecuteResultList() { + getDictionary({ code: 'flow_project_executeResult' }).then(res => { + this.executeResultList = res.data.data; + }); + }, // 获取详情数据 getDetails() { getProcessDetail(this.rowItem.id).then(res => { console.log(res.data.data, 'res'); this.addForm = res.data.data; + const records = res.data.data; + this.addForm.stoneList = records.stoneList.map(item => { + item.executeTypeText = this.getExecuteTypeText(item.executeType); + return item; + }); // 安全地处理 memberName 回显 if (res.data.data.memberName) { this.addForm.memberName = String(res.data.data.memberName) @@ -537,13 +586,12 @@ export default { // 插入里程碑行 handleOpenDialog() { const newRow = { - id: 0, + id: null, fmProjectApplication: {}, attachList: [], // 附件列表默认空数组 paId: 0, paIndex: `${(this.addForm.stoneList?.length || 0) + 1}`, milestonePlan: '', - milestoneMan: '', outputMaterial: '', milestoneNode: '', milestoneMemo: '', @@ -610,6 +658,7 @@ export default { }); return; } + this.loadingShow = true const submitData = this.formatSubmitData(this.addForm); submitData.projectStartTime = submitData.projectStartTime + ' 00:00:00'; submitData.projectDesiredEnd = submitData.projectDesiredEnd + ' 00:00:00'; @@ -617,13 +666,19 @@ export default { updateProcess({ ...submitDat, approvalStatus: 1 }).then(res => { this.$message.success('修改成功'); this.handleClose(true); - }); + this.loadingShow = false + }).catch(err=>{ + this.loadingShow = false + }) return; } else { addProcess({ ...submitData, approvalStatus: 1 }).then(res => { this.$message.success('提交成功'); this.handleClose(true); - }); + this.loadingShow = false + }).catch(err=>{ + this.loadingShow = false + }) } }); }, diff --git a/src/views/flowManagement/managementOfKeyTasks.vue b/src/views/flowManagement/managementOfKeyTasks.vue index 1f5b39f..88e3d92 100644 --- a/src/views/flowManagement/managementOfKeyTasks.vue +++ b/src/views/flowManagement/managementOfKeyTasks.vue @@ -58,7 +58,11 @@ {{ scope.row.milestoneNode ? scope.row.milestoneNode.substring(0, 10) : '' }} - + + + - + + + @@ -222,6 +223,7 @@ export default { }, data() { return { + loadingShow: false, openShow: false, memberList: [], executeForm: {}, @@ -239,12 +241,20 @@ export default { this.openShow = this.showDialog; this.executeForm = this.rowItem; console.log(this.detailForm, 'title'); + this.detailForm.checkResult = null; this.subTitle = this.title; console.log(this.rowItem, 'rowItem'); this.getRoleUserList(); this.getExecuteResult(); }, methods: { + executeTypeChange() { + this.detailForm.delayTime = ''; + }, + handleUserChange() { + this.detailForm.checkMan = + this.memberList.find(item => item.id === this.detailForm.userId)?.realName || ''; + }, getExecuteResult() { getDictionary({ code: 'flow_project_executeResult' }).then(res => { this.executeResultList = res.data.data; @@ -263,9 +273,9 @@ export default { submit() { this.$refs.executeForm.validate(valid => { if (valid) { + this.loadingShow = true; // this.executeDialog = false; if (this.title == '执行') { - this.executeForm.delayTime = this.executeForm.delayTime + ' 00:00:00'; let query_ = { ...this.detailForm, fmProjectApplication: { @@ -275,11 +285,17 @@ export default { }; query_.checkResult = 1; query_.fmProjectApplication.approvalStatus = 4; - console.log(query_, 'query_'); - projectExecute(query_).then(res => { - this.$message.success('操作成功!'); - this.closeDialog(); - }); + query_.fmProjectApplication.delayTime = + query_.fmProjectApplication.delayTime + ' 00:00:00'; + projectExecute(query_) + .then(res => { + this.$message.success('操作成功!'); + this.closeDialog(); + this.loadingShow = false; + }) + .catch(err => { + this.loadingShow = false; + }); } if (this.title == '核查') { let query_ = { @@ -289,17 +305,22 @@ export default { }, // attachList: this.existingFiles, }; - if (query_.checkResult == 2) { - query_.fmProjectApplication.approvalStatus = 6; - } - if (query_.checkResult == 3) { - query_.fmProjectApplication.approvalStatus = 5; - } + // if (query_.checkResult == 2) { + // query_.fmProjectApplication.approvalStatus = 6; + // } + // if (query_.checkResult == 3) { + // query_.fmProjectApplication.approvalStatus = 5; + // } console.log(query_, '核查query_'); - projectCheck(query_).then(res => { - this.$message.success('操作成功!'); - this.closeDialog(); - }); + projectCheck(query_) + .then(res => { + this.$message.success('操作成功!'); + this.closeDialog(); + this.loadingShow = false; + }) + .catch(err => { + this.loadingShow = false; + }); } if (this.title == '核准') { let query_ = { @@ -314,20 +335,34 @@ export default { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', - }).then(() => { - // return removePersonAbility(row.id); - query_.fmProjectApplication.approvalStatus = 7; - projectApprove(query_).then(res => { + }) + .then(() => { + // return removePersonAbility(row.id); + // query_.fmProjectApplication.approvalStatus = 7; + projectApprove(query_) + .then(res => { + this.$message.success('操作成功!'); + this.closeDialog(); + this.loadingShow = false; + }) + .catch(err => { + this.loadingShow = false; + }); + }) + .catch(() => { + this.loadingShow = false; + }); + } else { + // query_.fmProjectApplication.approvalStatus = 8; + projectApprove(query_) + .then(res => { this.$message.success('操作成功!'); this.closeDialog(); + this.loadingShow = false; + }) + .catch(err => { + this.loadingShow = false; }); - }); - } else { - query_.fmProjectApplication.approvalStatus = 8; - projectApprove(query_).then(res => { - this.$message.success('操作成功!'); - this.closeDialog(); - }); } } }