src/views/procurementManagement/paymentLedger/index.vue
@@ -79,7 +79,7 @@
                    @pagination="sonPaginationSearch">
            <template #payableAmountSlot="{ row }">
              <el-text type="danger">
                {{ parseFloat(row.unshippedAmount).toFixed(2) }}
                {{ formatDecimal(row.unshippedAmount) }}
              </el-text>
            </template>
          </PIMTable>
@@ -90,13 +90,14 @@
</template>
<script setup>
  import { ref, toRefs } from "vue";
  import { ref, toRefs, reactive, getCurrentInstance } from "vue";
  import { Search } from "@element-plus/icons-vue";
  import {
    paymentLedgerList,
    paymentRecordList,
  } from "@/api/procurementManagement/paymentLedger.js";
  import Pagination from "../../../components/PIMTable/Pagination.vue";
  import { tableAmountFormatter, formatDecimal, buildAmountSummaryFormat } from "@/utils/numberFormat";
  const tableData = ref([]);
  const tableLoading = ref(false);
@@ -140,17 +141,13 @@
      label: "合同金额(元)",
      prop: "contractAmount",
      width: 200,
      formatData: params => {
        return params ? parseFloat(params).toFixed(2) : 0;
      },
      formatData: params => formatDecimal(params),
    },
    {
      label: "已入库金额(元)",
      prop: "shippedAmount",
      width: 200,
      formatData: params => {
        return params ? parseFloat(params).toFixed(2) : 0;
      },
      formatData: params => formatDecimal(params),
    },
    {
      label: "未入库金额(元)",
@@ -171,10 +168,13 @@
    return proxy.summarizeTable(
      param,
      ["contractAmounts", "shippedAmount", "unshippedAmount"],
      {
        ticketsNum: { noDecimal: true }, // 不保留小数
        futureTickets: { noDecimal: true }, // 不保留小数
      }
      buildAmountSummaryFormat(
        ["contractAmounts", "shippedAmount", "unshippedAmount"],
        {
          ticketsNum: { noDecimal: true },
          futureTickets: { noDecimal: true },
        }
      )
    );
  };
  // 子表合计方法
@@ -182,10 +182,13 @@
    let summarizeTable = proxy.summarizeTable(
      param,
      ["contractAmount", "shippedAmount", "unshippedAmount"],
      {
        ticketsNum: { noDecimal: true }, // 不保留小数
        futureTickets: { noDecimal: true }, // 不保留小数
      }
      buildAmountSummaryFormat(
        ["contractAmount", "shippedAmount", "unshippedAmount"],
        {
          ticketsNum: { noDecimal: true },
          futureTickets: { noDecimal: true },
        }
      )
    );
    return summarizeTable;
  };
@@ -257,13 +260,7 @@
    sonPage.size = pagination.limit;
    getPaymenRecordtList(currentSupplierId.value);
  };
  const formattedNumber = (row, column, cellValue) => {
    if (column.property !== "supplierName") {
      return parseFloat(cellValue).toFixed(2);
    } else {
      return cellValue;
    }
  };
  const formattedNumber = tableAmountFormatter;
  getList();
</script>