From ad5e7a527167a86ca7969e874df9950a5c4e2ff9 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 30 十月 2026 09:57:41 +0800
Subject: [PATCH] 器官收费

---
 src/views/project/statistics/caseStatistics/index.vue |  166 ++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 121 insertions(+), 45 deletions(-)

diff --git a/src/views/project/statistics/caseStatistics/index.vue b/src/views/project/statistics/caseStatistics/index.vue
index 1f64c67..c2a3f02 100644
--- a/src/views/project/statistics/caseStatistics/index.vue
+++ b/src/views/project/statistics/caseStatistics/index.vue
@@ -86,50 +86,71 @@
       ></right-toolbar>
     </el-row>
 
-    <!--<el-table v-loading="loading" border :data="donatebaseinfoList">     -->
-    <el-table
-      v-loading="loading"
-      :data="jxidata"
-      ref="table"
-      border
-      max-height="700"
-      highlight-current-row
-      :summary-method="getSummaries"
-      show-summary
-    >
-      <el-table-column label="搴忓彿" align="center" prop="id" width="50" />
-      <el-table-column label="缁熻鏈堜唤" align="center" prop="donationmonth" />
-      <el-table-column label="涓氬姟缁�" align="center" prop="deptname">      </el-table-column>
-      <el-table-column label="涓撹亴浜哄憳" align="center" prop="reportername" />
-      <el-table-column label="妗堜緥绱" align="center" prop="casesum" />
-      <el-table-column label="娼滃湪鎹愮尞" align="center" prop="workflow0" width="100" />
-      <el-table-column label="鍖诲璇勪及" align="center" prop="workflow1" width="100" />
-      <el-table-column label="瀹跺睘纭" align="center" prop="workflow2" width="100" />
-      <el-table-column label="浼︾悊瀹℃煡" align="center" prop="workflow3" width="100" />
-      <el-table-column label="鍣ㄥ畼鍒嗛厤" align="center" prop="workflow4" width="100" />
-      <el-table-column label="鑾峰彇瑙佽瘉" align="center" prop="workflow5" width="100" />
-      <el-table-column label="鎹愮尞瀹屾垚" align="center" prop="workflow6" width="100" />
-      <el-table-column label="褰掓。鎾ら攢" align="center" prop="workflow7" width="100" />
-      <el-table-column label="妗堜緥褰掓。" align="center" prop="workflow8" width="100" />
-      <!-- <el-table-column label="妗堜緥缁堟" align="center" prop="workflow9" width="90" /> -->
-      <el-table-column label="缁堟妗堜緥" align="center" prop="terminationcase" width="100" />
+    <el-tabs v-model="activeTab">
+      <el-tab-pane label="鎸変笟鍔$粍" name="dept">
+        <el-table
+          v-loading="loading"
+          :data="deptData"
+          ref="deptTable"
+          border
+          max-height="700"
+          highlight-current-row
+          :summary-method="getDeptSummaries"
+          show-summary
+        >
+          <el-table-column label="搴忓彿" align="center" prop="id" width="50" />
+          <el-table-column label="涓氬姟缁�" align="center" prop="deptname" width="250" />
+          <el-table-column label="绱妗堜緥" align="center" prop="caseTotal" width="150" />
+          <el-table-column label="缁堟妗堜緥" align="center" prop="terminationTotal" width="150" />
+        </el-table>
+      </el-tab-pane>
 
-      <!-- <el-table-column
-        label="鎿嶄綔"
-        align="center"
-        class-name="small-padding fixed-width"
-        fixed="right"
-      >
-        <template slot-scope="scope">
-          <el-button size="mini" type="text" icon="el-icon-edit"
-            >鏄庣粏</el-button
+      <el-tab-pane label="鎸変汉鍛�" name="person">
+        <el-table
+          v-loading="loading"
+          :data="jxidata"
+          ref="personTable"
+          border
+          max-height="700"
+          highlight-current-row
+          :summary-method="getSummaries"
+          show-summary
+        >
+          <el-table-column label="搴忓彿" align="center" prop="id" width="50" />
+          <el-table-column label="涓氬姟缁�" align="center" prop="deptname" width="250" >      </el-table-column>
+          <el-table-column label="涓撹亴浜哄憳" align="center" prop="reportername" width="150" />
+          <!-- <el-table-column label="鐧昏妗堜緥绱" align="center" prop="casesum" width="100" /> -->
+          <!-- <el-table-column label="娼滃湪鎹愮尞" align="center" prop="workflow0" width="100" />
+          <el-table-column label="鍖诲璇勪及" align="center" prop="workflow1" width="100" />
+          <el-table-column label="瀹跺睘纭" align="center" prop="workflow2" width="100" />
+          <el-table-column label="浼︾悊瀹℃煡" align="center" prop="workflow3" width="100" />
+          <el-table-column label="鍣ㄥ畼鍒嗛厤" align="center" prop="workflow4" width="100" />
+          <el-table-column label="鑾峰彇瑙佽瘉" align="center" prop="workflow5" width="100" />
+          <el-table-column label="鎹愮尞瀹屾垚" align="center" prop="workflow6" width="100" />
+          <el-table-column label="褰掓。鎾ら攢" align="center" prop="workflow7" width="100" />
+          <el-table-column label="妗堜緥褰掓。" align="center" prop="workflow8" width="100" /> -->
+          <el-table-column label="妗堜緥绱" align="center" prop="workflowsum" width="200" />
+          <el-table-column label="缁堟妗堜緥" align="center" prop="terminationcase" width="100" />
+
+          <!-- <el-table-column
+            label="鎿嶄綔"
+            align="center"
+            class-name="small-padding fixed-width"
+            fixed="right"
           >
