diff --git a/src/views/modules/base/propertiesItem/propertiesModel.vue b/src/views/modules/base/propertiesItem/propertiesModel.vue index d6ab871..7e0f8a6 100644 --- a/src/views/modules/base/propertiesItem/propertiesModel.vue +++ b/src/views/modules/base/propertiesItem/propertiesModel.vue @@ -176,6 +176,7 @@ :height="300" :data="detailList" border + ref="detailTable" v-loading="dataListLoading" style="width: 100%;"> { + if (this.$refs.detailTable) { + this.$refs.detailTable.doLayout() + } + }) + }, }, data() { return { diff --git a/src/views/modules/order/poOrder.vue b/src/views/modules/order/poOrder.vue index 2bf5310..ea7d024 100644 --- a/src/views/modules/order/poOrder.vue +++ b/src/views/modules/order/poOrder.vue @@ -3889,6 +3889,7 @@ export default { if (data && data.code === 0 && data.data) { this.addFormSchemaFields = data.data.fields || [] this.applyAddDefaultDateBySchema() + this.applyAddDefaultShipViaBySchema(this.addForm) return this.preloadAddDictSelectOptions(this.addFormSchemaFields).then(() => true) } else { this.addFormSchemaFields = [] @@ -3933,6 +3934,25 @@ export default { }) }, + // 新增 schema 中若展示运输方式(ship_via / S_Method),则默认填充为海运 + applyAddDefaultShipViaBySchema (targetForm) { + if (!targetForm || !Array.isArray(this.addFormSchemaFields) || !this.addFormSchemaFields.length) { + return + } + const field = this.getSchemaFieldByCode('ship_via') + if (!field || String(field.visibleFlag || '').trim().toUpperCase() !== 'Y') { + return + } + const prop = this.getAddFieldProp(field) + if (!prop) { + return + } + const current = targetForm[prop] + if (current === undefined || current === null || String(current).trim() === '') { + this.$set(targetForm, prop, '海运') + } + }, + getFormExtValue (targetForm, fieldCode) { if (!targetForm || !targetForm.extValues) { return '' @@ -4023,6 +4043,7 @@ export default { form.customer = this.searchData.customer || form.customer form.site = this.searchData.site || this.$store.state.user.site this.applyDefaultDateBySchemaToForm(form) + this.applyAddDefaultShipViaBySchema(form) return form }, diff --git a/src/views/modules/srmPart/partInfoList.vue b/src/views/modules/srmPart/partInfoList.vue index b40013c..9d61213 100644 --- a/src/views/modules/srmPart/partInfoList.vue +++ b/src/views/modules/srmPart/partInfoList.vue @@ -145,12 +145,12 @@
- + - + @@ -173,7 +173,7 @@ - + 默认供应商 @@ -915,9 +915,6 @@ export default { ], npc: [ { required: true, message: ' ', trigger: 'blur' } - ], - partSpec: [ - { required: true, message: ' ', trigger: 'blur' } ], codeNo: [ { required: true, message: ' ', trigger: 'blur' } diff --git a/src/views/modules/srmSupplier/com_srmSupplier_Address.vue b/src/views/modules/srmSupplier/com_srmSupplier_Address.vue index ac8e244..e4869a7 100644 --- a/src/views/modules/srmSupplier/com_srmSupplier_Address.vue +++ b/src/views/modules/srmSupplier/com_srmSupplier_Address.vue @@ -612,7 +612,7 @@ export default { contact: '', phoneNo: '', address: '', - addressType: '验货地址', + addressType: '', active: 'Y', email: '', originCountry: '', @@ -628,7 +628,7 @@ export default { if (this.$refs.modalForm) { this.$refs.modalForm.clearValidate(); } - + // 根据供应商ID自动查询公司名称等信息 if (this.modalData.supplierId) { this.fetchSupplierInfo(this.modalData.supplierId); @@ -663,7 +663,7 @@ export default { if (this.$refs.modalForm) { this.$refs.modalForm.clearValidate(); } - + // 编辑模式下,如果已有公司名称则直接使用,否则根据供应商ID查询 if (!this.modalData.companyName && this.modalData.supplierId) { this.fetchSupplierInfo(this.modalData.supplierId); @@ -787,12 +787,12 @@ export default { page: 1, limit: 1 } - + searchSrmSupplierList(params).then(({data}) => { if (data && data.code === 0) { const pageData = data.data || data.page const supplierList = pageData && pageData.list ? pageData.list : pageData || [] - + if (supplierList && supplierList.length > 0) { const supplierData = supplierList[0] // 填充公司名称 diff --git a/src/views/modules/supplier/supplierPartMoqPrice.vue b/src/views/modules/supplier/supplierPartMoqPrice.vue index 9e7b0a4..3a6fca5 100644 --- a/src/views/modules/supplier/supplierPartMoqPrice.vue +++ b/src/views/modules/supplier/supplierPartMoqPrice.vue @@ -78,11 +78,6 @@ empty-text="点击查询查看数据" @row-click="handleTopRowClick" > - - - @@ -138,62 +133,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ 维护MOQ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 阶梯价格 +
@@ -521,17 +493,6 @@ export default { supplierPartList: [], selectedSupplierPart: null, currentTierPriceList: [], - moqDialogVisible: false, - moqSaveLoading: false, - moqForm: { - site: '', - supplierCode: '', - partNo: '', - moq: 0, - moqColor: 0, - qtyCarton: 0, - active: 'Y' - }, addDialogVisible: false, addSaveLoading: false, addForm: { @@ -570,6 +531,10 @@ export default { sku: '', partDesc: '', priceDate: '', + moq: 0, + moqColor: 0, + qtyCarton: 0, + active: 'Y', tierPriceList: [] }, attachmentLoading: false, @@ -764,52 +729,6 @@ export default { this.bottomLoading = false }) }, - /** - * 打开维护弹窗。三个数量顺序为 MOQ/COLOR、QTY/PO、QTY/CARTON,空值按 0。 - */ - openMoqDialog (row) { - this.moqForm = { - site: this.$store.state.user.site, - supplierCode: row.supplierCode, - partNo: row.partNo, - moq: this.normalizeNumberValue(row.moq, 0), - moqColor: this.normalizeNumberValue(row.moqColor, 0), - qtyCarton: this.normalizeNumberValue(row.qtyCarton, 0), - active: row.active || 'Y' - } - this.moqDialogVisible = true - }, - /** - * 保存维护弹窗。三个数量都不能为空且不能小于 0,site 取当前登录站点。 - */ - saveMoq () { - if (!this.validateQtyFields(this.moqForm)) { - return - } - this.moqSaveLoading = true - const inData = { - site: this.$store.state.user.site, - supplierCode: this.moqForm.supplierCode, - partNo: this.moqForm.partNo, - moq: this.moqForm.moq, - moqColor: this.moqForm.moqColor, - qtyCarton: this.moqForm.qtyCarton, - active: this.moqForm.active - } - saveSupplierPartMoq(inData).then(({ data }) => { - if (data && data.code === 0) { - this.$message.success('保存成功') - this.moqDialogVisible = false - this.searchSupplierPartList() - } else { - this.$alert((data && data.msg) || '保存失败', '错误', { confirmButtonText: '确定' }) - } - }).catch(() => { - this.$message.error('保存失败') - }).finally(() => { - this.moqSaveLoading = false - }) - }, openAddDialog () { this.addForm = { site: this.$store.state.user.site, @@ -931,6 +850,8 @@ export default { if (data && data.code === 0) { this.$message.success('复制成功') this.copyDialogVisible = false + // 复制会同步价格与 MOQ,成功后刷新列表以展示最新数据 + this.searchSupplierPartList() return } this.$message.error((data && data.msg) || '复制失败') @@ -954,6 +875,11 @@ export default { sku: this.selectedSupplierPart.sku || '', partDesc: this.selectedSupplierPart.partDesc || '', priceDate: this.getTodayDate(), + // MOQ 页签回显当前选中行的起订量与在用状态 + moq: this.normalizeNumberValue(this.selectedSupplierPart.moq, 0), + moqColor: this.normalizeNumberValue(this.selectedSupplierPart.moqColor, 0), + qtyCarton: this.normalizeNumberValue(this.selectedSupplierPart.qtyCarton, 0), + active: this.selectedSupplierPart.active || 'Y', tierPriceList: (this.currentTierPriceList || []).map(item => ({ qtyStart: this.normalizeNumberValue(item.qtyStart, 0), qtyEnd: this.normalizeNumberValue(item.qtyEnd, 0), @@ -1067,8 +993,12 @@ export default { if (!this.validateTierRows()) { return } + // MOQ 页签与阶梯价一起提交,三个起订量需校验 + if (!this.validateQtyFields(this.tierForm)) { + return + } this.tierSaveLoading = true - const inData = { + const priceInData = { site: this.$store.state.user.site, supplierCode: this.tierForm.supplierCode, partNo: this.tierForm.partNo, @@ -1082,13 +1012,25 @@ export default { remark: item.remark || '' })) } - saveTierPrice(inData).then(({ data }) => { - if (data && data.code === 0) { + const moqInData = { + site: this.$store.state.user.site, + supplierCode: this.tierForm.supplierCode, + partNo: this.tierForm.partNo, + moq: this.tierForm.moq, + moqColor: this.tierForm.moqColor, + qtyCarton: this.tierForm.qtyCarton, + active: this.tierForm.active + } + Promise.all([saveTierPrice(priceInData), saveSupplierPartMoq(moqInData)]).then(([priceRes, moqRes]) => { + const priceData = priceRes && priceRes.data + const moqData = moqRes && moqRes.data + if (priceData && priceData.code === 0 && moqData && moqData.code === 0) { this.$message.success('保存成功') this.tierDialogVisible = false - this.loadCurrentTierPrice() + // 刷新上表以同步 MOQ 列,并重载当前阶梯价 + this.searchSupplierPartList() } else { - this.$alert((data && data.msg) || '保存失败', '错误', { confirmButtonText: '确定' }) + this.$alert((priceData && priceData.msg) || (moqData && moqData.msg) || '保存失败', '错误', { confirmButtonText: '确定' }) } }).catch(() => { this.$message.error('保存失败')