From 3df460667d74868d0a54fce12d5e881bbd6c0c1a Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期四, 17 九月 2026 17:11:18 +0800
Subject: [PATCH] 青岛维护统计

---
 src/views/business/ethicalReview/index.vue |  131 ++++++++++++++++++++++---------------------
 1 files changed, 67 insertions(+), 64 deletions(-)

diff --git a/src/views/business/ethicalReview/index.vue b/src/views/business/ethicalReview/index.vue
index 3033248..0428f61 100644
--- a/src/views/business/ethicalReview/index.vue
+++ b/src/views/business/ethicalReview/index.vue
@@ -86,12 +86,6 @@
             >淇敼</el-button
           > -->
           <el-button
-            type="warning"
-            icon="el-icon-download"
-            @click="handleExport"
-            >瀵煎嚭</el-button
-          >
-          <el-button
             type="info"
             icon="el-icon-check"
             :disabled="single"
@@ -121,12 +115,7 @@
           prop="inpatientno"
           width="120"
         />
-        <el-table-column
-          label="濮撳悕"
-          align="center"
-          prop="name"
-          width="100"
-        />
+        <el-table-column label="濮撳悕" align="center" prop="name" width="100" />
 
         <el-table-column label="鎬у埆" align="center" prop="sex" width="80">
           <template slot-scope="scope">
@@ -195,7 +184,7 @@
         <el-table-column
           label="鎿嶄綔"
           align="center"
-          width="180"
+          width="240"
           fixed="right"
           class-name="small-padding fixed-width"
         >
@@ -222,6 +211,13 @@
               :disabled="scope.row.status === '2'"
               >缁撴潫</el-button
             >
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+              >涓嬭浇</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -239,13 +235,23 @@
 </template>
 
 <script>
-import { reviewinitiateBaseInfoList, ethicalreviewedit,  } from "@/api/businessApi";
+import {
+  reviewinitiateBaseInfoList,
+  ethicalreviewedit,
+  ethicalReviewDownload
+} from "@/api/businessApi";
 import Pagination from "@/components/Pagination";
