From 82b238214db913000a12fc037c5e0f101a7b9d73 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 27 六月 2025 10:47:30 +0800
Subject: [PATCH] 修改工作流

---
 src/views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue |  146 +++++++++++++++++++++++++++++++++---------------
 1 files changed, 101 insertions(+), 45 deletions(-)

diff --git a/src/views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue b/src/views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue
index 4fb9b29..ee3e296 100644
--- a/src/views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue
+++ b/src/views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue
@@ -17,7 +17,7 @@
         <br>
         <br>
         <a-tag color="blue">
-          澶勭悊浜� {{ selectShenpiData.assignee }}
+          澶勭悊浜� {{ selectShenpiData.assignee_dictText }}
         </a-tag>
         <a-tag color="blue">
           鍒涘缓鏃堕棿 {{ selectShenpiData.createTime }}
@@ -37,7 +37,7 @@
           <a-spin :spinning="spinning">
             <a-tabs default-active-key='1' @change='callback'>
               <a-tab-pane key='1' tab='鐢宠鍩烘湰淇℃伅'>
-                <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'>
+                <a-form-model ref='form' :model='tableRowRecord'>
                   <a-row>
                     <a-col :span='span'>
                       <a-form-model-item label='鍑哄簱鍗曠紪鍙�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='outNum'>
@@ -53,7 +53,7 @@
                   <a-row>
                     <a-col :span='span'>
                       <a-form-model-item label='鍑哄簱鏃堕棿' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='outboundTime'>
-                        <j-date :disabled="coldisabled" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" v-model="tableRowRecord.outboundTime"/>
+                        <j-date :disabled="coldisabled" v-model="tableRowRecord.outboundTime" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" style="width: 100%"/>
                       </a-form-model-item>
                     </a-col>
                     <a-col :span='span'>
@@ -65,7 +65,7 @@
                   <a-row>
                     <a-col :span='span'>
                       <a-form-model-item label='缁忔墜浜�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='handler'>
-                        <j-select-user-by-dep :disabled='coldisabled' v-model="tableRowRecord.handler" :store="'id'" :text="'realname'" :multi="false"/>
+                        <a-input :disabled='coldisabled' v-model='tableRowRecord.handler_dictText'></a-input>
                       </a-form-model-item>
                     </a-col>
                     <a-col :span='span'>
@@ -107,7 +107,7 @@
           </a-spin>
         </a-form>
       </div>
-      <div>
+      <div v-if="auditVisible">
         <hr class="shallow-hr">
         <br>
         <b>瀹℃壒璇︽儏</b>
@@ -126,18 +126,33 @@
             </a-col>
             <a-col :span="24" class="btxx">
               <a-form-item label="瀹℃壒鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                <j-dict-select-tag  type='list' v-model='assignFileStream.status' dictCode='dnc_assign_stream_status' placeholder="璇烽�夋嫨瀹℃壒鐘舵��"  />
+                <a-select v-model='assignFileStream.status' placeholder="璇烽�夋嫨瀹℃壒缁撴灉">
+                  <a-select-option value="3">閫氳繃</a-select-option>
+                  <a-select-option value="4">椹冲洖</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :span="24" class="btxx">
               <a-form-model-item  label="瀹℃壒鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                <a-textarea v-model="assignFileStream.approveContent" rows="4" placeholder="璇疯緭鍏ュ鎵规剰瑙�"/>
+                <a-textarea v-model="assignFileStream.approvalOpinion" rows="4" placeholder="璇疯緭鍏ュ鎵规剰瑙�"/>
               </a-form-model-item >
             </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>
@@ -176,9 +191,9 @@
       hitaskDataSource:[],
       dataSource: [],
       bomForm: {},
-      approveContent:"",
       imageSrc: null,
       drawerVisible: true,
