From d741e7a7ad7de5045e5c6b6145d9da1783cadecd Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 13 一月 2026 09:55:03 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215

---
 项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue |  629 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 485 insertions(+), 144 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue"
index 252da58..157c95f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue"
@@ -5,59 +5,139 @@
       :lazy="true"
       width="65%"
       :padding="20"
-      title="鏃犲簱瀛樺嚭搴�"
+      title="铏氭嫙鍑哄叆搴�"
       class="custom-vol-box"
     >
+      <!-- 鎻愪氦閬僵灞傦細瑕嗙洊鏁翠釜寮圭獥鍐呭鍖哄煙 -->
+      <div class="submit-mask" v-show="submitLoading">
+        <div class="mask-content">
+          <el-loading-spinner class="loading-icon" />
+          <span class="loading-text">姝e湪鎻愪氦鍑哄簱锛岃绋嶅��...</span>
+        </div>
+      </div>
+
       <div>
+        <!-- 鍗曟嵁杈撳叆鍖哄煙锛堟敮鎸佹壂鐮侊級 -->
+        <el-form 
+          :inline="true" 
+          :model="orderForm" 
+          style="margin-bottom: 20px; align-items: flex-end;"
+          @submit.prevent
+        >
+          <el-form-item label="鍑哄簱鍗曟嵁:" name="outboundOrderNo">
+            <el-input
+              v-model="orderForm.outboundOrderNo"
+              placeholder="璇疯緭鍏ユ垨鎵弿鍑哄簱鍗曟嵁鍙�"
+              clearable
+              style="width: 220px; margin-right: 10px;"
+              @input="handleOutboundInput"
+              @keyup.enter="validateOutboundOrder"
+              ref="outboundInputRef"
+              :disabled="loading || submitLoading"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="閲囪喘鍗曟嵁:" name="purchaseOrderNo">
+            <el-input
+              v-model="orderForm.purchaseOrderNo"
+              placeholder="鎵爜鏉$爜鍚庤嚜鍔ㄥ~鍏�"
+              clearable
+              style="width: 220px; margin-right: 10px;"
+              @input="handlePurchaseInput"
+              readonly
+              ref="purchaseInputRef"
+              :disabled="submitLoading"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+
         <!-- 涓婃柟杈撳叆妗� -->
-        <el-form :inline="true" :model="formData" ref="formData" style="margin-bottom: 20px; align-items: flex-end;">
+        <el-form 
+          :inline="true" 
+          :model="formData" 
+          ref="formRef" 
+          style="margin-bottom: 20px; align-items: flex-end;"
+          @submit.prevent  
+        >
           <el-form-item
             label="鎵弿鏉$爜:"
             style="width: 80%"
-            prop="barcode"
+            name="barcode"
+            :rules="[{ required: true, message: '璇锋壂鎻忔垨杈撳叆鏉$爜', trigger: 'blur' }]"
           >
             <el-input
-              ref="barcodeInput"
+              ref="barcodeInputRef"
               v-model="formData.barcode"
               placeholder="璇蜂娇鐢ㄦ壂鐮佹灙鎵弿鏉$爜锛屾垨鎵嬪姩杈撳叆"
-              @keyup.enter="handleScan"
+              @keydown.enter="debouncedHandleScan" 
               autofocus
               class="custom-input"
+              :disabled="!orderForm.outboundOrderNo || loading || submitLoading"
             ></el-input>
           </el-form-item>
           <el-form-item>
-            <el-button type="primary" size="small" @click="handleScan" class="custom-button">
-              <i class="el-icon-search"></i> 纭鎵弿
+            <el-button 
+              type="primary" 
+              size="small" 
+              @click="handleScan" 
+              class="custom-button"
+              :disabled="!orderForm.outboundOrderNo || loading || submitLoading"
+            >
+              <Search /> 纭鎵弿
             </el-button>
           </el-form-item>
         </el-form>
 
