From 69a56969fe9ee4084a03f88a5c93123587b1df65 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期四, 18 九月 2025 13:43:06 +0800
Subject: [PATCH] 档案管理

---
 src/views/project/fundstatistics/index.vue |   94 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 66 insertions(+), 28 deletions(-)

diff --git a/src/views/project/fundstatistics/index.vue b/src/views/project/fundstatistics/index.vue
index d8ae804..35195cc 100644
--- a/src/views/project/fundstatistics/index.vue
+++ b/src/views/project/fundstatistics/index.vue
@@ -52,7 +52,7 @@
           :data="donationCaseTableData"
         >
           <el-table-column
-            label="鎶ュ憡鏃堕棿"
+            label="妗堜緥鏃堕棿"
             align="center"
             prop="reporttime"
             width="150"
@@ -67,7 +67,21 @@
             align="center"
             prop="name"
           />
-          <el-table-column label="骞撮緞" width="120" align="center" prop="age" />
+          <el-table-column label="骞撮緞" align="center" prop="age" width="100">
+            <template slot-scope="scope">
+              {{
+                `${
+                  scope.row.age && scope.row.age !== 0
+                    ? `${scope.row.age}${scope.row.ageunit}`
+                    : ""
+                } ${
+                  scope.row.age2 && scope.row.age2 !== 0
+                    ? `${scope.row.age2}${scope.row.ageunit2}`
+                    : ""
+                }`.trim()
+              }}
+            </template>
+          </el-table-column>
           <el-table-column label="鎬у埆" width="120" align="center" prop="sex">
             <template slot-scope="scope">
               <dict-tag
@@ -77,15 +91,21 @@
             </template>
           </el-table-column>
           <el-table-column
-            label="鍖荤枟鏈烘瀯"
+            label="涓撹亴浜哄憳"
+            align="center"
+            prop="reportername"
+            width="100"
+          />
+          <el-table-column
+            label="涓氬姟缁�"
             align="center"
             prop="treatmenthospitalname"
           />
           <el-table-column label="鎹愮尞杩涘害" align="center" prop="recordstate">
             <template slot-scope="scope">
               <dict-tag
-                :options="dict.type.sys_DonationStatus"
-                :value="scope.row.recordstate"
+                :options="dict.type.sys_donornode"
+                :value="scope.row.workflow"
               />
             </template>
           </el-table-column>
@@ -160,10 +180,12 @@
 import { listDonatebaseinfo } from "@/api/project/donatebaseinfo";
 import { getDonationCost, exportFundCost } from "@/api/project/financesubject";
 import FundSummary from "@/views/project/components/fundsummary";
+import { getToken } from "@/utils/auth";
+
 export default {
   //import寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
   components: {
-    FundSummary,
+    FundSummary
   },
   dicts: [
     "sys_Organ",
@@ -172,6 +194,7 @@
     "sys_IDType",
     "sys_AgeUnit",
     "sys_DonationStatus",
+    "sys_donornode"
   ],
   data() {
     //杩欓噷瀛樻斁鏁版嵁
@@ -190,15 +213,18 @@
         name: "",
         pageSize: 10,
         name: null,
-        donorno: null,
+        donorno: null
       },
       curdonorno: null,
       showType: "list",
       curCaseInfo: {
         donorno: null,
         name: null,
-        id: null,
+        id: null
       },
+      headers: {
+        Authorization: "Bearer " + getToken()
+      }
     };
   },
   //鐩戝惉灞炴�� 绫讳技浜巇ata姒傚康
@@ -213,7 +239,7 @@
       if (this.queryParams.recordstate == "") {
         this.queryParams.recordstate = null;
       }
-      listDonatebaseinfo(this.queryParams).then((response) => {
+      listDonatebaseinfo(this.queryParams).then(response => {
         this.donationCaseTableData = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -243,26 +269,38 @@
     },
     //瀵煎嚭姹囨�昏〃
     exportSummary(id) {
-      exportFundCost(id).then((res) => {
-        debugger;
-        if (res.downloadUrl) {
-          var fileUrl = res;
-          //鑾峰彇褰撳墠缃戝潃
-          var urlBase = process.env.VUE_APP_BASE_API;
-          var curWWWPath = window.document.location.href;
-          var pos = curWWWPath.indexOf(window.document.location.pathname);
-          // 鍒涘缓a鏍囩
-          var aEle = document.createElement("a");
-          aEle.href =
-            curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
-          aEle.click();
-          this.$alert("涓嬭浇鎴愬姛", "鎻愮ず", {
-            confirmButtonText: "纭畾",
-            type: "success",
+      exportFundCost(id).then(res => {
+        var fileUrl = res;
+        //鑾峰彇褰撳墠缃戝潃
+        var urlBase = process.env.VUE_APP_BASE_API;
+        var curWWWPath = window.document.location.href;
+        var pos = curWWWPath.indexOf(window.document.location.pathname);
+        // 鍒涘缓a鏍囩
+        var aEle = document.createElement("a");
+        aEle.href =
+          curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
+        console.log(aEle.href);
+        // 娣诲姞Authorization澶撮儴
+        fetch(aEle.href, {
+          headers: this.headers
+        })
+          .then(response => {
+            // 灏嗘枃浠朵笅杞介摼鎺ヤ綔涓篵lob瀵硅薄杩涜涓嬭浇
+            return response.blob();
+          })
+          .then(blob => {
+            const url = window.URL.createObjectURL(new Blob([blob]));
+            console.log(url);
+            const link = document.createElement("a");
+            link.href = url;
+            const name = fileUrl["downloadName"];
+            link.setAttribute("download", name); // 鏇挎崲file.pdf涓哄疄闄呯殑鏂囦欢鍚�
+            document.body.appendChild(link);
+            link.click();
+            link.parentNode.removeChild(link);
           });
-        }
       });
-    },
+    }
   },
   //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛�
   created() {
@@ -276,7 +314,7 @@
   updated() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
   beforeDestroy() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
   destroyed() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴�
-  activated() {}, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
+  activated() {} //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
 };
 </script>
 <style scoped>

--
Gitblit v1.9.3