From 076bb96b437258f0e8cdbe184040e1e302b60d4b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 22 十二月 2025 14:10:12 +0800
Subject: [PATCH] 1.军泰伟业代码初始化

---
 src/views/procurementManagement/procurementInvoiceLedger/index.vue |   63 ++++++++++++++++++++-----------
 1 files changed, 41 insertions(+), 22 deletions(-)

diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index 439837b..5c01e3a 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -63,13 +63,6 @@
             <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>
@@ -80,16 +73,15 @@
         <template #operation="{ row }">
           <el-button
             type="primary"
-            text
+						link
             @click="openEdit(row)"
-						:disabled="row.issUerId !== userStore.id"
           >
             缂栬緫
           </el-button>
+					<el-button link type="primary" size="small" @click="downLoadFile(row)">闄勪欢</el-button>
           <el-button
             type="primary"
-            text
-						:disabled="row.issUerId !== userStore.id"
+						link
             @click="handleDelete(row)"
           >
             鍒犻櫎
@@ -97,6 +89,7 @@
         </template>
       </PIMTable>
     </div>
+		<FileList ref="fileListRef" />
     <UploadModal ref="modalRef" @uploadSuccess="uploadSuccess"></UploadModal>
     <EditModal ref="editmodalRef" @success="getTableData"></EditModal>
   </div>
@@ -111,19 +104,21 @@
   Search,
   Upload,
   EditPen,
+  Delete,
 } from "@element-plus/icons-vue";
 import {
 	delRegistration,
 	productRecordPage,
 	productUploadFile,
 } from "@/api/procurementManagement/procurementInvoiceLedger.js";
+import { delCommonFile } from "@/api/publicApi/commonFile.js";
 import { onMounted } from "vue";
-import { ElMessageBox } from "element-plus";
+import { ElMessageBox, ElMessage } 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();
+import dayjs from "dayjs";
+import FileList from "./fileList.vue";
 
 defineOptions({
   name: "鏉ョエ鍙拌处",
@@ -148,7 +143,8 @@
   {
     purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
     supplierName: undefined, // 渚涘簲鍟�
-    createdAt: [], // 鏉ョエ鏃ユ湡
+    // 璁剧疆鏉ョエ鏃ユ湡鑼冨洿涓哄綋澶�
+    createdAt: [dayjs().startOf('day').format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')], // 鏉ョエ鏃ユ湡
   },
   [
     {
@@ -160,11 +156,6 @@
       label: "閿�鍞悎鍚屽彿",
       prop: "salesContractNo",
       width: 150,
-    },
-    {
-      label: "椤圭洰鍚嶇О",
-      prop: "projectName",
-      width: 240,
     },
     {
       label: "渚涘簲鍟嗗悕绉�",
@@ -231,7 +222,7 @@
     },
     {
       fixed: "right",
-      width: 150,
+      width: 190,
       label: "鎿嶄綔",
       dataType: "slot",
       slot: "operation",
@@ -267,7 +258,12 @@
 const handleSelectionChange = (val) => {
   multipleVal.value = val;
 };
-
+//闄勪欢鐩稿叧
+const fileListRef = ref(null)
+//鏌ョ湅闄勪欢
+const downLoadFile = (row) => {
+	fileListRef.value.open(row.commonFiles, row.id)
+}
 // 瀵煎嚭
 const handleOut = () => {
   ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
@@ -304,6 +300,29 @@
       console.log(row.commonFiles);
       openUoload(row.ticketRegistrationId);
       break;
+    case "delete":
+      // 鍒犻櫎鎵�鏈夐檮浠�
+      if (row.commonFiles.length > 0) {
+        ElMessageBox.confirm(`纭鍒犻櫎璇ヨ褰曠殑鎵�鏈夐檮浠跺悧锛焋, '鎻愮ず', {
+          confirmButtonText: '纭畾',
+          cancelButtonText: '鍙栨秷',
+          type: 'warning'
+        }).then(() => {
+          // 鑾峰彇鎵�鏈夐檮浠剁殑ID
+          const fileIds = row.commonFiles.map(file => file.id);
+          
+          delCommonFile(fileIds).then(() => {
+            ElMessage.success('鍒犻櫎鎴愬姛')
+            // 鍒锋柊鏁版嵁
+            getTableData();
+          }).catch(() => {
+            ElMessage.error('鍒犻櫎澶辫触')
+          })
+        }).catch(() => {
+          ElMessage.info('宸插彇娑堝垹闄�')
+        })
+      }
+      break;
   }
 };
 

--
Gitblit v1.9.3