From f2ce587e752798a2a454e0f029069b4e82a41bc8 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 27 六月 2025 17:36:52 +0800
Subject: [PATCH] 增加提交样式,新增批量处理dnc审签

---
 src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleForm.vue                   |    5 
 src/views/flowable/workflow/assignEquipmentFileStream/AssignEquipmentFileStreamHandle.vue |   93 +++++++++++++++++++++--
 src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue                       |    6 +
 src/views/flowable/workflow/FlowTodo.vue                                                  |   20 +++++
 src/views/flowable/workflow/guideCardBatch/GuideCardBatchHandle.vue                       |   92 +++++++++++++++++++++--
 5 files changed, 195 insertions(+), 21 deletions(-)

diff --git a/src/views/flowable/workflow/FlowTodo.vue b/src/views/flowable/workflow/FlowTodo.vue
index e70779b..9a452fc 100644
--- a/src/views/flowable/workflow/FlowTodo.vue
+++ b/src/views/flowable/workflow/FlowTodo.vue
@@ -580,6 +580,26 @@
       } else if (categorySet.has('WEEK_MAINTENANCE')) {
         this.$refs.weenMaintenanceBatchApprovalModalRef.handleDetail(this.selectionRows[0])
         this.$refs.weenMaintenanceBatchApprovalModalRef.title = this.selectionRows[0].name
+      }else if (categorySet.has('ggApproval')){
+        let ids = ''
+        for (let a = 0; a < this.selectedRowKeys.length; a++) {
+          ids += this.selectedRowKeys[a] + ','
+        }
+        getAction(this.url.isSameNode + '?taskIds=' + ids).then((res) => {
+          if (res.success) {
+            let taskDefKey = res.result
+            this.selectBachData.taskIds = ids
+            this.selectBachData.taskDefKey = taskDefKey
+            this.$refs.modalFormDispatchFileBatch.title = '鎵归噺澶勭悊'
+            this.$refs.modalFormDispatchFileBatch.edit(this.selectBachData)
+            this.$refs.modalFormDispatchFileBatch.disableSubmit = false
+          } else {
+            this.$notification.warning({
+              message: '娑堟伅',
+              description: res.message
+            })
+          }
+        })
       }
     },
 
diff --git a/src/views/flowable/workflow/assignEquipmentFileStream/AssignEquipmentFileStreamHandle.vue b/src/views/flowable/workflow/assignEquipmentFileStream/AssignEquipmentFileStreamHandle.vue
index 36b9386..654bc7a 100644
--- a/src/views/flowable/workflow/assignEquipmentFileStream/AssignEquipmentFileStreamHandle.vue
+++ b/src/views/flowable/workflow/assignEquipmentFileStream/AssignEquipmentFileStreamHandle.vue
@@ -139,8 +139,20 @@
 
           </a-row>
           <div class="table-operator" style="text-align: right;">
-            <a-button  @click="handleQueXiaoTask" type="primary" icon="close">鍙栨秷</a-button>
-            <a-button @click="submitForm">鎻� 浜�</a-button>
+            <a-button
+              @click="handleQueXiaoTask"
+              icon="close"
+              :disabled="isSubmitting"
+              :class="{'disabled-btn': isSubmitting}"
+            >鍙栨秷</a-button>
+            <a-button
+              @click="submitForm"
+              type="primary"
+              :disabled="isSubmitting"
+              :loading="isSubmitting"
+            >
+              鎻� 浜�
+            </a-button>
           </div>
         </a-form-model>
       </div>
@@ -209,7 +221,8 @@
       },
       dictOptions: {},
       superFieldList: [],
-      workflowSource: []
+      workflowSource: [],
+      isSubmitting: false,
     }
   },
   created() {
@@ -243,12 +256,27 @@
         alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�')
       }
     },
