diff --git a/src/views/modules/changeManagement/changeRecord.vue b/src/views/modules/changeManagement/changeRecord.vue index 2775291..cca40e2 100644 --- a/src/views/modules/changeManagement/changeRecord.vue +++ b/src/views/modules/changeManagement/changeRecord.vue @@ -4756,8 +4756,16 @@ this.$message.warning('请添加需要变更的技术参数卡!') return } - row.executeFlag = 'Y' - row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') + // 获取当前执行时间 + const executionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') + // 获取当前行的执行人 + const currentExecutor = row.executor + // 找出所有执行人相同的行,一起更新执行标识和执行时间 + const sameExecutorRows = this.chooseItemList.filter(item => item.executor === currentExecutor && item.executeFlag !== 'Y') + sameExecutorRows.forEach(item => { + item.executeFlag = 'Y' + item.itemExecutionDate = executionDate + }) this.costImpactData.changeTotalCost = this.totalCost this.executionInfoData.chooseItemList = this.chooseItemList this.executionInfoData.chooseItemList2 = this.chooseItemList2 @@ -4783,21 +4791,22 @@ this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) - row.executeFlag = '' - row.itemExecutionDate = '' + // 回滚:清除所有相同执行人的执行标识和时间 + sameExecutorRows.forEach(item => { + item.executeFlag = '' + item.itemExecutionDate = '' + }) } this.submitLoading = false }).catch(()=>{ + // 回滚:清除所有相同执行人的执行标识和时间 + sameExecutorRows.forEach(item => { + item.executeFlag = '' + item.itemExecutionDate = '' + }) this.submitLoading = false }) }) - // row.executeFlag = 'Y' - // row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') - // row.executor = this.$store.state.user.name - // // 执行时调用同意提交方法 // 2025-04-15 海波要求修改 一定会是审批中状态 - // if (this.modalData.changeStatus === '审批中') { - // this.agreeSubmit() - // } }, // 执行所选属性 @@ -4885,8 +4894,16 @@ this.$message.warning('请添加需要变更的技术参数卡!') return } - row.executeFlag = 'Y' - row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') + // 获取当前会签时间 + const executionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') + // 获取当前行的会签人(itemDesc 字段) + const currentCountersigner = row.itemDesc + // 找出所有会签人相同的行,一起更新会签标识和会签时间 + const sameCountersignerRows = this.chooseCSItemList.filter(item => item.itemDesc === currentCountersigner && item.executeFlag !== 'Y') + sameCountersignerRows.forEach(item => { + item.executeFlag = 'Y' + item.itemExecutionDate = executionDate + }) this.costImpactData.changeTotalCost = this.totalCost this.executionInfoData.chooseItemList = this.chooseItemList this.executionInfoData.chooseItemList2 = this.chooseItemList2 @@ -4912,11 +4929,19 @@ this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) - row.executeFlag = '' - row.itemExecutionDate = '' + // 回滚:清除所有相同会签人的会签标识和时间 + sameCountersignerRows.forEach(item => { + item.executeFlag = '' + item.itemExecutionDate = '' + }) } this.submitLoading = false }).catch(()=>{ + // 回滚:清除所有相同会签人的会签标识和时间 + sameCountersignerRows.forEach(item => { + item.executeFlag = '' + item.itemExecutionDate = '' + }) this.submitLoading = false }) })