From 9b6ad3e202d43f47729fa8e91ca5ccc871c8c4b9 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期三, 03 十二月 2025 10:57:06 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/PickingRetuenPallet.vue             |   15 +++++
 项目代码/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue                     |   14 ++++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js                    |   16 ++++-
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue                          |   21 ++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs          |   16 +----
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs               |   45 +++++++++++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs |    4 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs                 |    2 
 项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue              |   24 +++++++-
 项目代码/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue                       |   14 ++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs                 |    4 
 11 files changed, 150 insertions(+), 25 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'] }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
index db36e69..290038c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
@@ -169,6 +169,7 @@
   data() {
     return {
       palletVisible: this.visible,
+      trayBarcodeReg:/^[A-Z]\d{9}$/,
       trayBarcode: '',
       barcode: '',
       materials: [],
@@ -209,9 +210,16 @@
             trigger: 'change'
           }
         ],
+        trayBarcode:[
+          {
+            pattern: this.trayBarcodeReg,
+            message: '鎵樼洏鍙锋牸寮忛敊璇紙闇�涓�1涓ぇ鍐欏瓧姣�+9涓暟瀛楋紝濡侫000008024锛�',
+            trigger: 'blur'
+         }
+        ],
         warehouseType: [
           {
-            massage: '璇烽�夋嫨浠撳簱',
+            message: '璇烽�夋嫨浠撳簱',
             trigger: 'change'
           }
         ]
@@ -516,6 +524,7 @@
           inputEl.focus();
           this.currentFocus = 'tray';
           this.scanTarget = 'tray';
+          inputEl.select();
         }
       }
     },
@@ -705,6 +714,16 @@
 
       this.error = '';
 
+      if(!this.trayBarcodeReg.test(currentTrayBarcode)){
+        ElMessage.warning({
+          message: '鎵樼洏鍙锋牸寮忛敊璇�',
+          type: 'warning',
+          duration: 3000
+        })
+        this.focusTrayInput();
+        return;
+      }
+
       // 璁剧疆鎵樼洏鏉$爜鍚庯紝鑷姩鑱氱劍鍒扮墿鏂欒緭鍏ユ
       this.focusBarcodeInput();
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/PickingRetuenPallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/PickingRetuenPallet.vue"
index a99859c..4aa4e57 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/PickingRetuenPallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/PickingRetuenPallet.vue"
@@ -169,6 +169,7 @@
   data() {
     return {
       palletVisible: this.visible,
+      trayBarcodeReg: /^[A-Z]\d{9}$/,
       trayBarcode: '',
       barcode: '',
       materials: [],
@@ -209,6 +210,13 @@
             trigger: 'change'
           }
         ],
+        trayBarcode: [
+        {
+          pattern: /^[A-Z]\d{9}$/,
+          message: '鎵樼洏鍙锋牸寮忛敊璇�',
+          trigger: 'blur'
+        }
+      ],
         warehouseType: [
           {
             massage: '璇烽�夋嫨浠撳簱',
@@ -516,6 +524,7 @@
           inputEl.focus();
           this.currentFocus = 'tray';
           this.scanTarget = 'tray';
+          inputEl.select();
         }
       }
     },
@@ -705,6 +714,12 @@
 
       this.error = '';
 
+      if (!this.trayBarcodeReg.test(currentTrayBarcode)) {
+        ElMessage.error('鎵樼洏鏉$爜鏍煎紡閿欒');
+        this.focusTrayInput();
+        return;
+      }
+
       // 璁剧疆鎵樼洏鏉$爜鍚庯紝鑷姩鑱氱劍鍒扮墿鏂欒緭鍏ユ
       this.focusBarcodeInput();
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue"
index 4e388a9..5db787b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue"
@@ -2,6 +2,14 @@
   <vol-box v-model="show" title="绌烘墭鍑哄簱" :width="800" :height="600">
     <template #content>
       <el-form ref="form" :model="form" label-width="90px">
+        <el-form-item label="鍑哄簱鍖哄煙:">
+          <el-select v-model="locationType" placeholder="璇烽�夋嫨鍑哄簱鍖哄煙">
+            <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc.toString()" :value="item.locationType">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <el-form ref="form" :model="form" label-width="90px">
         <el-form-item label="鍑哄簱鏁伴噺:">
           <el-select v-model="num" placeholder="璇烽�夋嫨鍑哄簱鏁伴噺">
             <el-option v-for="item in 6" :key="item" :label="item.toString()" :value="item">
@@ -32,16 +40,19 @@
   data() {
     return {
       num: 1,
-      show: false
+      show: false,
+      locationTypes: [],
+      locationType:"",
     }
   },
   methods: {
     open() {
       this.show = true
+      this.getData();
     },
     submit() {
       this.$emit('parentCall', ($vue) => {
-        this.http.post(`/api/Task/PalletOutboundTask?num=${this.num}`, {}, '鏁版嵁澶勭悊涓�...')
+        this.http.post(`/api/Task/PalletOutboundTask?num=${this.num}&locationType=${this.locationType}`, {}, '鏁版嵁澶勭悊涓�...')
           .then((x) => {
             if (!x.status) {
               this.$message.error(x.message)
@@ -52,7 +63,14 @@
             }
           })
       })
-    }
+    },
+
+    getData() {
+      this.http.post("api/LocationInfo/GetLocationTypes",null, "鏌ヨ涓�")
+        .then((x) => {
+          this.locationTypes = x.data;
+        })
+    },
   }
 }
 </script>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue"
