zhangwencui
2026-05-21 2d391be892b1faca84656a7ac201cbb43640fab3
财务功能修改
已修改5个文件
552 ■■■■■ 文件已修改
src/views/financialManagement/payable/payment.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/financialManagement/payable/purchaseIn.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/financialManagement/receivable/receipt.vue 393 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/paymentLedger/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/receiptPaymentLedger/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/financialManagement/payable/payment.vue
@@ -1,32 +1,38 @@
<template>
  <div class="app-container">
    <el-form :model="filters" :inline="true">
    <el-form :model="filters"
             :inline="true">
      <el-form-item label="付款单号:">
        <el-input v-model="filters.paymentNumber" placeholder="请输入付款单号" clearable style="width: 200px;" />
        <el-input v-model="filters.paymentNumber"
                  placeholder="请输入付款单号"
                  clearable
                  style="width: 200px;" />
      </el-form-item>
      <el-form-item label="供应商:">
        <el-select v-model="filters.supplierId" placeholder="请选择供应商" clearable filterable style="width: 200px;">
          <el-option
            v-for="item in supplierList"
        <el-select v-model="filters.supplierId"
                   placeholder="请选择供应商"
                   clearable
                   filterable
                   style="width: 200px;">
          <el-option v-for="item in supplierList"
            :key="item.id"
            :label="item.supplierName"
            :value="item.id"
          />
                     :value="item.id" />
        </el-select>
      </el-form-item>
      <el-form-item label="付款方式:">
        <el-select v-model="filters.paymentMethod" placeholder="请选择付款方式" clearable style="width: 150px;">
          <el-option
            v-for="item in checkout_payment"
        <el-select v-model="filters.paymentMethod"
                   placeholder="请选择付款方式"
                   clearable
                   style="width: 150px;">
          <el-option v-for="item in checkout_payment"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
                     :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="付款日期:">
        <el-date-picker
          v-model="filters.dateRange"
        <el-date-picker v-model="filters.dateRange"
          type="daterange"
          value-format="YYYY-MM-DD"
          format="YYYY-MM-DD"
@@ -34,25 +40,28 @@
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          clearable
          style="width: 240px;"
        />
                        style="width: 240px;" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSearch">搜索</el-button>
        <el-button type="primary"
                   @click="onSearch">搜索</el-button>
        <el-button @click="resetFilters">重置</el-button>
      </el-form-item>
    </el-form>
    <div class="table_list">
      <div class="actions">
        <div>
          <el-statistic title="本页付款合计" :value="totalPaymentAmount" :precision="2" prefix="¥" />
          <el-statistic title="本页付款合计"
                        :value="totalPaymentAmount"
                        :precision="2"
                        prefix="¥" />
        </div>
        <div>
          <el-button @click="handleExport" icon="Download">导出</el-button>
          <el-button @click="handleExport"
                     icon="Download">导出</el-button>
        </div>
      </div>
      <PIMTable
        rowKey="id"
      <PIMTable rowKey="id"
        :column="columns"
        :tableData="dataList"
        :tableLoading="tableLoading"
@@ -61,8 +70,7 @@
          size: pagination.pageSize,
          total: pagination.total,
        }"
        @pagination="changePage"
      >
                @pagination="changePage">
        <template #amount="{ row }">
          <span class="text-danger">¥{{ formatMoney(row.amount) }}</span>
        </template>
@@ -70,7 +78,10 @@
          <el-tag>{{ getPaymentMethodLabel(row.paymentMethod) }}</el-tag>
        </template>
        <template #operation="{ row }">
          <el-button type="danger" link @click="handleDelete(row)">删除</el-button>
          <el-button :disabled="row.accountStatemen"
                     type="danger"
                     link
                     @click="handleDelete(row)">删除</el-button>
        </template>
      </PIMTable>
    </div>
