From 07f9f8657d057a38792c3822acc9b08d83478967 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 07 五月 2026 14:23:10 +0800
Subject: [PATCH] 合并代码

---
 src/views/procurementManagement/procurementInvoiceLedger/index.vue |  180 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 142 insertions(+), 38 deletions(-)

diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index d161978..c94d8c2 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -47,7 +47,7 @@
         :tableLoading="loading"
         :tableData="dataList"
         :isSelection="true"
-        height="calc(100vh - 18.5em)"
+        height="calc(100vh - 19.5em)"
         :isShowSummary="true"
         :summaryMethod="summarizeMainTable"
         :page="{
@@ -56,24 +56,66 @@
           total: pagination.total,
         }"
         @selection-change="handleSelectionChange"
-        @pagination="onCurrentChange"
+        @pagination="changePage"
       >
+        <template #operation="{ row }">
+          <el-button
+            type="primary"
+            link
+            @click="openEdit(row)"
+          >
+            缂栬緫
+          </el-button>
+          <el-button
+            type="primary"
+            link
+            @click="openFileDialog(row)"
+          >
+            闄勪欢
+          </el-button>
+          <el-button
+            type="primary"
+            link
+            @click="handleDelete(row)"
+          >
+            鍒犻櫎
+          </el-button>
+        </template>
       </PIMTable>
     </div>
+    <FileList v-if="fileDialogVisible"  v-model:visible="fileDialogVisible" record-type="ticket_registration" :record-id="recordId"  />
+    <EditModal ref="editmodalRef" @success="getTableData"></EditModal>
   </div>
 </template>
 
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import { usePaginationApi } from "@/hooks/usePaginationApi";
-import { Search } from "@element-plus/icons-vue";
-import { productRecordPage } from "@/api/procurementManagement/procurementInvoiceLedger.js";
+import {
+	Search,
+} from "@element-plus/icons-vue";
+import {
+	delRegistration,
+	productRecordPage,
+	delCommonFile,
+} from "@/api/procurementManagement/procurementInvoiceLedger.js";
+import request from "@/utils/request";
+import { getToken } from "@/utils/auth";
 import { onMounted } from "vue";
 import { ElMessageBox } from "element-plus";
+import EditModal from "./Modal/EditModal.vue";
+import useUserStore from "@/store/modules/user.js";
+const userStore = useUserStore();
+const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
 
 defineOptions({
   name: "鏉ョエ鍙拌处",
 });
+
+const editmodalRef = ref();
+const fileListRef = ref(null);
+const fileListDialogVisible = ref(false);
+const currentRowId = ref(null); // 褰撳墠鏌ョ湅闄勪欢鐨勮ID
 
 const { proxy } = getCurrentInstance();
 const multipleVal = ref([]);
@@ -97,75 +139,85 @@
     {
       label: "閲囪喘鍚堝悓鍙�",
       prop: "purchaseContractNumber",
-      align: "center",
+      width: 150,
     },
     {
       label: "閿�鍞悎鍚屽彿",
       prop: "salesContractNo",
-      align: "center",
+      width: 150,
     },
     {
-      label: "瀹㈡埛鍚嶇О",
-      prop: "customerName",
-      align: "center",
+      label: "椤圭洰鍚嶇О",
+      prop: "projectName",
+      width: 240,
     },
     {
       label: "渚涘簲鍟嗗悕绉�",
       prop: "supplierName",
-      align: "center",
+      width: 240,
+    },
+    {
+      label: "浜у搧澶х被",
+      prop: "productCategory",
+      width: 150,
     },
     {
       label: "瑙勬牸鍨嬪彿",
       prop: "specificationModel",
-      align: "center",
+      width: 150,
     },
     {
       label: "鍙戠エ鍙�",
       prop: "invoiceNumber",
-      align: "center",
+      width: 200,
     },
     {
       label: "鍚堝悓閲戦(鍏�)",
       prop: "taxInclusiveTotalPrice",
-      align: "center",
+      width: 200,
       formatData: (cell) => {
-        return parseFloat(cell).toFixed(2);
+        return cell ? parseFloat(cell).toFixed(2) : 0;
       },
     },
     {
       label: "寮�绁ㄦ棩鏈�",
       prop: "createdAt",
-      align: "center",
+      width: 110,
     },
     {
       label: "寮�绁ㄩ噾棰�",
       prop: "ticketsAmount",
-      align: "center",
+      width: 200,
       formatData: (cell) => {
-        return parseFloat(cell).toFixed(2);
+        return cell ? parseFloat(cell).toFixed(2) : 0;
       },
     },
     {
       label: "涓嶅惈绋庨噾棰�",
       prop: "unTicketsPrice",
-      align: "center",
+      width: 200,
       formatData: (cell) => {
-        return parseFloat(cell).toFixed(2);
+        return cell ? parseFloat(cell).toFixed(2) : 0;
       },
     },
     {
       label: "澧炲�肩◣",
       prop: "invoiceAmount",
+      width: 200,
+    },
+    {
+      label: "褰曞叆浜�",
+      prop: "issUer",
+      width: 200,
+    },
+    {
+      fixed: "right",
+      width: 200,
+      label: "鎿嶄綔",
+      dataType: "slot",
+      slot: "operation",
       align: "center",
     },
