From 2bcd2e34b928daf86ecb1c478a7b8a54fd698c7e Mon Sep 17 00:00:00 2001 From: DESKTOP-9BNTV8O <DESKTOP-9BNTV8O@163.com> Date: 星期一, 30 十二月 2024 19:11:00 +0800 Subject: [PATCH] 修改问题 --- HTML/views/WareHouseSetting/Pallets.html | 222 +++++++++++-------------------------------------------- 1 files changed, 44 insertions(+), 178 deletions(-) diff --git a/HTML/views/WareHouseSetting/Pallets.html b/HTML/views/WareHouseSetting/Pallets.html index a7a3e9b..0433e85 100644 --- a/HTML/views/WareHouseSetting/Pallets.html +++ b/HTML/views/WareHouseSetting/Pallets.html @@ -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,29 @@ 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 + }; + 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 +280,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