diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index 4893d86..79db9e5 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -313,7 +313,7 @@ - + @@ -326,7 +326,7 @@ - + @@ -5026,6 +5026,22 @@ }, // ======== 新增/编辑/删除方法 ======== + isEightPrefixPartNo (partNo) { + return /^8/.test((partNo || '').toString().trim()) + }, + + isShelfLifeDayInvalid (durabilityDay) { + return durabilityDay === '' || durabilityDay == null || Number(durabilityDay) === 0 + }, + + isFormalPart (row) { + return row && row.temporaryPartFlag === 'N' && row.status === 'Y' + }, + + isTemporaryPart (row) { + return row && row.temporaryPartFlag === 'Y' && row.status === 'N' + }, + // 物料信息新增/编辑 saveData () { let partNo = this.modalData.partNo @@ -5091,6 +5107,11 @@ this.$message.warning('请填写密度!') return } + const isFormalPartEdit = this.modalData.flag === '2' && this.isFormalPart(this.modalData) + if (isFormalPartEdit && this.isEightPrefixPartNo(this.modalData.partNo) && this.isShelfLifeDayInvalid(this.modalData.durabilityDay)) { + this.$message.warning('Shelf Life(Days) 不能为空且不能为0!') + return + } // 校验属性必须都填有属性值 if (this.partItemList.length > 0 && this.partItemList.some(item => { @@ -5163,6 +5184,11 @@ this.$message.warning('IFS物料编码不能等于PLM物料编码!') return } + const isTemporaryPartToFormal = this.isTemporaryPart(this.modalData) + if (isTemporaryPartToFormal && this.isEightPrefixPartNo(this.modalData.ifsPartNo) && this.isShelfLifeDayInvalid(this.modalData.durabilityDay)) { + this.$message.warning('Shelf Life(Days) 不能为空且不能为0!') + return + } if (this.modalData.planningMethod == null || this.modalData.planningMethod === '') { this.$message.warning('请选择计划方法!') return diff --git a/src/views/modules/project/projectInfo/com_project_info_part.vue b/src/views/modules/project/projectInfo/com_project_info_part.vue index 0e10edf..6b6f47d 100644 --- a/src/views/modules/project/projectInfo/com_project_info_part.vue +++ b/src/views/modules/project/projectInfo/com_project_info_part.vue @@ -241,7 +241,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -2641,6 +2641,14 @@ import CodeGeneration from "../../code/generation.vue"; } }, + isEightPrefixPartNo (partNo) { + return /^8/.test((partNo || '').toString().trim()) + }, + + isShelfLifeDayInvalid (durabilityDay) { + return durabilityDay === '' || durabilityDay == null || Number(durabilityDay) === 0 + }, + // 物料信息新增 / 编辑 saveData () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { @@ -2684,6 +2692,11 @@ import CodeGeneration from "../../code/generation.vue"; this.$message.warning('请填写密度!') return } + const isFormalPartEdit = this.modalData.flag === '2' && this.modalData.temporaryPartFlag === 'N' && this.modalData.status === 'Y' + if (isFormalPartEdit && this.isEightPrefixPartNo(this.modalData.ifsPartNo) && this.isShelfLifeDayInvalid(this.modalData.durabilityDay)) { + this.$message.warning('正式物料IFS物料编码以8开头时,Shelf Life(Days) 不能为空且不能为0!') + return + } // 校验属性必须都填有属性值 if (this.partItemList.length > 0 && this.partItemList.some(item => {