diff --git a/src/views/modules/npcIqc/logisticsManagement.vue b/src/views/modules/npcIqc/logisticsManagement.vue index 0c1790b..0af6f59 100644 --- a/src/views/modules/npcIqc/logisticsManagement.vue +++ b/src/views/modules/npcIqc/logisticsManagement.vue @@ -130,7 +130,7 @@ - + @@ -160,6 +160,13 @@ + + + + + + + @@ -179,12 +186,20 @@ style="width: 100%;"> + + + + + + + + + - diff --git a/src/views/modules/srmBaseInformation/srmPartSku.vue b/src/views/modules/srmBaseInformation/srmPartSku.vue index ee7baca..ee5cf1a 100644 --- a/src/views/modules/srmBaseInformation/srmPartSku.vue +++ b/src/views/modules/srmBaseInformation/srmPartSku.vue @@ -130,6 +130,14 @@ + + + + + + + + @@ -185,6 +193,7 @@ export default { deep: true, handler: function () { this.modalData.sku = (this.modalData.sku || '').toUpperCase() + this.modalData.basePartNo = (this.modalData.basePartNo || '').toUpperCase() } } }, @@ -228,6 +237,7 @@ export default { sku: '', remark: '', active: 'Y', + basePartNo: '', createBy: this.$store.state.user.name }, @@ -250,6 +260,24 @@ export default { fixed: '', columnWidth: 180 }, + { + userId: this.$store.state.user.name, + functionId: functionId, + serialNumber: 'srmPartSkuTableBasePartNo', + tableId: 'srmPartSkuTable', + tableName: 'SKU管理表', + columnProp: 'basePartNo', + headerAlign: 'center', + align: 'left', + columnLabel: '基准料号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 180 + }, { userId: this.$store.state.user.name, functionId: functionId, @@ -412,6 +440,7 @@ export default { sku: '', remark: '', active: 'Y', + basePartNo: '', createBy: this.$store.state.user.name } @@ -433,6 +462,7 @@ export default { sku: row.sku, remark: row.remark || '', active: row.active, + basePartNo: row.basePartNo || '', createBy: this.$store.state.user.name } diff --git a/src/views/modules/srmPart/partInfoList.vue b/src/views/modules/srmPart/partInfoList.vue index 70311b1..cc6b8a1 100644 --- a/src/views/modules/srmPart/partInfoList.vue +++ b/src/views/modules/srmPart/partInfoList.vue @@ -190,7 +190,7 @@ - + SKU { + // 新增时单向强校验:填了 Item 就必须填 SKU;只填 SKU 时 Item 仍可留空 + // 编辑态不强制,避免历史“有 Item 无 SKU”的数据无法保存 + if (this.isAdd && String(this.currentpart.item || '').trim() && !String(value || '').trim()) { + callback(new Error('填写 Item 后必须填写 SKU')) + return + } + callback() + }, + trigger: ['blur', 'change'] + } ] }, copyDialogVisible: false, @@ -964,8 +978,8 @@ export default { basePartNo: '', partSuffix: '' }, - // 编辑/新增弹窗中的SKU字段先隐藏(改由“指定SKU”按钮统一维护),如需恢复改为 true - showSkuInDialog: false, + // 编辑/新增弹窗中展示 SKU 字段(与“指定SKU”按钮批量维护并存),不需要时改为 false + showSkuInDialog: true, // 指定SKU弹窗 specifySkuDialogVisible: false, specifySkuSaving: false, @@ -1151,6 +1165,10 @@ export default { // 默认选中第一个自动赋值给SKU输入框 if (rows.length && canOverwrite) { this.currentpart.sku = rows[0] + // 程序赋值不触发输入框校验,重算一次避免旧的报错残留(未带出值时不主动校验,防止提前抛错) + if (this.showSkuInDialog && this.$refs.partForm) { + this.$refs.partForm.validateField('sku') + } } }).catch(() => { this.skuOptions = [] @@ -1485,6 +1503,10 @@ export default { this.confirmSpecifySku() } else { this.currentpart.sku = val.sku + // 选择器回填为程序赋值,不会触发输入框 change/blur,此处主动重算 SKU 校验,避免旧的「必须填写 SKU」报错残留 + if (this.showSkuInDialog && this.$refs.partForm) { + this.$refs.partForm.validateField('sku') + } } } if (this.tagNo === 529) {