From ae478a3d5dab28dd598d39f27429e4a544b15ad2 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期四, 25 十二月 2025 22:48:06 +0800
Subject: [PATCH] feat:已完成时,检查附件是否上传

---
 app/pages/index.vue |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/app/pages/index.vue b/app/pages/index.vue
index 7b2aeb4..a98e7e1 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -851,12 +851,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(() => {
@@ -864,20 +871,21 @@
             })
             .catch(() => {});
         } else {
-          // 鏈笂浼犵煡鎯呭悓鎰忎功锛屾樉绀烘彁绀�
-          this.$modal.confirm('浠诲姟鏈笂浼犵煡鎯呭悓鎰忎功锛屾棤娉曞畬鎴愪换鍔°�傛槸鍚︾幇鍦ㄥ幓涓婁紶锛�').then(() => {
+          // 鏈笂浼犵煡鎯呭悓鎰忎功鎴栧叾浠栭敊璇紝闃绘瀹屾垚
+          const message = (response && response.msg) || '浠诲姟鏈笂浼犵煡鎯呭悓鎰忎功锛屾棤娉曞畬鎴愪换鍔�';
+          console.log('鏈笂浼犵煡鎯呭悓鎰忎功锛岄樆姝㈠畬鎴�');
+          
+          this.$modal.confirm(message + '銆傛槸鍚︾幇鍦ㄥ幓涓婁紶锛�').then(() => {
             // 璺宠浆鍒颁换鍔¤鎯呴〉涓婁紶闄勪欢
             this.$tab.navigateTo(`/pagesTask/detail?id=${taskId}`);
           }).catch(() => {});
         }
       } catch (error) {
         uni.hideLoading();
-        console.error('妫�鏌ラ檮浠跺け璐�:', error);
+        console.error('妫�鏌ラ檮浠跺紓甯�:', error);
         
-        // 濡傛灉妫�鏌ュけ璐ワ紝璇㈤棶鐢ㄦ埛鏄惁缁х画
-        this.$modal.confirm('妫�鏌ラ檮浠剁姸鎬佸け璐ワ紝鏄惁缁х画瀹屾垚浠诲姟锛�').then(() => {
-          this.updateTaskStatus(taskId, status, remark);
-        }).catch(() => {});
+        // 濡傛灉妫�鏌ュけ璐ワ紙缃戠粶寮傚父绛夛級锛屼笉鍏佽瀹屾垚浠诲姟
+        this.$modal.showToast('妫�鏌ラ檮浠剁姸鎬佸け璐ワ紝鏃犳硶瀹屾垚浠诲姟');
       }
     },
 

--
Gitblit v1.9.1