gaoluyang
2025-12-09 b02cd77eb78d973c1eb11ebf03d7d5d71b02aa65
src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -58,6 +58,7 @@
              v-model="form.invoiceAmount"
              placeholder="自动填充"
              clearable
              :disabled="true"
            />
          </el-form-item>
        </el-col>
@@ -127,7 +128,6 @@
            placeholder="请输入"
            :min="0"
            :step="0.1"
                  :precision="2"
            clearable
            style="width: 100%"
            @change="invoiceNumBlur(row)"
@@ -138,7 +138,6 @@
            v-model="row.ticketsAmount"
            placeholder="请输入"
            :min="0"
                  :precision="2"
            :step="0.1"
            clearable
            style="width: 100%"
@@ -198,8 +197,7 @@
const rules = ref({
  invoiceNumber: [
    { required: true, message: "请输入发票号", trigger: "blur" },
    { type: "string" },
    { required: false, message: "请输入发票号", trigger: "blur" },
  ],
  invoiceAmount: [
    { required: true, message: "请输入发票金额", trigger: "blur" },
@@ -258,7 +256,7 @@
    prop: "taxInclusiveUnitPrice",
    width: 150,
    formatData: (val) => {
      return val ? parseFloat(val).toFixed(2) : 0;
      return val ? parseFloat(val).toFixed(5) : 0;
    },
  },
  {
@@ -266,7 +264,7 @@
    prop: "taxInclusiveTotalPrice",
    width: 150,
    formatData: (val) => {
      return parseFloat(val).toFixed(2) ?? 0;
      return parseFloat(val).toFixed(5) ?? 0;
    },
  },
  {
@@ -274,7 +272,7 @@
    prop: "taxExclusiveTotalPrice",
    width: 150,
    formatData: (val) => {
      return parseFloat(val).toFixed(2) ?? 0;
      return parseFloat(val).toFixed(5) ?? 0;
    },
  },
  {
@@ -349,17 +347,18 @@
  if (!row.ticketsNum || row.ticketsNum === "") {
    row.ticketsNum = 0;
  }
   row.ticketsNum = row.ticketsNum.toFixed(5);
  if (Number(row.ticketsNum) > Number(row.tempFutureTickets)) {
    proxy.$modal.msgWarning("本次开票数不得大于未开票数");
    row.ticketsNum = 0;
    return;
  }
  // 计算本次来票金额
  row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(2)
  row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(5)
  // 计算未来票数
  row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
  row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(5)
  // 计算未来票金额
  row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
  row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(5)
  calculateinvoiceAmount();
};
@@ -368,6 +367,7 @@
  if (!row.ticketsAmount) {
    row.ticketsAmount = 0;
  }
   row.ticketsAmount = row.ticketsAmount.toFixed(5);
  // 计算是否超过来票总金额
  if (row.ticketsAmount > row.tempFutureTicketsAmount) {
    proxy.$modal.msgWarning("本次来票金额不得大于未来票金额");
@@ -375,12 +375,12 @@
  }
  // 计算本次来票数
  row.ticketsNum = Number(
    (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2)
    (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(5)
  );
  // 计算未来票数
  row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
  row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(5)
  // 计算未来票金额
  row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
  row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(5)
  calculateinvoiceAmount();
};
@@ -391,7 +391,7 @@
      invoiceAmountTotal += Number(item.ticketsAmount);
    }
  });
  form.invoiceAmount = invoiceAmountTotal.toFixed(2);
  form.invoiceAmount = invoiceAmountTotal.toFixed(5);
};
const open = (type, eid) => {