diff --git a/src/views/modules/srmPart/PartAdvancedCopyDialog.vue b/src/views/modules/srmPart/PartAdvancedCopyDialog.vue index d033644..9934419 100644 --- a/src/views/modules/srmPart/PartAdvancedCopyDialog.vue +++ b/src/views/modules/srmPart/PartAdvancedCopyDialog.vue @@ -22,15 +22,18 @@ --> - + - + - + + + + @@ -64,8 +67,8 @@ - - + + @@ -149,6 +152,11 @@ export default { return base ? base + (suffix ? `-${suffix}` : '') : '' } }, + watch: { + 'form.partSuffix' () { + this.autoFillItem() + } + }, methods: { /** 以当前选中行作为唯一复制源;打开时重新初始化,避免沿用上次勾选或目标输入 - rqrq */ open (row) { @@ -175,7 +183,7 @@ export default { partDesc: row.partDesc || '', partSpec: row.partSpec || '', item: row.item || '', - // 保存行上的 SKU 与默认供应商,仅用于复制前置价格表判断,不在源区展示 + // 保存行上的 SKU 与默认供应商,用于源区展示及复制前置价格表判断 sku: row.sku || '', supplierNo: row.defaultSupplierNo || '' } @@ -187,7 +195,7 @@ export default { partSuffix: '', partDesc: row.partDesc || '', partSpec: row.partSpec || '', - // 目标 item 不自动带入,由用户自行填写;留空提交时后端沿用源物料 item + // 目标 item 根据 SKU+后缀自动填充;无 SKU 时留空由用户自行填写 item: '', copySupplier: false, copyInspectionTemplate: false @@ -196,6 +204,15 @@ export default { this.$nextTick(() => { if (this.$refs.targetForm) this.$refs.targetForm.clearValidate() }) + // 打开时根据源 SKU 自动填充 item(后缀初始为空,仅有 SKU 时 item = SKU) + this.autoFillItem() + }, + /** 根据源物料 SKU 和目标物料后缀自动计算 item:SKU 存在时 item = SKU[-后缀] */ + autoFillItem () { + const sku = (this.source.sku || '').trim().toUpperCase() + if (!sku) return + const suffix = (this.form.partSuffix || '').trim().toUpperCase() + this.form.item = suffix ? `${sku}-${suffix}` : sku }, /** 保存前校验编码;与编辑弹窗链路一致,先判断价格表组合并按需询问是否进入新品流程,用户选择后才执行复制写入 */ save () { diff --git a/src/views/modules/srmSupplier/srmSupplierAddress.vue b/src/views/modules/srmSupplier/srmSupplierAddress.vue index 3fb4da7..2eb493a 100644 --- a/src/views/modules/srmSupplier/srmSupplierAddress.vue +++ b/src/views/modules/srmSupplier/srmSupplierAddress.vue @@ -1,11 +1,18 @@