-        </template>
-      </el-table-column> -->
-    </el-table>
+            <template slot-scope="scope">
+              <el-button size="mini" type="text" icon="el-icon-edit"
+                >鏄庣粏</el-button
+              >
+            </template>
+          </el-table-column> -->
+        </el-table>
+      </el-tab-pane>
+    </el-tabs>
+
     <div style="margin: 10px;text-align: right;">
       <div>
-        鍏� <span style="color:#1890FF ;">{{ total }}</span> 鏉℃暟鎹�
+        鍏� <span style="color:#1890FF ;">{{ tableTotal }}</span> 鏉℃暟鎹�
       </div>
     </div>
 
@@ -146,7 +167,8 @@
   listbxiaostatistics,
   listjixstatistics,
   listanlstatistics,
-  exportCaseStatistics
+  exportCaseStatistics,
+  exportCaseDeptStatistics
 } from "@/api/project/statistics";
 
 import { listUser } from "@/api/project/organization";
@@ -230,6 +252,10 @@
       donatebaseinfoList: [],
       // 鎹愮尞鍩虹琛ㄦ牸鏁版嵁
       jxidata: [],
+      // 褰撳墠椤电锛歞ept=鎸変笟鍔$粍锛宲erson=鎸変汉鍛�
+      activeTab: "dept",
+      // 鎸変笟鍔$粍鑱氬悎鏁版嵁
+      deptData: [],
       // 寮瑰嚭灞傛爣棰�
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
@@ -260,7 +286,11 @@
     };
   },
   //鐩戝惉灞炴�� 绫讳技浜巇ata姒傚康
-  computed: {},
+  computed: {
+    tableTotal() {
+      return this.activeTab === "dept" ? this.deptData.length : this.jxidata.length;
+    }
+  },
   activated() {},
   mounted() {},
 
@@ -316,6 +346,28 @@
           $obj.id = $index + 1;
         });
         this.total = res.total;
+        this.buildDeptData();
+      });
+    },
+    /** 鎸変笟鍔$粍鑱氬悎锛氱疮璁℃渚� = 危workflowsum锛岀粓姝㈡渚� = 危terminationcase */
+    buildDeptData() {
+      const map = new Map();
+      this.jxidata.forEach(row => {
+        const key = row.deptid || row.deptname || "鏈垎缁�";
+        if (!map.has(key)) {
+          map.set(key, {
+            deptname: row.deptname || "鏈垎缁�",
+            caseTotal: 0,
+            terminationTotal: 0
+          });
+        }
+        const item = map.get(key);
+        item.caseTotal += Number(row.workflowsum) || 0;
+        item.terminationTotal += Number(row.terminationcase) || 0;
+      });
+      this.deptData = Array.from(map.values()).map((item, index) => {
+        item.id = index + 1;
+        return item;
       });
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
@@ -326,11 +378,15 @@
         padeptno: this.queryParams.padeptno,
         pausername: this.queryParams.pausername
       };
+      const exportApi =
+        this.activeTab === "dept"
+          ? exportCaseDeptStatistics
+          : exportCaseStatistics;
       this.$modal
-        .confirm("鏄惁纭瀵煎嚭褰撳墠绛涢�夋潯浠朵笅鐨勬渚嬬粺璁℃暟鎹紵")
+        .confirm("鏄惁纭瀵煎嚭褰撳墠鍒楄〃鐨勬渚嬬粺璁℃暟鎹紵")
         .then(() => {
           this.exportLoading = true;
-          return exportCaseStatistics(queryParams);
+          return exportApi(queryParams);
         })
         .then(response => {
           this.$download.name(response.msg);
@@ -343,7 +399,7 @@
     getSummaries(param) {
       const { columns, data } = param;
       const sums = [];
-      var columnnames = ["donationmonth", "deptname", "reportername"];
+      var columnnames = ["deptname", "reportername"];
       columns.forEach((column, index) => {
         if (index === 0) {
           sums[index] = "鍚堣";
@@ -371,6 +427,26 @@
       });
       return sums;
     },
+    /** 鎸変笟鍔$粍琛ㄦ牸鍚堣 */
+    getDeptSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = "鍚堣";
+          return;
+        }
+        if (column.property === "deptname") {
+          return;
+        }
+        const total = data.reduce(
+          (prev, item) => prev + (Number(item[column.property]) || 0),
+          0
+        );
+        sums[index] = data.length === 0 ? "" : total;
+      });
+      return sums;
+    },
 
     // 琛ㄥ崟閲嶇疆
     reset() {

--
Gitblit v1.9.3