From 3e7b82e73d972972bab8c67dac7a5a6078f30a8b Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期五, 18 七月 2025 13:33:14 +0800
Subject: [PATCH] 修改问题

---
 HTML/views/WareHouseSetting/Pallets.html |  225 +++++++++++--------------------------------------------
 1 files changed, 46 insertions(+), 179 deletions(-)

diff --git a/HTML/views/WareHouseSetting/Pallets.html b/HTML/views/WareHouseSetting/Pallets.html
index a7a3e9b..0f767ef 100644
--- a/HTML/views/WareHouseSetting/Pallets.html
+++ b/HTML/views/WareHouseSetting/Pallets.html
@@ -29,7 +29,7 @@
 				<div class="layui-form layui-card-header layuiadmin-card-header-auto" style="border-bottom:1px solid #CCC" id="top">
 					<div class="layui-form-item">
 						<div class="layui-inline">
-							<label class="layui-form-label" style="width: 70px;">鎵樼洏鏉$爜锛�</label>
+							<label class="layui-form-label" style="width: 70px;">妗舵潯鐮侊細</label>
 							<div class="layui-input-inline">
 								<input type="text" id="PalletNo" name="PalletNo" placeholder="鎵樼洏鏉$爜" autocomplete="off" class="layui-input">
 							</div>
@@ -145,11 +145,11 @@
 							fixed: 'left'
 						}, {
 							field: 'PalletNo',
-							title: '鎵樼洏鏉$爜',
+							title: '妗跺彿',
 							align: 'center',
 						}, {
 							field: 'Status',
-							title: '鏉$爜鐘舵��',
+							title: '妗剁姸鎬�',
 							align: 'center',
 							templet:function(d){
 								switch (d.Status) {
@@ -179,13 +179,15 @@
 							templet:function(d){
 								return formatDate(d.LastUse);
 							}
-						}, {
-							title: '鎿嶄綔',
-							fixed: 'right',
-							width: 220,
-							align: 'center',
-							toolbar: '#table-content-list'
-						}]
+						}
+						// , {
+						// 	title: '鎿嶄綔',
+						// 	fixed: 'right',
+						// 	width: 220,
+						// 	align: 'center',
+						// 	toolbar: '#table-content-list'
+						// }
+					]
 					],
 				});
 				//鐩戝惉鎼滅储
@@ -220,15 +222,13 @@
 						}, function() {});
 					}
 				});
