gaoluyang
15 小时以前 3ab45f295fb26c7794b4829976f3fb20c68a012e
src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue
@@ -4,6 +4,8 @@
    :column="columns"
    :tableData="dataList"
    :tableLoading="loading"
      :summaryMethod="summarizeChildrenTable"
      :isShowSummary="true"
    height="auto"
  >
  </PIMTable>
@@ -12,7 +14,9 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { productList } from "@/api/procurementManagement/procurementLedger.js";
import { nextTick } from "vue";
import { nextTick, getCurrentInstance } from "vue";
import { truncate } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
defineOptions({
  name: "来票登记折叠表",
@@ -56,29 +60,33 @@
    {
      label: "含税单价(元)",
      prop: "taxInclusiveUnitPrice",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
        return val ? truncate(parseFloat(val), 3) : "-";
      },
    },
    {
      label: "含税总价(元)",
      prop: "taxInclusiveTotalPrice",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
        return val ? truncate(parseFloat(val), 3) : "-";
      },
    },
    {
      label: "不含税总价(元)",
      prop: "taxExclusiveTotalPrice",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
        return val ? truncate(parseFloat(val), 3) : "-";
      },
    },
    {
      label: "本次来票金额(元)",
      prop: "ticketsAmount",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
        return val ? truncate(parseFloat(val), 3) : "-";
      },
    },
    {
@@ -88,8 +96,9 @@
    {
      label: "未来票金额(元)",
      prop: "futureTicketsAmount",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
        return val ? truncate(parseFloat(val), 3) : "-";
      },
    },
  ],
@@ -105,7 +114,25 @@
  filters.salesLedgerId = id;
  getTableData();
};
// 子表合计方法
const summarizeChildrenTable = (param) => {
   return proxy.summarizeTable(
      param,
      [
         "taxInclusiveUnitPrice",
         "taxInclusiveTotalPrice",
         "taxExclusiveTotalPrice",
         "ticketsNum",
         "ticketsAmount",
         "futureTickets",
         "futureTicketsAmount",
      ],
      {
         ticketsNum: { noDecimal: true }, // 不保留小数
         futureTickets: { noDecimal: true }, // 不保留小数
      }
   );
};
defineExpose({
  getList,
});