@@ -112,9 +123,22 @@
  { label: "供应商", prop: "supplierName", width: "180" },
  { label: "付款日期", prop: "paymentDate", width: "120" },
  { label: "付款金额", prop: "amount", dataType: "slot", slot: "amount" },
  { label: "付款方式", prop: "paymentMethod", dataType: "slot", slot: "paymentMethod", width: "120" },
    {
      label: "付款方式",
      prop: "paymentMethod",
      dataType: "slot",
      slot: "paymentMethod",
      width: "120",
    },
  { label: "备注", prop: "remark", showOverflowTooltip: true },
  { label: "操作", prop: "operation", dataType: "slot", slot: "operation", width: "80", fixed: "right" },
    {
      label: "操作",
      prop: "operation",
      dataType: "slot",
      slot: "operation",
      width: "80",
      fixed: "right",
    },
];
const dataList = ref([]);
@@ -125,18 +149,22 @@
  dataList.value.reduce((sum, item) => sum + Number(item.amount ?? 0), 0)
);
const formatMoney = (value) => {
  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(2)
      .replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};
const getPaymentMethodLabel = (value) => {
  const getPaymentMethodLabel = value => {
  if (value === undefined || value === null || value === "") return "-";
  const item = checkout_payment.value?.find((m) => String(m.value) === String(value));
    const item = checkout_payment.value?.find(
      m => String(m.value) === String(value)
    );
  return item?.label ?? value;
};
const normalizeTableRow = (row) => ({
  const normalizeTableRow = row => ({
  ...row,
  paymentNumber: row.paymentNumber ?? row.paymentCode,
  invoiceApplicationNo: row.invoiceApplicationNo ?? row.applyCode ?? "",
@@ -146,14 +174,14 @@
});
const getSupplierList = () => {
  getOptions().then((res) => {
    getOptions().then(res => {
    if (res.code === 200) {
      supplierList.value = res.data ?? [];
    }
  });
};
const appendFilterParams = (params) => {
  const appendFilterParams = params => {
  if (filters.paymentNumber) {
    params.paymentNumber = filters.paymentNumber;
  }
@@ -189,7 +217,7 @@
const getTableData = () => {
  tableLoading.value = true;
  listPageAccountPurchasePayment(buildListParams())
    .then((res) => {
      .then(res => {
      if (res.code === 200) {
        dataList.value = (res.data?.records ?? []).map(normalizeTableRow);
        pagination.total = res.data?.total ?? 0;
@@ -229,14 +257,14 @@
  getTableData();
};
const handleDelete = (row) => {
  const handleDelete = row => {
  ElMessageBox.confirm(`确认删除付款单「${row.paymentNumber}」吗?`, "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  }).then(() => {
    deleteAccountPurchasePayment([row.id])
      .then((res) => {
        .then(res => {
        if (res.code === 200) {
          ElMessage.success("删除成功");
          getTableData();
src/views/financialManagement/payable/purchaseIn.vue
@@ -1,34 +1,39 @@
<template>
  <!-- 采购入库 -->
  <div class="app-container">
    <el-form :model="filters" :inline="true">
    <el-form :model="filters"
             :inline="true">
      <el-form-item label="入库单号:">
        <el-input v-model="filters.inboundBatches" placeholder="请输入入库单号" clearable style="width: 200px;" />
        <el-input v-model="filters.inboundBatches"
                  placeholder="请输入入库单号"
                  clearable
                  style="width: 200px;" />
      </el-form-item>
      <el-form-item label="供应商:">
        <el-select v-model="filters.supplierId" placeholder="请选择供应商" clearable filterable style="width: 200px;">
          <el-option
            v-for="item in supplierList"
        <el-select v-model="filters.supplierId"
                   placeholder="请选择供应商"
                   clearable
                   filterable
                   style="width: 200px;">
          <el-option v-for="item in supplierList"
            :key="item.id"
            :label="item.supplierName"
            :value="item.id"
          />
                     :value="item.id" />
        </el-select>
      </el-form-item>
      <el-form-item label="入库日期:">
        <el-date-picker
          v-model="filters.dateRange"
        <el-date-picker v-model="filters.dateRange"
          value-format="YYYY-MM-DD"
          format="YYYY-MM-DD"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          clearable
        />
                        clearable />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSearch">搜索</el-button>
        <el-button type="primary"
                   @click="onSearch">搜索</el-button>
        <el-button @click="resetFilters">重置</el-button>
      </el-form-item>
    </el-form>
@@ -36,11 +41,11 @@
      <div class="actions">
        <div></div>
        <div>
          <el-button @click="handleOut" icon="Download">导出</el-button>
          <el-button @click="handleOut"
                     icon="Download">导出</el-button>
        </div>
      </div>
      <PIMTable
        rowKey="id"
      <PIMTable rowKey="id"
        :column="columns"
        :tableData="dataList"
        :tableLoading="tableLoading"
@@ -49,8 +54,7 @@
          size: pagination.pageSize,
          total: pagination.total,
        }"
        @pagination="changePage"
      >
                @pagination="changePage">
        <template #inboundDate="{ row }">
          {{ row.inboundDate ?? row.InboundDate ?? "" }}
        </template>
@@ -95,6 +99,19 @@
  },
  { label: "产品名称", prop: "productName", minWidth: "140" },
  { label: "产品规格", prop: "specificationModel", minWidth: "140" },
    {
      label: "金额",
      prop: "inboundAmount",
      minWidth: "120",
      align: "right",
      formatData: val =>
        val === null || val === undefined || val === ""
          ? ""
          : Number(val).toLocaleString("zh-CN", {
              minimumFractionDigits: 2,
              maximumFractionDigits: 2,
            }),
    },
  { label: "采购订单号", prop: "purchaseContractNumber", minWidth: "150" },
];
@@ -118,7 +135,7 @@
};
const getSupplierList = () => {
  listSupplier({ current: -1, size: -1, isWhite: 0 }).then((res) => {
    listSupplier({ current: -1, size: -1, isWhite: 0 }).then(res => {
    if (res.code === 200) {
      supplierList.value = res.data?.records ?? [];
    }
@@ -137,7 +154,7 @@
    current: pagination.currentPage,
    size: pagination.pageSize,
  })
    .then((res) => {
      .then(res => {
      const ok = res.code === 200 || res.code === 0;
      if (ok && res.data) {
        pagination.total = res.data.total ?? 0;
src/views/financialManagement/receivable/receipt.vue
@@ -1,27 +1,38 @@
<template>
  <div class="app-container">
    <el-form :model="filters" :inline="true">
    <el-form :model="filters"
             :inline="true">
      <el-form-item label="收款单号:">
        <el-input v-model="filters.collectionNumber" placeholder="请输入收款单号" clearable style="width: 200px;" />
        <el-input v-model="filters.collectionNumber"
                  placeholder="请输入收款单号"
                  clearable
                  style="width: 200px;" />
      </el-form-item>
      <el-form-item label="客户:">
        <el-select v-model="filters.customerId" placeholder="请选择客户" clearable filterable style="width: 200px;">
          <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id" />
        <el-select v-model="filters.customerId"
                   placeholder="请选择客户"
                   clearable
                   filterable
                   style="width: 200px;">
          <el-option v-for="item in customerList"
                     :key="item.id"
                     :label="item.customerName"
                     :value="item.id" />
        </el-select>
      </el-form-item>
      <el-form-item label="收款方式:">
        <el-select v-model="filters.collectionMethod" placeholder="请选择收款方式" clearable style="width: 150px;">
          <el-option
            v-for="item in payment_methods"
        <el-select v-model="filters.collectionMethod"
                   placeholder="请选择收款方式"
                   clearable
                   style="width: 150px;">
          <el-option v-for="item in payment_methods"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
                     :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="收款日期:">
        <el-date-picker
          v-model="filters.dateRange"
        <el-date-picker v-model="filters.dateRange"
          type="daterange"
          value-format="YYYY-MM-DD"
          format="YYYY-MM-DD"
@@ -29,26 +40,32 @@
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          clearable
          style="width: 240px;"
        />
                        style="width: 240px;" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSearch">搜索</el-button>
        <el-button type="primary"
                   @click="onSearch">搜索</el-button>
        <el-button @click="resetFilters">重置</el-button>
      </el-form-item>
    </el-form>
    <div class="table_list">
      <div class="actions">
        <div>
          <el-statistic title="本页收款合计" :value="totalReceiptAmount" :precision="2" prefix="¥" />
          <el-statistic title="本页收款合计"
                        :value="totalReceiptAmount"
                        :precision="2"
                        prefix="¥" />
        </div>
        <div>
          <el-button type="primary" @click="add" icon="Plus">新增收款</el-button>
          <el-button type="success" @click="handleExport" icon="Download">导出</el-button>
          <el-button type="primary"
                     @click="add"
                     icon="Plus">新增收款</el-button>
          <el-button type="success"
                     @click="handleExport"
                     icon="Download">导出</el-button>
        </div>
      </div>
      <PIMTable
        rowKey="id"
      <PIMTable rowKey="id"
        v-loading="tableLoading"
        :column="columns"
        :tableData="dataList"
@@ -57,8 +74,7 @@
          size: pagination.pageSize,
          total: pagination.total,
        }"
        @pagination="changePage"
      >
                @pagination="changePage">
        <template #amount="{ row }">
          <span class="text-success">¥{{ formatMoney(row.amount) }}</span>
        </template>
@@ -66,60 +82,71 @@
          <span>{{ getReceiptMethodLabel(row.receiptMethod) }}</span>
        </template>
        <template #operation="{ row }">
          <el-button type="primary" link @click="view(row)">查看</el-button>
          <el-button type="primary" link @click="edit(row)">编辑</el-button>
          <el-button type="danger" link @click="handleDelete(row)">删除</el-button>
          <el-button type="primary"
                     link
                     @click="view(row)">查看</el-button>
          <el-button :disabled="row.accountStatemen"
                     type="primary"
                     link
                     @click="edit(row)">编辑</el-button>
          <el-button :disabled="row.accountStatemen"
                     type="danger"
                     link
                     @click="handleDelete(row)">删除</el-button>
        </template>
      </PIMTable>
    </div>
    <FormDialog
      :title="dialogTitle"
    <FormDialog :title="dialogTitle"
      v-model="dialogVisible"
      width="800px"
      :operation-type="isView ? 'detail' : ''"
      @confirm="submitForm"
      @cancel="closeDialog"
    >
      <el-form :model="form" :rules="rules" ref="formRef" label-width="120px">
                @cancel="closeDialog">
      <el-form :model="form"
               :rules="rules"
               ref="formRef"
               label-width="120px">
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="收款单号" prop="receiptCode">
              <el-input v-model="form.receiptCode" placeholder="系统自动生成" disabled />
            <el-form-item label="收款单号"
                          prop="receiptCode">
              <el-input v-model="form.receiptCode"
                        placeholder="系统自动生成"
                        disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="客户" prop="customerId">
              <el-select
                v-model="form.customerId"
            <el-form-item label="客户"
                          prop="customerId">
              <el-select v-model="form.customerId"
                placeholder="请选择客户"
                style="width: 100%;"
                :disabled="isEdit || isView"
                filterable
                @change="handleCustomerChange"
              >
                <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id" />
                         @change="handleCustomerChange">
                <el-option v-for="item in customerList"
                           :key="item.id"
                           :label="item.customerName"
                           :value="item.id" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="关联单据" prop="stockOutRecordIds">
              <el-input
                :model-value="outboundBatchDisplayText"
            <el-form-item label="关联单据"
                          prop="stockOutRecordIds">
              <el-input :model-value="outboundBatchDisplayText"
                placeholder="请先选择客户"
                readonly
                :disabled="!form.customerId || isEdit || isView"
                class="outbound-batch-input"
                @click="handleOutboundInputClick"
              >
                <template v-if="!isEdit && !isView" #append>
                  <el-button
                    :disabled="!form.customerId"
                        @click="handleOutboundInputClick">
                <template v-if="!isEdit && !isView"
                          #append>
                  <el-button :disabled="!form.customerId"
                    :loading="outboundBatchLoading"
                    @click.stop="openOutboundSelectDialog"
                  >
                             @click.stop="openOutboundSelectDialog">
                    选择
                  </el-button>
                </template>
@@ -129,95 +156,123 @@
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="收款日期" prop="receiptDate">
              <el-date-picker
                v-model="form.receiptDate"
            <el-form-item label="收款日期"
                          prop="receiptDate">
              <el-date-picker v-model="form.receiptDate"
                type="date"
                placeholder="选择日期"
                value-format="YYYY-MM-DD"
                style="width: 100%;"
                :disabled="isView"
              />
                              :disabled="isView" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收款金额" prop="amount">
              <el-input-number
                v-model="form.amount"
            <el-form-item label="收款金额"
                          prop="amount">
              <el-input-number v-model="form.amount"
                :min="0"
                :precision="2"
                style="width: 100%;"
                :disabled="isView"
                placeholder="根据关联单据自动汇总,可修改"
              />
                               placeholder="根据关联单据自动汇总,可修改" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="收款方式" prop="receiptMethod">
              <el-select
                v-model="form.receiptMethod"
            <el-form-item label="收款方式"
                          prop="receiptMethod">
              <el-select v-model="form.receiptMethod"
                placeholder="请选择收款方式"
                style="width: 100%;"
                :disabled="isView"
              >
                <el-option
                  v-for="item in payment_methods"
                         :disabled="isView">
                <el-option v-for="item in payment_methods"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
                           :value="item.value" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" :disabled="isView" />
        <el-form-item label="备注"
                      prop="remark">
          <el-input v-model="form.remark"
                    type="textarea"
                    :rows="3"
                    placeholder="请输入备注"
                    :disabled="isView" />
        </el-form-item>
      </el-form>
      <template v-if="!isView" #footer>
        <el-button type="primary" :loading="submitLoading" @click="submitForm">确定</el-button>
      <template v-if="!isView"
                #footer>
        <el-button type="primary"
                   :loading="submitLoading"
                   @click="submitForm">确定</el-button>
        <el-button @click="closeDialog">取消</el-button>
      </template>
    </FormDialog>
    <el-dialog
      v-model="outboundSelectVisible"
    <el-dialog v-model="outboundSelectVisible"
      title="选择关联单据"
      width="1200px"
      append-to-body
      destroy-on-close
      :close-on-click-modal="false"
      @closed="handleOutboundDialogClosed"
    >
      <el-table
        ref="outboundTableRef"
               @closed="handleOutboundDialogClosed">
      <el-table ref="outboundTableRef"
        v-loading="outboundBatchLoading"
        :data="outboundBatchList"
        row-key="id"
        border
        stripe
        max-height="480"
        @selection-change="handleOutboundDialogSelectionChange"
      >
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column prop="outboundBatches" label="出库单号" min-width="140" show-overflow-tooltip />
        <el-table-column prop="customerName" label="客户名称" min-width="120" show-overflow-tooltip />
        <el-table-column prop="productName" label="产品名称" min-width="120" show-overflow-tooltip />
        <el-table-column prop="specificationModel" label="规格型号" min-width="140" show-overflow-tooltip />
        <el-table-column prop="salesContractNo" label="销售合同号" min-width="140" show-overflow-tooltip />
        <el-table-column prop="shippingNo" label="发货单号" min-width="130" show-overflow-tooltip />
        <el-table-column prop="shippingDate" label="发货日期" width="110" align="center" />
        <el-table-column prop="outboundAmount" label="出库金额" width="110" align="right">
                @selection-change="handleOutboundDialogSelectionChange">
        <el-table-column type="selection"
                         width="55"
                         align="center" />
        <el-table-column prop="outboundBatches"
                         label="出库单号"
                         min-width="140"
                         show-overflow-tooltip />
        <el-table-column prop="customerName"
                         label="客户名称"
                         min-width="120"
                         show-overflow-tooltip />
        <el-table-column prop="productName"
                         label="产品名称"
                         min-width="120"
                         show-overflow-tooltip />
        <el-table-column prop="specificationModel"
                         label="规格型号"
                         min-width="140"
                         show-overflow-tooltip />
        <el-table-column prop="salesContractNo"
                         label="销售合同号"
                         min-width="140"
                         show-overflow-tooltip />
        <el-table-column prop="shippingNo"
                         label="发货单号"
                         min-width="130"
                         show-overflow-tooltip />
        <el-table-column prop="shippingDate"
                         label="发货日期"
                         width="110"
                         align="center" />
        <el-table-column prop="outboundAmount"
                         label="出库金额"
                         width="110"
                         align="right">
          <template #default="{ row }">¥{{ formatMoney(row.outboundAmount) }}</template>
        </el-table-column>
        <el-table-column prop="taxRate" label="税率" width="80" align="center">
        <el-table-column prop="taxRate"
                         label="税率"
                         width="80"
                         align="center">
          <template #default="{ row }">{{ row.taxRate }}%</template>
        </el-table-column>
      </el-table>
      <template #footer>
        <el-button type="primary" @click="confirmOutboundSelection">确定</el-button>
        <el-button type="primary"
                   @click="confirmOutboundSelection">确定</el-button>
        <el-button @click="outboundSelectVisible = false">取消</el-button>
      </template>
    </el-dialog>
@@ -225,7 +280,14 @@
</template>
<script setup>
import { ref, reactive, computed, onMounted, nextTick, getCurrentInstance } from "vue";
  import {
    ref,
    reactive,
    computed,
    onMounted,
    nextTick,
    getCurrentInstance,
  } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import FormDialog from "@/components/Dialog/FormDialog.vue";
import { listCustomer } from "@/api/basicData/customer.js";
@@ -262,9 +324,22 @@
  { label: "客户名称", prop: "customerName", width: "180" },
  { label: "收款日期", prop: "receiptDate", width: "120" },
  { label: "收款金额", prop: "amount", dataType: "slot", slot: "amount" },
  { label: "收款方式", prop: "receiptMethod", dataType: "slot", slot: "receiptMethod", width: "120" },
    {
      label: "收款方式",
      prop: "receiptMethod",
      dataType: "slot",
      slot: "receiptMethod",
      width: "120",
    },
  { label: "备注", prop: "remark", showOverflowTooltip: true },
  { label: "操作", prop: "operation", dataType: "slot", slot: "operation", width: "200", fixed: "right" },
    {
      label: "操作",
      prop: "operation",
      dataType: "slot",
      slot: "operation",
      width: "200",
      fixed: "right",
    },
];
const dataList = ref([]);
@@ -285,9 +360,11 @@
const outboundTableRef = ref(null);
const dialogOutboundSelection = ref([]);
const getReceiptMethodLabel = (value) => {
  const getReceiptMethodLabel = value => {
  if (value === undefined || value === null || value === "") return "-";
  const item = payment_methods.value?.find((m) => String(m.value) === String(value));
    const item = payment_methods.value?.find(
      m => String(m.value) === String(value)
    );
  return item?.label ?? value;
};
@@ -306,42 +383,56 @@
const rules = {
  customerId: [{ required: true, message: "请选择客户", trigger: "change" }],
  stockOutRecordIds: [{ required: true, type: "array", min: 1, message: "请选择关联单据", trigger: "change" }],
  receiptDate: [{ required: true, message: "请选择收款日期", trigger: "change" }],
    stockOutRecordIds: [
      {
        required: true,
        type: "array",
        min: 1,
        message: "请选择关联单据",
        trigger: "change",
      },
    ],
    receiptDate: [
      { required: true, message: "请选择收款日期", trigger: "change" },
    ],
  amount: [{ required: true, message: "请输入收款金额", trigger: "blur" }],
  receiptMethod: [{ required: true, message: "请选择收款方式", trigger: "change" }],
    receiptMethod: [
      { required: true, message: "请选择收款方式", trigger: "change" },
    ],
};
const totalReceiptAmount = computed(() =>
  dataList.value.reduce((sum, item) => sum + Number(item.amount || 0), 0)
);
const formatMoney = (value) => {
  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(2)
      .replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};
const parseStockOutRecordIds = (value) => {
  const parseStockOutRecordIds = value => {
  if (!value) return [];
  if (Array.isArray(value)) return value;
  return String(value)
    .split(/[,,]/)
    .map((s) => s.trim())
      .map(s => s.trim())
    .filter(Boolean)
    .map((s) => (/^\d+$/.test(s) ? Number(s) : s));
      .map(s => (/^\d+$/.test(s) ? Number(s) : s));
};
const formatOutboundBatches = (value) => {
  const formatOutboundBatches = value => {
  if (value === undefined || value === null || value === "") return "";
  if (Array.isArray(value)) return value.filter(Boolean).join("、");
  return String(value)
    .split(/[,,]/)
    .map((s) => s.trim())
      .map(s => s.trim())
    .filter(Boolean)
    .join("、");
};
const normalizeTableRow = (row) => ({
  const normalizeTableRow = row => ({
  ...row,
  receiptCode: row.collectionNumber ?? row.receiptCode,
  receiptDate: row.collectionDate ?? row.receiptDate,
@@ -352,14 +443,14 @@
});
const getCustomerList = () => {
  listCustomer({ current: -1, size: -1, type: 0 }).then((res) => {
    listCustomer({ current: -1, size: -1, type: 0 }).then(res => {
    if (res.code === 200) {
      customerList.value = res.data?.records || [];
    }
  });
};
const normalizeOutboundBatchOptions = (data) => {
  const normalizeOutboundBatchOptions = data => {
  const list = Array.isArray(data) ? data : [];
  return list.map((item, index) => {
    if (typeof item === "string" || typeof item === "number") {
@@ -374,13 +465,17 @@
      item.label ??
      `出库单${index + 1}`;
    const value = item.id ?? item.stockOutRecordId ?? label;
    return { label: String(label), value, outboundAmount: Number(item.outboundAmount) || 0 };
      return {
        label: String(label),
        value,
        outboundAmount: Number(item.outboundAmount) || 0,
      };
  });
};
const isSameOutboundId = (a, b) => String(a) === String(b);
const getOutboundRowId = (row) => row?.id ?? row?.stockOutRecordId;
  const getOutboundRowId = row => row?.id ?? row?.stockOutRecordId;
const outboundBatchDisplayText = computed(() => {
  if (isEdit.value || isView.value) {
@@ -390,8 +485,8 @@
  const ids = form.stockOutRecordIds || [];
  if (!ids.length) return "";
  const labels = outboundBatchOptions.value
    .filter((opt) => ids.some((id) => isSameOutboundId(id, opt.value)))
    .map((opt) => opt.label);
      .filter(opt => ids.some(id => isSameOutboundId(id, opt.value)))
      .map(opt => opt.label);
  if (labels.length) return labels.join("、");
  return ids.join("、");
});
@@ -404,10 +499,14 @@
/** 为已选 ID 补全选项(编辑/查看回显) */
const ensureOutboundOptionsForSelected = () => {
  const ids = form.stockOutRecordIds || [];
  ids.forEach((id) => {
    const exists = outboundBatchOptions.value.some((opt) => isSameOutboundId(opt.value, id));
    ids.forEach(id => {
      const exists = outboundBatchOptions.value.some(opt =>
        isSameOutboundId(opt.value, id)
      );
    if (exists) return;
    const fromList = outboundBatchList.value.find((row) => isSameOutboundId(getOutboundRowId(row), id));
      const fromList = outboundBatchList.value.find(row =>
        isSameOutboundId(getOutboundRowId(row), id)
      );
    if (fromList) {
      const [option] = normalizeOutboundBatchOptions([fromList]);
      if (option) outboundBatchOptions.value.push(option);
@@ -424,7 +523,7 @@
const syncCollectionAmount = () => {
  const selected = form.stockOutRecordIds || [];
  const sum = outboundBatchOptions.value
    .filter((opt) => selected.some((id) => isSameOutboundId(id, opt.value)))
      .filter(opt => selected.some(id => isSameOutboundId(id, opt.value)))
    .reduce((acc, opt) => acc + (Number(opt.outboundAmount) || 0), 0);
  form.amount = sum > 0 ? Number(sum.toFixed(2)) : 0;
};
@@ -434,10 +533,16 @@
    const table = outboundTableRef.value;
    if (!table) return;
    table.clearSelection();
    const selectedIds = new Set((form.stockOutRecordIds || []).map((id) => String(id)));
    outboundBatchList.value.forEach((row) => {
      const selectedIds = new Set(
        (form.stockOutRecordIds || []).map(id => String(id))
      );
      outboundBatchList.value.forEach(row => {
      const rowId = getOutboundRowId(row);
      if (rowId !== undefined && rowId !== null && selectedIds.has(String(rowId))) {
        if (
          rowId !== undefined &&
          rowId !== null &&
          selectedIds.has(String(rowId))
        ) {
        table.toggleRowSelection(row, true);
      }
    });
@@ -456,7 +561,7 @@
  }
  outboundBatchLoading.value = true;
  return getOutboundBatchesByCustomer({ customerId })
    .then((res) => {
      .then(res => {
      if (res.code === 200) {
        const list = res.data?.records ?? res.data ?? [];
        outboundBatchList.value = Array.isArray(list) ? list : [];
@@ -479,7 +584,7 @@
    });
};
const handleCustomerChange = (customerId) => {
  const handleCustomerChange = customerId => {
  form.stockOutRecordIds = [];
  form.outboundBatches = "";
  form.amount = 0;
@@ -494,7 +599,7 @@
  });
};
const handleOutboundDialogSelectionChange = (selection) => {
  const handleOutboundDialogSelectionChange = selection => {
  dialogOutboundSelection.value = selection;
};
@@ -504,10 +609,10 @@
    return;
  }
  form.stockOutRecordIds = dialogOutboundSelection.value
    .map((row) => getOutboundRowId(row))
    .filter((id) => id !== undefined && id !== null);
      .map(row => getOutboundRowId(row))
      .filter(id => id !== undefined && id !== null);
  form.outboundBatches = dialogOutboundSelection.value
    .map((row) => row.outboundBatches ?? row.batchNo ?? row.shippingNo ?? "")
      .map(row => row.outboundBatches ?? row.batchNo ?? row.shippingNo ?? "")
    .filter(Boolean)
    .join("、");
  outboundSelectVisible.value = false;
@@ -519,7 +624,7 @@
  dialogOutboundSelection.value = [];
};
const appendFilterParams = (params) => {
  const appendFilterParams = params => {
  if (filters.collectionNumber) {
    params.collectionNumber = filters.collectionNumber;
  }
@@ -560,8 +665,10 @@
  return payload;
};
const fillFormFromRow = (row) => {
  const stockOutRecordIds = parseStockOutRecordIds(row.stockOutRecordIds ?? row.stockOutRecordId);
  const fillFormFromRow = row => {
    const stockOutRecordIds = parseStockOutRecordIds(
      row.stockOutRecordIds ?? row.stockOutRecordId
    );
  Object.assign(form, {
    receiptCode: row.receiptCode ?? row.collectionNumber ?? "",
    customerId: row.customerId,
@@ -583,13 +690,17 @@
const handleExport = () => {
  const params = buildExportParams();
  proxy.download("/accountSalesCollection/exportAccountSalesCollection", params, `收款单_${Date.now()}.xlsx`);
    proxy.download(
      "/accountSalesCollection/exportAccountSalesCollection",
      params,
      `收款单_${Date.now()}.xlsx`
    );
};
const getTableData = () => {
  tableLoading.value = true;
  listPageAccountSalesCollection(buildListParams())
    .then((res) => {
      .then(res => {
      const ok = res.code === 200 || res.code === 0;
      if (ok && res.data) {
        pagination.total = res.data.total ?? 0;
@@ -649,7 +760,7 @@
  dialogVisible.value = true;
};
const edit = (row) => {
  const edit = row => {
  isEdit.value = true;
  isView.value = false;
  currentId.value = row.id;
@@ -658,7 +769,7 @@
  dialogVisible.value = true;
};
const view = (row) => {
  const view = row => {
  isView.value = true;
  isEdit.value = false;
  dialogTitle.value = "查看收款";
@@ -666,14 +777,18 @@
  dialogVisible.value = true;
};
const handleDelete = (row) => {
  ElMessageBox.confirm(`确认删除收款单「${row.receiptCode ?? row.collectionNumber}」吗?`, "提示", {
  const handleDelete = row => {
    ElMessageBox.confirm(
      `确认删除收款单「${row.receiptCode ?? row.collectionNumber}」吗?`,
      "提示",
      {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  }).then(() => {
      }
    ).then(() => {
    deleteAccountSalesCollection([row.id])
      .then((res) => {
        .then(res => {
        if (res.code === 200) {
          ElMessage.success("删除成功");
          getTableData();
@@ -688,14 +803,14 @@
};
const submitForm = () => {
  formRef.value.validate((valid) => {
    formRef.value.validate(valid => {
    if (!valid) return;
    submitLoading.value = true;
    const request = isEdit.value
      ? updateAccountSalesCollection(buildSubmitPayload(true))
      : addAccountSalesCollection(buildSubmitPayload());
    request
      .then((res) => {
        .then(res => {
        if (res.code === 200) {
          ElMessage.success(isEdit.value ? "修改成功" : "新增成功");
          closeDialog();
src/views/procurementManagement/paymentLedger/index.vue
@@ -127,7 +127,7 @@
  // 子模块
  const tableColumnSon = ref([
    {
      label: "发生日期",
      label: "合同签订日期",
      prop: "executionDate",
      width: 110,
    },
src/views/salesManagement/receiptPaymentLedger/index.vue
@@ -78,7 +78,7 @@
                             label="序号"
                             type="index"
                             width="60" />
            <el-table-column label="发生日期"
            <el-table-column label="合同签订日期"
                             prop="executionDate"
                             show-overflow-tooltip
                             width="110" />