Bladeren bron

fix(mobile): 修复待办列表办理/审批按钮点击无响应

u-button 的 click 不带事件对象,去掉 @click.stop,避免 stopPropagation 报错导致按钮失效。

Co-authored-by: Cursor <cursoragent@cursor.com>
“wuzhen” 1 week geleden
bovenliggende
commit
de223a1f5a
2 gewijzigde bestanden met toevoegingen van 15 en 10 verwijderingen
  1. 3 2
      mobile/src/components/Process/submitVerify.vue
  2. 12 8
      mobile/src/pages/task/taskWaiting.vue

+ 3 - 2
mobile/src/components/Process/submitVerify.vue

@@ -6,6 +6,7 @@
             width="100%"
             width="100%"
             height="90%"
             height="90%"
             border-radius="12"
             border-radius="12"
+            :z-index="20090"
             @close="cancel"
             @close="cancel"
             :custom-style="{ width: '90vw', maxHeight: '90vh', overflow: 'auto' }"
             :custom-style="{ width: '90vw', maxHeight: '90vh', overflow: 'auto' }"
         >
         >
@@ -517,9 +518,9 @@ export default {
                 });
                 });
 
 
                 if (response.code === 200) {
                 if (response.code === 200) {
-                    this.task = response.data;
+                    this.task = response.data || {};
                     this.buttonObj = {};
                     this.buttonObj = {};
-                    this.task.buttonList.forEach((e) => {
+                    (this.task.buttonList || []).forEach((e) => {
                         this.buttonObj[e.code] = e.show;
                         this.buttonObj[e.code] = e.show;
                     });
                     });
                     this.buttonDisabled = false;
                     this.buttonDisabled = false;

+ 12 - 8
mobile/src/pages/task/taskWaiting.vue

@@ -126,10 +126,11 @@
                         </view>
                         </view>
 
 
                         <!-- 操作按钮 -->
                         <!-- 操作按钮 -->
+                        <!-- 注意:u-button 的 $emit('click') 不带事件对象,不能写 @click.stop,否则 stopPropagation 报错表现为“点了没反应” -->
                         <view class="card-actions">
                         <view class="card-actions">
                             <view class="action-btn">
                             <view class="action-btn">
                                 <u-button
                                 <u-button
-                                    @click.stop="handleApproval(item)"
+                                    @click="handleApproval(item)"
                                     type="primary"
                                     type="primary"
                                     size="small"
                                     size="small"
                                     shape="circle"
                                     shape="circle"
@@ -147,7 +148,7 @@
                             <!-- 列表直接审批:仅本页弹窗,不跳转业务页 -->
                             <!-- 列表直接审批:仅本页弹窗,不跳转业务页 -->
                             <view class="action-btn">
                             <view class="action-btn">
                                 <u-button
                                 <u-button
-                                    @click.stop="handleDirectApprove(item)"
+                                    @click="handleDirectApprove(item)"
                                     type="warning"
                                     type="warning"
                                     size="small"
                                     size="small"
                                     shape="circle"
                                     shape="circle"
@@ -531,12 +532,15 @@ export default {
                 uni.showToast({ title: '缺少任务信息,无法审批', icon: 'none' });
                 uni.showToast({ title: '缺少任务信息,无法审批', icon: 'none' });
                 return;
                 return;
             }
             }
-            const verifyRef = this.$refs.submitVerifyRef;
-            if (!verifyRef || typeof verifyRef.openDialog !== 'function') {
-                uni.showToast({ title: '审批组件未就绪', icon: 'none' });
-                return;
-            }
-            verifyRef.openDialog(row.id);
+            const taskId = String(row.id);
+            this.$nextTick(() => {
+                const verifyRef = this.$refs.submitVerifyRef;
+                if (!verifyRef || typeof verifyRef.openDialog !== 'function') {
+                    uni.showToast({ title: '审批组件未就绪', icon: 'none' });
+                    return;
+                }
+                verifyRef.openDialog(taskId);
+            });
         },
         },
 
 
         // 审批成功:刷新待办列表,停留在本页(不跳转请假列表等业务页)
         // 审批成功:刷新待办列表,停留在本页(不跳转请假列表等业务页)