From dbfd38c9f09c0d057c1f762e808a741081ff7dcf Mon Sep 17 00:00:00 2001
From: test <15284381150@163.com>
Date: 星期一, 22 九月 2025 18:11:41 +0800
Subject: [PATCH] 托盘明细备注

---
 HTML/js/public.js                              |    2 
 Wms/WMS.BLL/DataServer/StockDetailServer.cs    |   32 ++++++++++
 Wms/Wms/Controllers/StatisticalController.cs   |   35 +++++++++++
 HTML/views/StatisticalReport/BoxInfor.html     |   62 ++++++++++++++++++++
 Wms/WMS.IBLL/IDataServer/IStockDetailServer.cs |    1 
 5 files changed, 129 insertions(+), 3 deletions(-)

diff --git a/HTML/js/public.js b/HTML/js/public.js
index ff31e00..8cca1df 100644
--- a/HTML/js/public.js
+++ b/HTML/js/public.js
@@ -2,7 +2,7 @@
 // var IP = "http://172.16.71.101:8082/";//鎺ュ彛IP
 //var IP = "http://localhost:13243/api";
 //var IP = "http://localhost:50515/api";  //鏈湴
-var IP="https://localhost:44363/api";
+var IP="https://localhost:5001/api";
 // var IP = "http://localhost:44318/api";
 //var IP = "http://192.168.1.6:8017";
 //var IP = "http://192.168.1.226:8086";  
diff --git a/HTML/views/StatisticalReport/BoxInfor.html b/HTML/views/StatisticalReport/BoxInfor.html
index 9ab7017..fbac037 100644
--- a/HTML/views/StatisticalReport/BoxInfor.html
+++ b/HTML/views/StatisticalReport/BoxInfor.html
@@ -169,7 +169,14 @@
 							</select>
 						</div>
 					</div>
-
+					<!-- 缁存姢澶囨敞寮规 -->
+					<div class="layui-inline" id="divEditDemo" style="display: none; padding-top: 10px;">
+						<label class="layui-form-label">澶囨敞</label>
+						<div class="layui-input-inline" style="width: 300px;height: 100%;">
+							<textarea placeholder="璇疯緭鍏ュ唴瀹�" id="NoticeDemo" name="NoticeDemo"
+								class="layui-textarea"></textarea>
+						</div>
+					</div>
 
 					<div class="layui-inline sousuo">
 						<button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
@@ -318,6 +325,13 @@
                             <i class="layui-icon layui-icon-edit"></i>璇︽儏
                         </button>
                     </script>
+					<!-- 娣诲姞澶囨敞鎸夐挳 -->
+					<script type="text/html" id="toolbarDemo1">
+
+						<a class="layui-btn layui-btn-normal layui-btn-xs editDemoClass" lay-event="editDemo">
+						  <i class="layui-icon layui-icon-edit"></i>澶囨敞
+						</a>
+					  </script>
 			</div>
 		</div>
 	</div>
@@ -412,7 +426,9 @@
 				{ field: 'OwnerName', title: '璐т富鍚嶇О', align: 'center', width: 100, },
 				{ field: 'SupplierNo', title: '渚涘簲鍟嗙紪鐮�', align: 'center', width: 100, },
 				{ field: 'SupplierName', title: '渚涘簲鍟嗗悕绉�', align: 'center', width: 100, },
-
+				{ field: 'SupplierName', title: '渚涘簲鍟嗗悕绉�', align: 'center', width: 100, },
+				{ field: 'SupplierName', title: '澶囨敞', align: 'center', width: 100, },
+				{ field: 'caozuo', title: '鎿嶄綔', fixed: 'right', width: 280, align: 'center', toolbar: '#toolbarDemo1', "disabled": true }
 
 			]];
 			var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜
@@ -592,7 +608,49 @@
 			}
 
 			//var url = IP + "/Statistical/GetInventoryList1";
+			table.on('tool(LAY-app-content-list)', function (obj) {
+				var data = obj.data;
+				switch (obj.event) {
+					case "editDemo":
+						$('#NoticeDemo').val(data.Demo);
+						layer.open({
+							type: 1,
+							title: '缁存姢澶囨敞',
+							content: $('#divEditDemo'),
+							maxmin: false,
+							area: ['420px', '260px'],
+							btn: ['纭畾', '鍙栨秷'],
+							yes: function (index, layero) {
+								var demo = $('#NoticeDemo').val();
+								var param = {
+									id: data.Id,
+									demo: demo,
+								};
+								sendData(IP + "/Statistical/EditStockDetailDemo", param, 'get', function (res) {
+									if (res.code == 0) { //鎴愬姛
+										refreshTable();
+										layer.msg(res.msg, {
+											icon: 1,
+											time: 1500 //1绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+										}, function () {
 
+										});
+									} else { //涓嶆垚鍔�
+										layer.msg(res.msg, {
+											icon: 2,
+											time: 3000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+										}, function () {
+											refreshTable();
+										});
+									}
+									layer.close(index);
+								});
+							}
+						});
+						break;
+					default: break;
+				}
+			});
 
 
 			//鎺ュ彈鍏ㄥ眬鍙橀噺
