liding
13 小时以前 06372ae6f71fd776fc3db320c410c38966576c7c
fix:含税单价改成4位小数
已修改14个文件
88 ■■■■ 文件已修改
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/purchaseApproval/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/feedbackRegistration/components/formDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/ledger/Form.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/invoiceEntry/components/Modal.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/procurementLedger/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/purchaseReturnOrder/New.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/purchaseReturnOrder/ProductList.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/purchaseReturnOrder/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManagement/Management/components/formDia.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safeProduction/safeWorkApproval/components/approvalDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/invoiceRegistration/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -156,7 +156,7 @@
                  <el-table-column prop="unit" label="单位" />
                  <el-table-column prop="quantity" label="数量" />
                  <el-table-column prop="taxInclusiveUnitPrice" label="含税单价">
                    <template #default="scope">¥{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2) }}</template>
                    <template #default="scope">¥{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(4) }}</template>
                  </el-table-column>
                  <el-table-column prop="taxInclusiveTotalPrice" label="含税总价">
                    <template #default="scope">¥{{ Number(scope.row.taxInclusiveTotalPrice ?? 0).toFixed(2) }}</template>
src/views/collaborativeApproval/purchaseApproval/index.vue
@@ -448,7 +448,7 @@
    "taxInclusiveUnitPrice",
    "taxInclusiveTotalPrice",
    "taxExclusiveTotalPrice",
  ]);
  ], { taxInclusiveUnitPrice: { decimalPlaces: 4 } });
};
// 打开弹框
const openForm = (type, row) => {
@@ -813,12 +813,12 @@
  if (field === 'taxInclusiveTotalPrice') {
    // 已知含税总价和数量,反算含税单价
    if (productForm.value.quantity) {
      productForm.value.taxInclusiveUnitPrice =
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
      productForm.value.taxInclusiveUnitPrice =
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(4);
    }
    // 已知含税总价和含税单价,反算数量
    else if (productForm.value.taxInclusiveUnitPrice) {
      productForm.value.quantity =
      productForm.value.quantity =
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
    }
    // 反算不含税总价
@@ -830,12 +830,12 @@
      (Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)).toFixed(2);
    // 已知数量,反算含税单价
    if (productForm.value.quantity) {
      productForm.value.taxInclusiveUnitPrice =
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
      productForm.value.taxInclusiveUnitPrice =
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(4);
    }
    // 已知含税单价,反算数量
    else if (productForm.value.taxInclusiveUnitPrice) {
      productForm.value.quantity =
      productForm.value.quantity =
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
    }
  }
src/views/customerService/feedbackRegistration/components/formDia.vue
@@ -179,7 +179,7 @@
const formatCurrency = (val) => {
  if (val === null || val === undefined || val === '') return '-'
  const num = Number(val)
  return Number.isFinite(num) ? num.toFixed(2) : '-'
  return Number.isFinite(num) ? num.toFixed(4) : '-'
}
const { post_sale_waiting_list, degree_of_urgency } = proxy.useDict(
src/views/equipmentManagement/ledger/Form.vue
@@ -80,9 +80,10 @@
      </el-col>
      <el-col :span="12">
        <el-form-item label="含税单价" prop="taxIncludingPriceUnit">
          <el-input-number :step="0.01" :min="0" style="width: 100%"
          <el-input-number :step="0.0001" :min="0" style="width: 100%"
            v-model="form.taxIncludingPriceUnit"
            placeholder="请输入含税单价"
            :precision="4"
            maxlength="10"
            @change="mathNum"
          />
src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue
@@ -62,7 +62,7 @@
      prop: "taxInclusiveUnitPrice",
            width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
        return val ? parseFloat(val).toFixed(4) : "-";
      },
    },
    {
src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -293,7 +293,7 @@
        prop: "taxInclusiveUnitPrice",
        width: 150,
        formatData: (val) => {
            return val ? parseFloat(val).toFixed(2) : 0;
            return val ? parseFloat(val).toFixed(4) : 0;
        },
    },
    {
@@ -341,10 +341,10 @@
];
const formattedNumber = (row, column, cellValue) => {
    if (cellValue == 0) {
        return parseFloat(cellValue).toFixed(2);
        return parseFloat(cellValue).toFixed(column.property === "taxInclusiveUnitPrice" ? 4 : 2);
    }
    if (cellValue) {
        return parseFloat(cellValue).toFixed(2);
        return parseFloat(cellValue).toFixed(column.property === "taxInclusiveUnitPrice" ? 4 : 2);
    } else {
        return cellValue;
    }
src/views/procurementManagement/procurementLedger/index.vue
@@ -604,8 +604,8 @@
            <el-form-item label="含税单价(元):"
                          prop="taxInclusiveUnitPrice">
              <el-input-number v-model="productForm.taxInclusiveUnitPrice"
                               :precision="2"
                               :step="0.1"
                               :precision="4"
                               :step="0.0001"
                               :min="0"
                               clearable
                               style="width: 100%"
@@ -1072,7 +1072,9 @@
  };
  const formattedNumber = (row, column, cellValue) => {
    return parseFloat(cellValue).toFixed(2);
    const val = Number(cellValue ?? 0);
    if (!Number.isFinite(val)) return "0.00";
    return column.property === "taxInclusiveUnitPrice" ? val.toFixed(4) : val.toFixed(2);
  };
  // 查询列表
  /** 搜索按钮操作 */
