yuan
2026-08-29 35bca0a78746b8b97497f89c9e1e52e643dc4d5e
src/views/salesManagement/salesLedger/index.vue
@@ -664,7 +664,7 @@
          align="right"
        >
          <template #default="scope">
            {{ Number(scope.row.totalAmount ?? 0).toFixed(2) }}
            {{ Number(scope.row.totalAmount ?? 0).toFixed(6) }}
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="120" align="center">
@@ -776,7 +776,7 @@
                :min="0"
                v-model="productForm.taxInclusiveUnitPrice"
                style="width: 100%"
                :precision="2"
                :precision="6"
                placeholder="请输入"
                clearable
                @change="calculateFromUnitPrice"
@@ -791,7 +791,7 @@
                v-model="productForm.quantity"
                placeholder="请输入"
                clearable
                :precision="2"
                :precision="6"
                @change="calculateFromQuantity"
                style="width: 100%"
              />
@@ -1144,7 +1144,7 @@
                      v-model="scope.row.deliveryQuantity"
                      :min="0"
                      :max="getDeliveryBatchDeliveryMax(scope.row)"
                      :precision="2"
                      :precision="6"
                      :step="0.01"
                      controls-position="right"
                      @change="handleDeliveryBatchQuantityChange(scope.row)"
@@ -1542,9 +1542,9 @@
};
const formattedNumber = (row, column, cellValue) => {
  if (cellValue === undefined || cellValue === null || cellValue === "") {
    return "0.00";
    return "0.000000";
  }
  return parseFloat(cellValue).toFixed(2);
  return parseFloat(cellValue).toFixed(6);
};
const findLedgerRecordByRow = (row) => {
  if (!row) return null;
@@ -1708,11 +1708,15 @@
};
// 主表合计方法
const summarizeMainTable = (param) => {
  return proxy.summarizeTable(param, [
    "contractAmount",
    "taxInclusiveTotalPrice",
    "taxExclusiveTotalPrice",
  ]);
  return proxy.summarizeTable(
    param,
    ["contractAmount", "taxInclusiveTotalPrice", "taxExclusiveTotalPrice"],
    {
      contractAmount: { decimalPlaces: 6 },
      taxInclusiveTotalPrice: { decimalPlaces: 6 },
      taxExclusiveTotalPrice: { decimalPlaces: 6 },
    }
  );
};
// 子表合计方法
const summarizeChildrenTable = (param, parentRow) => {
@@ -1734,11 +1738,19 @@
      return "";
    });
  }
  return proxy.summarizeTable(param, [
    "taxInclusiveUnitPrice",
    "taxInclusiveTotalPrice",
    "taxExclusiveTotalPrice",
  ]);
  return proxy.summarizeTable(
    param,
    [
      "taxInclusiveUnitPrice",
      "taxInclusiveTotalPrice",
      "taxExclusiveTotalPrice",
    ],
    {
      taxInclusiveUnitPrice: { decimalPlaces: 6 },
      taxInclusiveTotalPrice: { decimalPlaces: 6 },
      taxExclusiveTotalPrice: { decimalPlaces: 6 },
    }
  );
};
// 打开弹框
const openForm = async (type, row) => {
@@ -1868,10 +1880,11 @@
    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 taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(6);
    const taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(
      taxInclusiveTotalPrice,
      taxRate
      taxRate,
      6
    );
    return {
      // 台账字段
@@ -1880,7 +1893,7 @@
      unit: p.unit || "",
      quantity: quantity,
      taxRate: taxRate,
      taxInclusiveUnitPrice: unitPrice.toFixed(2),
      taxInclusiveUnitPrice: unitPrice.toFixed(6),
      taxInclusiveTotalPrice: taxInclusiveTotalPrice,
      taxExclusiveTotalPrice: taxExclusiveTotalPrice,
      invoiceType: "增普票",
@@ -2549,7 +2562,7 @@
  const total = products.reduce((sum, product) => {
    return sum + (parseFloat(product.quantity) || 0);
  }, 0);
  return total.toFixed(2);
  return total.toFixed(6);
};
// 计算产品总金额
@@ -2558,7 +2571,7 @@
  const total = products.reduce((sum, product) => {
    return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
  }, 0);
  return total.toFixed(2);
  return total.toFixed(6);
};
// 用于打印的计算函数
@@ -2567,7 +2580,7 @@
  const total = products.reduce((sum, product) => {
    return sum + (parseFloat(product.quantity) || 0);
  }, 0);
  return total.toFixed(2);
  return total.toFixed(6);
};
const getTotalAmountForPrint = (products) => {
@@ -2575,7 +2588,7 @@
  const total = products.reduce((sum, product) => {
    return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
  }, 0);
  return total.toFixed(2);
  return total.toFixed(6);
};
const mathNum = () => {
@@ -2590,14 +2603,16 @@
  productForm.value.taxInclusiveTotalPrice =
    proxy.calculateTaxIncludeTotalPrice(
      productForm.value.taxInclusiveUnitPrice,
      productForm.value.quantity
      productForm.value.quantity,
      6
    );
  if (productForm.value.taxRate) {
    // 不含税总价计算
    productForm.value.taxExclusiveTotalPrice =
      proxy.calculateTaxExclusiveTotalPrice(
        productForm.value.taxInclusiveTotalPrice,
        productForm.value.taxRate
        productForm.value.taxRate,
        6
      );
  }
};
@@ -2616,14 +2631,15 @@
  isCalculating.value = true;
  // 计算含税单价 = 含税总价 / 数量
  productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(2);
  productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(6);
  // 如果有税率,计算不含税总价
  if (productForm.value.taxRate) {
    productForm.value.taxExclusiveTotalPrice =
      proxy.calculateTaxExclusiveTotalPrice(
        totalPrice,
        productForm.value.taxRate
        productForm.value.taxRate,
        6
      );
  }
