| | |
| | | {{ getShippingStatusText(row) }} |
| | | </el-tag> |
| | | </template> |
| | | <template #quantity="{ row }"> |
| | | <el-input-number v-model="row.quantity" :min="0" size="small" /> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | </div> |
| | |
| | | salesContractNo: "", |
| | | proDesc: "", |
| | | customerName: "", |
| | | productModelQuantities: "", |
| | | }, |
| | | rules: { |
| | | customerName: [ |
| | |
| | | align: "center", |
| | | }, |
| | | { label: "发货日期", prop: "shippingDate", minWidth: 100, align: "center" }, |
| | | { label: "数量", prop: "quantity", width: 100 }, |
| | | { label: "税率(%)", prop: "taxRate", width: 100 }, |
| | | { |
| | | label: "含税单价(元)", |
| | | prop: "taxInclusiveUnitPrice", |
| | | width: 160, |
| | | formatData: formatCurrency, |
| | | }, |
| | | { |
| | | label: "含税总价(元)", |
| | | prop: "taxInclusiveTotalPrice", |
| | | width: 160, |
| | | formatData: formatCurrency, |
| | | }, |
| | | { |
| | | label: "不含税总价(元)", |
| | | prop: "taxExclusiveTotalPrice", |
| | | width: 160, |
| | | formatData: formatCurrency, |
| | | label: "数量", |
| | | prop: "quantity", |
| | | width: 140, |
| | | dataType: "slot", |
| | | slot: "quantity", |
| | | }, |
| | | { |
| | | dataType: "action", |
| | |
| | | id: item.id, |
| | | }) |
| | | ); |
| | | const opt = associatedSalesOrderNumberOptions.value.find( |
| | | item => item.value === form.value.salesContractNo |
| | | ); |
| | | if (opt) { |
| | | let restoredData = (opt.productData || []).map(normalizeProductRow); |
| | | const selectedIds = form.value.productModelIds ? String(form.value.productModelIds).split(",") : []; |
| | | const quantities = form.value.productModelQuantities ? String(form.value.productModelQuantities).split(",") : []; |
| | | tableData.value = restoredData.filter(item => selectedIds.includes(String(item.id))).map(item => { |
| | | let qIndex = selectedIds.indexOf(String(item.id)); |
| | | if (qIndex !== -1 && qIndex < quantities.length && quantities[qIndex] !== "") { |
| | | item.quantity = Number(quantities[qIndex]); |
| | | } |
| | | return item; |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | console.log(form.value); |
| | |
| | | form.value.productModelIds = tableData.value |
| | | .map(item => item.id) |
| | | .join(","); |
| | | form.value.productModelQuantities = tableData.value |
| | | .map(item => item.quantity || 0) |
| | | .join(","); |
| | | if (operationType.value === "add") { |
| | | afterSalesServiceAdd(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("新增成功"); |