-        <!-- 涓嬫柟鏄剧ず妗� -->
+        <!-- 涓嬫柟鏄剧ず妗嗭紙鐩存帴娓叉煋鍚庣杩斿洖鐨勬暟缁勶級 -->
         <div class="scan-list">
           <el-card shadow="hover" style="margin-bottom: 10px; border: none;" class="custom-card">
             <div class="card-header">
               <span class="header-title">宸叉壂鎻忔潯鐮佸垪琛紙鍏眥{ scannedBarcodes.length }}鏉★級</span>
-              <el-button
-                class="clear-all-btn"
-                @click="clearAll"
-                :disabled="scannedBarcodes.length === 0"
-              >娓呯┖鎵�鏈�</el-button>
             </div>
             <div class="card-body">
               <el-scrollbar height="400px" class="custom-scrollbar">
-                <!-- 浣跨敤 transition-group 鍖呰9浠ュ疄鐜板姩鐢� -->
                 <transition-group name="barcode-item-transition">
-                  <div class="barcode-item" v-for="(barcode, index) in scannedBarcodes" :key="barcode" :data-index="index">
-                    <span class="barcode-text">{{ index + 1 }}. {{ barcode }}</span>
+                  <div class="barcode-item" v-for="(item, index) in scannedBarcodes" :key="`${item.barcode}-${index}`" :data-index="index">
+                    <div class="barcode-detail">
+                      <div class="detail-row">
+                        <span class="label">鏉$爜锛�</span>
+                        <span class="value">{{ item.barcode || '-' }}</span>
+                      </div>
+                      <div class="detail-row">
+                        <span class="label">鐗╂枡缂栫爜锛�</span>
+                        <span class="value">{{ item.materielCode || '-' }}</span>
+                      </div>
+                      <div class="detail-row">
+                        <span class="label">鐗╂枡鍚嶇О锛�</span>
+                        <span class="value">{{ item.materielName || '-' }}</span>
+                      </div>
+                      <div class="detail-row">
+                        <span class="label">鎵规鍙凤細</span>
+                        <span class="value">{{ item.batchNo || '-' }}</span>
+                      </div>
+                      <div class="detail-row">
+                        <span class="label">鏉$爜鏁伴噺锛�</span>
+                        <span class="value">{{ item.orderQuantity || item.quantity || 0 }}</span>
+                      </div>
+                      <div class="detail-row">
+                        <span class="label">渚涘簲鍟嗙紪鐮侊細</span>
+                        <span class="value">{{ item.supplyCode || '-' }}</span>
+                      </div>
+                      <div class="detail-row">
+                        <span class="label">閲囪喘鍗曞彿锛�</span>
+                        <span class="value">{{ item.purchaseOrderNo || '-' }}</span>
+                      </div>
+                    </div>
                     <el-button
                       class="delete-btn"
-                      @click="removeItem(index)"
-                    >鍒犻櫎</el-button>
+                      @click="removeItem(index, item.barcode)"
+                      icon="Delete"
+                      circle
+                      :disabled="loading || submitLoading"
+                    ></el-button>
                   </div>
                 </transition-group>
                 <div class="empty-tip" v-if="scannedBarcodes.length === 0">
-                  <i class="el-icon-information"></i>
-                  <span>鏆傛棤鎵弿璁板綍锛岃鎵弿鏉$爜</span>
+                  <span>鏆傛棤鎵弿璁板綍锛岃鍏堣緭鍏ュ嚭搴撳崟鎹悗鎵弿鏉$爜</span>
                 </div>
               </el-scrollbar>
             </div>
@@ -67,10 +147,26 @@
 
       <template #footer>
         <div class="footer-actions">
-          <el-button type="primary" size="small" @click="submit" :disabled="scannedBarcodes.length === 0" class="submit-btn">
-            <i class="el-icon-check"></i> 鎻愪氦鍑哄簱
+          <el-button 
+            type="primary" 
+            size="small" 
+            @click="submit" 
+            :disabled="scannedBarcodes.length === 0 || !orderForm.outboundOrderNo || loading || submitLoading" 
+            class="submit-btn"
+          >
+            <Check /> 鎻愪氦鍑哄簱
           </el-button>
