zhang_12370
3 天以前 aaf943ada13005f2b22d01e3d7080b8740d9aa96
src/views/procureMent/components/ProductionDialog.vue
@@ -203,7 +203,7 @@
  // 1. 根据含税单价和税率计算不含税单价
  // 不含税单价 = 含税单价 / (1 + 税率/100)
  const priceExcludingTax = priceIncludingTax && taxRate 
    ? toFixed(priceIncludingTax / (1 + taxRate / 100), 2)
    ? parseFloat((priceIncludingTax / (1 + taxRate / 100)).toFixed(2))
    : 0;
  // 2. 计算不含税总价 = 不含税单价 × 数量
@@ -216,8 +216,8 @@
    ? toFixed(priceIncludingTax * quantity, 2)
    : 0;
  // 更新表单数据
  form.value.priceExcludingTax = priceExcludingTax;
  // 保证显示为两位小数(如88.5显示为88.50)
  form.value.priceExcludingTax = priceExcludingTax.toFixed(2);
  form.value.totalPriceExcludingTax = totalPriceExcludingTax;
  form.value.totalPriceIncludingTax = totalPriceIncludingTax;
};
@@ -282,20 +282,13 @@
  priceExcludingTax: [
    {required: true, message: "请输入单价", trigger: "blur"},
  ],
  totalPriceExcludingTax: [
    {required: true, message: "请输入总价", trigger: "blur"},
  ],
  priceIncludingTax: [
    {required: true, message: "请输入含税单价", trigger: "blur"},
  ],
  totalPriceIncludingTax: [
    {required: true, message: "请输入含税总价", trigger: "blur"},
  ],
  taxRate: [{required: true, message: "请输入税率", trigger: "blur"}],
  registrantId: [{required: true, message: "请输入登记人", trigger: "blur"}],
  registrationDate: [
    {required: true, message: "请选择登记日期", trigger: "change"},
  ],
  taxRate:[
    {required: true, message: "请输入税率", trigger: "blur"},
    {type: "number", message: "税率必须为数字", trigger: "blur"},
  ]
};
// 关闭弹窗
const handleClose = () => {
@@ -344,4 +337,4 @@
};
</script>
<style lang="sass" scoped></style>
<style lang="scss" scoped></style>