@@ -2653,12 +2669,12 @@
  // 先计算含税总价 = 不含税总价 / (1 - 税率/100)
  const taxRateDecimal = taxRate / 100;
  const inclusiveTotalPrice = exclusiveTotalPrice / (1 - taxRateDecimal);
  productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(2);
  productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(6);
  // 计算含税单价 = 含税总价 / 数量
  productForm.value.taxInclusiveUnitPrice = (
    inclusiveTotalPrice / quantity
  ).toFixed(2);
  ).toFixed(6);
  isCalculating.value = false;
};
@@ -2681,14 +2697,15 @@
  isCalculating.value = true;
  // 计算含税总价
  productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2);
  productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(6);
  // 如果有税率,计算不含税总价
  if (productForm.value.taxRate) {
    productForm.value.taxExclusiveTotalPrice =
      proxy.calculateTaxExclusiveTotalPrice(
        productForm.value.taxInclusiveTotalPrice,
        productForm.value.taxRate
        productForm.value.taxRate,
        6
      );
  }
@@ -2713,14 +2730,15 @@
  isCalculating.value = true;
  // 计算含税总价
  productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2);
  productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(6);
  // 如果有税率,计算不含税总价
  if (productForm.value.taxRate) {
    productForm.value.taxExclusiveTotalPrice =
      proxy.calculateTaxExclusiveTotalPrice(
        productForm.value.taxInclusiveTotalPrice,
        productForm.value.taxRate
        productForm.value.taxRate,
        6
      );
  }
@@ -2748,7 +2766,7 @@
  // 计算不含税总价
  productForm.value.taxExclusiveTotalPrice =
    proxy.calculateTaxExclusiveTotalPrice(inclusiveTotalPrice, taxRate);
    proxy.calculateTaxExclusiveTotalPrice(inclusiveTotalPrice, taxRate, 6);
  isCalculating.value = false;
};