yuan
2026-05-21 ef6cbd25049a42855212b1a8d47b63ab4ace231c
修改合同金额保留小数点后六位
已修改4个文件
130 ■■■■■ 文件已修改
src/views/salesManagement/receiptPaymentLedger/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/components/formDia.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesQuotation/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/receiptPaymentLedger/index.vue
@@ -188,7 +188,7 @@
  });
};
const formattedNumber = (row, column, cellValue) => {
  return parseFloat(cellValue).toFixed(2);
  return parseFloat(cellValue).toFixed(8);
};
// 主表合计方法
const summarizeMainTable = (param) => {
@@ -217,7 +217,7 @@
      (item) => item.id == customerId.value
    );
    summarizeTable[summarizeTable.length - 1] =
      tableData.value[index].unReceiptPaymentAmount.toFixed(2);
      tableData.value[index].unReceiptPaymentAmount.toFixed(8);
  } else {
    summarizeTable[summarizeTable.length - 1] = 0.0;
  }
src/views/salesManagement/returnOrder/components/formDia.vue
@@ -650,14 +650,14 @@
const calculateRowAmount = (row) => {
  const stockOutNum = Number(row.returnQuantity || 0);
  const price = Number(row.price || 0);
  row.amount = (stockOutNum * price).toFixed(2);
  row.amount = (stockOutNum * price).toFixed(8);
};
const calculateTotalRefund = () => {
  const total = tableData.value.reduce((sum, row) => {
    return sum + Number(row.amount || 0);
  }, 0);
  form.value.refundAmount = total.toFixed(2);
  form.value.refundAmount = total.toFixed(8);
};
const availableProducts = ref([]);
src/views/salesManagement/salesLedger/index.vue
@@ -444,13 +444,13 @@
                           prop="taxRate" />
          <el-table-column label="含税单价(元)"
                           prop="taxInclusiveUnitPrice"
                           :formatter="formattedNumber" />
                           :formatter="format8" />
          <el-table-column label="含税总价(元)"
                           prop="taxInclusiveTotalPrice"
                           :formatter="formattedNumber" />
                           :formatter="format8" />
          <el-table-column label="不含税总价(元)"
                           prop="taxExclusiveTotalPrice"
                           :formatter="formattedNumber" />
                           :formatter="format8" />
          <el-table-column label="是否生产"
                           prop="isProduction"
                           width="150">
@@ -650,11 +650,11 @@
          <el-col :span="12">
            <el-form-item label="含税单价(元):"
                          prop="taxInclusiveUnitPrice">
              <el-input-number :step="0.01"
              <el-input-number :step="1"
                               :min="0"
                               v-model="productForm.taxInclusiveUnitPrice"
                               style="width: 100%"
                               :precision="2"
                               :precision="8"
                               placeholder="请输入"
                               clearable
                               @change="calculateFromUnitPrice" />
@@ -663,12 +663,12 @@
          <el-col :span="12">
            <el-form-item label="数量:"
                          prop="quantity">
              <el-input-number :step="0.1"
              <el-input-number :step="1"
                               :min="0"
                               v-model="productForm.quantity"
                               placeholder="请输入"
                               clearable
                               :precision="2"
                               :precision="8"
                               @change="calculateFromQuantity"
                               style="width: 100%" />
            </el-form-item>
@@ -1366,11 +1366,27 @@
      return productOptions.value;
    });
  };
  const calculateTaxExclusiveTotalPrice8 = (inclusiveTotalPrice, taxRate) => {
    const taxRateDecimal = taxRate / 100;
    return (inclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(8);
  };
  const calculateTaxIncludeTotalPrice8 = (unitPrice, quantity) => {
    return (unitPrice * quantity).toFixed(8);
  };
  const format8 = (row, column, cellValue) => {
    if (cellValue === undefined || cellValue === null || cellValue === "") {
      return "0.00000000";
    }
    return parseFloat(cellValue).toFixed(8);
  };
  const formattedNumber = (row, column, cellValue) => {
    if (cellValue === undefined || cellValue === null || cellValue === "") {
      return "0.00";
    }
    return parseFloat(cellValue).toFixed(2);
    return parseFloat(cellValue).toFixed(8);
  };
  const findLedgerRecordByRow = row => {
    if (!row) return null;
@@ -1423,7 +1439,7 @@
    if (!isCurrentUserMaintainer(row)) {
      return "*****";
    }
    return formattedNumber(row, column, cellValue);
    return format8(row, column, cellValue);
  };
  // 获取tree子数据
  const getModels = value => {
@@ -1538,7 +1554,10 @@
      "contractAmount",
      "taxInclusiveTotalPrice",
      "taxExclusiveTotalPrice",
    ]);
    ], {
      taxInclusiveTotalPrice: { decimalPlaces: 8 },
      taxExclusiveTotalPrice: { decimalPlaces: 8 },
    });
  };
  // 子表合计方法
  const summarizeChildrenTable = (param, parentRow) => {
@@ -1564,7 +1583,11 @@
      "taxInclusiveUnitPrice",
      "taxInclusiveTotalPrice",
      "taxExclusiveTotalPrice",
    ]);
    ], {
      taxInclusiveUnitPrice: { decimalPlaces: 8 },
      taxInclusiveTotalPrice: { decimalPlaces: 8 },
      taxExclusiveTotalPrice: { decimalPlaces: 8 },
    });
  };
  // 打开弹框
  const openForm = async (type, row) => {
@@ -1688,19 +1711,18 @@
      const quantity = Number(p.quantity ?? 0) || 0;
      const unitPrice = Number(p.unitPrice ?? 0) || 0;
      const taxRate = "13"; // 默认 13%,便于直接提交(如需可在产品中自行修改)
      const taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2);
      const taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(
      const taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(8);
      const taxExclusiveTotalPrice = calculateTaxExclusiveTotalPrice8(
        taxInclusiveTotalPrice,
        taxRate
      );
      return {
        // 台账字段
        productCategory: p.product || p.productName || "",
        specificationModel: p.specification || "",
        unit: p.unit || "",
        quantity: quantity,
        taxRate: taxRate,
        taxInclusiveUnitPrice: unitPrice.toFixed(2),
        taxInclusiveUnitPrice: unitPrice.toFixed(8),
        taxInclusiveTotalPrice: taxInclusiveTotalPrice,
        taxExclusiveTotalPrice: taxExclusiveTotalPrice,
        invoiceType: "增普票",
@@ -2375,7 +2397,7 @@
    const total = products.reduce((sum, product) => {
      return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
    }, 0);
    return total.toFixed(2);
    return total.toFixed(8);
  };
  // 用于打印的计算函数
@@ -2392,30 +2414,25 @@
    const total = products.reduce((sum, product) => {
      return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
    }, 0);
    return total.toFixed(2);
    return total.toFixed(8);
  };
  const mathNum = () => {
    console.log("productForm.value", productForm.value);
    if (!productForm.value.taxInclusiveUnitPrice) {
      return;
    }
    if (!productForm.value.quantity) {
      return;
    }
    // 含税总价计算
    productForm.value.taxInclusiveTotalPrice =
      proxy.calculateTaxIncludeTotalPrice(
        productForm.value.taxInclusiveUnitPrice,
        productForm.value.quantity
      );
    productForm.value.taxInclusiveTotalPrice = calculateTaxIncludeTotalPrice8(
      productForm.value.taxInclusiveUnitPrice,
      productForm.value.quantity
    );
    if (productForm.value.taxRate) {
      // 不含税总价计算
      productForm.value.taxExclusiveTotalPrice =
        proxy.calculateTaxExclusiveTotalPrice(
          productForm.value.taxInclusiveTotalPrice,
          productForm.value.taxRate
        );
      productForm.value.taxExclusiveTotalPrice = calculateTaxExclusiveTotalPrice8(
        productForm.value.taxInclusiveTotalPrice,
        productForm.value.taxRate
      );
    }
  };
