From 475fc7c0176aafe0e0833ba4dd5cab9fd5c18160 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期三, 03 十二月 2025 15:26:37 +0800
Subject: [PATCH] 1

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js"
index a3e70ed..38f5145 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js"
@@ -235,6 +235,7 @@
     const mountNode = document.createElement('div');
     document.body.appendChild(mountNode);
 
+    const boxCodeReg = /^[A-Z]\d{9}$/;
     // 鍝嶅簲寮忚〃鍗曟暟鎹細鏂欑鐮侊紙蹇呭~锛屾壂鐮佹灙/鎵嬪姩杈撳叆锛�
     const formData = reactive({ 
       boxCode: '',
@@ -269,15 +270,23 @@
     // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫锛堜緵鍥炶溅瑙﹀彂鍜屾寜閽偣鍑诲叡鐢級
     const submitForm = async () => {
       const formRef = vnode.component.refs.batchInForm;
+
+      if (!boxCodeReg.test(formData.boxCode.trim())) {
+        ElMessage.warning('鏂欑鐮佹牸寮忛敊璇�');
+        selectBoxCodeInput();
+        return;
+      }
+      
       try {
         // 鎵ц琛ㄥ崟鏍¢獙锛堟枡绠辩爜蹇呭~锛�
         await formRef.validate();
       } catch (err) {
-        ElMessage.warning('璇疯緭鍏ユ湁鏁堢殑鏂欑鐮�');
+        const errorMsg = err?.[0]?.message || '璇疯緭鍏ユ湁鏁堢殑鏂欑鐮�';
+        ElMessage.warning(errorMsg);
+        selectBoxCodeInput();
         return;
       }
 
-      
       http.post('/api/InboundOrder/EmptyMaterielGroup', {
         palletCode: formData.boxCode.trim(),
         warehouseCode:formData.warehouseCode
@@ -333,7 +342,8 @@
         model: formData,
         rules: {
           boxCode: [
-            { required: true, message: '璇疯緭鍏ユ枡绠辩爜', trigger: ['blur', 'enter'] }
+            { required: true, message: '璇疯緭鍏ユ枡绠辩爜', trigger: ['blur', 'change'] },
+            { pattern: boxCodeReg, message: '鏂欑鐮佹牸寮忛敊璇�', trigger: ['blur', 'change'] }
           ],
           warehouseCode:[
             { required: true, message: '璇烽�夋嫨鍖哄煙', trigger: ['change', 'blur'] }

--
Gitblit v1.9.3