From e34f379c22862982c20376c952ab56f9c4ccb163 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期二, 25 六月 2024 08:08:04 +0800
Subject: [PATCH] 修改controller

---
 HTML/views/StatisticalReport/BoxInfor.html |   98 ++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 84 insertions(+), 14 deletions(-)

diff --git a/HTML/views/StatisticalReport/BoxInfor.html b/HTML/views/StatisticalReport/BoxInfor.html
index 55b4d25..c1b8bc1 100644
--- a/HTML/views/StatisticalReport/BoxInfor.html
+++ b/HTML/views/StatisticalReport/BoxInfor.html
@@ -190,18 +190,30 @@
                         {{#  } else if(d.BitPalletMark == '1') { }}
                             <p>鏄�</p>
                         {{# } }}
-						<script type="text/html" id="InspectPalletStatus">
-							{{#  if(d.PalletStatus=='0'){ }}
-								<p>鍑�妗�</p>
-							{{#  } else if(d.PalletStatus == '1') { }}
-								<p>棰勬贩</p>
-							{{# } else if(d.PalletStatus == '2') { }}
-								<p>鍗婃垚鍝�</p>
-							{{# } else if(d.PalletStatus == '3') { }}
-								<p>鑴忔《</p>
-							{{# }  }}
-						</script>
                     </script>
+					<script type="text/html" id="InspectPalletStatus">
+						{{# function GetBtn11(d){
+							var html = ``;
+							if(d.PalletStatus=='0'){ 
+								html = `鍑�妗禶; 
+							} else if(d.PalletStatus=='1') { 
+								html = `棰勬贩`; 
+							} else if(d.PalletStatus=='2') { 
+								html = `鍗婃垚鍝乣; 
+							}else if(d.PalletStatus=='3') { 
+								html = `鑴忔《`; 
+							}
+							return html;
+						}	
+					}}
+					{{ GetBtn11(d) }}
+					</script>
+					<script type="text/html" id="toolbarDemo">
+
+						<button class="layui-btn layuiadmin-btn-list layui-btn-sm  addClass" lay-event="add">
+							<i class="layui-icon">&#xe654;</i>娣诲姞
+						</button>
+					</script>
 				</div>
 			</div>
 		</div>
@@ -331,11 +343,11 @@
 				var TotalColsArr = [[
 					{field: '',title: '搴忓彿',type:'numbers',align: 'center',fixed: 'left', "disabled": true},
 					{field: 'WareHouseName', title: '鎵�灞炰粨搴�', align: 'center'},
-					{field: 'RoadwayName', title: '鎵�灞炲贩閬�', align: 'center'},
+					//{field: 'RoadwayName', title: '鎵�灞炲贩閬�', align: 'center'},
                     {field: 'AreaName', title: '鎵�灞炲尯鍩�', align: 'center'},
                     {field: 'LocatNo', title: '鍌ㄤ綅鍦板潃', align: 'center'},
                     {field: 'PalletNo', title: '鎵樼洏鍙�', align: 'center'},
-					{field: 'PalletStatus', title: '鎵樼洏鐘舵��', align: 'center', templet: '#InspectPalletStatus'},
+					{field: 'PalletStatus', title: '鎵樼洏绫诲埆', align: 'center', templet: '#InspectPalletStatus'},
                     {field: 'SkuNo', title: '鐗╂枡缂栫爜', align: 'center'},
                     {field: 'SkuName', title: '鐗╂枡鍚嶇О', align: 'center'},
 					//{field: 'OwnerNo',title: '璐т富缂栫爜',align: 'center'},
@@ -378,6 +390,8 @@
 							limit: pageCnt,
 							limits: pageLimits,
 							even: true,
+							toolbar: '#toolbarDemo',
+							defaultToolbar: [''], //'print', 'exports'
 							cellMinWidth: 80, //鍏ㄥ眬瀹氫箟甯歌鍗曞厓鏍肩殑鏈�灏忓搴︼紝layui 2.2.1 鏂板
 							done: function(){
 								//鑷畾涔夊垪瀹�
@@ -423,7 +437,63 @@
 						});
 					});
 					//#endregion                    
-                }                
+                }     
+				
+				//澶村伐鍏锋爮浜嬩欢
+				table.on('toolbar(LAY-app-content-list)', function (obj) {
+					var checkStatus = table.checkStatus(obj.config.id);
+					if (obj.event == "add") {
+						layer.open({
+							type: 2,
+							title: '娣诲姞鎵樼洏搴撳瓨鏄庣粏',
+							content: 'PalletAddFrom.html',
+							maxmin: true,
+							area: ['530px', '530px'],
+							btn: ['纭畾', '鍙栨秷'],
+							yes: function(index, layero) {
+								var iframeWindow = window['layui-layer-iframe' + index],
+									submitID = 'layuiadmin-app-form-submit',
+									submit = layero.find('iframe').contents().find('#' + submitID);
+								//鐩戝惉鎻愪氦
+								iframeWindow.layui.form.on('submit(' + submitID + ')', function(data) {
+									var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈�
+									//鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹�
+									var param = {
+										PalletNo:field.PalletNo,//鎵樼洏鐮�
+										WareHouseNo: field.WareHouseNo, //鎵�灞炰粨搴�
+										AreaNo: field.AreaNo, //鎵�灞炲尯鍩�
+										LocatNo:field.LocatNo,//鎵�灞炲偍浣�
+										PalletStatus: field.PalletStatus, //鎵樼洏绫诲埆
+									};
+									if(doing){
+										doing = false;
+										sendData(IP + "/Statistical/InsertStockDetail", param, 'post',function(res) {
+											console.log(res);
+											if (res.code == 0) { //鎴愬姛
+												layer.msg(res.msg, {
+													icon: 1,
+													time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+												}, function() {
+													layer.close(index); //鍏抽棴寮瑰眰
+													refreshTable("","","","","","","","","","","","","","");
+													doing = true;
+												});
+											}
+											else
+											{ //涓嶆垚鍔�
+												layer.msg(res.msg, {
+													icon: 2,
+													time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+												}, function() {doing = true;});
+											}
+										});
+									}
+								});
+								submit.trigger('click');
+							}
+						});
+					}
+				});
 
 				//鐩戝惉鎼滅储
 				form.on('submit(LAY-app-contlist-search)', function(data) {

--
Gitblit v1.8.0