liding
2026-06-18 06372ae6f71fd776fc3db320c410c38966576c7c
src/views/salesManagement/salesLedger/index.vue
@@ -377,8 +377,8 @@
            <el-row :gutter="30">
               <el-col :span="12">
                  <el-form-item label="含税单价(元):" prop="taxInclusiveUnitPrice">
                     <el-input-number :step="0.001" :min="0" v-model="productForm.taxInclusiveUnitPrice" style="width: 100%"
                                              :precision="3"
                     <el-input-number :step="0.0001" :min="0" v-model="productForm.taxInclusiveUnitPrice" style="width: 100%"
                                              :precision="4"
                                              placeholder="请输入" clearable @change="calculateFromUnitPrice" />
                  </el-form-item>
               </el-col>
@@ -923,11 +923,11 @@
   });
};
const formattedNumber = (row, column, cellValue) => {
   return parseFloat(cellValue).toFixed(3);
   return parseFloat(cellValue).toFixed(4);
};
/** 销售台账单价/总价统一保留 3 位小数(与全局 calculateTax* 的 2 位区分) */
/** 销售台账单价/总价统一保留 4 位小数(与全局 calculateTax* 的 2 位区分) */
const calculateSalesTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
   return (Number(taxInclusiveUnitPrice) * Number(quantity)).toFixed(3);
   return (Number(taxInclusiveUnitPrice) * Number(quantity)).toFixed(4);
};
const calculateSalesTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
   const taxRateDecimal = Number(taxRate) / 100;
@@ -1052,7 +1052,7 @@
      "taxInclusiveUnitPrice",
      "taxInclusiveTotalPrice",
      "taxExclusiveTotalPrice",
   ]);
   ], { taxInclusiveUnitPrice: { decimalPlaces: 4 }, taxInclusiveTotalPrice: { decimalPlaces: 4 }, taxExclusiveTotalPrice: { decimalPlaces: 4 } });
};
// 打开弹框
const openForm = async (type, row) => {
@@ -1176,7 +1176,7 @@
         unit: p.unit || "",
         quantity: quantity,
         taxRate: taxRate,
         taxInclusiveUnitPrice: unitPrice.toFixed(3),
         taxInclusiveUnitPrice: unitPrice.toFixed(4),
         taxInclusiveTotalPrice: taxInclusiveTotalPrice,
         taxExclusiveTotalPrice: taxExclusiveTotalPrice,
         invoiceType: "增普票",
@@ -1880,7 +1880,7 @@
   isCalculating.value = true;
   
   // 计算含税单价 = 含税总价 / 数量
   productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(3);
   productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(4);
   
   // 如果有税率,计算不含税总价
   if (productForm.value.taxRate) {
@@ -1917,7 +1917,7 @@
   productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(3);
   
   // 计算含税单价 = 含税总价 / 数量
   productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(3);
   productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(4);
   
   isCalculating.value = false;
};