gaoluyang
6 天以前 4aaae263a6c728eaa2a3f45a1ae36082619b52a0
src/views/financialManagement/payable/input-invoice.vue
@@ -200,7 +200,7 @@
              <el-input-number
                v-model="form.amount"
                :min="0"
                :precision="2"
                :precision="4"
                style="width: 100%;"
                :disabled="isView"
                placeholder="根据入库单含税金额自动换算,可修改"
@@ -213,7 +213,7 @@
              <el-input-number
                v-model="form.taxAmount"
                :min="0"
                :precision="2"
                :precision="4"
                :controls="false"
                style="width: 100%;"
                disabled
@@ -225,7 +225,7 @@
              <el-input-number
                v-model="form.totalAmount"
                :min="0"
                :precision="2"
                :precision="4"
                :controls="false"
                style="width: 100%;"
                disabled
@@ -377,7 +377,7 @@
const formatMoney = (value) => {
  if (value === undefined || value === null) return "0.00";
  return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
  return Number(value).toFixed(4).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};
const normalizeStatus = (status) => {
@@ -440,8 +440,8 @@
/** 不含税金额变更:税额、价税合计正向计算 */
const calculateTaxFromExclusive = () => {
  form.taxAmount = Number((form.amount * form.taxRate / 100).toFixed(2));
  form.totalAmount = Number((form.amount + form.taxAmount).toFixed(2));
  form.taxAmount = Number((form.amount * form.taxRate / 100).toFixed(4));
  form.totalAmount = Number((form.amount + form.taxAmount).toFixed(4));
};
/** 价税合计变更:按税率反算不含税金额、税额 */
@@ -454,9 +454,9 @@
    return;
  }
  const rate = Number(form.taxRate) / 100;
  form.totalAmount = Number(total.toFixed(2));
  form.amount = Number((form.totalAmount / (1 + rate)).toFixed(2));
  form.taxAmount = Number((form.totalAmount - form.amount).toFixed(2));
  form.totalAmount = Number(total.toFixed(4));
  form.amount = Number((form.totalAmount / (1 + rate)).toFixed(4));
  form.taxAmount = Number((form.totalAmount - form.amount).toFixed(4));
};
const handleTaxRateChange = () => {
@@ -481,7 +481,7 @@
      .reduce((acc, row) => acc + getInboundRowTaxInclusiveAmount(row), 0);
  }
  calculateTaxFromInclusive(taxInclusiveSum > 0 ? Number(taxInclusiveSum.toFixed(2)) : 0);
  calculateTaxFromInclusive(taxInclusiveSum > 0 ? Number(taxInclusiveSum.toFixed(4)) : 0);
};
const inboundBatchDisplayText = computed(() => {
@@ -520,15 +520,15 @@
  const taxRate = toFormNumber(row.taxRate) || 13;
  if (totalAmount > 0 && amount === 0 && taxAmount === 0) {
    amount = Number((totalAmount / (1 + taxRate / 100)).toFixed(2));
    taxAmount = Number((totalAmount - amount).toFixed(2));
    amount = Number((totalAmount / (1 + taxRate / 100)).toFixed(4));
    taxAmount = Number((totalAmount - amount).toFixed(4));
  } else if (totalAmount > 0 && amount > 0 && taxAmount === 0) {
    taxAmount = Number((totalAmount - amount).toFixed(2));
    taxAmount = Number((totalAmount - amount).toFixed(4));
  } else if (amount > 0 && taxAmount === 0 && totalAmount === 0) {
    taxAmount = Number((amount * taxRate / 100).toFixed(2));
    totalAmount = Number((amount + taxAmount).toFixed(2));
    taxAmount = Number((amount * taxRate / 100).toFixed(4));
    totalAmount = Number((amount + taxAmount).toFixed(4));
  } else if (amount > 0 && taxAmount > 0 && totalAmount === 0) {
    totalAmount = Number((amount + taxAmount).toFixed(2));
    totalAmount = Number((amount + taxAmount).toFixed(4));
  }
  return { amount, taxAmount, totalAmount };