From 2d391be892b1faca84656a7ac201cbb43640fab3 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 21 五月 2026 16:06:33 +0800
Subject: [PATCH] 财务功能修改

---
 src/views/financialManagement/payable/payment.vue |  438 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 233 insertions(+), 205 deletions(-)

diff --git a/src/views/financialManagement/payable/payment.vue b/src/views/financialManagement/payable/payment.vue
index d762ae9..18e7941 100644
--- a/src/views/financialManagement/payable/payment.vue
+++ b/src/views/financialManagement/payable/payment.vue
@@ -1,68 +1,76 @@
 <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"
-            :key="item.id"
-            :label="item.supplierName"
-            :value="item.id"
-          />
+        <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" />
         </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"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
+        <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" />
         </el-select>
       </el-form-item>
       <el-form-item label="浠樻鏃ユ湡:">
-        <el-date-picker
-          v-model="filters.dateRange"
-          type="daterange"
-          value-format="YYYY-MM-DD"
-          format="YYYY-MM-DD"
-          range-separator="鑷�"
-          start-placeholder="寮�濮嬫棩鏈�"
-          end-placeholder="缁撴潫鏃ユ湡"
-          clearable
-          style="width: 240px;"
-        />
+        <el-date-picker v-model="filters.dateRange"
+                        type="daterange"
+                        value-format="YYYY-MM-DD"
+                        format="YYYY-MM-DD"
+                        range-separator="鑷�"
+                        start-placeholder="寮�濮嬫棩鏈�"
+                        end-placeholder="缁撴潫鏃ユ湡"
+                        clearable
+                        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"
-        :column="columns"
-        :tableData="dataList"
-        :tableLoading="tableLoading"
-        :page="{
+      <PIMTable rowKey="id"
+                :column="columns"
+                :tableData="dataList"
+                :tableLoading="tableLoading"
+                :page="{
           current: pagination.currentPage,
           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>
@@ -78,194 +89,211 @@
 </template>
 
 <script setup>
-import { ref, reactive, computed, onMounted, getCurrentInstance } from "vue";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { getOptions } from "@/api/procurementManagement/procurementLedger.js";
-import {
-  listPageAccountPurchasePayment,
-  deleteAccountPurchasePayment,
-} from "@/api/financialManagement/accountPurchasePayment.js";
+  import { ref, reactive, computed, onMounted, getCurrentInstance } from "vue";
+  import { ElMessage, ElMessageBox } from "element-plus";
+  import { getOptions } from "@/api/procurementManagement/procurementLedger.js";
+  import {
+    listPageAccountPurchasePayment,
+    deleteAccountPurchasePayment,
+  } from "@/api/financialManagement/accountPurchasePayment.js";
 
