ZN
7 天以前 6e0aa101e90008a0be14a6d60716acc18caf7ffc
src/views/procurementManagement/procurementLedger/index.vue
@@ -1699,8 +1699,12 @@
        productForm.value.taxInclusiveUnitPrice,
        productForm.value.quantity
      );
    // 优化:使带税和不带税价格一致
    productForm.value.taxExclusiveTotalPrice = productForm.value.taxInclusiveTotalPrice;
    // 根据税率计算不含税总价
    const taxRate = Number(productForm.value.taxRate) || 0;
    productForm.value.taxExclusiveTotalPrice = (
      Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100)
    ).toFixed(2);
  };
  const reverseMathNum = field => {
    // 确保输入值不为负数
@@ -1715,6 +1719,8 @@
        return;
      }
    }
    const taxRate = Number(productForm.value.taxRate) || 0;
    if (field === "taxInclusiveTotalPrice") {
      // 已知含税总价和数量,反算含税单价
@@ -1739,11 +1745,16 @@
          productForm.value.quantity = "0";
        }
      }
      // 优化:使带税和不带税价格一致
      productForm.value.taxExclusiveTotalPrice = productForm.value.taxInclusiveTotalPrice;
      // 根据税率计算不含税总价
      productForm.value.taxExclusiveTotalPrice = (
        Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100)
      ).toFixed(2);
    } else if (field === "taxExclusiveTotalPrice") {
      // 优化:使带税和不带税价格一致
      productForm.value.taxInclusiveTotalPrice = productForm.value.taxExclusiveTotalPrice;
      // 根据税率计算含税总价
      productForm.value.taxInclusiveTotalPrice = (
        Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)
      ).toFixed(2);
      // 已知数量,反算含税单价
      if (productForm.value.quantity) {
        productForm.value.taxInclusiveUnitPrice = (