From 04bc1dbb0a2f0ed846c7202b8c880a4eae46a6a7 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 16 十二月 2025 10:57:48 +0800
Subject: [PATCH] 1.海川开心-质量管理附件修改

---
 src/views/salesManagement/invoiceLedger/index.vue |   34 ++++++++++++++++++++++++----------
 1 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index f02a87c..d9c87a7 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -32,7 +32,7 @@
         <el-table-column align="center" label="搴忓彿" type="index" width="60" />
         <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" show-overflow-tooltip width="180" />
         <el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" show-overflow-tooltip width="240" />
-        <el-table-column label="椤圭洰" prop="projectName" width="320" />
+<!--        <el-table-column label="椤圭洰" prop="projectName" width="320" />-->
         <el-table-column label="浜у搧澶х被" prop="productCategory" width="200" />
         <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="160" show-overflow-tooltip />
         <el-table-column label="鍙戠エ鍙�" prop="invoiceNo" width="200" show-overflow-tooltip />
@@ -42,7 +42,7 @@
         <el-table-column label="褰曞叆浜�" prop="invoicePerson" show-overflow-tooltip />
         <el-table-column label="褰曞叆鏃ユ湡" prop="createTime" show-overflow-tooltip :formatter="formatDate" width="180" />
         <el-table-column label="寮�绁ㄦ棩鏈�" prop="invoiceDate" show-overflow-tooltip width="120" />
-        <el-table-column label="鍙戠エ" prop="invoiceFileName" width="120" align="center" show-overflow-tooltip fixed="right">
+        <!-- <el-table-column label="鍙戠エ" prop="invoiceFileName" width="120" align="center" show-overflow-tooltip fixed="right">
           <template #default="scope">
             <el-button v-if="scope.row.invoiceFileName" text bg type="primary"
               @click="handleFile(scope.row.commonFiles)">
@@ -52,10 +52,11 @@
               涓婁紶
             </el-button>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
           <template #default="scope">
             <el-button link type="primary" size="small" @click="openForm(scope.row)">缂栬緫</el-button>
+            <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">闄勪欢</el-button>
             <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row)">鍒犻櫎</el-button>
           </template>
         </el-table-column>
@@ -148,6 +149,7 @@
         </div>
       </template>
     </el-dialog>
+    <FileList ref="fileListRef" />
   </div>
 </template>
 
@@ -164,9 +166,11 @@
   registrationProductPage,
   delInvoiceLedgerByRegProductId,
 } from "../../../api/salesManagement/invoiceLedger.js";
+import { getSalesLedgerWithProducts } from "@/api/salesManagement/salesLedger.js";
 import useUserStore from "@/store/modules/user.js";
 import useFormData from "@/hooks/useFormData";
 import dayjs from "dayjs";
+import FileList from "./fileList.vue";
 
 const { proxy } = getCurrentInstance();
 const tableData = ref([]);
@@ -292,7 +296,6 @@
 };
 // 涓婁紶鍓嶆牎妫�
 function handleBeforeUpload(file) {
-  console.log("file", file);
   // 鏍℃鏂囦欢澶у皬
   if (file.size > 1024 * 1024 * 10) {
     proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
@@ -304,6 +307,7 @@
     proxy.$modal.msgError("鏂囦欢鏍煎紡涓嶅尮閰�");
     return false;
   }
+  console.log('handleBeforeUpload');
   proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
   return true;
 }
@@ -315,9 +319,10 @@
 // 涓婁紶鎴愬姛鍥炶皟
 function handleUploadSuccess(res, file, uploadFiles) {
   proxy.$modal.closeLoading();
+  console.log('handleUploadSuccess');
   if (res.code === 200) {
-    proxy.$refs["fileUpload"].handleRemove(file);
-    fileList.value.push(res.data);
+    // proxy.$refs["fileUpload"].handleRemove(file);
+    // fileList.value.push(res.data);
     proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
   } else {
     proxy.$modal.msgError(res.msg);
@@ -326,10 +331,10 @@
 }
 // 绉婚櫎鏂囦欢
 function handleRemove(file) {
-  let index = fileList.value.findIndex((item) => item.url === file.url);
-  if (index > -1) {
-    fileList.value.splice(index, 1);
-  }
+  // let index = fileList.value.findIndex((item) => item.url === file.url);
+  // if (index > -1) {
+  //   fileList.value.splice(index, 1);
+  // }
 }
 // 鎻愪氦琛ㄥ崟
 const submitForm = () => {
@@ -434,6 +439,15 @@
   getList();
 };
 
+//闄勪欢鐩稿叧
+const fileListRef = ref(null)
+//鏌ョ湅闄勪欢
+const downLoadFile = (row) => {
+  getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => {
+    fileListRef.value.open(res.salesLedgerFiles)
+  });
+}
+
 onMounted(() => {
   // 璁剧疆寮�绁ㄦ棩鏈熻寖鍥撮粯璁ゅ�间负褰撳ぉ
   const today = dayjs().format('YYYY-MM-DD');

--
Gitblit v1.9.3