-
-
-				 
+ 
 				
 				var	active = {
 					add: function() {
 						layer.open({
 							type: 2,
-							title: '鎵撳嵃鎵樼洏鏉$爜',
+							title: '娣诲姞妗跺彿',
 							content: 'PalletsPrintFrom.html',
 							maxmin: true,
 							area: ['600px', '300px'],
@@ -242,31 +242,30 @@
 									var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈�
 									console.log(field);
 									if (isTrue = true) {
-										isTrue = false;
-									
-										var html = "";
-										var xun = 0;
-										document.getElementById('print').innerHTML="";
-										for(var i=0;i<field.GroupCount;i++){
-											
-											for(var j=0;j<field.SameCount;j++){
-												html ="<div class=\"layui-form\" lay-filter=\"layuiadmin-app-form-list\" id=\"print\" style=\"width: 50%; text-align: center;padding-top: 10%;margin-left: 0%;\">\n"+
-												"<div class=\"layui-form-item\">\n"+
-												"<div class=\"layui-inline\">\n"+
-												"<div class=\"\">\n"+
-												"<img  id=\"imgBar\" width=\"245px\" height=\"120px\"/></div>\n"+
-												"</div>\n"+
-												"</div>\n"+
-												"</div>\n"+
-												"<div style=\"page-break-after: always;\"></div>\n"+
-												"</div>" ;	
-												document.getElementById('print').innerHTML+=html;
-												document.getElementById('imgBar').id="imgBar"+xun;
-												xun+=1
+										isTrue = false;									
+																			
+										var param = {
+											PalletNo:field.StockCode,
+											LocatNo:field.LocatNo,
+											DeviceCode:field.DeviceCode
+										};
+										synData(IP + "/Sys/AddPallets", param, 'post', function(res) {
+											console.log(res);
+											if (res.code == 0) { //鎴愬姛
+												layer.msg("娣诲姞鎴愬姛", {
+													icon: 1,
+													time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+												}, function() {
+													layer.close(index);
+												});
+												
+											} else{
+												layer.msg(res.msg, {
+													icon: 2,
+													time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+												}, function() {});
 											}
-										}
-										GetimgBar(field.StockCode,field.GroupCount,field.SameCount);
-										layer.close(index);
+										});
 									}	
 								});  
 								submit.trigger('click');
@@ -282,162 +281,30 @@
 					var type = $(this).data('type');
 					active[type] ? active[type].call(this) : '';
 				});
-				//鑾峰彇娣诲姞鏉″舰鐮�
-				function GetimgBar(StockCode,GroupCount,SameCount){
-					var param = {
-						PalletNo:StockCode,
-						GroupCount: parseInt(GroupCount),
-						SameCount:parseInt(SameCount),
-					};
-					console.log(param);
-					synData(IP + "/Sys/GetImgBar", param, 'post', function(res) {
-						console.log(res);
-						if (res.code == 0) { //鎴愬姛
-							for(var i=0;i<res.data.length;i++){
-								$("#"+"imgBar"+i).attr("src", res.data[i]);
-							}
-							
-							AddPallets(StockCode,GroupCount);
-						} else { //涓嶆垚鍔�
-							layer.msg(res.msg, {
-								icon: 2,
-								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-							}, function() {});
-						}
-					});
-					
-				};
+				
 				//娣诲姞鏉″舰鐮�
-				function AddPallets(StockCode,GroupCount){
+				function AddPallets(StockCode,LocatNo){
 					//鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹�
 					var param = {
-						GroupCount:parseInt(GroupCount),
+						PalletNo:StockCode,
+						LocatNo:LocatNo
 					};
 					synData(IP + "/Sys/AddPallets", param, 'post', function(res) {
 						console.log(res);
 						if (res.code == 0) { //鎴愬姛
-							$("#print").print();
-							
-						} else if(res.code == 1){
-							layer.msg(res.msg, {
+							layer.msg("娣诲姞鎴愬姛", {
 								icon: 2,
 								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 							}, function() {});
-						} else { //涓嶆垚鍔�
-							layer.msg(res.statusText, {
+							
+						} else{
+							layer.msg(res.msg, {
 								icon: 2,
 								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 							}, function() {});
 						}
 					});
-				};
-				//鑾峰彇琛ユ墦鏉″舰鐮�
-				function GetimgBar1(StockCode,GroupCount,SameCount){
-					
-					var param = {
-						PalletNo:StockCode,
-						GroupCount:parseInt(GroupCount),
-						SameCount:parseInt(SameCount),
-					};
-					synData(IP + "/Sys/GetImgBarReprint", param, 'post', function(res) {
-						console.log(res);
-						
-						if (res.code == 0) { //鎴愬姛
-							var ok=false;
-							for(var i=0;i<res.data.length;i++){
-								$("#"+"imgBar"+i).attr("src", res.data[i]);	
-								if(i==(res.data.length-1)){
-									ok=true;
-								}
-							}
-							if(ok){
-								$("#print").print();
-							}
-						} else { //涓嶆垚鍔�
-							layer.msg(res.msg, {
-								icon: 2,
-								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-							}, function() {});
-						}
-					})
-				};
-				 
-				table.on('tool(LAY-app-content-list)', function(obj) {
-					var data = obj.data;
-					if (obj.event === 'edit') {
-						layer.open({
-							type: 2,
-							title: '鎵樼洏鏃堕棿绾�',
-							content: 'PalletsTimeLine.html?PalletNo=' +  data.PalletNo,
-							maxmin: true,
-							area: ['700px', '650px'],
-							btn: ['纭畾', '鍙栨秷'],
-							yes: function(index, layero){
-								layer.close(index); //鍏抽棴寮瑰眰
-							}
-						});
-					}
-					if (obj.event === 'print') {
-						PalletNo = data.PalletNo; 
-						
-						layer.open({
-							type: 2,
-							title: '鎵撳嵃鎵樼洏鏉$爜',
-							content: 'PalletsPrintFrom.html?PalletNo='+PalletNo,
-							maxmin: true,
-							area: ['600px', '300px'],
-							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; //鑾峰彇鎻愪氦鐨勫瓧娈�
-									console.log(field);
-									var html = "";
-									var xun = 0;
-									var isOk = false;
-									document.getElementById('print').innerHTML="";
-								
-									for(var i=0;i<parseInt(field.GroupCount);i++){
-										
-										for(var j=0;j<parseInt(field.SameCount);j++){
-											html ="<div class=\"layui-form\" lay-filter=\"layuiadmin-app-form-list\" id=\"print\" style=\"width: 50%; text-align: center;padding-top: 10%;margin-left: 0%;\">\n"+
-												"<div class=\"layui-form-item\">\n"+
-												"<div class=\"layui-inline\">\n"+
-												"<div class=\"\">\n"+
-												"<img  id=\"imgBar\" width=\"245px\" height=\"120px\" /></div>\n"+
-												"</div>\n"+
-												"</div>\n"+
-												"</div>\n"+
-												"<div style=\"page-break-after: always;\"></div>\n"+
-												"</div>" ;	
-												document.getElementById('print').innerHTML+=html;
-												document.getElementById('imgBar').id="imgBar"+xun;
-												xun+=1	
-												
-										}
-										
-										if(i==(parseInt(field.GroupCount)-1)){
-											isOk= true;
-										}
-									}
-									if(isOk){
-										GetimgBar1(field.StockCode,field.GroupCount,field.SameCount);
-									} 
-								});  
-							  submit.trigger('click');
-							},
-							end:function(){ 
-								location.reload();
-								return false;
-							}
-						
-						});
-					}
-				});
-				
+				};						
 				
 			});
 		</script>

--
Gitblit v1.8.0