-defineOptions({
-  name: "浠樻鍗�",
-});
-
-const { proxy } = getCurrentInstance();
-const { checkout_payment } = proxy.useDict("checkout_payment");
-
-const filters = reactive({
-  paymentNumber: "",
-  supplierId: "",
-  paymentMethod: "",
-  dateRange: [],
-});
-
-const pagination = reactive({
-  currentPage: 1,
-  pageSize: 10,
-  total: 0,
-});
-
-const columns = [
-  { label: "浠樻鍗曞彿", prop: "paymentNumber", width: "150" },
-  { label: "鍏宠仈鐢宠鍗�", prop: "invoiceApplicationNo", width: "150" },
-  { 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: "remark", showOverflowTooltip: true },
-  { label: "鎿嶄綔", prop: "operation", dataType: "slot", slot: "operation", width: "80", fixed: "right" },
-];
-
-const dataList = ref([]);
-const tableLoading = ref(false);
-const supplierList = ref([]);
-
-const totalPaymentAmount = computed(() =>
-  dataList.value.reduce((sum, item) => sum + Number(item.amount ?? 0), 0)
-);
-
-const formatMoney = (value) => {
-  if (value === undefined || value === null) return "0.00";
-  return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
-};
-
-const getPaymentMethodLabel = (value) => {
-  if (value === undefined || value === null || value === "") return "-";
-  const item = checkout_payment.value?.find((m) => String(m.value) === String(value));
-  return item?.label ?? value;
-};
-
-const normalizeTableRow = (row) => ({
-  ...row,
-  paymentNumber: row.paymentNumber ?? row.paymentCode,
-  invoiceApplicationNo: row.invoiceApplicationNo ?? row.applyCode ?? "",
-  amount: row.paymentAmount ?? row.amount,
-  bankAccountNum: row.bankAccountNum ?? row.bankAccount ?? "",
-  bankAccountName: row.bankAccountName ?? row.bankName ?? "",
-});
-
-const getSupplierList = () => {
-  getOptions().then((res) => {
-    if (res.code === 200) {
-      supplierList.value = res.data ?? [];
-    }
-  });
-};
-
-const appendFilterParams = (params) => {
-  if (filters.paymentNumber) {
-    params.paymentNumber = filters.paymentNumber;
-  }
-  if (filters.supplierId) {
-    params.supplierId = filters.supplierId;
-  }
-  if (filters.paymentMethod) {
-    params.paymentMethod = filters.paymentMethod;
-  }
-  if (filters.dateRange?.length === 2) {
-    params.startDate = filters.dateRange[0];
-    params.endDate = filters.dateRange[1];
-  }
-  return params;
-};
-
-const buildListParams = () =>
-  appendFilterParams({
-    current: pagination.currentPage,
-    size: pagination.pageSize,
+  defineOptions({
+    name: "浠樻鍗�",
   });
 
-const buildExportParams = () => appendFilterParams({});
+  const { proxy } = getCurrentInstance();
+  const { checkout_payment } = proxy.useDict("checkout_payment");
 
-const handleExport = () => {
-  proxy.download(
-    "/accountPurchasePayment/exportAccountPurchasePayment",
-    buildExportParams(),
-    `浠樻鍗昣${Date.now()}.xlsx`
+  const filters = reactive({
+    paymentNumber: "",
+    supplierId: "",
+    paymentMethod: "",
+    dateRange: [],
+  });
+
+  const pagination = reactive({
+    currentPage: 1,
+    pageSize: 10,
+    total: 0,
+  });
+
+  const columns = [
+    { label: "浠樻鍗曞彿", prop: "paymentNumber", width: "150" },
+    { label: "鍏宠仈鐢宠鍗�", prop: "invoiceApplicationNo", width: "150" },
+    { 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: "remark", showOverflowTooltip: true },
+    {
+      label: "鎿嶄綔",
+      prop: "operation",
+      dataType: "slot",
+      slot: "operation",
+      width: "80",
+      fixed: "right",
+    },
+  ];
+
+  const dataList = ref([]);
+  const tableLoading = ref(false);
+  const supplierList = ref([]);
+
+  const totalPaymentAmount = computed(() =>
+    dataList.value.reduce((sum, item) => sum + Number(item.amount ?? 0), 0)
   );
-};
 
-const getTableData = () => {
-  tableLoading.value = true;
-  listPageAccountPurchasePayment(buildListParams())
-    .then((res) => {
+  const formatMoney = value => {
+    if (value === undefined || value === null) return "0.00";
+    return Number(value)
+      .toFixed(2)
+      .replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+  };
+
+  const getPaymentMethodLabel = value => {
+    if (value === undefined || value === null || value === "") return "-";
+    const item = checkout_payment.value?.find(
+      m => String(m.value) === String(value)
+    );
+    return item?.label ?? value;
+  };
+
+  const normalizeTableRow = row => ({
+    ...row,
+    paymentNumber: row.paymentNumber ?? row.paymentCode,
+    invoiceApplicationNo: row.invoiceApplicationNo ?? row.applyCode ?? "",
+    amount: row.paymentAmount ?? row.amount,
+    bankAccountNum: row.bankAccountNum ?? row.bankAccount ?? "",
+    bankAccountName: row.bankAccountName ?? row.bankName ?? "",
+  });
+
+  const getSupplierList = () => {
+    getOptions().then(res => {
       if (res.code === 200) {
-        dataList.value = (res.data?.records ?? []).map(normalizeTableRow);
-        pagination.total = res.data?.total ?? 0;
-      } else {
-        dataList.value = [];
-        pagination.total = 0;
-        ElMessage.error(res.msg || "鏌ヨ澶辫触");
+        supplierList.value = res.data ?? [];
       }
-    })
-    .catch(() => {
-      dataList.value = [];
-      pagination.total = 0;
-      ElMessage.error("鏌ヨ澶辫触");
-    })
-    .finally(() => {
-      tableLoading.value = false;
     });
-};
+  };
 
-const onSearch = () => {
-  pagination.currentPage = 1;
-  getTableData();
-};
+  const appendFilterParams = params => {
+    if (filters.paymentNumber) {
+      params.paymentNumber = filters.paymentNumber;
+    }
+    if (filters.supplierId) {
+      params.supplierId = filters.supplierId;
+    }
+    if (filters.paymentMethod) {
+      params.paymentMethod = filters.paymentMethod;
+    }
+    if (filters.dateRange?.length === 2) {
+      params.startDate = filters.dateRange[0];
+      params.endDate = filters.dateRange[1];
+    }
+    return params;
+  };
 
-const resetFilters = () => {
-  filters.paymentNumber = "";
-  filters.supplierId = "";
-  filters.paymentMethod = "";
-  filters.dateRange = [];
-  pagination.currentPage = 1;
-  getTableData();
-};
+  const buildListParams = () =>
+    appendFilterParams({
+      current: pagination.currentPage,
+      size: pagination.pageSize,
+    });
 
-const changePage = ({ page, limit }) => {
-  pagination.currentPage = page;
-  pagination.pageSize = limit;
-  getTableData();
-};
+  const buildExportParams = () => appendFilterParams({});
 
-const handleDelete = (row) => {
-  ElMessageBox.confirm(`纭鍒犻櫎浠樻鍗曘��${row.paymentNumber}銆嶅悧锛焋, "鎻愮ず", {
-    confirmButtonText: "纭畾",
-    cancelButtonText: "鍙栨秷",
-    type: "warning",
-  }).then(() => {
-    deleteAccountPurchasePayment([row.id])
-      .then((res) => {
+  const handleExport = () => {
+    proxy.download(
+      "/accountPurchasePayment/exportAccountPurchasePayment",
+      buildExportParams(),
+      `浠樻鍗昣${Date.now()}.xlsx`
+    );
+  };
+
+  const getTableData = () => {
+    tableLoading.value = true;
+    listPageAccountPurchasePayment(buildListParams())
+      .then(res => {
         if (res.code === 200) {
-          ElMessage.success("鍒犻櫎鎴愬姛");
-          getTableData();
+          dataList.value = (res.data?.records ?? []).map(normalizeTableRow);
+          pagination.total = res.data?.total ?? 0;
         } else {
-          ElMessage.error(res.msg || "鍒犻櫎澶辫触");
+          dataList.value = [];
+          pagination.total = 0;
+          ElMessage.error(res.msg || "鏌ヨ澶辫触");
         }
       })
       .catch(() => {
-        ElMessage.error("鍒犻櫎澶辫触");
+        dataList.value = [];
+        pagination.total = 0;
+        ElMessage.error("鏌ヨ澶辫触");
+      })
+      .finally(() => {
+        tableLoading.value = false;
       });
-  });
-};
+  };
 
-onMounted(() => {
-  getSupplierList();
-  getTableData();
-});
+  const onSearch = () => {
+    pagination.currentPage = 1;
+    getTableData();
+  };
+
+  const resetFilters = () => {
+    filters.paymentNumber = "";
+    filters.supplierId = "";
+    filters.paymentMethod = "";
+    filters.dateRange = [];
+    pagination.currentPage = 1;
+    getTableData();
+  };
+
+  const changePage = ({ page, limit }) => {
+    pagination.currentPage = page;
+    pagination.pageSize = limit;
+    getTableData();
+  };
+
+  const handleDelete = row => {
+    ElMessageBox.confirm(`纭鍒犻櫎浠樻鍗曘��${row.paymentNumber}銆嶅悧锛焋, "鎻愮ず", {
+      confirmButtonText: "纭畾",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    }).then(() => {
+      deleteAccountPurchasePayment([row.id])
+        .then(res => {
+          if (res.code === 200) {
+            ElMessage.success("鍒犻櫎鎴愬姛");
+            getTableData();
+          } else {
+            ElMessage.error(res.msg || "鍒犻櫎澶辫触");
+          }
+        })
+        .catch(() => {
+          ElMessage.error("鍒犻櫎澶辫触");
+        });
+    });
+  };
+
+  onMounted(() => {
+    getSupplierList();
+    getTableData();
+  });
 </script>
 
 <style lang="scss" scoped>
-.actions {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 15px;
-}
+  .actions {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 15px;
+  }
 
-.text-danger {
-  color: #f56c6c;
-  font-weight: bold;
-}
+  .text-danger {
+    color: #f56c6c;
+    font-weight: bold;
+  }
 </style>

--
Gitblit v1.9.3