+      auditVisible: true,
       loading: false,
       labelCol: {
         xs: { span: 24 },
@@ -278,26 +293,6 @@
         }
       ],
       validatorRules: {
-        version: {
-          rules: [
-            { required: true, message: '璇疯緭鍏ユ枃妗g増鏈�!'},
-          ]
-        },
-        applyUser: {
-          rules: [
-            { required: true, message: '璇烽�夋嫨鐢宠浜�!'},
-          ]
-        },
-        approveContent: {
-          rules: [
-            { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!'},
-          ]
-        },
-        docName: {
-          rules: [
-            { required: true, message: '璇疯緭鍏ユ枃妗e悕绉�!'},
-          ]
-        },
         status: {
           rules: [
             { required: true, message: '璇烽�夋嫨瀹℃壒鐘舵��!'},
@@ -313,14 +308,14 @@
       url: {
         queryOutBoundOrder: '/tms/outboundOrder/queryById',
         queryOutBoundDetailList: '/tms/outboundOrder/listOutboundDetailByMainId',
-        queryBomDataById: '/nc/activit/selectVoById',
         diagramView: '/assign/flow/diagramView',
         queryHisTaskList:'/assign/flow/queryHisTaskList',
-        approve:"/nc/activit/assign/file/approve",
+        approve:"/tms/outboundOrder/approval",
       },
       dictOptions: {},
       superFieldList: [],
-      workflowSource: []
+      workflowSource: [],
+      isSubmitting: false,
     }
   },
   created() {
@@ -330,6 +325,7 @@
     callback() {
     },
     handCancel() {
+      this.assignFileStream = {}
       this.visible = false
     },
     clearTableSource() {
@@ -354,31 +350,49 @@
         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;
       }
-      if (!that.assignFileStream.approveContent==null || that.assignFileStream.approveContent===undefined) {
+      if (!that.assignFileStream.approvalOpinion==null || that.assignFileStream.approvalOpinion===undefined) {
         this.$message.warning('璇疯緭鍏ュ鎵规剰瑙侊紒')
         return false;
       }
       // 瑙﹀彂琛ㄥ崟楠岃瘉
       this.form.validateFields((err, values) => {
+        if (err) {
+          resetState(); // 楠岃瘉澶辫触锛屾仮澶嶇姸鎬�
+          return;
+        }
         if (!err) {
           that.confirmLoading = true;
           let url=this.url.approve
           let method = 'post';
           let flowTaskVo = {}
           flowTaskVo.status=that.assignFileStream.status;
-          flowTaskVo.approveContent =that.assignFileStream.approveContent;
-          flowTaskVo.comment =that.assignFileStream.approveContent;
-          flowTaskVo.secretLevel = that.assignFileStream.secretLevel;
+          flowTaskVo.approvalOpinion =that.assignFileStream.approvalOpinion;
+          flowTaskVo.comment =that.assignFileStream.approvalOpinion;
           flowTaskVo.dataId = this.selectShenpiData.dataId
           flowTaskVo.taskId = this.selectShenpiData.id
           flowTaskVo.userId = this.selectShenpiData.assignee
@@ -386,22 +400,26 @@
           flowTaskVo.targetKey = this.selectShenpiData.taskDefKey
           flowTaskVo.values = this.selectShenpiData.variables
           flowTaskVo.assignee = this.selectShenpiData.assignee
-          flowTaskVo.secretLevel = that.assignFileStream.secretLevel;
           console.log("琛ㄥ崟鎻愪氦鏁版嵁",flowTaskVo)
           httpAction(url,flowTaskVo,method).then((res)=>{
             if(res.success){
               that.$message.success(res.message);
-              that.visible = false
+              this.handCancel()
               //鍒锋柊琛ㄦ牸
               that.$emit('searchReset')
             }else{
               that.$message.warning(res.message);
             }
-          }).finally(() => {
-            that.confirmLoading = false;
           })
+            .catch((error) => {
+              console.error(error);
+              that.$message.error('鎻愪氦澶辫触');
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+              resetState(); // 璇锋眰缁撴潫锛屾仮澶嶇姸鎬�
+            });
         }
-
       })
     },
     getAllApproveData(item) {
@@ -438,6 +456,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; /* 鍒嗙晫绾跨殑楂樺害 */

--
Gitblit v1.9.3