-          <el-button type="text" size="small" @click="showDetailBox = false" class="cancel-btn">
+          <el-button 
+            type="text" 
+            size="small" 
+            @click="(e) => {
+              e.stopPropagation();
+              e.preventDefault();
+              showDetailBox = false;
+            }" 
+            class="cancel-btn" 
+            :disabled="loading || submitLoading"
+          >
             鍙栨秷
           </el-button>
         </div>
@@ -79,103 +175,313 @@
   </div>
 </template>
 
-<script>
+<script setup>
+import { ref, reactive, onMounted, nextTick } from 'vue';
+import { ElMessage } from 'element-plus';
+import { Search, Check } from '@element-plus/icons-vue';
+
 import VolBox from "@/components/basic/VolBox.vue";
+import http from '@/api/http';
 
-export default {
-  components: { VolBox },
-  data() {
-    return {
-      showDetailBox: false,
-      formData: {
-        barcode: "",
-      },
-      scannedBarcodes: [],
-    };
-  },
-  methods: {
-    open() {
-      this.showDetailBox = true;
-      this.scannedBarcodes = [];
-      this.formData.barcode = "";
-      this.$nextTick(() => {
-        this.$refs.barcodeInput.focus();
-      });
-    },
+// 鍝嶅簲寮忔暟鎹�
+const showDetailBox = ref(false);
+const orderForm = reactive({
+  outboundOrderNo: "",
+  purchaseOrderNo: ""
+});
+const formData = reactive({
+  barcode: "",
+});
+const scannedBarcodes = ref([]);
+const loading = ref(false);
+// 鏂板锛氭彁浜や笓灞瀕oading鐘舵�侊紝鎺у埗閬僵灞傛樉绀�
+const submitLoading = ref(false);
 
-    handleScan() {
-      const barcode = this.formData.barcode.trim();
-      if (!barcode) {
-        this.$refs.barcodeInput.focus();
-        return;
-      }
-      if (this.scannedBarcodes.includes(barcode)) {
-        this.$message.warning(`鏉$爜 ${barcode} 宸叉壂鎻忚繃锛岃鍕块噸澶嶆壂鎻廯);
-        this.formData.barcode = "";
-        this.$refs.barcodeInput.focus();
-        return;
-      }
+// 妯℃澘寮曠敤
+const formRef = ref(null);
+const barcodeInputRef = ref(null);
+const outboundInputRef = ref(null);
+const purchaseInputRef = ref(null);
 
-      this.scannedBarcodes.push(barcode);
-      this.formData.barcode = "";
+// 缁勪欢鎸傝浇鏃惰仛鐒﹀埌鍑哄簱鍗曡緭鍏ユ
+onMounted(() => {
+  nextTick(() => {
+    outboundInputRef.value?.focus();
+  });
+});
 
-      this.$nextTick(() => {
-        this.$refs.barcodeInput.focus();
-      });
-    },
-
-    removeItem(index) {
-      this.scannedBarcodes.splice(index, 1);
-    },
-
-    clearAll() {
-      this.$confirm("纭畾瑕佹竻绌烘墍鏈夋壂鎻忚褰曞悧锛�", "鎻愮ず", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning",
-      }).then(() => {
-        this.scannedBarcodes = [];
-      }).catch(() => {
-        this.$refs.barcodeInput.focus();
-      });
-    },
-
-    submit() {
-      if (this.scannedBarcodes.length === 0) {
-        this.$message.warning("璇峰厛鎵弿鑷冲皯涓�鏉℃潯鐮�");
-        this.$refs.barcodeInput.focus();
-        return;
-      }
-
-      const params = {
-        barcodes: this.scannedBarcodes,
-      };
-
-      this.http
-        .post("/api/OutboundOrder/NoStockOut", params, "鏁版嵁澶勭悊涓�...")
-        .then((res) => {
-          if (!res.status) {
-            this.$message.error(res.message);
-            this.$refs.barcodeInput.focus();
-            return;
-          }
-          this.$message.success("鍑哄簱鎴愬姛");
-          this.showDetailBox = false;
-          this.$emit("parentCall", ($vue) => {
-            $vue.refresh();
-          });
-        })
-        .catch((err) => {
-          this.$message.error(`璇锋眰澶辫触锛�${err.message || "鏈煡閿欒"}`);
-          this.$refs.barcodeInput.focus();
-        });
-    },
-  },
+// 绠�鍗曢槻鎶栧嚱鏁�
+const debounce = (fn, delay = 100) => {
+  let timer = null;
+  return (...args) => {
+    if (timer) clearTimeout(timer);
+    timer = setTimeout(() => {
+      fn.apply(this, args);
+    }, delay);
+  };
 };
+
+// 鎵撳紑寮圭獥
+const open = () => {
+  showDetailBox.value = true;
+  scannedBarcodes.value = [];
+  formData.barcode = "";
+  orderForm.outboundOrderNo = "";
+  orderForm.purchaseOrderNo = "";
+  submitLoading.value = false; // 鎵撳紑寮圭獥鏃堕噸缃彁浜oading
+  nextTick(() => {
+    outboundInputRef.value?.focus(); // 鎵撳紑寮圭獥浠嶈仛鐒﹀嚭搴撳崟杈撳叆妗�
+  });
+};
+
+/**
+ * 楠岃瘉鍑哄簱鍗曟嵁鍙风殑鏈夋晥鎬�
+ * 鏍稿績淇敼锛氶獙璇佹垚鍔熷悗鐩存帴鑱氱劍鏉$爜鎵弿妗嗭紝澶辫触鍒欒仛鐒﹀洖鍑哄簱鍗曡緭鍏ユ
+ */
+const validateOutboundOrder = async () => {
+  const outboundOrderNo = orderForm.outboundOrderNo.trim();
+  if (!outboundOrderNo) {
+    return;
+  }
+
+  try {
+    loading.value = true;
+    const res = await http.post(
+      `/api/OutboundPicking/GetAvailablePickingOrders?outOrder=`+ outboundOrderNo,
+      "楠岃瘉鍑哄簱鍗曟嵁鍙蜂腑..."
+    );
+
+    if (res.status !== true) {
+      // 楠岃瘉澶辫触锛氭竻绌鸿緭鍏ユ锛屾彁绀洪敊璇紝鑱氱劍鍥炲嚭搴撳崟杈撳叆妗�
+      orderForm.outboundOrderNo = "";
+      ElMessage.error(res.message || "鍑哄簱鍗曟嵁鍙烽獙璇佸け璐ワ紝璇锋鏌ュ崟鎹彿鏄惁姝g‘");
+      nextTick(() => {
+        outboundInputRef.value?.focus(); // 澶辫触鑱氱劍鍑哄簱鍗曡緭鍏ユ
+      });
+      return;
+    }
+
+    // 楠岃瘉鎴愬姛锛氭彁绀虹敤鎴凤紝鐩存帴鑱氱劍鏉$爜鎵弿妗嗭紙鏍稿績淇敼锛�
+    ElMessage.success("鍑哄簱鍗曟嵁鍙烽獙璇侀�氳繃");
+    nextTick(() => {
+      barcodeInputRef.value?.focus(); // 鎴愬姛鐩存帴璺宠浆鍒版潯鐮佹壂鎻忔
+    });
+  } catch (error) {
+    // 鎺ュ彛寮傚父锛氭竻绌鸿緭鍏ユ锛屾彁绀洪敊璇紝鑱氱劍鍥炲嚭搴撳崟杈撳叆妗�
+    orderForm.outboundOrderNo = "";
+    ElMessage.error(`鍑哄簱鍗曟嵁鍙烽獙璇佸紓甯革細${error.message || "缃戠粶閿欒锛岃閲嶈瘯"}`);
+    nextTick(() => {
+      outboundInputRef.value?.focus(); // 寮傚父鑱氱劍鍑哄簱鍗曡緭鍏ユ
+    });
+  } finally {
+    loading.value = false;
+  }
+};
+
+// 鍑哄簱鍗曡緭鍏ュ鐞�
+const handleOutboundInput = (value) => {
+  if (value && value.trim()) {
+    // 鍙繚鐣欏嚭搴撳崟鍙锋牸寮忛獙璇侀�昏緫
+  }
+};
+
+// 閲囪喘鍗曡緭鍏ュ鐞�
+const handlePurchaseInput = (value) => {
+  if (value && value.trim()) {
+    // 鍙繚鐣欓噰璐崟鍙锋牸寮忛獙璇侀�昏緫
+  }
+};
+
+// 鑱氱劍鏉$爜杈撳叆妗嗭紙澶嶇敤鍑芥暟锛�
+const focusBarcodeInputDirectly = () => {
+  if (orderForm.outboundOrderNo.trim()) {
+    barcodeInputRef.value?.focus();
+  } else {
+    ElMessage.warning("璇峰厛杈撳叆鏈夋晥鐨勫嚭搴撳崟鎹彿");
+  }
+};
+
+/**
+ * 鏍规嵁鏉$爜鏌ヨ閲囪喘鍗曞彿
+ */
+const getPurchaseOrderByBarcode = async (barcode) => {
+  const res = await http.post(`/api/OutboundPicking/GetPurchaseOrderByBarcode?barCode=${encodeURIComponent(barcode)}`, "鏌ヨ閲囪喘鍗曞彿涓�...");
+
+  if (res.status !== true) {
+    throw new Error(res.message || "鏌ヨ閲囪喘鍗曞彿澶辫触");
+  }
+
+  let purchaseOrderNo = '';
+  if (Array.isArray(res.data) && res.data.length > 0) {
+    purchaseOrderNo = res.data[0].purchaseOrderNo || res.data[0].orderId;
+  } else {
+    purchaseOrderNo = res.data?.purchaseOrderNo || res.data?.orderId;
+  }
+
+  return purchaseOrderNo;
+};
+
+// 鎵弿鏉$爜鏍稿績閫昏緫
+const handleScan = async () => {
+  if (!formRef.value) return;
+  await formRef.value.validateField('barcode');
+
+  const barcode = formData.barcode.trim();
+  const outboundOrderNo = orderForm.outboundOrderNo.trim();
+
+  // 鏉$爜鍘婚噸
+  const isDuplicate = scannedBarcodes.value.some(item => item.barcode === barcode);
+  if (isDuplicate) {
+    ElMessage.warning(`鏉$爜銆�${barcode}銆戝凡瀛樺湪锛屾棤闇�閲嶅鎵弿`);
+    formData.barcode = "";
+    nextTick(() => barcodeInputRef.value?.focus()); // 鍘婚噸鍚庝粛鑱氱劍鏉$爜妗�
+    return;
+  }
+
+  try {
+    loading.value = true;
+
+    // 姝ラ1锛氭煡璇㈤噰璐崟鍙�
+    const purchaseOrderNo = await getPurchaseOrderByBarcode(barcode);
+    if (purchaseOrderNo) {
+      orderForm.purchaseOrderNo = purchaseOrderNo;
+    } else {
+      ElMessage.info("鏈煡璇㈠埌璇ユ潯鐮佸搴旂殑閲囪喘鍗曞彿锛岀户缁獙璇佹潯鐮佹湁鏁堟��");
+      formData.barcode = ""; // 鏂板锛氶獙璇佸け璐ユ椂娓呯┖杈撳叆妗�
+      nextTick(() => barcodeInputRef.value?.focus()); // 鏂板锛氳仛鐒︽潯鐮佽緭鍏ユ
+    }
+
+    // 姝ラ2锛氶獙璇佹潯鐮佸苟鑾峰彇鐗╂枡淇℃伅
+    const validateRes = await http.post("/api/OutboundPicking/BarcodeValidate", {
+      outOder: outboundOrderNo,
+      inOder: purchaseOrderNo || orderForm.purchaseOrderNo,
+      barCode: barcode
+    });
+
+    if (validateRes.status === true) {
+      if (!Array.isArray(validateRes.data) || validateRes.data.length === 0) {
+        ElMessage.warning("璇ユ潯鐮侀獙璇佹垚鍔燂紝浣嗘湭杩斿洖鐗╂枡淇℃伅");
+        formData.barcode = ""; // 鏂板锛氭棤鐗╂枡淇℃伅鏃朵篃娓呯┖杈撳叆妗�
+        nextTick(() => barcodeInputRef.value?.focus()); // 鏂板锛氳仛鐒︽潯鐮佹
+      } else {
+        const newItems = validateRes.data.map(item => ({
+          barcode: item.barcode || '',
+          materielCode: item.materielCode || '',
+          materielName: item.materielName || '',
+          batchNo: item.batchNo || '',
+          orderQuantity: item.orderQuantity || item.quantity || 0,
+          supplyCode: item.supplyCode || '',
+          purchaseOrderNo: purchaseOrderNo || ''
+        }));
+        scannedBarcodes.value.push(...newItems);
+        ElMessage.success(`鎵弿鎴愬姛锛屾柊澧� ${newItems.length} 鏉$墿鏂欎俊鎭紝绱 ${scannedBarcodes.value.length} 鏉);
+        formData.barcode = "";
+      }
+    } else {
+      ElMessage.error("鎵弿澶辫触锛�" + (validateRes.message || '鏉$爜楠岃瘉澶辫触'));
+      formData.barcode = ""; // 鏂板锛氶獙璇佸け璐ユ椂娓呯┖杈撳叆妗�
+      nextTick(() => barcodeInputRef.value?.focus()); // 鏂板锛氳仛鐒︽潯鐮佽緭鍏ユ
+    }
+  } catch (error) {
+    ElMessage.error(error.message);
+    formData.barcode = ""; // 淇濈暀锛氭帴鍙e紓甯告椂娓呯┖
+    // 鏂板锛氬紓甯告椂涔熷己鍒惰仛鐒︽潯鐮佹
+    nextTick(() => barcodeInputRef.value?.focus());
+  } finally {
+    loading.value = false;
+    // 鎵弿瀹屾垚鍚庡缁堣仛鐒︽潯鐮佽緭鍏ユ锛堟柟渚胯繛缁壂鎻忥級
+    nextTick(() => {
+      barcodeInputRef.value?.focus();
+      if (barcodeInputRef.value?.input) {
+        barcodeInputRef.value.input.select = () => {};
+      }
+    });
+  }
+};
+
+// 甯﹂槻鎶栫殑鎵弿澶勭悊
+const debouncedHandleScan = debounce(async (e) => {
+  e.stopPropagation();
+  e.preventDefault();
+  await handleScan();
+}, 100);
+
+// 绉婚櫎鍗曟潯璁板綍
+const removeItem = async (index, barcode) => {
+  try {
+    loading.value = true;
+    const currentItem = scannedBarcodes.value[index];
+    const res = await http.post("/api/OutboundPicking/DeleteBarcode", {
+      outOder: orderForm.outboundOrderNo,
+      inOder: currentItem?.purchaseOrderNo || orderForm.purchaseOrderNo,
+      barCode: barcode
+    });
+
+    if (res.status === true) {
+      scannedBarcodes.value.splice(index, 1);
+      ElMessage.success("鍒犻櫎鎴愬姛");
+      if (scannedBarcodes.value.length === 0) {
+        orderForm.purchaseOrderNo = "";
+      }
+    } else {
+      ElMessage.error("鍒犻櫎澶辫触锛�" + (res.message || '鍒犻櫎澶辫触'));
+    }
+  } catch (error) {
+    ElMessage.error("鍒犻櫎鏉$爜寮傚父锛�" + error.message);
+  } finally {
+    loading.value = false;
+    // 鍒犻櫎鍚庝粛鑱氱劍鏉$爜杈撳叆妗�
+    nextTick(() => barcodeInputRef.value?.focus());
+  }
+};
+
+// 鎻愪氦鍑哄簱
+const submit = async () => {
+  if (scannedBarcodes.value.length === 0) {
+    ElMessage.warning("璇峰厛鎵弿鑷冲皯涓�鏉℃潯鐮�");
+    nextTick(() => barcodeInputRef.value?.focus()); // 鎻愪氦澶辫触鑱氱劍鏉$爜妗�
+    return;
+  }
+
+  const barcodes = scannedBarcodes.value.map(item => item.barcode);
+  const purchaseOrderNos = [...new Set(scannedBarcodes.value.map(item => item.purchaseOrderNo).filter(Boolean))];
+
+  try {
+    // 寮�鍚彁浜oading锛屾樉绀洪伄缃╁眰
+    submitLoading.value = true;
+    const res = await http.post("/api/OutboundPicking/NoStockOutSubmit", {
+      OutOderSubmit: orderForm.outboundOrderNo,
+      InOderSubmit: purchaseOrderNos.join(',') || '',
+      BarCodeSubmit: barcodes
+    });
+
+    if (res.status === true) {
+      ElMessage.success("鍑哄簱鎻愪氦鎴愬姛");
+      showDetailBox.value = false;
+      scannedBarcodes.value = [];
+      orderForm.purchaseOrderNo = "";
+    } else {
+      ElMessage.error("鍑哄簱鎻愪氦澶辫触锛�" + (res.message || '鎻愪氦澶辫触'));
+      nextTick(() => barcodeInputRef.value?.focus()); // 鎻愪氦澶辫触鑱氱劍鏉$爜妗�
+    }
+  } catch (error) {
+    ElMessage.error("鍑哄簱鎻愪氦寮傚父锛�" + error.message);
+    nextTick(() => barcodeInputRef.value?.focus()); // 寮傚父鑱氱劍鏉$爜妗�
+  } finally {
+    // 鍏抽棴鎻愪氦loading锛岄殣钘忛伄缃╁眰
+    submitLoading.value = false;
+    loading.value = false;
+  }
+};
+
+// 鏆撮湶缁欑埗缁勪欢鐨勬柟娉�
+defineExpose({
+  open
+});
 </script>
 
 <style scoped>
