diff --git a/src/views/modules/changeManagement/changeRecord.vue b/src/views/modules/changeManagement/changeRecord.vue index 5acb07e..58af87d 100644 --- a/src/views/modules/changeManagement/changeRecord.vue +++ b/src/views/modules/changeManagement/changeRecord.vue @@ -746,6 +746,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + 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) { + if (this.plmChangeCostImpactArr) { // 库存成本影响 for (let i = 0; i < this.plmChangeCostImpactArr.length; i++) { - if (!this.modalData[this.plmChangeCostImpactArr[i].fieldId] && this.plmChangeCostImpactArr[i].required === 'Y') { + if (!this.costImpactData[this.plmChangeCostImpactArr[i].fieldId] && this.plmChangeCostImpactArr[i].required === 'Y') { this.$message.warning(this.plmChangeCostImpactArr[i].fieldName + '不能为空!') return } } } - if (this.plmChangeFAItemArr) { + if (this.plmChangeFAItemArr) { // 评估信息 for (let i = 0; i < this.plmChangeFAItemArr.length; i++) { - if (!this.modalData[this.plmChangeFAItemArr[i].fieldId] && this.plmChangeFAItemArr[i].required === 'Y') { + 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 } @@ -3564,29 +3700,36 @@ } if (this.plmChangeExecutionInfoArr) { for (let i = 0; i < this.plmChangeExecutionInfoArr.length; i++) { - if (!this.modalData[this.plmChangeExecutionInfoArr[i].fieldId] && this.plmChangeExecutionInfoArr[i].required === 'Y') { + if (!this.executionInfoData[this.plmChangeExecutionInfoArr[i].fieldId] && this.plmChangeExecutionInfoArr[i].required === 'Y') { this.$message.warning(this.plmChangeExecutionInfoArr[i].fieldName + '不能为空!') return } } } - if (this.plmChangeItemArr) { + if (this.plmChangeItemArr) { // 执行信息 for (let i = 0; i < this.plmChangeItemArr.length; i++) { - if (!this.modalData[this.plmChangeItemArr[i].fieldId] && this.plmChangeItemArr[i].required === 'Y') { + 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) { + if (this.plmChangeCountersignatureItemArr) { // 会签信息 for (let i = 0; i < this.plmChangeCountersignatureItemArr.length; i++) { - if (!this.modalData[this.plmChangeCountersignatureItemArr[i].fieldId] && this.plmChangeCountersignatureItemArr[i].required === 'Y') { + 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 @@ -3731,6 +3874,21 @@ }) }, + tpExecutionInfoSearch2 () { + executionInfoSearch(this.currentRow).then(({data}) => { + if (data && data.code === 0) { + this.currentExecutionInfoData = data.rows.executionInfoData + this.currentExecutionInfoData.createBy = this.$store.state.user.name + this.currentChooseItemList = data.rows.chooseItemList + this.currentChooseItemList2 = data.rows.chooseItemList2 + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 查询会签信息 countersignatureSearch () { countersignatureSearch(this.modalData).then(({data}) => { @@ -3744,6 +3902,18 @@ }) }, + countersignatureSearch2 () { + countersignatureSearch(this.currentRow).then(({data}) => { + if (data && data.code === 0) { + this.currentChooseCSItemList = data.rows.chooseCSItemList + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 删除所选技术参数卡 deleteChooseDataModal (row) { this.$confirm(`是否删除该技术参数卡的变更?`, '提示', { @@ -4057,7 +4227,7 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { - if (this.plmChangeRequestArr) { + 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 + '不能为空!') @@ -4065,25 +4235,35 @@ } } } - if (this.plmChangeRequestDetailArr) { + if (this.plmChangeRequestDetailArr) { // 所选技术参数卡 for (let i = 0; i < this.plmChangeRequestDetailArr.length; i++) { - if (!this.modalData[this.plmChangeRequestDetailArr[i].fieldId] && this.plmChangeRequestDetailArr[i].required === 'Y') { + // 判断集合中的该属性是否都有值 + 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) { + if (this.plmChangeCostImpactArr) { // 库存成本影响 for (let i = 0; i < this.plmChangeCostImpactArr.length; i++) { - if (!this.modalData[this.plmChangeCostImpactArr[i].fieldId] && this.plmChangeCostImpactArr[i].required === 'Y') { + if (!this.costImpactData[this.plmChangeCostImpactArr[i].fieldId] && this.plmChangeCostImpactArr[i].required === 'Y') { this.$message.warning(this.plmChangeCostImpactArr[i].fieldName + '不能为空!') return } } } - if (this.plmChangeFAItemArr) { + if (this.plmChangeFAItemArr) { // 评估信息 for (let i = 0; i < this.plmChangeFAItemArr.length; i++) { - if (!this.modalData[this.plmChangeFAItemArr[i].fieldId] && this.plmChangeFAItemArr[i].required === 'Y') { + 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 } @@ -4091,23 +4271,31 @@ } if (this.plmChangeExecutionInfoArr) { for (let i = 0; i < this.plmChangeExecutionInfoArr.length; i++) { - if (!this.modalData[this.plmChangeExecutionInfoArr[i].fieldId] && this.plmChangeExecutionInfoArr[i].required === 'Y') { + if (!this.executionInfoData[this.plmChangeExecutionInfoArr[i].fieldId] && this.plmChangeExecutionInfoArr[i].required === 'Y') { this.$message.warning(this.plmChangeExecutionInfoArr[i].fieldName + '不能为空!') return } } } - if (this.plmChangeItemArr) { + if (this.plmChangeItemArr) { // 执行信息 for (let i = 0; i < this.plmChangeItemArr.length; i++) { - if (!this.modalData[this.plmChangeItemArr[i].fieldId] && this.plmChangeItemArr[i].required === 'Y') { + 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) { + if (this.plmChangeCountersignatureItemArr) { // 会签信息 for (let i = 0; i < this.plmChangeCountersignatureItemArr.length; i++) { - if (!this.modalData[this.plmChangeCountersignatureItemArr[i].fieldId] && this.plmChangeCountersignatureItemArr[i].required === 'Y') { + 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 } @@ -4117,6 +4305,8 @@ 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 @@ -4137,19 +4327,17 @@ this.$message({message: '操作成功', type: 'success'}) this.submitModalFlag = false this.modalFlag = false - - row.executeFlag = 'Y' - row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) + row.executeFlag = '' + row.itemExecutionDate = '' } this.submitLoading = false }).catch(()=>{ this.submitLoading = false }) - }) // row.executeFlag = 'Y' // row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') diff --git a/src/views/modules/processManagement/processFlowInfo.vue b/src/views/modules/processManagement/processFlowInfo.vue index 7dd23bd..4572516 100644 --- a/src/views/modules/processManagement/processFlowInfo.vue +++ b/src/views/modules/processManagement/processFlowInfo.vue @@ -27,6 +27,7 @@ +