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 |  151 ++++++++++++++++++++------------------------------
 1 files changed, 60 insertions(+), 91 deletions(-)

diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index 6c35c5b..c94d8c2 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -58,38 +58,24 @@
         @selection-change="handleSelectionChange"
         @pagination="changePage"
       >
-        <template #commonFilesRef="{ row }">
-          <el-dropdown @command="(command) => handleCommand(command, row)">
-            <el-button link :icon="Files" type="danger"> 闄勪欢 </el-button>
-            <template #dropdown>
-              <el-dropdown-menu>
-                <el-dropdown-item
-                  v-if="row.commonFiles.length !== 0"
-                  :icon="Download"
-                  command="download"
-                >
-                  涓嬭浇
-                </el-dropdown-item>
-                <el-dropdown-item :icon="Upload" command="upload">
-                  涓婁紶
-                </el-dropdown-item>
-              </el-dropdown-menu>
-            </template>
-          </el-dropdown>
-        </template>
         <template #operation="{ row }">
           <el-button
             type="primary"
-            text
-            @click="openEdit(row.id)"
-						:disabled="row.issUerId !== userStore.id"
+            link
+            @click="openEdit(row)"
           >
             缂栬緫
           </el-button>
           <el-button
             type="primary"
-            text
-						:disabled="row.issUerId !== userStore.id"
+            link
+            @click="openFileDialog(row)"
+          >
+            闄勪欢
+          </el-button>
+          <el-button
+            type="primary"
+            link
             @click="handleDelete(row)"
           >
             鍒犻櫎
@@ -97,7 +83,7 @@
         </template>
       </PIMTable>
     </div>
-    <UploadModal ref="modalRef" @uploadSuccess="uploadSuccess"></UploadModal>
+    <FileList v-if="fileDialogVisible"  v-model:visible="fileDialogVisible" record-type="ticket_registration" :record-id="recordId"  />
     <EditModal ref="editmodalRef" @success="getTableData"></EditModal>
   </div>
 </template>
@@ -106,31 +92,30 @@
 import { ref, getCurrentInstance } from "vue";
 import { usePaginationApi } from "@/hooks/usePaginationApi";
 import {
-  Files,
-  Download,
-  Search,
-  Upload,
-  EditPen,
+	Search,
 } from "@element-plus/icons-vue";
 import {
 	delRegistration,
 	productRecordPage,
-	productUploadFile,
+	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 UploadModal from "./Modal/UploadModal.vue";
 import EditModal from "./Modal/EditModal.vue";
 import useUserStore from "@/store/modules/user.js";
-import {delInvoiceLedgerByRegProductId} from "@/api/salesManagement/invoiceLedger.js";
 const userStore = useUserStore();
+const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
 
 defineOptions({
   name: "鏉ョエ鍙拌处",
 });
 
-const modalRef = ref();
 const editmodalRef = ref();
+const fileListRef = ref(null);
+const fileListDialogVisible = ref(false);
+const currentRowId = ref(null); // 褰撳墠鏌ョ湅闄勪欢鐨勮ID
 
 const { proxy } = getCurrentInstance();
 const multipleVal = ref([]);
@@ -162,14 +147,19 @@
       width: 150,
     },
     {
-      label: "瀹㈡埛鍚嶇О",
-      prop: "customerName",
+      label: "椤圭洰鍚嶇О",
+      prop: "projectName",
       width: 240,
     },
     {
       label: "渚涘簲鍟嗗悕绉�",
       prop: "supplierName",
       width: 240,
+    },
+    {
+      label: "浜у搧澶х被",
+      prop: "productCategory",
+      width: 150,
     },
     {
       label: "瑙勬牸鍨嬪彿",
@@ -221,17 +211,8 @@
       width: 200,
     },
     {
-      label: "闄勪欢",
-      align: "center",
-      prop: "commonFiles",
-      dataType: "slot",
-			fixed: "right",
-      slot: "commonFilesRef",
-      width: 120,
-    },
-    {
       fixed: "right",
-      width: 150,
+      width: 200,
       label: "鎿嶄綔",
       dataType: "slot",
       slot: "operation",
@@ -247,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) => {
@@ -283,47 +275,24 @@
     });
 };
 
-const handleFiles = (fileList) => {
-  fileList.forEach((e) => {
-    proxy.$download.name(e.url);
-  });
-};
-
-const changePage = ({ page }) => {
+const changePage = ({ page, limit }) => {
   pagination.currentPage = page;
+	pagination.pageSize = limit;
   onCurrentChange(page);
 };
 
-const handleCommand = (command, row) => {
-  switch (command) {
-    case "download":
-      handleFiles(row.commonFiles);
-      break;
-    case "upload":
-      console.log(row.commonFiles);
-      openUoload(row.ticketRegistrationId);
-      break;
-  }
-};
+// 鎵撳紑闄勪欢寮圭獥
+const recordId =ref(0)
+const fileDialogVisible = ref(false)
 
-const openUoload = (id) => {
-  modalRef.value.handleImport(id);
-};
+// 鎵撳紑闄勪欢寮规
+const openFileDialog = async (row) => {
+  recordId.value = row.id
+  fileDialogVisible.value = true
+}
 
-const openEdit = (id) => {
-  editmodalRef.value.open(id);
-};
-
-// 涓婁紶鎴愬姛鍚庡仛浠�涔�
-const uploadSuccess = async (data) => {
-  const { code } = await productUploadFile({
-    ticketRegistrationId: data.id,
-    tempFileIds: data.tempFileIds,
-  });
-  if (code === 200) {
-    proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
-    getTableData();
-  }
+const openEdit = (row) => {
+  editmodalRef.value.open(row);
 };
 // 鍒犻櫎
 const handleDelete = (row) => {

--
Gitblit v1.9.3