-    handleQueXiaoTask(){
-      this.visible = false
-      this.routeReload()
+    handleQueXiaoTask() {
+      // 濡傛灉姝e湪鎻愪氦锛岄樆姝㈠彇娑堟搷浣�
+      if (this.isSubmitting) return;
+      this.visible = false;
+      this.routeReload();
     },
     submitForm () {
+      // 濡傛灉姝e湪鎻愪氦锛岄樆姝㈤噸澶嶇偣鍑�
+      if (this.isSubmitting) return;
+
+      // 寮�鍚叏灞�绂侀��
+      this.isSubmitting = true;
+      document.body.classList.add('submitting');
+
       const that = this;
+
+      // 瀹氫箟涓�涓仮澶嶇姸鎬佺殑鍑芥暟
+      const resetState = () => {
+        that.isSubmitting = false;
+        document.body.classList.remove('submitting');
+      };
       if (!that.assignFileStream.auditType==null || that.assignFileStream.auditType===undefined){
           this.$message.warning('璇烽�夋嫨澶勭悊绫诲瀷锛�')
           return false;
@@ -262,6 +290,10 @@
       }
       // 瑙﹀彂琛ㄥ崟楠岃瘉
       this.form.validateFields((err, values) => {
+        if (err) {
+          resetState(); // 楠岃瘉澶辫触锛屾仮澶嶇姸鎬�
+          return;
+        }
         if (!err) {
           that.confirmLoading = true;
           let url=this.url.auditGuideCardBatch
@@ -285,9 +317,15 @@
             }else{
               that.$message.warning(res.message);
             }
-          }).finally(() => {
-            that.confirmLoading = false;
           })
+            .catch((error) => {
+              console.error(error);
+              that.$message.error('鎻愪氦澶辫触');
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+              resetState(); // 璇锋眰缁撴潫锛屾仮澶嶇姸鎬�
+            });
         }
       })
     },
@@ -317,6 +355,45 @@
 }
 </script>
 <style scoped>
+/* 鍏ㄥ眬绂侀�夋牱寮� - 浣滅敤浜庢暣涓〉闈� */
+html.submitting,
+html.submitting body {
+  pointer-events: none !important;
+  cursor: wait !important;
+}
+
+/* 钂欏眰鏁堟灉澧炲己 */
+html.submitting::before {
+  content: '';
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(255, 255, 255, 0.5);
+  z-index: 9998;
+}
+
+/* 鍔犺浇鎸囩ず鍣� - 鏇存槑鏄剧殑瑙嗚鍙嶉 */
+html.submitting::after {
+  content: '鎻愪氦涓�...';
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  background: #1890ff;
+  color: white;
+  padding: 10px 20px;
+  border-radius: 4px;
+  z-index: 9999;
+}
+
+/* 绂佺敤鐘舵�佹寜閽牱寮� */
+.disabled-btn {
+  opacity: 0.6;
+  cursor: not-allowed !important;
+}
+
 .shallow-hr {
   border: 0;
   height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */
diff --git a/src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleForm.vue b/src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleForm.vue
index a883bcc..5da0304 100644
--- a/src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleForm.vue
+++ b/src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleForm.vue
@@ -146,9 +146,8 @@
               httpAction(url,flowTaskVo,method).then((res)=>{
                 if(res.success){
                   that.$message.success(res.message);
-                  that.valid = false
-                  //鍒锋柊琛ㄦ牸
-                  that.$emit('searchReset')
+                  that.visible = false;
+                  that.$emit('searchReset');
                 }else{
                   that.$message.warning(res.message);
                 }
diff --git a/src/views/flowable/workflow/guideCardBatch/GuideCardBatchHandle.vue b/src/views/flowable/workflow/guideCardBatch/GuideCardBatchHandle.vue
index b8172eb..6899a2e 100644
--- a/src/views/flowable/workflow/guideCardBatch/GuideCardBatchHandle.vue
+++ b/src/views/flowable/workflow/guideCardBatch/GuideCardBatchHandle.vue
@@ -144,8 +144,20 @@
             </a-col>
           </a-row>
           <div class="table-operator" style="text-align: right;">
-            <a-button  @click="handleQueXiaoTask" type="primary" icon="close">鍙栨秷</a-button>
-            <a-button @click="submitForm">鎻� 浜�</a-button>
+            <a-button
+              @click="handleQueXiaoTask"
+              icon="close"
+              :disabled="isSubmitting"
+              :class="{'disabled-btn': isSubmitting}"
+            >鍙栨秷</a-button>
+            <a-button
+              @click="submitForm"
+              type="primary"
+              :disabled="isSubmitting"
+              :loading="isSubmitting"
+            >
+              鎻� 浜�
+            </a-button>
           </div>
         </a-form-model>
       </div>
@@ -214,7 +226,8 @@
       },
       dictOptions: {},
       superFieldList: [],
-      workflowSource: []
+      workflowSource: [],
+      isSubmitting: false,
     }
   },
   created() {
@@ -248,12 +261,27 @@
         alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�')
       }
     },
