From 7c1149529976debf66cc0a76c63cc13d7507aa0e Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Tue, 9 Jun 2026 14:18:46 +0800
Subject: [PATCH] =?UTF-8?q?2026-06-09=201=E3=80=81Inventory=20Part?=
=?UTF-8?q?=EF=BC=8CWeeks=E5=92=8CDays=E6=8C=89=E7=85=A7IFS=E7=9A=84?=
=?UTF-8?q?=E6=8F=8F=E8=BF=B0=EF=BC=9B=202=E3=80=81=E6=9C=89=E6=95=88?=
=?UTF-8?q?=E6=9C=9F=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF8=E5=BC=80?=
=?UTF-8?q?=E5=A4=B4=E7=9A=84=E6=96=99=E5=8F=B7=EF=BC=8C=E9=99=90=E5=88=B6?=
=?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=B8=BA0=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/modules/part/partInformation.vue | 30 +++++++++++++++++--
.../projectInfo/com_project_info_part.vue | 17 +++++++++--
2 files changed, 43 insertions(+), 4 deletions(-)
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 => {