From 260d6082a7e53e0f040365a763da9bcf952118bd Mon Sep 17 00:00:00 2001 From: zhaowc <526854230@qq.com> Date: 星期三, 04 九月 2024 16:51:46 +0800 Subject: [PATCH] 修改平库出库页面单据加载托盘位置功能 --- Pda/View/SoSetting/pingKuOut.html | 100 ++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 85 insertions(+), 15 deletions(-) diff --git a/Pda/View/SoSetting/pingKuOut.html b/Pda/View/SoSetting/pingKuOut.html index 92a28f8..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"> @@ -115,17 +124,21 @@ <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="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> @@ -173,11 +186,23 @@ } 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 () { @@ -195,14 +220,13 @@ var val = input.val() $("#bar").empty() $("#bar").append('<option value =>' + '</option>'); - form.render('select'); var PalletNo = $("#PalletNo").val(); if(PalletNo.length != 8){ //涓嬫媺妗嗚幏鍙栧钩搴撳嚭搴撳崟 var param = { Type: "1", }; synData(IP + "/PdaSo/GetRunNoticeList", param,'post', function (res) { - console.log(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] @@ -264,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, @@ -274,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() { @@ -299,7 +368,6 @@ var arrTrs = new Array() let idx = 0 for (var i in list) { - console.log("list[i].LocatN:"+list[i].LocatNo); // list[i].BoxCode var tr = $("#boxCell").eq(0).clone(); tr.appendTo("#tableBoxList"); @@ -307,9 +375,11 @@ 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='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) @@ -331,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