diff --git a/src/api/changeManagement/changeManagement.js b/src/api/changeManagement/changeManagement.js index 143b33b..9c8ac02 100644 --- a/src/api/changeManagement/changeManagement.js +++ b/src/api/changeManagement/changeManagement.js @@ -242,6 +242,13 @@ export const choosePartNoList = data => createAPI(`/plm/changeManagement/chooseP */ export const tpExecute = data => createAPI(`/plm/changeManagement/tpExecute`,'post',data) +/** + * 会签执行 + * @param data + * @returns {*} + */ +export const csExecute = data => createAPI(`/plm/changeManagement/csExecute`,'post',data) + diff --git a/src/views/modules/changeManagement/changeRecord.vue b/src/views/modules/changeManagement/changeRecord.vue index 737d61c..8f7a434 100644 --- a/src/views/modules/changeManagement/changeRecord.vue +++ b/src/views/modules/changeManagement/changeRecord.vue @@ -598,16 +598,16 @@ - - - - - - - - - - + + + @@ -1303,7 +1303,8 @@ countersignatureUpdate, // 编辑会签信息 issueChange, // 下达 submitChange, // 提交 - tpExecute, // 执行 + tpExecute, // TP执行 + csExecute, // 会签执行 getNodeAuthority, // 获取节点权限 getApprovalList, // 查询审批信息 getBuBySite, // 根据site查bu @@ -4353,9 +4354,123 @@ // 执行所选属性 executeCSModal (row) { - 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 + this.$confirm(`是否确认提交?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + if (this.plmChangeRequestArr) { // 主信息 + for (let i = 0; i < this.plmChangeRequestArr.length; i++) { + if (!this.modalData[this.plmChangeRequestArr[i].fieldId] && this.plmChangeRequestArr[i].required === 'Y') { + this.$message.warning(this.plmChangeRequestArr[i].fieldName + '不能为空!') + return + } + } + } + if (this.plmChangeRequestDetailArr) { // 所选技术参数卡 + for (let i = 0; i < this.plmChangeRequestDetailArr.length; i++) { + // 判断集合中的该属性是否都有值 + let val = this.chooseDataList.every(item => { + const value = item[this.plmChangeRequestDetailArr[i].fieldId] + return value !== null && value !== '' + }) + // 如果没有值 且该字段为必填 + if (!val && this.plmChangeRequestDetailArr[i].required === 'Y') { + this.$message.warning(this.plmChangeRequestDetailArr[i].fieldName + '不能为空!') + return + } + } + } + if (this.plmChangeCostImpactArr) { // 库存成本影响 + for (let i = 0; i < this.plmChangeCostImpactArr.length; i++) { + if (!this.costImpactData[this.plmChangeCostImpactArr[i].fieldId] && this.plmChangeCostImpactArr[i].required === 'Y') { + this.$message.warning(this.plmChangeCostImpactArr[i].fieldName + '不能为空!') + return + } + } + } + if (this.plmChangeFAItemArr) { // 评估信息 + for (let i = 0; i < this.plmChangeFAItemArr.length; i++) { + let val = this.chooseItemList2.every(item => { + const value = item[this.plmChangeFAItemArr[i].fieldId] + return value !== null && value !== '' + }) + if (!val && this.plmChangeFAItemArr[i].required === 'Y') { + this.$message.warning(this.plmChangeFAItemArr[i].fieldName + '不能为空!') + return + } + } + } + if (this.plmChangeExecutionInfoArr) { + for (let i = 0; i < this.plmChangeExecutionInfoArr.length; i++) { + if (!this.executionInfoData[this.plmChangeExecutionInfoArr[i].fieldId] && this.plmChangeExecutionInfoArr[i].required === 'Y') { + this.$message.warning(this.plmChangeExecutionInfoArr[i].fieldName + '不能为空!') + return + } + } + } + if (this.plmChangeItemArr) { // 执行信息 + for (let i = 0; i < this.plmChangeItemArr.length; i++) { + let val = this.chooseItemList.every(item => { + const value = item[this.plmChangeItemArr[i].fieldId] + return value !== null && value !== '' + }) + if (!val && this.plmChangeItemArr[i].required === 'Y') { + this.$message.warning(this.plmChangeItemArr[i].fieldName + '不能为空!') + return + } + } + } + if (this.plmChangeCountersignatureItemArr) { // 会签信息 + for (let i = 0; i < this.plmChangeCountersignatureItemArr.length; i++) { + let val = this.currentChooseCSItemList.every(item => { + const value = item[this.plmChangeCountersignatureItemArr[i].fieldId] + return value !== null && value !== '' + }) + if (!val && this.plmChangeCountersignatureItemArr[i].required === 'Y') { + this.$message.warning(this.plmChangeCountersignatureItemArr[i].fieldName + '不能为空!') + return + } + } + } + if (this.chooseDataList.length === 0) { + this.$message.warning('请添加需要变更的技术参数卡!') + return + } + row.executeFlag = 'Y' + row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') + this.costImpactData.changeTotalCost = this.totalCost + this.executionInfoData.chooseItemList = this.chooseItemList + this.executionInfoData.chooseItemList2 = this.chooseItemList2 + this.countersignatureData.changeNo = this.modalData.changeNo + this.countersignatureData.chooseCSItemList = this.chooseCSItemList + this.modalData.userName = this.$store.state.user.name + this.modalData.menuId = this.$route.meta.menuId + this.modalData.detailList = this.chooseDataList + this.modalData.ecnTypeData = this.form + this.modalData.costImpactData = this.costImpactData + this.modalData.executionInfoData = this.executionInfoData + this.modalData.countersignatureData = this.countersignatureData + this.modalData.nodeConclusion = 'Y' + this.submitLoading = true + csExecute(this.modalData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.$message({message: '操作成功', type: 'success'}) + this.submitModalFlag = false + this.modalFlag = false + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + row.executeFlag = '' + row.itemExecutionDate = '' + } + this.submitLoading = false + }).catch(()=>{ + this.submitLoading = false + }) + }) }, // 执行所选属性 diff --git a/src/views/modules/project/projectInfo/com_project_technicalSpecification.vue b/src/views/modules/project/projectInfo/com_project_technicalSpecification.vue index 349e93c..5556dd9 100644 --- a/src/views/modules/project/projectInfo/com_project_technicalSpecification.vue +++ b/src/views/modules/project/projectInfo/com_project_technicalSpecification.vue @@ -36,7 +36,7 @@ :min-width="item.columnWidth" :label="item.columnLabel">