张诺
昨天 b41552e7d56a7068e9080a475baaef9c173f8b7e
src/views/salesManagement/invoiceRegistration/index.vue
@@ -116,7 +116,7 @@
            </el-table-column>
            <el-table-column align="center" label="序号" type="index" width="60" />
            <el-table-column
               label="销售合同号"
               label="订单编号"
               prop="salesContractNo"
               show-overflow-tooltip
            />
@@ -184,7 +184,7 @@
         >
            <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>
@@ -452,17 +452,17 @@
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;
};
// 判断是否可以开票(基于选中的台账数据)
@@ -539,7 +539,11 @@
      "contractAmount",
      "invoiceTotal",
      "noInvoiceAmountTotal",
   ]);
   ], {
      contractAmount: { decimalPlaces: 3 },
      invoiceTotal: { decimalPlaces: 3 },
      noInvoiceAmountTotal: { decimalPlaces: 3 },
   });
};
// 子表合计方法
const summarizeChildrenTable = (param) => {
@@ -553,7 +557,17 @@
      "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 = () => {
@@ -595,7 +609,7 @@
               allProductData.push({
                  ...item,
                  // id: contractId, // 明确设置合同ID
                  salesContractNo: contract.salesContractNo, // 添加销售合同号
                  salesContractNo: contract.salesContractNo, // 添加订单编号
                  customerName: contract.customerName, // 添加客户名称
                  customerContractNo: contract.customerContractNo // 添加客户合同号
               });
@@ -603,13 +617,13 @@
         }
      });
      
      // 设置表单数据(使用第一个合同的基本信息,销售合同号留空)
      // 设置表单数据(使用第一个合同的基本信息,订单编号留空)
      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;
      
@@ -752,7 +766,7 @@
   // 计算本次开票金额
   row.currentInvoiceAmount = (
      row.currentInvoiceNum * row.taxInclusiveUnitPrice
   ).toFixed(2);
   ).toFixed(3);
   // 计算未开票数
   row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(
      2
@@ -760,7 +774,7 @@
   // 计算未开票金额
   row.noInvoiceAmount = (
      row.tempnoInvoiceAmount - row.currentInvoiceAmount
   ).toFixed(2);
   ).toFixed(3);
};
// 本次开票金额失焦操作
const invoiceAmountBlur = (row) => {
@@ -775,7 +789,7 @@
   // 计算本次开票数
   row.currentInvoiceNum = (
      row.currentInvoiceAmount / row.taxInclusiveUnitPrice
   ).toFixed(2);
   ).toFixed(3);
   console.log("row.currentInvoiceNum ", row.currentInvoiceNum);
   console.log(" row.originalNoInvoiceNum  ", row.originalNoInvoiceNum);
   // 计算未开票数
@@ -785,7 +799,7 @@
   // 计算未开票金额
   row.noInvoiceAmount = (
      row.tempnoInvoiceAmount - row.currentInvoiceAmount
   ).toFixed(2);
   ).toFixed(3);
};
onMounted(() => {