From c10b1e130ccbc94e6481a43e8e2d35cfc8fcf83b Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期五, 26 十二月 2025 18:05:06 +0800
Subject: [PATCH] feat:显示问题
---
app/pages/task/index.vue | 59 +++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/app/pages/task/index.vue b/app/pages/task/index.vue
index 3b0a399..da47896 100644
--- a/app/pages/task/index.vue
+++ b/app/pages/task/index.vue
@@ -188,7 +188,7 @@
<view class="info-row">
<view class="info-item">
<view class="label">鎵ц浜哄憳:</view>
- <view class="value">{{ task.assignee }}</view>
+ <view class="value">{{ getAssigneesDisplay(task) }}</view>
</view>
</view>
</view>
@@ -663,13 +663,36 @@
// 浼樺厛鏄剧ず杞叆鍖婚櫌鍚嶇О
if (task.emergencyInfo.hospitalInName) {
if(task.emergencyInfo.hospitalInName.includes("瀹朵腑")){
- return task.emergencyInfo.destinationAddress;
+ return task.emergencyInfo.hospitalInAddress;
}
return task.emergencyInfo.hospitalInName;
- }
+ }
+ // 濡傛灉娌℃湁杞叆鍖婚櫌鍚嶇О锛屼絾鏈夎浆鍏ュ尰闄㈠湴鍧�锛屽垯鏄剧ず鍦板潃
+ if (task.emergencyInfo.hospitalInAddress) {
+ return task.emergencyInfo.hospitalInAddress;
+ }
}
// 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨別ndLocation
return this.formatAddress(task.endLocation || "鏈缃�");
+ },
+
+ // 鑾峰彇鎵ц浜哄憳鏄剧ず锛堜粠 assignees 鏁扮粍涓彁鍙� userName锛�
+ getAssigneesDisplay(task) {
+ // 濡傛灉鏈� assignees 鏁扮粍涓斾笉涓虹┖
+ if (task.assignees && task.assignees.length > 0) {
+ // 鎻愬彇鎵�鏈� userName锛岃繃婊ゆ帀绌哄��
+ const userNames = task.assignees
+ .map(assignee => assignee.userName)
+ .filter(name => name); // 杩囨护鎺� null/undefined/绌哄瓧绗︿覆
+
+ // 濡傛灉鏈夋湁鏁堢殑鐢ㄦ埛鍚嶏紝鐢ㄩ�楀彿杩炴帴
+ if (userNames.length > 0) {
+ return userNames.join('銆�');
+ }
+ }
+
+ // 濡傛灉娌℃湁 assignees 鏁扮粍锛屼娇鐢ㄦ棫鐨� assigneeName 鎴� assignee 瀛楁
+ return task.assigneeName || task.assignee || '鏈垎閰�';
},
// 鍒囨崲鏌ヨ鐣岄潰鏄剧ず/闅愯棌
@@ -940,12 +963,19 @@
title: '妫�鏌ラ檮浠�...'
});
- const response = await checkTaskConsentAttachment(taskId);
+ // 娉ㄦ剰锛氳繖閲屼細琚姹傛嫤鎴櫒澶勭悊锛宑ode !== 200 鏃朵細 reject
+ const response = await checkTaskConsentAttachment(taskId).catch(err => {
+ // 鎷︽埅鍣� reject 鐨勬儏鍐碉紝杩斿洖涓�涓粯璁ゅ璞�
+ console.log('璇锋眰琚嫤鎴櫒 reject锛宔rr:', err);
+ return { code: -1, msg: '鏈笂浼犵煡鎯呭悓鎰忎功' };
+ });
uni.hideLoading();
+ console.log('妫�鏌ラ檮浠剁粨鏋�:', response);
- if (response.code === 200) {
+ if (response && response.code === 200) {
// 宸蹭笂浼犵煡鎯呭悓鎰忎功锛岀户缁洿鏂扮姸鎬�
+ console.log('宸蹭笂浼犵煡鎯呭悓鎰忎功锛岀户缁畬鎴愪换鍔�');
this.$modal
.confirm("纭浠诲姟宸插畬鎴愶紵")
.then(() => {
@@ -953,8 +983,11 @@
})
.catch(() => {});
} else {
- // 鏈笂浼犵煡鎯呭悓鎰忎功锛屾樉绀烘彁绀�
- this.$modal.confirm('浠诲姟鏈笂浼犵煡鎯呭悓鎰忎功锛屾棤娉曞畬鎴愪换鍔°�傛槸鍚︾幇鍦ㄥ幓涓婁紶锛�').then(() => {
+ // 鏈笂浼犵煡鎯呭悓鎰忎功鎴栧叾浠栭敊璇紝闃绘瀹屾垚
+ const message = (response && response.msg) || '浠诲姟鏈笂浼犵煡鎯呭悓鎰忎功锛屾棤娉曞畬鎴愪换鍔�';
+ console.log('鏈笂浼犵煡鎯呭悓鎰忎功锛岄樆姝㈠畬鎴�');
+
+ this.$modal.confirm(message + '銆傛槸鍚︾幇鍦ㄥ幓涓婁紶锛�').then(() => {
// 璺宠浆鍒颁换鍔¤鎯呴〉涓婁紶闄勪欢
uni.navigateTo({
url: `/pagesTask/detail?id=${taskId}`
@@ -963,12 +996,10 @@
}
} catch (error) {
uni.hideLoading();
- console.error('妫�鏌ラ檮浠跺け璐�:', error);
+ console.error('妫�鏌ラ檮浠跺紓甯�:', error);
- // 濡傛灉妫�鏌ュけ璐ワ紝璇㈤棶鐢ㄦ埛鏄惁缁х画
- this.$modal.confirm('妫�鏌ラ檮浠剁姸鎬佸け璐ワ紝鏄惁缁х画瀹屾垚浠诲姟锛�').then(() => {
- this.updateTaskStatus(taskId, status, remark);
- }).catch(() => {});
+ // 濡傛灉妫�鏌ュけ璐ワ紙缃戠粶寮傚父绛夛級锛屼笉鍏佽瀹屾垚浠诲姟
+ this.$modal.showToast('妫�鏌ラ檮浠剁姸鎬佸け璐ワ紝鏃犳硶瀹屾垚浠诲姟');
}
},
@@ -1426,6 +1457,10 @@
font-size: 26rpx;
flex: 1;
word-break: break-all;
+ overflow-wrap: break-word;
+ line-height: 1.5;
+ max-height: none;
+ overflow: visible;
}
}
}
--
Gitblit v1.9.1