gaoluyang
3 天以前 792ddec0ad8c5fe780ad65d4d04a38ae67ac4cea
src/views/procurementManagement/invoiceEntry/components/ExpandTable.vue
@@ -4,6 +4,9 @@
    :column="columns"
    :tableData="dataList"
    :tableLoading="loading"
      :summaryMethod="summarizeChildrenTable"
      :isShowSummary="true"
    height="auto"
  >
  </PIMTable>
</template>
@@ -11,6 +14,8 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { productList } from "@/api/procurementManagement/procurementLedger.js";
import { nextTick } from "vue";
const { proxy } = getCurrentInstance();
defineOptions({
  name: "来票登记折叠表",
@@ -54,6 +59,7 @@
    {
      label: "含税单价(元)",
      prop: "taxInclusiveUnitPrice",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
      },
@@ -61,6 +67,7 @@
    {
      label: "含税总价(元)",
      prop: "taxInclusiveTotalPrice",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
      },
@@ -68,6 +75,7 @@
    {
      label: "不含税总价(元)",
      prop: "taxExclusiveTotalPrice",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
      },
@@ -75,6 +83,7 @@
    {
      label: "本次来票金额(元)",
      prop: "ticketsAmount",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
      },
@@ -86,6 +95,7 @@
    {
      label: "未来票金额(元)",
      prop: "futureTicketsAmount",
         width:200,
      formatData: (val) => {
        return val ? parseFloat(val).toFixed(2) : "-";
      },
@@ -98,11 +108,30 @@
  }
);
const getList = (id) => {
const getList = async (id) => {
  await nextTick();
  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,
});