| | |
| | | </el-table-column> |
| | | <el-table-column align="center" label="序号" type="index" width="60" /> |
| | | <el-table-column |
| | | label="销售合同号" |
| | | label="订单编号" |
| | | prop="salesContractNo" |
| | | show-overflow-tooltip |
| | | /> |
| | |
| | | > |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售合同号:" prop="salesContractNo"> |
| | | <el-form-item label="订单编号:" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" disabled placeholder="多合同批量处理(具体合同号见产品列表)"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | if (cellValue == 0) { |
| | | return parseFloat(cellValue).toFixed(2); |
| | | return parseFloat(cellValue).toFixed(3); |
| | | } |
| | | if (cellValue) { |
| | | return parseFloat(cellValue).toFixed(2); |
| | | return parseFloat(cellValue).toFixed(3); |
| | | } else { |
| | | return cellValue; |
| | | } |
| | | }; |
| | | |
| | | const formattedInputNumber = (value) => { |
| | | return value ? parseFloat(value).toFixed(2) : 0; |
| | | return value ? parseFloat(value).toFixed(3) : 0; |
| | | }; |
| | | |
| | | // 判断是否可以开票(基于选中的台账数据) |
| | |
| | | "contractAmount", |
| | | "invoiceTotal", |
| | | "noInvoiceAmountTotal", |
| | | ]); |
| | | ], { |
| | | contractAmount: { decimalPlaces: 3 }, |
| | | invoiceTotal: { decimalPlaces: 3 }, |
| | | noInvoiceAmountTotal: { decimalPlaces: 3 }, |
| | | }); |
| | | }; |
| | | // 子表合计方法 |
| | | const summarizeChildrenTable = (param) => { |
| | |
| | | "noInvoiceNum", |
| | | "noInvoiceAmount", |
| | | "currentInvoiceNum", |
| | | ]); |
| | | ], { |
| | | taxInclusiveUnitPrice: { decimalPlaces: 3 }, |
| | | taxInclusiveTotalPrice: { decimalPlaces: 3 }, |
| | | taxExclusiveTotalPrice: { decimalPlaces: 3 }, |
| | | invoiceNum: { decimalPlaces: 3 }, |
| | | invoiceAmount: { decimalPlaces: 3 }, |
| | | currentInvoiceAmount: { decimalPlaces: 3 }, |
| | | noInvoiceNum: { decimalPlaces: 3 }, |
| | | noInvoiceAmount: { decimalPlaces: 3 }, |
| | | currentInvoiceNum: { decimalPlaces: 3 }, |
| | | }); |
| | | }; |
| | | // 打开弹框 |
| | | const openForm = () => { |
| | |
| | | allProductData.push({ |
| | | ...item, |
| | | // id: contractId, // 明确设置合同ID |
| | | salesContractNo: contract.salesContractNo, // 添加销售合同号 |
| | | salesContractNo: contract.salesContractNo, // 添加订单编号 |
| | | customerName: contract.customerName, // 添加客户名称 |
| | | customerContractNo: contract.customerContractNo // 添加客户合同号 |
| | | }); |
| | |
| | | } |
| | | }); |
| | | |
| | | // 设置表单数据(使用第一个合同的基本信息,销售合同号留空) |
| | | // 设置表单数据(使用第一个合同的基本信息,订单编号留空) |
| | | form.value = { ...results[0] }; |
| | | form.value.createTime = dayjs().format("YYYY-MM-DD"); |
| | | form.value.issueDate = dayjs().format("YYYY-MM-DD"); |
| | | form.value.createUer = userStore.nickName; |
| | | form.value.selectedContractIds = selectedRows.value.map(row => row.id); // 存储所有选中的合同ID |
| | | form.value.salesContractNo = ""; // 销售合同号留空,因为会在产品表格中分别显示 |
| | | form.value.salesContractNo = ""; // 订单编号留空,因为会在产品表格中分别显示 |
| | | |
| | | productData.value = allProductData; |
| | | |
| | |
| | | // 计算本次开票金额 |
| | | row.currentInvoiceAmount = ( |
| | | row.currentInvoiceNum * row.taxInclusiveUnitPrice |
| | | ).toFixed(2); |
| | | ).toFixed(3); |
| | | // 计算未开票数 |
| | | row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed( |
| | | 2 |
| | |
| | | // 计算未开票金额 |
| | | row.noInvoiceAmount = ( |
| | | row.tempnoInvoiceAmount - row.currentInvoiceAmount |
| | | ).toFixed(2); |
| | | ).toFixed(3); |
| | | }; |
| | | // 本次开票金额失焦操作 |
| | | const invoiceAmountBlur = (row) => { |
| | |
| | | // 计算本次开票数 |
| | | row.currentInvoiceNum = ( |
| | | row.currentInvoiceAmount / row.taxInclusiveUnitPrice |
| | | ).toFixed(2); |
| | | ).toFixed(3); |
| | | console.log("row.currentInvoiceNum ", row.currentInvoiceNum); |
| | | console.log(" row.originalNoInvoiceNum ", row.originalNoInvoiceNum); |
| | | // 计算未开票数 |
| | |
| | | // 计算未开票金额 |
| | | row.noInvoiceAmount = ( |
| | | row.tempnoInvoiceAmount - row.currentInvoiceAmount |
| | | ).toFixed(2); |
| | | ).toFixed(3); |
| | | }; |
| | | |
| | | onMounted(() => { |