@@ -1267,7 +1269,7 @@
      "taxInclusiveUnitPrice",
      "taxInclusiveTotalPrice",
      "taxExclusiveTotalPrice",
    ]);
    ], { taxInclusiveUnitPrice: { decimalPlaces: 4 } });
  };
  // 打开弹框
  const openForm = async (type, row) => {
@@ -1769,7 +1771,7 @@
        productForm.value.taxInclusiveUnitPrice = (
          Number(productForm.value.taxInclusiveTotalPrice) /
          Number(productForm.value.quantity)
        ).toFixed(2);
        ).toFixed(4);
        // 确保结果不为负数
        if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
          productForm.value.taxInclusiveUnitPrice = "0";
@@ -1810,7 +1812,7 @@
        productForm.value.taxInclusiveUnitPrice = (
          Number(productForm.value.taxInclusiveTotalPrice) /
          Number(productForm.value.quantity)
        ).toFixed(2);
        ).toFixed(4);
        // 确保结果不为负数
        if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
          productForm.value.taxInclusiveUnitPrice = "0";
src/views/procurementManagement/purchaseReturnOrder/New.vue
@@ -498,7 +498,9 @@
});
const formattedNumber = (row, column, cellValue) => {
  return parseFloat(cellValue).toFixed(2);
  const val = Number(cellValue ?? 0);
  if (!Number.isFinite(val)) return "0.00";
  return column.property === "taxInclusiveUnitPrice" ? val.toFixed(4) : val.toFixed(2);
};
const formatAmount = (value) => {
src/views/procurementManagement/purchaseReturnOrder/ProductList.vue
@@ -107,7 +107,9 @@
})
const total = ref(0)
const formattedNumber = (row, column, cellValue) => {
  return parseFloat(cellValue).toFixed(2);
  const val = Number(cellValue ?? 0);
  if (!Number.isFinite(val)) return "0.00";
  return column.property === "taxInclusiveUnitPrice" ? val.toFixed(4) : val.toFixed(2);
};
const paginationChange = (obj) => {
src/views/procurementManagement/purchaseReturnOrder/index.vue
@@ -86,7 +86,7 @@
          <el-table-column label="库存预警数量" prop="warnNum" width="120" />
          <el-table-column label="税率(%)" prop="taxRate" width="90" />
          <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" width="130">
            <template #default="scope">{{ formatAmount(scope.row.taxInclusiveUnitPrice) }}</template>
            <template #default="scope">{{ scope.row.taxInclusiveUnitPrice != null ? Number(scope.row.taxInclusiveUnitPrice).toFixed(4) : '--' }}</template>
          </el-table-column>
          <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" width="130">
            <template #default="scope">{{ formatAmount(scope.row.taxInclusiveTotalPrice) }}</template>
src/views/projectManagement/Management/components/formDia.vue
@@ -583,9 +583,9 @@
          <el-form-item label="含税单价(元):" prop="taxInclusiveUnitPrice">
            <el-input-number
              v-model="productForm.taxInclusiveUnitPrice"
              :step="0.01"
              :step="0.0001"
              :min="0"
              :precision="2"
              :precision="4"
              style="width: 100%"
              placeholder="请输入"
              clearable
@@ -863,7 +863,8 @@
function formattedNumber(row, column, cellValue) {
  const val = Number(cellValue ?? 0)
  return Number.isFinite(val) ? val.toFixed(2) : '0.00'
  if (!Number.isFinite(val)) return '0.00'
  return column.property === 'taxInclusiveUnitPrice' ? val.toFixed(4) : val.toFixed(2)
}
function summarizeProductTable(param) {
@@ -1029,7 +1030,7 @@
  const quantity = parseFloat(productForm.value.quantity)
  if (!totalPrice || !quantity || quantity <= 0) return
  isCalculating.value = true
  productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(2)
  productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(4)
  if (productForm.value.taxRate) {
    productForm.value.taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(totalPrice, productForm.value.taxRate)
  }
@@ -1050,7 +1051,7 @@
  const taxRateDecimal = taxRate / 100
  const inclusiveTotalPrice = exclusiveTotalPrice / (1 - taxRateDecimal)
  productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(2)
  productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(2)
  productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(4)
  isCalculating.value = false
}
src/views/safeProduction/safeWorkApproval/components/approvalDia.vue
@@ -183,7 +183,7 @@
                                   label="数量" />
                  <el-table-column prop="taxInclusiveUnitPrice"
                                   label="含税单价">
                    <template #default="scope">¥{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2) }}</template>
                    <template #default="scope">¥{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(4) }}</template>
                  </el-table-column>
                  <el-table-column prop="taxInclusiveTotalPrice"
                                   label="含税总价">
src/views/salesManagement/invoiceRegistration/index.vue
@@ -543,8 +543,8 @@
};
// 子表合计方法
const summarizeChildrenTable = (param) => {
    return proxy.summarizeTable(param, [
        "taxInclusiveUnitPrice",
        return proxy.summarizeTable(param, [
            "taxInclusiveUnitPrice",
        "taxInclusiveTotalPrice",
        "taxExclusiveTotalPrice",
        "invoiceNum",
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;
};