From bdd84cc48ba7b2527584c44d174da8e7d20c5375 Mon Sep 17 00:00:00 2001 From: zhaowc <526854230@qq.com> Date: 星期三, 18 九月 2024 16:37:13 +0800 Subject: [PATCH] 增加对申请入库时对平库库位的校验 --- Pda/View/SoSetting/pingKuOut.html | 202 ++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 161 insertions(+), 41 deletions(-) diff --git a/Pda/View/SoSetting/pingKuOut.html b/Pda/View/SoSetting/pingKuOut.html index 3f0cecb..8ce06bf 100644 --- a/Pda/View/SoSetting/pingKuOut.html +++ b/Pda/View/SoSetting/pingKuOut.html @@ -84,6 +84,15 @@ <img src="/assets/down_arraw.png"> </div> </div> + <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;"> + <label class="layui-form-label">鐗╂枡-鎵规锛�</label> + <div class="layui-input-block" id="goodDiv"> + <select id="goodSelect" lay-filter="goodSelect" lay-search> + <option value=""></option> + </select> + <img src="/assets/down_arraw.png"> + </div> + </div> <!-- <div id="" class="layui-form-item layout-input"> <label class="layui-form-label" lang>搴撲綅鍦板潃锛�</label> <div class="layui-input-block"> @@ -110,19 +119,27 @@ <img src="/assets/fengexian.png"> </div> - <div class="layout-tbl-paging" id="" style="display: none;"> + <div class="layout-tbl-paging" id="" > <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> <tr> - <th lang>鐗╂枡鍙�</th> + <th lang>鎵樼洏鐮�</th> + <!-- <th lang>鐗╂枡鍙�</th> <th lang>鐗╂枡鍚嶇О</th> - <th lang>鎵规鍙�</th> + <th lang>鎵规鍙�</th> --> + <th lang>鎵�灞炰粨搴�</th> + <th lang>鎵�灞炲尯鍩�</th> + <th lang>搴撲綅鍦板潃</th> + </tr> <tr id="boxCell" style="display: none"> - <!-- <td name="PalletNo">鎵樼洏鐮�</td> --> - <td name="SkuNo">鐗╂枡鍙�</td> + <td name="PalletNo">鎵樼洏鐮�</td> + <td name="WareHouseName">鎵�灞炰粨搴�</td> + <td name="AreaName">鎵�灞炲尯鍩�</td> + <!-- <td name="SkuNo">鐗╂枡鍙�</td> <td name="SkuName">鐗╂枡鍚嶇О</td> - <td name="LotNo">鎵规鍙�</td> + <td name="LotNo">鎵规鍙�</td> --> + <td name="LocatNo">搴撲綅鍦板潃</td> <!-- <td name="del"> <div id="" class="tbl-btn-del" lang> 鍒犻櫎 @@ -169,43 +186,98 @@ } form.on('select(getbar)', function (data) { - console.log(); + //console.log(); if (data.value == "") { return; } GetBoxInfo(); }); + + form.on('select(goodSelect)', function (data) { + console.log($("#goodSelect").val()); + if (data.value == "") { + return; + } + var skuno = $("#goodSelect").val().substring(0,6); + var lotNo = $("#goodSelect").val().substring(12); + console.log("skuno:"+skuno); + console.log("lotNo:" + lotNo); + loadlocatinfo(skuno, lotNo); + }); + + $("#selectDiv").click(function () { + var input = $('select[id="bar"]').next().find('.layui-select-title input') + var val = input.val() + //鍏堟洿鏂颁竴涓嬪嚭搴撳崟 + updateBillList(function (data) { + $('select[id="bar"]').next().addClass('layui-form-selected') + $('select[id="bar"]').next().find('.layui-select-title input').val(val) + }) + }) //鍒濆鍖栨覆鏌� 鍑哄簱鍗� - function updateBillList() { + function updateBillList(callback) { + var input = $('select[id="bar"]').next().find('.layui-select-title input') + var val = input.val() $("#bar").empty() $("#bar").append('<option value =>' + '</option>'); - form.render('select'); - - var param = { - PalletNo: $("#PalletNo").val(), - Type: "1", - }; - synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) { - console.log(res); - - if (res.code == 0) { //鎴愬姛 - console.log(res.data); - for (var i = 0; i < res.data.length; i++) { - if (i == 0) { - $("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>'); - } else { - $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); + var PalletNo = $("#PalletNo").val(); + if(PalletNo.length != 8){ //涓嬫媺妗嗚幏鍙栧钩搴撳嚭搴撳崟 + var param = { + Type: "1", + }; + synData(IP + "/PdaSo/GetRunNoticeList", param,'post', function (res) { + //console.log(res); + if (res.code == 0) { //鎴愬姛 + for (var i = 0; i < res.data.length; i++) { + $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + + + '</option>'); } - } - form.render('select'); + form.render('select'); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - } - }); + if (!val) { + $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') + } else { + var sel = 'dd[lay-value=' + val + ']'; + $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + } + + callback(res.data) + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + } + }); + }else{//鏍规嵁鎵樼洏鍙疯幏鍙栧嚭搴撳崟 + var param = { + PalletNo: $("#PalletNo").val(), + Type: "1", + }; + synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) { + console.log(res); + + if (res.code == 0) { //鎴愬姛 + console.log(res.data); + for (var i = 0; i < res.data.length; i++) { + if (i == 0) { + $("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>'); + } else { + $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); + } + } + form.render('select'); + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + } + }); + } } //鑾峰彇鎵樼洏鐗╂枡鍚嶇粏 @@ -216,9 +288,10 @@ } synData(IP + "/PdaSo/GetPingKuInfoByPallet", param2, 'get', function (res) { if (res.code == 0) { - tableData = deepCopy(res.data) - - refreshTable(tableData) + updateGoodList(res.data);//鐗╂枡鎵规淇℃伅 + var skuno = res.data[0].SkuNo; + var lotNo = res.data[0].LotNo; + loadlocatinfo(skuno, lotNo);//鑾峰彇鎵樼洏浣嶇疆淇℃伅 } else { layer.msg(res.msg, { icon: 2, @@ -226,6 +299,50 @@ }, function () { }); } }); + } + + //鑾峰彇鎵樼洏浣嶇疆淇℃伅骞舵洿鏂拌〃鍗� + function loadlocatinfo(skuno, lotNo){ + let param3 = { + "SoNo": $("#bar").val(), + "SkuNo": skuno, + "LotNo": lotNo + } + synData(IP + "/PdaSo/GetPingKuLocationInfo", param3, 'get', function (res) {//鑾峰彇鎵樼洏鏄庣粏 + if (res.code == 0) { + tableData = deepCopy(res.data) + refreshTable(tableData) + } else { + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }) + } + + /* 鐗╂枡鍙婃壒娆′笅鎷夋 */ + function updateGoodList(data) { + var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') + var val = input.val() + $("#goodSelect").empty() + $("#goodSelect").append('<option value =>' + '</option>'); + + for (var i = 0; i < data.length; i++) { + + if (data[i].LotNo == '' || data[i].LotNo == null) { + $("#goodSelect").append('<option value =' + data[i].SkuNo + ' selected>' + data[i] + .SkuName + + '</option>'); + } else { + $("#goodSelect").append('<option value =' + data[i].SkuNo + data[i].SkuName + "-" + + data[i].LotNo + ' selected>' + data[i] + .SkuNo + data[i].SkuName + "-" + data[i].LotNo + + '</option>'); + } + } + form.render('select'); + } function clearTable() { @@ -257,10 +374,13 @@ // tr.attr('id', list[i].BoxCode) idx++; tr.attr('index', idx) - // tr.find("td[name='PalletNo']").html(list[i].PalletNo); - tr.find("td[name='SkuNo']").html(list[i].SkuNo); - tr.find("td[name='SkuName']").html(list[i].SkuName); - tr.find("td[name='LotNo']").html(list[i].LotNo); + tr.find("td[name='PalletNo']").html(list[i].PalletNo); + //tr.find("td[name='SkuNo']").html(list[i].SkuNo); + //tr.find("td[name='SkuName']").html(list[i].SkuName); + //tr.find("td[name='LotNo']").html(list[i].LotNo); + tr.find("td[name='WareHouseName']").html(list[i].WareHouseName); + tr.find("td[name='AreaName']").html(list[i].AreaName); + tr.find("td[name='LocatNo']").html(list[i].LocatNo); // var code = list[i].BoxCode // //console.log("code is "+code) @@ -281,7 +401,7 @@ "PalletNo": $("#PalletNo").val() } synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) { - console.log(res); + if (res.code == 0) { //鎴愬姛 updateBillList(); -- Gitblit v1.8.0