From 557f7f6079c30cd6fe8d6005cea3d89468bbcd31 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期一, 09 三月 2026 09:23:13 +0800
Subject: [PATCH] 代码优化

---
 项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/DirectOutbound.vue |   71 +++++++++++++++++++++++++++++++++--
 1 files changed, 66 insertions(+), 5 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/DirectOutbound.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/DirectOutbound.vue"
index d19763c..07127fa 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/DirectOutbound.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/DirectOutbound.vue"
@@ -1,4 +1,7 @@
 <template>
+    <!-- 鍏ㄥ眬閬僵灞傦細鍦ㄨ姹傚鐞嗘椂鏄剧ず -->
+    <div class="mask-layer" v-if="loading"></div>
+    
     <vol-box v-model="show" title="鐩存帴鍑哄簱" :width="800" :height="1200">
         <template #content>
             <el-form ref="form" :model="form" label-width="90px">
@@ -18,7 +21,7 @@
         </template>
         <template #footer>
             <div>
-                <el-button type="danger" size="small" plain @click="submit">
+                <el-button type="danger" size="small" plain @click="submit" :loading="loading">
                     <i class="el-icon-check">纭</i>
                 </el-button>
                 <el-button size="small" type="primary" plain @click="() => { this.show = false }">
@@ -48,6 +51,8 @@
             orderNo: "",
             keys: [],
             isBatch: "",
+            loading: false, // 鎺у埗閬僵鍜屾寜閽姞杞界姸鎬�
+            form: {} // 琛ュ厖鍘熶唬鐮佷腑鏈畾涔夌殑form
         }
     },
     methods: {
@@ -59,9 +64,19 @@
             if (params.isBatch == 1) {
                 this.outboundQuantity = params.outboundQuantity
             }
-
         },
         submit() {
+            // 楠岃瘉蹇呭~椤�
+            if (!this.station) {
+                this.$message.warning("璇烽�夋嫨鍑哄簱鍖哄煙");
+                return;
+            }
+            if (this.isBatch === 1 && !this.outboundQuantity) {
+                this.$message.warning("璇峰~鍐欏嚭搴撴暟閲�");
+                return;
+            }
+            
+            this.loading = true; // 鎵撳紑閬僵鍜屽姞杞界姸鎬�
             this.$emit('parentCall', ($vue) => {
                 const requestParams = {
                     detailIds: this.keys,
@@ -74,17 +89,63 @@
                 console.log(requestParams);
                 this.http.post("api/Outbound/ProcessPickingOutbound", requestParams, '鏁版嵁澶勭悊涓�...')
                     .then((x) => {
+                        this.loading = false; // 鍏抽棴閬僵鍜屽姞杞界姸鎬�
                         if (!x.status) {
                             this.$message.error(x.message)
                         } else {
                             this.show = false
-                            this.$Message.success(x.message)
-                            $vue.refresh();
+                            this.$message.success(x.message) // 淇$Message涓�$message
+                            
+                            // 淇鏍稿績锛氬畨鍏ㄨ皟鐢╮efresh鏂规硶
+                            if ($vue && typeof $vue.refresh === 'function') {
+                                $vue.refresh();
+                            } else {
+                                // 澶囬�夋柟妗堬細濡傛灉鐖剁粍浠舵病鏈塺efresh鏂规硶锛岃Е鍙戣嚜瀹氫箟浜嬩欢閫氱煡鍒锋柊
+                                this.$emit('needRefresh');
+                                console.warn('鐖剁粍浠舵湭瀹氫箟refresh鏂规硶锛屽凡瑙﹀彂needRefresh浜嬩欢');
+                            }
                         }
+                    })
+                    .catch((error) => {
+                        this.loading = false; // 寮傚父鏃朵篃瑕佸叧闂伄缃�
+                        this.$message.error("璇锋眰澶辫触锛�" + (error.message || "鏈煡閿欒"));
+                        console.error("璇锋眰寮傚父锛�", error);
                     })
             })
         },
     }
 }
 </script>
-  
\ No newline at end of file
+
+<style scoped>
+/* 閬僵灞傛牱寮� */
+.mask-layer {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100vw;
+    height: 100vh;
+    background-color: rgba(0, 0, 0, 0.5); /* 鍗婇�忔槑榛戣壊閬僵 */
+    z-index: 9999; /* 纭繚閬僵鍦ㄦ渶涓婂眰锛堥珮浜庡脊绐楋級 */
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    pointer-events: auto; /* 闃绘鐐瑰嚮閬僵涓嬫柟鐨勫唴瀹� */
+}
+
+/* 鍔犺浇鍔ㄧ敾 */
+.mask-layer::after {
+    content: "";
+    width: 40px;
+    height: 40px;
+    border: 4px solid #ffffff;
+    border-top: 4px solid #409eff;
+    border-radius: 50%;
+    animation: spin 1s linear infinite;
+}
+
+@keyframes spin {
+    0% { transform: rotate(0deg); }
+    100% { transform: rotate(360deg); }
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3