-/* 鍏抽敭锛氬畾涔夊垪琛ㄩ」鐨勮繃娓″姩鐢� */
+/*杩囨浮鍔ㄧ敾 */
 .barcode-item-transition-enter-active,
 .barcode-item-transition-leave-active {
   transition: all 0.3s ease;
@@ -188,9 +494,35 @@
   opacity: 0;
   transform: translateX(30px);
 }
-/* 纭繚鍒犻櫎鏃跺叾浠栧厓绱犲钩婊戜笂绉� */
 .barcode-item-transition-move {
   transition: transform 1s ease;
+}
+
+/* 鏂板锛氭彁浜ら伄缃╁眰鏍峰紡 */
+.submit-mask {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(255, 255, 255, 0.85);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  z-index: 100;
+  border-radius: inherit;
+}
+.mask-content {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 12px;
+  color: #409eff;
+  font-size: 15px;
+}
+.loading-icon {
+  font-size: 24px;
+  animation: el-loading-circle 1.5s linear infinite;
 }
 
 .scan-list {
@@ -219,71 +551,83 @@
   font-size: 15px;
   color: #333;
 }
-.clear-all-btn {
-  color: #f56c6c;
-  font-size: 13px;
-  transition: color 0.2s;
-}
-.clear-all-btn:hover {
-  color: #e53e3e;
-  background: rgba(245, 108, 108, 0.1);
-}
 
 .card-body {
   padding: 0;
 }
 