-    handleQueXiaoTask(){
-      this.visible = false
-      this.routeReload()
+    handleQueXiaoTask() {
+      // 濡傛灉姝e湪鎻愪氦锛岄樆姝㈠彇娑堟搷浣�
+      if (this.isSubmitting) return;
+      this.visible = false;
+      this.routeReload();
     },
     submitForm () {
+      // 濡傛灉姝e湪鎻愪氦锛岄樆姝㈤噸澶嶇偣鍑�
+      if (this.isSubmitting) return;
+
+      // 寮�鍚叏灞�绂侀��
+      this.isSubmitting = true;
+      document.body.classList.add('submitting');
+
       const that = this;
+
+      // 瀹氫箟涓�涓仮澶嶇姸鎬佺殑鍑芥暟
+      const resetState = () => {
+        that.isSubmitting = false;
+        document.body.classList.remove('submitting');
+      };
       if (!that.assignFileStream.status==null || that.assignFileStream.status===undefined){
           this.$message.warning('璇烽�夋嫨澶勭悊绫诲瀷锛�')
           return false;
@@ -267,6 +295,10 @@
       }
       // 瑙﹀彂琛ㄥ崟楠岃瘉
       this.form.validateFields((err, values) => {
+        if (err) {
+          resetState(); // 楠岃瘉澶辫触锛屾仮澶嶇姸鎬�
+          return;
+        }
         if (!err) {
           that.confirmLoading = true;
           let url=this.url.auditGuideCardBatch
@@ -301,9 +333,15 @@
             }else{
               that.$message.warning(res.message);
             }
-          }).finally(() => {
-            that.confirmLoading = false;
           })
+            .catch((error) => {
+              console.error(error);
+              that.$message.error('鎻愪氦澶辫触');
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+              resetState(); // 璇锋眰缁撴潫锛屾仮澶嶇姸鎬�
+            });
         }
       })
     },
@@ -333,6 +371,44 @@
 }
 </script>
 <style scoped>
+/* 鍏ㄥ眬绂侀�夋牱寮� - 浣滅敤浜庢暣涓〉闈� */
+html.submitting,
+html.submitting body {
+  pointer-events: none !important;
+  cursor: wait !important;
+}
+
+/* 钂欏眰鏁堟灉澧炲己 */
+html.submitting::before {
+  content: '';
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(255, 255, 255, 0.5);
+  z-index: 9998;
+}
+
+/* 鍔犺浇鎸囩ず鍣� - 鏇存槑鏄剧殑瑙嗚鍙嶉 */
+html.submitting::after {
+  content: '鎻愪氦涓�...';
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  background: #1890ff;
+  color: white;
+  padding: 10px 20px;
+  border-radius: 4px;
+  z-index: 9999;
+}
+
+/* 绂佺敤鐘舵�佹寜閽牱寮� */
+.disabled-btn {
+  opacity: 0.6;
+  cursor: not-allowed !important;
+}
 .shallow-hr {
   border: 0;
   height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */
diff --git a/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue b/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue
index 623b81f..972be29 100644
--- a/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue
+++ b/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue
@@ -354,8 +354,10 @@
       }
     },
     handleQueXiaoTask() {
-      this.visible = false
-      this.routeReload()
+      // 濡傛灉姝e湪鎻愪氦锛岄樆姝㈠彇娑堟搷浣�
+      if (this.isSubmitting) return;
+      this.visible = false;
+      this.routeReload();
     },
     submitForm() {
       // 濡傛灉姝e湪鎻愪氦锛岄樆姝㈤噸澶嶇偣鍑�

--
Gitblit v1.9.3