+import { getToken } from "@/utils/auth";
 
 export default {
   name: "EthicsReviewList",
   components: { Pagination },
-  dicts: ["sys_user_sex", "ReviewForm_status",'sys_ethical','expert_Conclusion'],
+  dicts: [
+    "sys_user_sex",
+    "ReviewForm_status",
+    "sys_ethical",
+    "expert_Conclusion"
+  ],
   data() {
     return {
       // 閬僵灞�
@@ -291,9 +297,14 @@
       delete params.reviewTimeRange;
 
       // 濡傛灉鏈夋椂闂磋寖鍥村弬鏁�
-      if (this.queryParams.reviewTimeRange && this.queryParams.reviewTimeRange.length === 2) {
-        params.expertTimeStart = this.queryParams.reviewTimeRange[0] + ' 00:00:00';
-        params.expertTimeEnd = this.queryParams.reviewTimeRange[1] + ' 23:59:59';
+      if (
+        this.queryParams.reviewTimeRange &&
+        this.queryParams.reviewTimeRange.length === 2
+      ) {
+        params.expertTimeStart =
+          this.queryParams.reviewTimeRange[0] + " 00:00:00";
+        params.expertTimeEnd =
+          this.queryParams.reviewTimeRange[1] + " 23:59:59";
       }
 
       reviewinitiateBaseInfoList(params)
@@ -333,7 +344,7 @@
     handleView(row) {
       this.$router.push({
         path: "/case/ethicalReviewInfo",
-        query: { infoid: row.infoid,id:row.id }
+        query: { infoid: row.infoid, id: row.id }
       });
     },
     // 鏂板鎸夐挳鎿嶄綔
@@ -345,12 +356,13 @@
       const infoid = row.infoid;
       this.$router.push({
         path: "/case/ethicalReviewInfo",
-        query: { infoid: infoid,id:row.id }
+        query: { infoid: infoid, id: row.id }
       });
     },
     // 缁撴潫瀹℃煡鎿嶄綔
     handleEndReview(row) {
-      const selectedRow = row || (this.selectedRows.length === 1 ? this.selectedRows[0] : null);
+      const selectedRow =
+        row || (this.selectedRows.length === 1 ? this.selectedRows[0] : null);
       if (!selectedRow) {
         this.$message.warning("璇烽�夋嫨涓�鏉¤褰�");
         return;
@@ -365,7 +377,7 @@
           // 璋冪敤淇敼鎺ュ彛锛屽皢鐘舵�佹敼涓虹粨鏉燂紙status: '2'锛�
           const updateData = {
             infoid: selectedRow.infoid,
-            status: '2',
+            status: "2",
             // 鍙互淇濈暀鍘熸湁鏁版嵁
             expertName: selectedRow.expertName,
             expertConclusion: selectedRow.expertConclusion,
@@ -385,50 +397,41 @@
         })
         .catch(() => {});
     },
-    // 瀵煎嚭鎸夐挳鎿嶄綔
-    handleExport() {
-      const queryParams = { ...this.queryParams };
-      delete queryParams.pageNum;
-      delete queryParams.pageSize;
-
-      // 澶勭悊鏃堕棿鑼冨洿鍙傛暟
-      if (queryParams.reviewTimeRange && queryParams.reviewTimeRange.length === 2) {
-        queryParams.expertTimeStart = queryParams.reviewTimeRange[0] + ' 00:00:00';
-        queryParams.expertTimeEnd = queryParams.reviewTimeRange[1] + ' 23:59:59';
-      }
-      delete queryParams.reviewTimeRange;
-
-      this.$confirm("鏄惁纭瀵煎嚭鎵�鏈変鸡鐞嗗鏌ユ暟鎹紵", "璀﹀憡", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
-      })
-        .then(() => {
-          this.loading = true;
-          // return ethicalreviewexport(queryParams);
-        })
-        .then(response => {
-          if (response.code === 200) {
-            this.$message.success("瀵煎嚭鎴愬姛");
-            // 澶勭悊瀵煎嚭鏂囦欢涓嬭浇
-            if (response.data) {
-              const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' });
-              const downloadElement = document.createElement('a');
-              const href = window.URL.createObjectURL(blob);
-              downloadElement.href = href;
-              downloadElement.download = '浼︾悊瀹℃煡鍒楄〃.xlsx';
-              document.body.appendChild(downloadElement);
-              downloadElement.click();
-              document.body.removeChild(downloadElement);
-              window.URL.revokeObjectURL(href);
-            }
-          } else {
-            this.$message.error(response.msg || "瀵煎嚭澶辫触");
+    // 涓嬭浇浼︾悊瀹℃煡妗f
+    handleDownload(row) {
+      ethicalReviewDownload({ nitiateId: row.id })
+        .then(res => {
+          if (res.code !== 200 || !res.data || !res.data.downloadUrl) {
+            this.$message.error(res.msg || "涓嬭浇澶辫触");
+            return;
           }
-          this.loading = false;
+          const fileUrl = res.data;
+          // 鎷兼帴涓嬭浇鍦板潃锛歰rigin + /dev-api(寮�鍙戜唬鐞嗗墠缂�) + /profile + downloadUrl锛�
+          // 鍚庣闈欐�佹枃浠跺疄闄呮寕鍦� /profile 涓嬶紝downloadUrl 灏戜簡杩欏眰鍓嶇紑
+          const urlBase = process.env.VUE_APP_BASE_API;
+          const curWWWPath = window.document.location.href;
+          const pos = curWWWPath.indexOf(window.document.location.pathname);
+          const fullUrl =
+            curWWWPath.substring(0, pos) + urlBase + "/profile" + fileUrl.downloadUrl;
+
+          fetch(fullUrl, {
+            headers: { Authorization: "Bearer " + getToken() }
+          })
+            .then(response => response.blob())
+            .then(blob => {
+              const url = window.URL.createObjectURL(new Blob([blob]));
+              const link = document.createElement("a");
+              link.href = url;
+              link.setAttribute("download", fileUrl.downloadName);
+              document.body.appendChild(link);
+              link.click();
+              link.parentNode.removeChild(link);
+              window.URL.revokeObjectURL(url);
+            });
         })
-        .catch(() => {
-          this.loading = false;
+        .catch(error => {
+          console.error("涓嬭浇妗f澶辫触:", error);
+          this.$message.error("涓嬭浇澶辫触");
         });
     },
     // 鏃堕棿鏍煎紡鍖�

--
Gitblit v1.9.3