From cfdbd0eadeb5dbe4ff8872bb67f43ae8f323a799 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期一, 13 十月 2025 09:35:13 +0800
Subject: [PATCH] 优化入库单导入功能

---
 Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs |    3 ++-
 Wms/Wms/Controllers/BllAsnController.cs         |    4 ++++
 HTML/views/ASNSetting/ArrivalNotice.html        |   13 ++++++-------
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/HTML/views/ASNSetting/ArrivalNotice.html b/HTML/views/ASNSetting/ArrivalNotice.html
index da7278e..a0462ac 100644
--- a/HTML/views/ASNSetting/ArrivalNotice.html
+++ b/HTML/views/ASNSetting/ArrivalNotice.html
@@ -140,7 +140,7 @@
 					</div>
 
 					<div class="layui-inline">
-						<button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
+						<button id="searchBtn" class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
 							lay-filter="LAY-app-contlist-search">
 							<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>鎼滅储
 						</button>
@@ -689,17 +689,16 @@
 							var param = {
 								"ListArrivalNotice": noticeList,
 							}
-							console.log('param:'+param)
+							//console.log('param:'+param)
 							layer.load();//鎵撳紑loading
 							sendData(IP + "/BllAsn/ImportArrivalNotice", param, 'post', function (res) {
-								console.log(res);
 								layer.closeAll(); //鍏抽棴loading
 								if (res.code == 0) { //鎴愬姛
 									layer.msg(res.msg, {
 										icon: 1,
 										time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 									}, function () {
-										refreshTable();
+										$('#searchBtn').click();
 										doing = true
 									});
 								} else { //涓嶆垚鍔�
@@ -707,12 +706,12 @@
 										layer.msg("瀵煎叆鏁版嵁鏍煎紡鏈夎锛�", {
 											icon: 2,
 											time: 3000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-										}, function () { refreshTable(); doing = true });
+										}, function () { $('#searchBtn').click(); doing = true });
 									} else {
 										layer.msg(res.msg, {
 											icon: 2,
-											time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-										}, function () { refreshTable(); doing = true });
+											time: 3000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+										}, function () { $('#searchBtn').click(); doing = true });
 									}
 								}
 							});
diff --git a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
index 2c91721..cadc2e7 100644
--- a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -536,8 +536,9 @@
                             }
                         }
                     }
-                    catch
+                    catch(Exception ex)
                     {
+                        throw new Exception($"鐗╂枡缂栫爜锛歿model.AsnDetail[0].SkuNo},鐗╂枡鍚嶇О锛歿model.AsnDetail[0].SkuName}锛屽鍏ュけ璐ワ細"+ex.Message);
                         // ignored
                     }
                 }
diff --git a/Wms/Wms/Controllers/BllAsnController.cs b/Wms/Wms/Controllers/BllAsnController.cs
index f9aa4a9..59cb896 100644
--- a/Wms/Wms/Controllers/BllAsnController.cs
+++ b/Wms/Wms/Controllers/BllAsnController.cs
@@ -172,6 +172,10 @@
         {
             try
             {
+                if (models.ListArrivalNotice.Count > 50)
+                {
+                    throw new Exception("鍗曟瀵煎叆鏈�澶�50鏉℃暟鎹�");
+                }
                 var claimsIdentity = this.User.Identity as ClaimsIdentity;
                 if (claimsIdentity == null)
                 {

--
Gitblit v1.8.0