From 484b1f3e41a561e438ce4cdbec0e09958c932767 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期三, 28 十月 2026 17:02:59 +0800
Subject: [PATCH] 统计分析

---
 src/views/project/fundstatistics/index.vue |  225 ++++++++++++++++++++++----------------------------------
 1 files changed, 89 insertions(+), 136 deletions(-)

diff --git a/src/views/project/fundstatistics/index.vue b/src/views/project/fundstatistics/index.vue
index d8ae804..ff5dbbd 100644
--- a/src/views/project/fundstatistics/index.vue
+++ b/src/views/project/fundstatistics/index.vue
@@ -3,141 +3,77 @@
   <div class="app-container">
     <el-col :span="24" v-if="showType == 'list'">
       <el-card shadow="never">
-        <el-form :model="queryParams" ref="queryForm" :inline="true">
+        <el-form class="opo-query-form" :model="queryParams" ref="queryForm" :inline="true">
           <el-form-item label="濮撳悕" prop="name">
-            <el-input
-              v-model="queryParams.name"
-              placeholder="璇疯緭鍏ュ鍚�"
-              clearable
-              size="small"
-              @keyup.enter.native="handleQuery"
-            />
+            <el-input v-model="queryParams.name" placeholder="璇疯緭鍏ュ鍚�" clearable size="small"
+              @keyup.enter.native="handleQuery" />
           </el-form-item>
           <el-form-item label="鎹愮尞杩涘害" prop="recordstate">
-            <el-select
-              v-model="queryParams.recordstate"
-              placeholder="璇烽�夋嫨褰撳墠杩涘害"
-              clearable
-              size="small"
-            >
-              <el-option
-                v-for="dict in dict.type.sys_DonationStatus"
-                :key="dict.value"
-                :label="dict.label"
-                :value="dict.value"
-              />
+            <el-select v-model="queryParams.recordstate" placeholder="璇烽�夋嫨褰撳墠杩涘害" clearable size="small">
+              <el-option v-for="dict in dict.type.sys_DonationStatus" :key="dict.value" :label="dict.label"
+                :value="dict.value" />
             </el-select>
           </el-form-item>
           <el-form-item>
-            <el-button
-              type="primary"
-              icon="el-icon-search"
-              size="mini"
-              @click="handleQuery"
-              >鎼滅储</el-button
-            >
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-              >閲嶇疆</el-button
-            >
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
           </el-form-item>
         </el-form>
         <!-- 鎹愮尞妗堜緥鍒楄〃 -->
-        <el-table
-          v-loading="loading"
-          style="width: 1240px"
-          fit
-          highlight-current-row
-          header-align
-          border
-          :data="donationCaseTableData"
-        >
-          <el-table-column
-            label="鎶ュ憡鏃堕棿"
-            align="center"
-            prop="reporttime"
-            width="150"
-          >
+        <el-table v-loading="loading" fit highlight-current-row header-align border
+          :data="donationCaseTableData">
+          <el-table-column label="妗堜緥鏃堕棿" align="center" prop="reporttime" width="150">
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.reporttime, "{y}-{m}-{d}") }}</span>
             </template>
           </el-table-column>
-          <el-table-column
-            label="濮撳悕"
-            width="120"
-            align="center"
-            prop="name"
-          />
-          <el-table-column label="骞撮緞" width="120" align="center" prop="age" />
+          <el-table-column label="濮撳悕" width="120" align="center" prop="name" />
           <el-table-column label="鎬у埆" width="120" align="center" prop="sex">
+          <el-table-column label="骞撮緞" align="center" prop="age" width="100">
             <template slot-scope="scope">