-    // {
-    //   fixed: "right",
-    //   width: 120,
-    //   label: "鎿嶄綔",
-    //   dataType: "slot",
-    //   slot: "operation",
-    //   align: "center",
-    // },
   ],
   {},
   {
@@ -176,21 +228,32 @@
   }
 );
 
-// 涓昏〃鍚堣鏂规硶
 const summarizeMainTable = (param) => {
-  return proxy.summarizeTable(
+  const sums = proxy.summarizeTable(
     param,
-    [
-      "taxInclusiveTotalPrice",
-      "ticketsAmount",
-      "unTicketsPrice",
-      "invoiceAmount",
-    ],
+    ["ticketsAmount", "unTicketsPrice", "invoiceAmount"],
     {
-      ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
-      futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+      ticketsNum: { noDecimal: true },
+      futureTickets: { noDecimal: true },
     }
   );
+
+  const keySet = new Set();
+  let taxInclusiveSum = 0;
+  (param.data || []).forEach((row) => {
+    const key = `${row.purchaseContractNumber ?? ""}\n${row.salesContractNo ?? ""}\n${row.productCategory ?? ""}\n${row.specificationModel ?? ""}`;
+    if (keySet.has(key)) return;
+    keySet.add(key);
+    const val = Number(row.taxInclusiveTotalPrice);
+    if (!isNaN(val)) taxInclusiveSum += val;
+  });
+  const taxInclusiveIndex = (param.columns || []).findIndex(
+    (c) => c.property === "taxInclusiveTotalPrice"
+  );
+  if (taxInclusiveIndex !== -1) {
+    sums[taxInclusiveIndex] = taxInclusiveSum.toFixed(2);
+  }
+  return sums;
 };
 
 const handleSelectionChange = (val) => {
@@ -212,7 +275,45 @@
     });
 };
 
-// const handleEdit = () => {};
+const changePage = ({ page, limit }) => {
+  pagination.currentPage = page;
+	pagination.pageSize = limit;
+  onCurrentChange(page);
+};
+
+// 鎵撳紑闄勪欢寮圭獥
+const recordId =ref(0)
+const fileDialogVisible = ref(false)
+
+// 鎵撳紑闄勪欢寮规
+const openFileDialog = async (row) => {
+  recordId.value = row.id
+  fileDialogVisible.value = true
+}
+
+const openEdit = (row) => {
+  editmodalRef.value.open(row);
+};
+// 鍒犻櫎
+const handleDelete = (row) => {
+	let ids = [];
+	ids.push(row.id);
+	ElMessageBox.confirm("璇ュ紑绁ㄥ彴璐﹀皢琚垹闄�,鏄惁纭鍒犻櫎", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			loading.value = true;
+			delRegistration(ids).then((res) => {
+				getTableData();
+			});
+			loading.value = false;
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑�");
+		});
+};
 
 onMounted(() => {
   getTableData();
@@ -223,4 +324,7 @@
 .table_list {
   margin-top: unset;
 }
+.tagBox {
+  margin-top: 4px;
+}
 </style>

--
Gitblit v1.9.3