-/* 鑷畾涔夋粴鍔ㄦ潯 */
-.custom-scrollbar ::v-deep .el-scrollbar__thumb {
+.custom-scrollbar :deep(.el-scrollbar__thumb) {
   background: rgba(0, 0, 0, 0.2);
   border-radius: 4px;
   width: 4px;
 }
-.custom-scrollbar ::v-deep .el-scrollbar__bar:hover .el-scrollbar__thumb {
+.custom-scrollbar :deep(.el-scrollbar__bar:hover .el-scrollbar__thumb) {
   background: rgba(0, 0, 0, 0.3);
   width: 6px;
 }
-.custom-scrollbar ::v-deep .el-scrollbar__wrap {
+.custom-scrollbar :deep(.el-scrollbar__wrap) {
   overflow-x: hidden;
 }
 
 .barcode-item {
   display: flex;
   justify-content: space-between;
-  align-items: center;
-  padding: 10px 15px;
+  align-items: flex-start;
+  padding: 15px;
   border-bottom: 1px solid #f7f7f7;
   transition: background-color 0.2s ease;
 }
 .barcode-item:hover {
   background-color: #fafafa;
 }
-/* 涓哄鏁拌娣诲姞杞诲井鐨勮儗鏅壊锛屽寮哄彲璇绘�� */
 .barcode-item:nth-child(odd) {
-  background-color: #e1e1e1;
+  background-color: #f9f9f9;
 }
-.barcode-text {
+.barcode-detail {
   flex: 1;
+  display: grid;
+  grid-template-columns: repeat(4, 1fr);
+  gap: 8px 15px;
   font-size: 14px;
-  color: #666;
-  transition: color 0.2s;
 }
-.barcode-item:hover .barcode-text {
-  color: #409eff;
+@media (max-width: 1200px) {
+  .barcode-detail {
+    grid-template-columns: repeat(3, 1fr);
+  }
+}
+@media (max-width: 992px) {
+  .barcode-detail {
+    grid-template-columns: repeat(2, 1fr);
+  }
+}
+.detail-row {
+  display: flex;
+  align-items: center;
+}
+.label {
+  color: #999;
+  margin-right: 5px;
+  white-space: nowrap;
+}
+.value {
+  color: #666;
+  flex: 1;
+  word-break: break-all;
 }
 
 .delete-btn {
   color: #ea1919;
-  font-size: 20px;
+  font-size: 16px;
   transition: all 0.2s;
-  transform: scale(0.8);
+  opacity: 0.7;
+  margin-left: 10px;
+  flex-shrink: 0;
 }
 .barcode-item:hover .delete-btn {
   opacity: 1;
-  transform: scale(1);
 }
 .delete-btn:hover {
-  color: #f56c6c !important; /* 浣跨敤 !important 瑕嗙洊 Element UI 榛樿鏍峰紡 */
+  color: #f56c6c !important;
   background: rgba(245, 108, 108, 0.1);
 }
 
@@ -296,27 +640,25 @@
   flex-direction: column;
   align-items: center;
   justify-content: center;
+  gap: 15px;
 }
 .empty-tip i {
   font-size: 40px;
-  margin-bottom: 15px;
   color: #dcdfe6;
 }
 
-/* 鑷畾涔夎緭鍏ユ */
-.custom-input ::v-deep .el-input__inner {
+.custom-input :deep(.el-input__inner) {
   border-radius: 6px;
   border-color: #e4e7ed;
   transition: all 0.3s;
   height: 36px;
   line-height: 36px;
 }
-.custom-input ::v-deep .el-input__inner:focus {
+.custom-input :deep(.el-input__inner:focus) {
   border-color: #409eff;
   box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
 }
 
-/* 鑷畾涔夋寜閽� */
 .custom-button {
   border-radius: 6px;
   height: 36px;
@@ -355,7 +697,6 @@
 </style>
 
 <style>
-/* ... (鍏ㄥ眬鏍峰紡閮ㄥ垎淇濇寔涓嶅彉) ... */
 .text-button:hover {
   background-color: #f0f9eb !important;
 }

--
Gitblit v1.9.3