@@ -2433,15 +2450,14 @@
    isCalculating.value = true;
    // 计算含税单价 = 含税总价 / 数量
    productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(2);
    productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(8);
    // 如果有税率,计算不含税总价
    if (productForm.value.taxRate) {
      productForm.value.taxExclusiveTotalPrice =
        proxy.calculateTaxExclusiveTotalPrice(
          totalPrice,
          productForm.value.taxRate
        );
      productForm.value.taxExclusiveTotalPrice = calculateTaxExclusiveTotalPrice8(
        totalPrice,
        productForm.value.taxRate
      );
    }
    isCalculating.value = false;
@@ -2470,12 +2486,12 @@
    // 先计算含税总价 = 不含税总价 / (1 - 税率/100)
    const taxRateDecimal = taxRate / 100;
    const inclusiveTotalPrice = exclusiveTotalPrice / (1 - taxRateDecimal);
    productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(2);
    productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(8);
    // 计算含税单价 = 含税总价 / 数量
    productForm.value.taxInclusiveUnitPrice = (
      inclusiveTotalPrice / quantity
    ).toFixed(2);
    ).toFixed(8);
    isCalculating.value = false;
  };
@@ -2498,15 +2514,14 @@
    isCalculating.value = true;
    // 计算含税总价
    productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2);
    productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(8);
    // 如果有税率,计算不含税总价
    if (productForm.value.taxRate) {
      productForm.value.taxExclusiveTotalPrice =
        proxy.calculateTaxExclusiveTotalPrice(
          productForm.value.taxInclusiveTotalPrice,
          productForm.value.taxRate
        );
      productForm.value.taxExclusiveTotalPrice = calculateTaxExclusiveTotalPrice8(
        productForm.value.taxInclusiveTotalPrice,
        productForm.value.taxRate
      );
    }
    isCalculating.value = false;
@@ -2530,15 +2545,14 @@
    isCalculating.value = true;
    // 计算含税总价
    productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2);
    productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(8);
    // 如果有税率,计算不含税总价
    if (productForm.value.taxRate) {
      productForm.value.taxExclusiveTotalPrice =
        proxy.calculateTaxExclusiveTotalPrice(
          productForm.value.taxInclusiveTotalPrice,
          productForm.value.taxRate
        );
      productForm.value.taxExclusiveTotalPrice = calculateTaxExclusiveTotalPrice8(
        productForm.value.taxInclusiveTotalPrice,
        productForm.value.taxRate
      );
    }
    isCalculating.value = false;
@@ -2564,8 +2578,10 @@
    isCalculating.value = true;
    // 计算不含税总价
    productForm.value.taxExclusiveTotalPrice =
      proxy.calculateTaxExclusiveTotalPrice(inclusiveTotalPrice, taxRate);
    productForm.value.taxExclusiveTotalPrice = calculateTaxExclusiveTotalPrice8(
      inclusiveTotalPrice,
      taxRate
    );
    isCalculating.value = false;
  };
src/views/salesManagement/salesQuotation/index.vue
@@ -215,7 +215,7 @@
            <el-table-column prop="unitPrice" label="单价">
              <template #default="scope">
                <el-form-item :prop="`products.${scope.$index}.unitPrice`" class="product-table-form-item">
                  <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="2" style="width: 100%" />
                  <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="8" style="width: 100%" />
                </el-form-item>
              </template>
            </el-table-column>