From 76b08b437e41cb6a3118c87636bc1777a110185a Mon Sep 17 00:00:00 2001 From: chengsc <11752@DESKTOP-DS49RCP> Date: 星期六, 18 一月 2025 11:44:06 +0800 Subject: [PATCH] 修改异常问题 --- HTML/views/WareHouseSetting/Locate.html | 164 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 138 insertions(+), 26 deletions(-) diff --git a/HTML/views/WareHouseSetting/Locate.html b/HTML/views/WareHouseSetting/Locate.html index 8daa3d2..e6a1d3f 100644 --- a/HTML/views/WareHouseSetting/Locate.html +++ b/HTML/views/WareHouseSetting/Locate.html @@ -18,11 +18,11 @@ }); </script> </head> - <body> + <body id="body"> <div class="layui-fluid" style="padding-bottom: 0;"> <div class="layui-card"> - <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="border-bottom:1px solid #CCC"> + <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: 60px;">鎵�灞炰粨搴�</label> @@ -117,6 +117,7 @@ </div> </div> </div> + <div id="center"></div> <div class="layui-card-body"> <table id="LAY-app-content-list" lay-filter="LAY-app-content-list" style="width: 100%;"></table> <script type="text/html" id="table-content-list"> @@ -147,20 +148,16 @@ layer = layui.layer, $ = layui.$; var houseid = 0; + var h1 = GetTableHeight(); // 琛ㄥ崟闇�瑕佺殑鍙橀噺 var doing = true; active = { - + editList: function () { - var checkStatus = table.checkStatus('LAY-app-content-list'), - checkData = checkStatus.data; //寰楀埌閫変腑鐨勬暟鎹� - if (checkData.length === 0) { - return layer.msg('璇烽�夋嫨鏁版嵁'); - } layer.open({ type: 2, title: '缂栬緫鍌ㄤ綅鐘舵�侀泦鍚�', - content: 'LocateFrom.html', + content: 'LocateEditArea.html', maxmin: true, area: ['560px', '510px'], btn: ['纭畾', '鍙栨秷'], @@ -172,23 +169,23 @@ iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) { var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈� console.log(field); - var msg = []; - for (var i = 0; i < checkData.length; i++) { - // msg.push(checkData[i].Id); - msg.push(checkData[i].Id) - } - console.log(msg); - + //鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹� var param = { - Id: msg, + RoadWayNo: field.RoadwayNo, + AreaNo:field.AreaNo, + Row:parseInt(field.Row), + Column:parseInt(field.Column), + Layer: parseInt(field.Layer), + Dept:parseInt(field.Depth), Status:field.Status, Flag:field.Flag, - Temperature:field.Temp + }; + console.log(param); if (doing) { doing = false; - sendData(IP + "/Sys/EditStorageLocatList", param, 'post', function (res) { + sendData(IP + "/Sys/EditStorageLocatListNew", param, 'post', function (res) { console.log(res); if (res.code == 0) { //鎴愬姛 layer.msg(res.msg, { @@ -216,13 +213,115 @@ } }); } - - //$.ajax({}); }); submit.trigger('click'); } }); } + + // editList: function () { + // var checkStatus = table.checkStatus('LAY-app-content-list'), + // checkData = checkStatus.data; //寰楀埌閫変腑鐨勬暟鎹� + // if (checkData.length === 0) { + // return layer.msg('璇烽�夋嫨鏁版嵁'); + // } + // else if(checkData.length > 1) + // { + // var li = 0; + // var ping = 0; + // var WareNo = "W01"; + // checkData.forEach(item => { + // if (item.WareHouseName == "鍔涜绔嬩綋搴�") + // { + // li += 1; + // WareNo = "W01"; + // if (ping > 0) + // { + // return; + // } + // } + // if (item.WareHouseName == "鍔涜骞冲簱") + // { + // ping += 1; + // WareNo = "W02"; + // if (li > 0) + // { + // return; + // } + // } + // }); + // if (li != 0 && ping != 0) + // { + // return layer.msg('璇峰嬁閫夋嫨澶氱浠撳簱锛�'); + // } + // } + + // layer.open({ + // type: 2, + // title: '缂栬緫鍌ㄤ綅鐘舵�侀泦鍚�', + // content: 'LocateFrom.html?WareHouseNo='+WareNo, + // maxmin: true, + // area: ['560px', '510px'], + // 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 msg = []; + // for (var i = 0; i < checkData.length; i++) { + // // msg.push(checkData[i].Id); + // msg.push(checkData[i].Id) + // } + // console.log(msg); + + // //鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹� + // var param = { + // Id: msg, + // Status:field.Status, + // Flag:field.Flag, + // Temperature:field.Temp + // }; + // if (doing) { + // doing = false; + // sendData(IP + "/Sys/EditStorageLocatList", param, 'post', function (res) { + // console.log(res); + // if (res.code == 0) { //鎴愬姛 + // layer.msg(res.msg, { + // icon: 1, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function () { + // tableIns.reload({ + // page: { + // curr: 1 + // } + // }); + // layer.close(index); //鍏抽棴寮瑰眰 + // doing = true; + // }); + // } else if(res.code == 1){ + // layer.msg(res.msg, { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function() {doing = true;}); + // } else { //涓嶆垚鍔� + // layer.msg(res.statusText, { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function() {doing = true;}); + // } + // }); + // } + + // //$.ajax({}); + // }); + // submit.trigger('click'); + // } + // }); + // } }; $('.layui-btn.layuiadmin-btn-list').on('click', function () { var type = $(this).data('type'); @@ -242,7 +341,7 @@ console.log(where); var tableIns = table.render({ elem: '#LAY-app-content-list', - height: 'full-135', + height: h1, id: 'LAY-app-content-list', url: IP + "/Sys/GetStorageLocatList", method: 'post', @@ -291,17 +390,29 @@ title: '鎵�灞炰粨搴�', align: 'center', width: 140, - fixed: 'left' + fixed: 'left', + templet: function(d) { + + return d.WareHouseNo + '-' + d.WareHouseName; + } }, { field: 'RoadwayNo', title: '鎵�灞炲贩閬�', align: 'center', width: 130, + templet: function(d) { + + return d.RoadwayNo + '-' + d.RoadwayName; + } }, { field: 'AreaName', title: '鎵�灞炲尯鍩�', align: 'center', width: 130, + templet: function(d) { + + return d.AreaNo + '-' + d.AreaName; + } }, { field: 'LocatNo', title: '鍌ㄤ綅缂栫爜', @@ -407,7 +518,8 @@ Id: id, Status:field.Status, Flag:field.Flag, - Temperature:field.Temp + Temperature:field.Temp, + Area:field.AreaNo }; sendData(IP + "/Sys/EditStorageLocat", param, 'post', function(res) { console.log(res); @@ -470,7 +582,7 @@ $("#RoadwayNo").append('<option value =""></option>'); if (res.code == 0) { //鎴愬姛 for (var i = 0; i < res.data.length; i++) { - $("#RoadwayNo").append('<option value =' + res.data[i].RoadwayNo + '>' + res.data[i].WareHouseNo + '-' + + $("#RoadwayNo").append('<option value =' + res.data[i].RoadwayNo + '>' + res.data[i].RoadwayNo + '-' + res.data[i].RoadwayName + '</option>'); } form.render('select'); @@ -490,7 +602,7 @@ $("#AreaNo").append('<option value =""></option>'); if (res.code == 0) { //鎴愬姛 for (var i = 0; i < res.data.length; i++) { - $("#AreaNo").append('<option value =' + res.data[i].AreaNo + '>' + res.data[i].WareHouseNo + '-' + + $("#AreaNo").append('<option value =' + res.data[i].AreaNo + '>' + res.data[i].AreaNo + '-' + res.data[i].AreaName + '</option>'); } form.render('select'); -- Gitblit v1.8.0