index 33c7454..7015bbe 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue"
@@ -174,6 +174,20 @@
         bind: { key: "createType", data: [] },
       },
       {
+        field: "fromWarehouse",
+        title: "璋冨嚭浠撳簱",
+        type: "string",
+        width: 120,
+        align: "left",
+      },
+      {
+        field: "toWarehouse",
+        title: "璋冨叆浠撳簱",
+        type: "string",
+        width: 120,
+        align: "left",
+      },
+      {
         field: "factoryArea",
         title: "鍘傚尯",
         type: "string",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue"
index 555ac55..2a9a15e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue"
@@ -194,6 +194,20 @@
         bind: { key: "createType", data: [] },
       },
       {
+        field: "fromWarehouse",
+        title: "璋冨嚭浠撳簱",
+        type: "string",
+        width: 120,
+        align: "left",
+      },
+      {
+        field: "toWarehouse",
+        title: "璋冨叆浠撳簱",
+        type: "string",
+        width: 120,
+        align: "left",
+      },
+      {
         field: "factoryArea",
         title: "鍘傚尯",
         type: "string",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
index 2a28e3e..f29e43e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
@@ -439,6 +439,51 @@
             }
         }
 
+        public override PageGridData<Dt_AllocateOrder> GetPageData(PageDataOptions options)
+        {
+            string wheres = ValidatePageOptions(options);
+            //鑾峰彇鎺掑簭瀛楁
+            Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties);
+            List<OrderByModel> orderByModels = new List<OrderByModel>();
+            foreach (var item in orderbyDic)
+            {
+                OrderByModel orderByModel = new()
+                {
+                    FieldName = item.Key,
+                    OrderByType = item.Value
+                };
+                orderByModels.Add(orderByModel);
+            }
+
+
+            int totalCount = 0;
+            List<SearchParameters> searchParametersList = new List<SearchParameters>();
+            if (!string.IsNullOrEmpty(options.Wheres))
+            {
+                try
+                {
+                    searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
+                    options.Filter = searchParametersList;
+                }
+                catch { }
+            }
+            var data = BaseDal.Db.Queryable<Dt_AllocateOrder>()
+                .WhereIF(!wheres.IsNullOrEmpty(), wheres)
+                .OrderBy(orderByModels)
+                .ToPageList(options.Page, options.Rows, ref totalCount);
+            
+            foreach (var item in data)
+            {
+                Dt_InboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == item.UpperOrderNo).First();
+                if (_InboundOrder != null)
+                {
+                    item.OrderStatus = _InboundOrder.OrderStatus;
+                    item.OrderType = _InboundOrder.OrderType;
+                }
+            }
+            return new PageGridData<Dt_AllocateOrder>(totalCount, data);
+        }
+
         public override PageGridData<Dt_InboundOrderDetail> GetDetailPage(PageDataOptions options)
         {
             string wheres = ValidatePageOptions(options);
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
index dc46b43..9b161d1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
@@ -139,7 +139,7 @@
 
                 throw new HttpRequestException(body);
             }
-
+            _logger.LogInformation("InvokeMESService  FeedbackOutbound  body:  " + body);
 
             return JsonConvert.DeserializeObject<ResponseModel>(body);
         }
@@ -489,7 +489,7 @@
                     business_type = outboundOrder.BusinessType,
                     factoryArea = outboundOrder.FactoryArea,
                     operationType = 1,
-                    Operator = outboundOrder.Operator,
+                    Operator = outboundOrder.Operator!=""? outboundOrder.Operator:App.User.UserName,
                     orderNo = outboundOrder.UpperOrderNo,
                     documentsNO = documentNo,
                     status = outboundOrder.OrderStatus,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
index 8afc055..7f01bf2 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
@@ -40,7 +40,7 @@
 
         Task<WebResponseContent> RequestInboundTask(string palletCode, string stationCode);
 
-        Task<WebResponseContent> PalletOutboundTask(int num);
+        Task<WebResponseContent> PalletOutboundTask(int num, int locationType);
 
         Task<WebResponseContent> TaskCompleted(string taskNum);
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index 639255c..db099ac 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -31,20 +31,19 @@
         /// </summary>
         /// <param name="inTask"></param>
         /// <returns></returns>
-        public async Task<WebResponseContent> PalletOutboundTask(int num)
+        public async Task<WebResponseContent> PalletOutboundTask(int num, int locationType)
         {
             WebResponseContent content = new WebResponseContent();
             try
             {
-                var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()).ToList();
+                var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()).WhereIF(locationType != 0, x => x.LocationType == locationType).Take(num).ToList();
 
                 if (stockInfos.Count() == 0)
                 {
                     return WebResponseContent.Instance.Error("鏈壘鍒扮┖鎵樼洏搴撳瓨");
                 }
-                for (int i = 0; i < num; i++)
+                foreach (var stockInfo in stockInfos)
                 {
-                    var stockInfo = stockInfos.Where(x=>x.StockStatus != StockStatusEmun.鍑哄簱閿佸畾.ObjToInt()).FirstOrDefault();
                     Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
                     if (locationInfo == null)
                     {
@@ -107,16 +106,7 @@
                     var result = await _eSSApiService.CreateTaskAsync(esstask);
 
                     _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
-                    if (result)
-                    {
-                        return WebResponseContent.Instance.OK(200);
-                    }
-                    else
-                    {
-                        return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
-                    }
                 }
-
                 return content.OK("绌烘墭鍑哄簱鎴愬姛!");
             }
             catch (Exception ex)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
index 96353d4..a8b86b7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
@@ -56,9 +56,9 @@
         }
 
         [HttpPost, Route("PalletOutboundTask"), AllowAnonymous, MethodParamsValidate]
-        public async Task<WebResponseContent> PalletOutboundTask(int num)
+        public async Task<WebResponseContent> PalletOutboundTask(int num, int locationType)
         {
-            return  await Service.PalletOutboundTask(num);
+            return  await Service.PalletOutboundTask(num, locationType);
         }
 
 

--
Gitblit v1.9.3