From 2140c5aae2032673cef7055df9738b9bacf37816 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 23 九月 2026 16:46:20 +0800
Subject: [PATCH] 青岛维护
---
pagesSub/ethicalReview/index.vue | 151 ++++++++++++++++++++++++++++++--------------------
1 files changed, 90 insertions(+), 61 deletions(-)
diff --git a/pagesSub/ethicalReview/index.vue b/pagesSub/ethicalReview/index.vue
index 0ae4a90..0a537df 100644
--- a/pagesSub/ethicalReview/index.vue
+++ b/pagesSub/ethicalReview/index.vue
@@ -14,12 +14,12 @@
<view class="divider"></view>
<view class="stat-item">
<text class="count">{{ stats.rejectCount }}</text>
- <text class="label">瀹℃煡椹冲洖</text>
+ <text class="label">涓嶅悓鎰�</text>
</view>
<view class="divider"></view>
<view class="stat-item">
<text class="count">{{ stats.waiveCount }}</text>
- <text class="label">宸叉斁寮�</text>
+ <text class="label">寮冩潈</text>
</view>
</view>
@@ -66,7 +66,7 @@
<view class="review-header">
<view class="case-info">
<view class="hospital-badge">
- <u-icon name="order" size="16" color="#fff" />
+ <up-icon name="order" size="16" color="#fff" />
</view>
<view class="info-content">
<text class="donor-name">{{ review.name || "鏈~鍐欏鍚�" }}</text>
@@ -112,19 +112,19 @@
<!-- 瀹℃煡璇︽儏 -->
<view class="review-details">
<view class="detail-item" v-if="review.createTime">
- <u-icon name="clock" size="14" color="#909399" />
+ <up-icon name="clock" size="14" color="#909399" />
<text class="detail-text"
>鍒涘缓鏃堕棿锛歿{ formatDate(review.createTime) }}</text
>
</view>
<view class="detail-item" v-if="review.conclusiontime">
- <u-icon name="checkmark-circle" size="14" color="#909399" />
+ <up-icon name="checkmark-circle" size="14" color="#909399" />
<text class="detail-text"
>瀹℃煡鏃堕棿锛歿{ formatDate(review.conclusiontime) }}</text
>
</view>
<view class="detail-item" v-if="review.expertname">
- <u-icon name="account" size="14" color="#909399" />
+ <up-icon name="account" size="14" color="#909399" />
<text class="detail-text">瀹℃煡浜猴細{{ review.expertname }}</text>
</view>
</view>
@@ -132,7 +132,7 @@
<!-- 瀹℃煡缁撹 -->
<view
class="conclusion-section"
- v-if="review.expertconclusion && review.expertconclusion !== 2"
+ v-if="review.expertconclusion !== '' && review.expertconclusion != null && review.expertconclusion != 2"
>
<text class="conclusion-label">瀹℃煡缁撹锛�</text>
<text class="conclusion-content">{{
@@ -149,7 +149,7 @@
<!-- 鎿嶄綔鎸夐挳 -->
<view class="action-buttons">
<button class="action-btn detail-btn" @tap.stop="viewDetail(review)">
- <u-icon name="eye" size="14" color="#747CF9" />
+ <up-icon name="eye" size="14" color="#747CF9" />
<text>鏌ョ湅璇︽儏</text>
</button>
@@ -158,25 +158,25 @@
class="action-btn download-btn"
@tap.stop="downloadReport(review)"
>
- <u-icon name="download" size="14" color="#52c41a" />
+ <up-icon name="download" size="14" color="#52c41a" />
<text>涓嬭浇鎶ュ憡</text>
</button>
<button
- v-if="review.expertconclusion == 2"
+ v-if="review.expertconclusion == 0"
class="action-btn appeal-btn"
@tap.stop="submitAppeal(review)"
>
- <u-icon name="arrow-up" size="14" color="#fa8c16" />
+ <up-icon name="arrow-up" size="14" color="#fa8c16" />
<text>鎻愯捣鐢宠瘔</text>
</button>
<button
- v-if="review.expertconclusion == 2 || review.expertconclusion == 3"
+ v-if="review.expertconclusion == 0 || review.expertconclusion == 3"
class="action-btn restart-btn"
@tap.stop="restartReview(review)"
>
- <u-icon name="play-circle" size="14" color="#747CF9" />
+ <up-icon name="play-circle" size="14" color="#747CF9" />
<text>閲嶆柊寮�濮�</text>
</button>
</view>
@@ -187,8 +187,7 @@
<!-- 绌虹姸鎬� -->
<view class="empty-state" v-if="!loading && reviewList.length == 0">
- <view> {{ loading }}-{{ reviewList.length }} </view>
- <u-icon name="file-remove" size="80" color="#C0C4CC" />
+ <!-- <up-icon name="more-dot-fill" size="80" color="#C0C4CC" /> -->
<text class="empty-text">鏆傛棤瀹℃煡璁板綍</text>
<text class="empty-desc">褰撳墠绛涢�夋潯浠朵笅娌℃湁鎵惧埌鐩稿叧璁板綍</text>
<button class="empty-action" @tap="resetFilters">
@@ -213,6 +212,7 @@
onReachBottom,
} from "@dcloudio/uni-app";
import { useDict } from "@/utils/dict";
+import { useUserStore } from "@/stores/user";
// 鍝嶅簲寮忔暟鎹�
const loading = ref(false);
@@ -221,6 +221,7 @@
const pageNum = ref(1);
const pageSize = ref(10);
const dict = ref({});
+const userStore = useUserStore();
// 绛涢�夋潯浠�
const currentStatus = ref("all");
@@ -243,24 +244,24 @@
{ label: "鍏ㄩ儴", value: "all" },
{ label: "寰呭鏌�", value: "pending" },
{ label: "瀹℃煡閫氳繃", value: "approved" },
- { label: "瀹℃煡椹冲洖", value: "rejected" },
- { label: "宸叉斁寮�", value: "abandoned" },
+ { label: "涓嶅悓鎰�", value: "rejected" },
+ { label: "寮冩潈", value: "abandoned" },
]);
// 瀛楀吀鏄犲皠
const statusDict = {
pending: "寰呭鏌�",
approved: "瀹℃煡閫氳繃",
- rejected: "瀹℃煡椹冲洖",
- abandoned: "宸叉斁寮�",
+ rejected: "涓嶅悓鎰�",
+ abandoned: "寮冩潈",
};
// 缁撹鏄犲皠
const conclusionDict = {
- 0: "鏈鏍�",
- 1: "瀹℃煡閫氳繃",
- 2: "瀹℃煡椹冲洖",
- 3: "鏀惧純",
+ 0: "涓嶅悓鎰�",
+ 1: "鍚屾剰",
+ 2: "瀹℃煡涓�",
+ 3: "寮冩潈",
4: "淇敼鍚庡悓鎰�",
};
@@ -361,10 +362,10 @@
params.expertconclusion = 1; // 鍚屾剰
break;
case "rejected":
- params.expertconclusion = 2; // 涓嶅悓鎰�
+ params.expertconclusion = 0; // 涓嶅悓鎰�
break;
case "abandoned":
- params.expertconclusion = 3; // 鏀惧純
+ params.expertconclusion = 3; // 寮冩潈
break;
}
}
@@ -460,45 +461,75 @@
});
};
-// 涓嬭浇鎶ュ憡
-const downloadReport = async (review) => {
- if (!review.conclusionannex) {
- uni.showToast({
- title: "鏆傛棤鎶ュ憡鍙笅杞�",
- icon: "none",
- });
- return;
- }
-
+// 鑾峰彇鏂囦欢涓嬭浇鐨勫熀纭�鍦板潃锛�
+// H5 绔蛋鍚屾簮鍦板潃锛堢敱閮ㄧ讲璇ラ〉闈㈢殑 nginx 鍙嶅悜浠g悊 /profile/ 鍒板悗绔紝瑙勯伩璺ㄥ煙锛夛紱
+// 灏忕▼搴� / App 绔娇鐢� userStore 涓殑鏂囦欢鏈嶅姟鍣ㄥ湴鍧�
+const getDownloadBaseUrl = () => {
+ // #ifdef H5
try {
- const annexes = review.conclusionannex
- .split(";")
- .filter((item) => item.trim());
+ return window.location.origin;
+ } catch {
+ return userStore.baseUrlHt;
+ }
+ // #endif
+ // #ifndef H5
+ return userStore.baseUrlHt;
+ // #endif
+};
- if (annexes.length == 0) {
+// 涓嬭浇鎶ュ憡锛氳皟鐢ㄥ悗绔。妗堜笅杞芥帴鍙h幏鍙栦笅杞藉湴鍧�锛屽啀涓嬭浇鏂囦欢
+const downloadReport = async (review) => {
+ try {
+ // 鍏堣皟鐢ㄥ悗绔帴鍙h幏鍙栨。妗堜笅杞藉湴鍧�锛堜笌 web 绔竴鑷达細鍙傛暟 nitiateId 瀵瑰簲浼︾悊瀹℃煡鍙戣捣 id锛�
+ const res = await uni.$uapi.get(
+ "/project/ethicalreviewopinions/download",
+ { nitiateId: review.nitiateId || review.fcid || review.id },
+ );
+
+ if (res.code != 200 || !res.data || !res.data.downloadUrl) {
uni.showToast({
- title: "鏆傛棤鎶ュ憡鍙笅杞�",
+ title: res.msg || "鏆傛棤鎶ュ憡鍙笅杞�",
icon: "none",
});
return;
}
+ const downloadUrl = res.data.downloadUrl;
+ const downloadName =
+ res.data.downloadName || downloadUrl.split("/").pop() || "浼︾悊瀹℃煡鎶ュ憡.doc";
+
+ // 鎷兼帴瀹屾暣涓嬭浇鍦板潃锛歜ase + /profile + downloadUrl锛堝悗绔� downloadUrl 缂哄皯 /profile 鍓嶇紑锛�
+ const fullUrl = getDownloadBaseUrl() + "/profile" + downloadUrl;
+
+ // #ifdef H5
+ // H5 绔細鐩存帴瑙﹀彂娴忚鍣ㄤ笅杞�
+ const link = document.createElement("a");
+ link.href = fullUrl;
+ link.download = downloadName;
+ link.target = "_blank";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ return;
+ // #endif
+
+ // #ifndef H5
+ // 灏忕▼搴� / App 绔細涓嬭浇鍚庝繚瀛樺苟鎵撳紑
uni.showLoading({
title: "涓嬭浇涓�...",
mask: true,
});
- // 涓嬭浇绗竴涓檮浠�
- const fileUrl = annexes[0];
+ const token = uni.getStorageSync("token") || "";
const downloadTask = uni.downloadFile({
- url: fileUrl,
+ url: fullUrl,
+ header: {
+ Authorization: token ? `Bearer ${token}` : "",
+ },
success: (downloadRes) => {
if (downloadRes.statusCode == 200) {
- const tempFilePath = downloadRes.tempFilePath;
-
- // 淇濆瓨鍒版湰鍦�
uni.saveFile({
- tempFilePath: tempFilePath,
+ tempFilePath: downloadRes.tempFilePath,
success: (saveRes) => {
uni.hideLoading();
uni.showToast({
@@ -507,21 +538,18 @@
duration: 2000,
});
- // 鍦ㄥ井淇″皬绋嬪簭涓彲浠ユ墦寮�鏂囦欢
- if (uni.getSystemInfoSync().platform == "weixin") {
- uni.openDocument({
- filePath: saveRes.savedFilePath,
- showMenu: true,
- success: () => {
- console.log("鎵撳紑鏂囨。鎴愬姛");
- },
- fail: (err) => {
- console.error("鎵撳紑鏂囨。澶辫触", err);
- },
- });
- }
+ uni.openDocument({
+ filePath: saveRes.savedFilePath,
+ showMenu: true,
+ success: () => {
+ console.log("鎵撳紑鏂囨。鎴愬姛");
+ },
+ fail: (err) => {
+ console.error("鎵撳紑鏂囨。澶辫触", err);
+ },
+ });
},
- fail: (saveErr) => {
+ fail: () => {
uni.hideLoading();
uni.showToast({
title: "淇濆瓨鏂囦欢澶辫触",
@@ -554,6 +582,7 @@
downloadTask.onProgressUpdate((res) => {
console.log("涓嬭浇杩涘害:", res.progress);
});
+ // #endif
} catch (error) {
uni.hideLoading();
console.error("涓嬭浇鎶ュ憡澶辫触:", error);
--
Gitblit v1.9.3