diff --git a/src/views/modules/quotation/toBeQuoted.vue b/src/views/modules/quotation/toBeQuoted.vue index 9865be7..a0adc6b 100644 --- a/src/views/modules/quotation/toBeQuoted.vue +++ b/src/views/modules/quotation/toBeQuoted.vue @@ -628,7 +628,8 @@ export default { // 批量新增报价信息 saveBatchQuotationHeader(list){ this.saveBatchQuotationLoading = true; - batchSaveQuote(list).then(({data})=>{ + const payload = this.buildBatchQuotePayload(list) + batchSaveQuote(payload).then(({data})=>{ this.saveBatchQuotationLoading = false; if (data && data.code === 0){ this.$message.success(data.msg); @@ -651,15 +652,31 @@ export default { this.$message.warning("请选择需报价的单号") return } - this.quotationSelections = this.quotationSelections.map(item=>{ - item.qty = undefined - item.currency = undefined - item.createBy = this.$store.state.user.name - item.site = this.$store.state.user.site - return item; - }) + this.quotationSelections = this.quotationSelections.map(item=>({ + ...item, + qty: undefined, + currency: undefined, + createBy: this.$store.state.user.name, + site: this.$store.state.user.site, + })) this.quoteVisible = true; }, + buildBatchQuotePayload(list){ + return list.map(item=>({ + site: item.site || this.$store.state.user.site, + quotationNo: item.quotationNo, + customerNo: item.customerNo, + projectId: item.projectId, + tracker: item.tracker, + quoter: item.quoter, + testPartNo: item.testPartNo, + finalPartNo: item.finalPartNo, + partName: item.partName, + createBy: item.createBy || this.$store.state.user.name, + qty: item.qty, + currency: item.currency, + })) + }, searchByAnyField(params){ params.site = this.$store.state.user.site params.menuId = '102004'