diff --git a/src/views/modules/srmPart/partInfoList.vue b/src/views/modules/srmPart/partInfoList.vue index ba0262e..b40013c 100644 --- a/src/views/modules/srmPart/partInfoList.vue +++ b/src/views/modules/srmPart/partInfoList.vue @@ -119,9 +119,9 @@ - - - + + + @@ -184,8 +184,9 @@ - - + + SKU + @@ -246,7 +247,7 @@ - + 属性模板 @@ -917,6 +918,9 @@ export default { ], partSpec: [ { required: true, message: ' ', trigger: 'blur' } + ], + codeNo: [ + { required: true, message: ' ', trigger: 'blur' } ] }, copyDialogVisible: false, @@ -1307,6 +1311,9 @@ export default { if (this.tagNo === 510) { strVal = this.currentpart.unit } + if (val === 508) { + strVal = this.currentpart.sku + } if (val === 529) { strVal = this.currentpart.buyerName } @@ -1333,6 +1340,9 @@ export default { if (this.tagNo === 510) { this.currentpart.unit = val.UMID } + if (this.tagNo === 508) { + this.currentpart.sku = val.sku + } if (this.tagNo === 529) { this.currentpart.buyerName = val.UserName } diff --git a/src/views/modules/supplier/purHeaderList.vue b/src/views/modules/supplier/purHeaderList.vue index fcfbc86..dfaad5b 100644 --- a/src/views/modules/supplier/purHeaderList.vue +++ b/src/views/modules/supplier/purHeaderList.vue @@ -1018,8 +1018,9 @@ export default { isMaterialEditable(row) { return row && (row.status === '待提交' || row.status === '待报价') }, + // 新增物料按钮只在主表状态为待提交时才显示 canAddMaterial() { - return this.currentInquiry && (this.currentInquiry.status === '待提交' || this.currentInquiry.status === '待报价') + return this.currentInquiry && this.currentInquiry.status === '待提交' }, openMaterialDialog(row) { if (!this.currentInquiry) { diff --git a/src/views/modules/supplier/quoPurDetailList.vue b/src/views/modules/supplier/quoPurDetailList.vue index ed4d2f2..22239cc 100644 --- a/src/views/modules/supplier/quoPurDetailList.vue +++ b/src/views/modules/supplier/quoPurDetailList.vue @@ -454,22 +454,8 @@ export default { site: this.$store.state.user.site, createdBy: this.$store.state.user.name }, - quoteRules: { - price: [ - { required: true, message: '请输入未税单价', trigger: 'blur' }, - { - validator: (rule, value, callback) => { - if (value == null || Number(value) <= 0) { - callback(new Error('未税单价必须大于0')) - } else { - callback() - } - }, - trigger: 'blur' - } - ], - taxRate: [{ required: true, message: '请输入税率', trigger: 'blur' }] - }, + // 报价弹窗取消必填字段校验,提交时仅校验阶梯价格表是否填写 + quoteRules: {}, // 上次填写的报价信息(用于残留功能) lastQuoteData: null, lastTierPriceData: null @@ -769,48 +755,39 @@ export default { // 提交报价 submitQuote() { this.calculatePrice() - this.$refs.quoteForm.validate((valid) => { - if (valid) { - if (!this.quoteForm.price || Number(this.quoteForm.price) <= 0) { - this.$message.error('未税单价必须大于0') - return - } - if (!this.validateTierPriceList()) { - return - } - // 计算总成本(可选) - const totalCost = this.quoteForm.materialCost + this.quoteForm.produceFee + - this.quoteForm.surfaceFee + this.quoteForm.profit + - this.quoteForm.mouldFee + this.quoteForm.additionalCost + - this.quoteForm.freight + this.quoteForm.duty - - const submitData = { - ...this.quoteForm, - tierPriceList: this.buildTierPricePayload(), - totalCost: totalCost - } + // 取消必填字段校验,仅校验阶梯价格表是否填写 + if (!this.validateTierPriceList()) { + return + } + // 计算总成本(可选) + const totalCost = this.quoteForm.materialCost + this.quoteForm.produceFee + + this.quoteForm.surfaceFee + this.quoteForm.profit + + this.quoteForm.mouldFee + this.quoteForm.additionalCost + + this.quoteForm.freight + this.quoteForm.duty + + const submitData = { + ...this.quoteForm, + tierPriceList: this.buildTierPricePayload(), + totalCost: totalCost + } - createPurReplyHist(submitData).then(({ data }) => { - if (data && data.code === 0) { - this.$message.success('报价提交成功') - // 提交成功后清除残留数据 - this.lastQuoteData = null - this.lastTierPriceData = null - this.quoteDialogVisible = false - this.tierPriceDialogVisible = false - // 刷新报价记录列表 - this.refreshCurrentTabTable() - // 刷新主列表状态 - this.getMainData() - } else { - this.$message.error(data.msg || '报价提交失败') - } - }).catch(error => { - this.$message.error('报价提交失败: ' + error.message) - }) + createPurReplyHist(submitData).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('报价提交成功') + // 提交成功后清除残留数据 + this.lastQuoteData = null + this.lastTierPriceData = null + this.quoteDialogVisible = false + this.tierPriceDialogVisible = false + // 刷新报价记录列表 + this.refreshCurrentTabTable() + // 刷新主列表状态 + this.getMainData() } else { - this.$message.warning('请填写必填字段') + this.$message.error(data.msg || '报价提交失败') } + }).catch(error => { + this.$message.error('报价提交失败: ' + error.message) }) }, diff --git a/src/views/modules/supplier/supPurReplyHistList.vue b/src/views/modules/supplier/supPurReplyHistList.vue index 1c5e41e..c406f89 100644 --- a/src/views/modules/supplier/supPurReplyHistList.vue +++ b/src/views/modules/supplier/supPurReplyHistList.vue @@ -46,10 +46,9 @@ - + @@ -650,6 +617,7 @@ export default { data() { return { height: 200, + tabHeight: 300, loading: false, submitLoading: false, dataList: [], @@ -657,7 +625,7 @@ export default { pageSize: 20, totalPage: 0, currentRow: {}, - activeName: 'attachments', + activeName: 'tierPrice', searchData: { site: this.$store.state.user.site, createdBy: this.$store.state.user.name, @@ -747,18 +715,8 @@ export default { overReceiveFlag: 'N', overReceiveTolerance: 0 }, - priceSheetDialogVisible: false, - priceSheetLoading: false, - priceSheetHeader: { - quotationReplyHistId: null, - partNo: '', - partDesc: '', - priceDate: '', - supplierId: '', - supplierName: '', - currency: '' - }, - priceSheetDetailList: [] + tierPriceList: [], + tierPriceLoading: false } }, mounted() { @@ -795,9 +753,35 @@ export default { this.currentRow = {site: '', orderNo: ''} } + if (this.activeName === 'tierPrice') { + this.refreshTierPrice() + } if (this.activeName === 'attachments') { this.refreshAttachments() } + }, + // 价格阶梯页签:查询逻辑与报价记录的价格表查询一致 + refreshTierPrice() { + if (!this.currentRow || !this.currentRow.id) { + this.tierPriceList = [] + return + } + const params = { + site: this.$store.state.user.site, + quotationReplyHistId: this.currentRow.id + } + this.tierPriceLoading = true + getPurReplyPriceSheet(params).then(({ data }) => { + if (data && data.code === 0 && data.row) { + this.tierPriceList = data.row.tierPriceList || [] + } else { + this.tierPriceList = [] + } + this.tierPriceLoading = false + }).catch(() => { + this.tierPriceLoading = false + this.tierPriceList = [] + }) }, refreshAttachments () { console.log('刷新附件组件,当前行数据:', this.currentRow) @@ -830,24 +814,6 @@ export default { if (value === null || value === undefined) return '-' return new Intl.NumberFormat('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(value) }, - displayText(value) { - if (value === null || value === undefined || value === '') { - return '-' - } - return value - }, - formatDateOnly(value) { - if (!value) return '' - if (typeof value === 'string') { - return value.length >= 10 ? value.slice(0, 10) : value - } - const date = new Date(value) - if (Number.isNaN(date.getTime())) { - return '' - } - const pad = num => String(num).padStart(2, '0') - return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}` - }, formatNumber(value) { if (value === null || value === undefined || value === '') { return '0' @@ -858,51 +824,6 @@ export default { } return String(Object.is(num, -0) ? 0 : num) }, - openPriceSheet(row) { - if (!row || !row.id) { - this.$message.warning('当前报价记录缺少主键,无法查询价格表') - return - } - const params = { - site: this.$store.state.user.site, - quotationReplyHistId: row.id - } - this.priceSheetDialogVisible = true - this.priceSheetLoading = true - this.priceSheetHeader = { - quotationReplyHistId: row.id, - partNo: row.partNo || '', - partDesc: row.partDesc || '', - priceDate: row.createdDate || '', - supplierId: row.supplierId || '', - supplierName: row.supplierName || '', - currency: row.currency || '' - } - this.priceSheetDetailList = [] - getPurReplyPriceSheet(params).then(({ data }) => { - if (data && data.code === 0 && data.row) { - const responseRow = data.row - this.priceSheetHeader = { - quotationReplyHistId: responseRow.quotationReplyHistId || row.id, - partNo: responseRow.partNo || row.partNo || '', - partDesc: responseRow.partDesc || row.partDesc || '', - priceDate: responseRow.priceDate || row.createdDate || '', - supplierId: responseRow.supplierId || row.supplierId || '', - supplierName: responseRow.supplierName || row.supplierName || '', - currency: responseRow.currency || row.currency || '' - } - this.priceSheetDetailList = responseRow.tierPriceList || [] - } else { - this.priceSheetDetailList = [] - this.$message.error((data && data.msg) || '获取价格表失败') - } - this.priceSheetLoading = false - }).catch(() => { - this.priceSheetLoading = false - this.priceSheetDetailList = [] - this.$message.error('获取价格表失败') - }) - }, getList() { this.loading = true const params = { @@ -1182,10 +1103,6 @@ export default { margin-right: 10px; } -.price-sheet-header-form { - margin-bottom: 8px; -} - /* 页签样式穿透 */ /deep/ .customer-tab.el-tabs--border-card > .el-tabs__content { padding: 0; diff --git a/src/views/modules/sys/user-add-or-update.vue b/src/views/modules/sys/user-add-or-update.vue index d8a1ec7..55d6d49 100644 --- a/src/views/modules/sys/user-add-or-update.vue +++ b/src/views/modules/sys/user-add-or-update.vue @@ -221,6 +221,10 @@ export default { init(id) { this.dataForm.id = id || 0 + // 新增用户时,工厂默认设置为 1 + if (!id) { + this.dataForm.site = '1' + } this.loadSiteOptions() this.getLanguageList(); this.$http({