-              <dict-tag
-                :options="dict.type.sys_user_sex"
-                :value="scope.row.sex"
-              />
+              {{
+                `${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="鍖荤枟鏈烘瀯"
-            align="center"
-            prop="treatmenthospitalname"
-          />
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex" />
+            </template>
+          </el-table-column>
           <el-table-column label="鎹愮尞杩涘害" align="center" prop="recordstate">
             <template slot-scope="scope">
-              <dict-tag
-                :options="dict.type.sys_DonationStatus"
-                :value="scope.row.recordstate"
-              />
+              <dict-tag :options="dict.type.sys_donornode" :value="scope.row.workflow" />
             </template>
-          </el-table-column>
-
-          <el-table-column
-            label="鎿嶄綔"
-            align="center"
-            class-name="small-padding fixed-width"
-            width="200"
-            fixed="right"
-          >
+          </el-table-column> <el-table-column label="鎹愮尞鍖婚櫌"align="center" prop="
+treatmenthospitalname
+" />
+          <el-table-column label="涓撹亴浜哄憳" align="center" prop="reportername"/>
+          <el-table-column label="涓氬姟缁�" align="center" prop="deptname" /> 
+          <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
             <template slot-scope="scope">
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-download"
-                @click="exportSummary(scope.row.id)"
-                v-hasPermi="['project:fundstatistics:summaryexoprt']"
-                >瀵煎嚭</el-button
-              >
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-edit"
-                @click="jumptocost(scope.row)"
-                v-hasPermi="['project:fundstatistics:list']"
-                >鏌ョ湅鎴愭湰姹囨��</el-button
-              >
+              <el-button size="mini" type="text" icon="el-icon-download" @click="exportSummary(scope.row.id)"
+                v-hasPermi="['project:fundstatistics:summaryexoprt']">瀵煎嚭</el-button>
+              <el-button size="mini" type="text" icon="el-icon-edit" @click="jumptocost(scope.row)"
+                v-hasPermi="['project:fundstatistics:list']">鏌ョ湅鏄庣粏</el-button>
             </template>
           </el-table-column>
         </el-table>
         <!-- hide-on-single-page -->
-        <pagination
-          v-show="total > 0"
-          style="margin-left: 100px"
-          :total="total"
-          :page.sync="queryParams.pageNum"
-          :limit.sync="queryParams.pageSize"
-          @pagination="getBaseInfoList"
-        />
+        <pagination v-show="total > 0" style="margin-left: 100px" :total="total" :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize" @pagination="getBaseInfoList" />
       </el-card>
     </el-col>
     <el-col :span="24" v-if="showType == 'costinfo'">
       <el-form :model="curCaseInfo" ref="infoForm" :inline="true">
         <el-row>
           <el-col :span="3">
-            <el-button
-              type="primary"
-              icon="el-icon-back"
-              @click="backDonateList"
-              >鎹愮尞鍒楄〃</el-button
-            >
+            <el-button type="primary" icon="el-icon-back" @click="backDonateList">鎹愮尞鍒楄〃</el-button>
           </el-col>
           <el-form-item label="鎹愮尞缂栧彿" prop="donorno">
             <el-input v-model="curCaseInfo.donorno" disabled />
@@ -160,10 +96,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 +110,7 @@
     "sys_IDType",
     "sys_AgeUnit",
     "sys_DonationStatus",
+    "sys_donornode"
   ],
   data() {
     //杩欓噷瀛樻斁鏁版嵁
@@ -190,15 +129,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,18 +155,17 @@
       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;
       });
     },
     jumptocost(row) {
-      this.showType = "costinfo";
       this.curdonorno = row.id;
       this.curCaseInfo.donorno = row.donorno;
       this.curCaseInfo.name = row.name;
-      //console.log("dononro:" + this.curdonorno);
+      this.showType = "costinfo";
     },
 
     backDonateList() {
@@ -243,40 +184,52 @@
     },
     //瀵煎嚭姹囨�昏〃
     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() {
     this.getBaseInfoList();
   },
   //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛�
-  mounted() {},
-  beforeCreate() {}, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠
-  beforeMount() {}, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠
-  beforeUpdate() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠
-  updated() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
-  beforeDestroy() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
-  destroyed() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴�
-  activated() {}, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
+  mounted() { },
+  beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠
+  beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠
+  beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠
+  updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
+  beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
+  destroyed() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴�
+  activated() { } //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
 };
 </script>
 <style scoped>

--
Gitblit v1.9.3