diff --git a/Wms/WMS.BLL/DataServer/StockDetailServer.cs b/Wms/WMS.BLL/DataServer/StockDetailServer.cs
index 3d94e2f..410570c 100644
--- a/Wms/WMS.BLL/DataServer/StockDetailServer.cs
+++ b/Wms/WMS.BLL/DataServer/StockDetailServer.cs
@@ -6,6 +6,7 @@
 using SqlSugar;
 using WMS.BLL.LogServer;
 using WMS.DAL;
+using WMS.Entity.BllAsnEntity;
 using WMS.Entity.BllQualityEntity;
 using WMS.Entity.Context;
 using WMS.Entity.DataEntity;
@@ -200,7 +201,38 @@
 
             return boxInforList;
         }
+        /// <summary>
+        /// 鎵樼洏鏄庣粏澶囨敞
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="demo"></param>
+        /// <param name="userId"></param>
+        /// <exception cref="Exception"></exception>
+        public void EditStockDetailDemo(int id, string demo, int userId)
+        {
+            try
+            {
+                var detail = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.Id == id);
+                if (detail == null)
+                {
+                    throw new Exception("鏈煡璇㈠埌搴撳瓨鏄庣粏淇℃伅");
+                }
+                detail.Demo = demo + "".Trim();
+                detail.UpdateUser = userId;
+                detail.UpdateTime = DateTime.Now;
 
+                int i = Db.Updateable(detail).ExecuteCommand();
+                if (i > 0)
+                {
+                    //娣诲姞鎿嶄綔鏃ュ織
+                    new OperationASNServer().AddLogOperationAsn("搴撳瓨缁熻", "鎵樼洏鏄庣粏", detail.PalletNo, "缂栬緫", $"缂栬緫浜嗘墭鐩樺彿涓簕detail.PalletNo}鐨勫娉ㄤ俊鎭�", userId);
+                }
+            }
+            catch (Exception ex)
+            {
+                throw new Exception(ex.Message);
+            }
+        }
 
         #endregion
 
diff --git a/Wms/WMS.IBLL/IDataServer/IStockDetailServer.cs b/Wms/WMS.IBLL/IDataServer/IStockDetailServer.cs
index 3074347..42c6f4b 100644
--- a/Wms/WMS.IBLL/IDataServer/IStockDetailServer.cs
+++ b/Wms/WMS.IBLL/IDataServer/IStockDetailServer.cs
@@ -27,6 +27,7 @@
             string boxNo, string status, string inspectMark, string bitPalletMark, string bitBoxMark, 
             string inspectStatus, string ownerNo, string ownerName, string startTime, string endTIme, 
             string WareHouseNo, string AreaNo);
+        void EditStockDetailDemo(int id, string demo, int userId);
 
         /// <summary>
         /// 瀵煎嚭鎵樼洏鏄庣粏
diff --git a/Wms/Wms/Controllers/StatisticalController.cs b/Wms/Wms/Controllers/StatisticalController.cs
index 0d14d91..21ace0d 100644
--- a/Wms/Wms/Controllers/StatisticalController.cs
+++ b/Wms/Wms/Controllers/StatisticalController.cs
@@ -8,6 +8,7 @@
 using System.Security.Claims;
 using System.Threading.Tasks;
 using Model.ModelDto.SysDto;
+using WMS.BLL.LogServer;
 
 namespace Wms.Controllers
 {
@@ -122,6 +123,40 @@
             }
 
         }
+        /// <summary>
+        /// 鎵樼洏鏄庣粏澶囨敞
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="demo"></param>
+        /// <param name="userId"></param>
+        /// <exception cref="Exception"></exception>
+        [HttpGet]
+        public IActionResult EditStockDetailDemo(int id, string demo)
+        {
+            try
+            {
+                var claimsIdentity = this.User.Identity as ClaimsIdentity;
+                if (claimsIdentity == null)
+                {
+                    throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+                }
+                string userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+                if (string.IsNullOrWhiteSpace(userId))
+                {
+                    throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+                }
+
+                _stockDetail.EditStockDetailDemo(id, demo, int.Parse(userId));
+
+
+                return Ok(new { code = 0, msg = "缂栬緫澶囨敞鎴愬姛" });
+
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
 
         /// <summary>
         /// 鑾峰彇绠辩爜鏄庣粏

--
Gitblit v1.8.0