From af73aff35be4607dd22232d5695e30ca3059c436 Mon Sep 17 00:00:00 2001 From: zhaowc <526854230@qq.com> Date: 星期二, 01 四月 2025 15:58:21 +0800 Subject: [PATCH] PDA的2个拣货页面修改 --- Pda/View/SoSetting/productOut.html | 373 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 340 insertions(+), 33 deletions(-) diff --git a/Pda/View/SoSetting/productOut.html b/Pda/View/SoSetting/productOut.html index dbc2b7b..b18023e 100644 --- a/Pda/View/SoSetting/productOut.html +++ b/Pda/View/SoSetting/productOut.html @@ -169,12 +169,14 @@ </ul> </div> - <ul> + <!-- <ul> <li id="option1">鏍囩</li> <li id="option2">鏁伴噺</li> - </ul> + </ul> --> - <br /> + <button id="option1" class="layout-btn" type="button">鏍囩</button> + <button id="option2" class="layout-btn" type="button">鏁伴噺</button> + <br /><br /> <!-- 鏈夌爜 --> <div id="content1"> @@ -260,6 +262,11 @@ <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch" lay-text="鏄瘄鍚�" lay-filter="IsZhengTuo"> </div> + <label class="layui-form-label" lang>鏄惁杩炵画鎷h揣锛�</label> + <div class="layui-input-block"> + <input type="checkbox" name="IsCheckCon" id="IsCheckCon" lay-skin="switch" lay-text="鏄瘄鍚�" + lay-filter="IsCheckCon"> + </div> </div> <div id="BoxDIv" class="layout-tab-page"> <table class="layout-tab-content" border="" cellspacing="" cellpadding=""> @@ -292,6 +299,17 @@ <div class="layui-input-block"> <input id="boxNo3" type="text" lang langholder placeholder="璇锋壂鎻忚拷婧潯鐮�" autocomplete="off" class="layui-input"> + </div> + </div> + </td> + </tr> + <tr class="divPickQty1"> + <td> + <div class="layui-form-item layout-input" style="margin-top: 6px;"> + <label class="layui-form-label lableWidth">鎷h揣鏁伴噺锛�</label> + <div class="layui-input-block"> + <input id="pickQty1" type="text" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�"autocomplete="off" + class="layui-input" > </div> </div> </td> @@ -332,6 +350,17 @@ </div> </td> --> </tr> + <tr> + <td> + <div class="layui-form-item "> + <label class="layui-form-label lableWidth">鎵樼洏涓婃暟閲忥細</label> + <div class="layui-input-block"> + <input id="palletNoqty" class="layui-input" style="border: 0;" + type="text" lay-verify="" disabled placeholder=""> + </div> + </div> + </td> + </tr> </table> </td> </tr> @@ -471,14 +500,14 @@ </div> </div> <div class="layui-form-item layout-input" style="display: flex; justify-content: space-between;"> - <div style="width: 48%;"> + <div style="width: 49%;"> <label class="layui-form-label" style="width: 34%;">鍑哄簱鍙o細</label> - <div class="layui-input-block" style="width: 66%;margin-left:34%;"> + <div class="layui-input-block" style="width: 62%;margin-left:34%;"> <input id="outModel2" type="text" lay-verify="" disabled placeholder="" class="layui-input" > <!-- style="border: 0px;" --> </div> </div> - <div style="width: 48%;"> + <div style="width: 49%;"> <label class="layui-form-label" style="width: 70px;">宸叉嫞鏁伴噺锛�</label> <div class="layui-input-block" style="width: 120px; margin-left:70px;"> <input id="pickedQty2" type="text" lay-verify="" disabled @@ -496,9 +525,9 @@ <label class="layui-form-label lableWidth" >鎷h揣鏁伴噺锛�</label> <div id="" class="local-input"> <div class="layui-input-block"> - <input id="pickQty2" type="number" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�" + <input id="pickQty2" type="text" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�" autocomplete="off" class="layui-input" style="padding-left:0.1rem;" - oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"> + > </div> </div> <div id="" class="local-ok"> @@ -519,8 +548,8 @@ </div> <div class="layout-tbl-paging" id=""> - <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> - <tr id="tableHead"> + <table id="tableBoxList2" class="tbl-box-list" border="" cellspacing="" cellpadding=""> + <tr id="tableHead2"> <th style="width: 54%;">鐗╂枡缂栫爜</th> <th style="width: 20%;">鎵樺唴<br>鏁伴噺</th> <th style="width: 20%;">宸叉嫞<br>鏁伴噺</th> @@ -528,9 +557,9 @@ <!-- <th style="width: 8%;">鎷h揣</th> --> </tr> <tr id="boxCell2" style="display: none;"> - <td name="SkuNo2">AG000001</td> - <td name="qty2">30</td> - <td name="pickedQty2">30</td> + <td name="SkuNo">AG000001</td> + <td name="Qty">30</td> + <td name="pickedQty">30</td> </tr> </table> @@ -567,18 +596,18 @@ var xianshiyemian = 0; - $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //閫変腑鍚庨鑹� - $('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //榛樿棰滆壊 + $('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //閫変腑鍚庨鑹� + $('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //榛樿棰滆壊 $('#content2').hide(); $(document).ready(function () { $('#option1').click(function () { // qingkong(); xianshiyemian = 0; $('#content1').show(); - $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //閫変腑鍚庨鑹� + $('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //閫変腑鍚庨鑹� $('#content2').hide(); - $('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //榛樿棰滆壊 + $('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //榛樿棰滆壊 $("#palletNo").focus();//鍏夋爣榛樿閫変腑 }); @@ -586,10 +615,10 @@ // qingkong(); xianshiyemian = 1; $('#content1').hide(); - $('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //榛樿棰滆壊 + $('#option1').attr("style", "background-color: #999;width: 50%;float: left;text-align: center;"); //榛樿棰滆壊 $('#content2').show(); - $('#option2').attr("style", "background-color: aqua;width: 45.77%;float: right;text-align: center;"); //閫変腑鍚庨鑹� + $('#option2').attr("style", "background-color: red;width: 50%;float: right;text-align: center;"); //閫変腑鍚庨鑹� $("#palletNo2").focus();//鍏夋爣榛樿閫変腑 }); }); @@ -599,10 +628,25 @@ var curPageIndex = 1 //鏄惁鏁存墭鎷h揣 var isContinue = "0"; + var isConCheck = "0"; var tableData = null + var tableData2 = null var canPickBox = true $("#palletNo").focus();//鍏夋爣榛樿閫変腑 + + function clear5() + { + $('#outModel').val("");//鍑哄簱鍙� + $('#standard').val("");//瑙勬牸 + + $('#pickQty').val("");//寰呮嫞鏁伴噺 + $('#pickedQty').val("");//宸叉嫞鏁伴噺 + $('#palletNoqty').val("");//宸叉嫞鏁伴噺 + + $('#boxNo').val("");//绠辩爜 + $('#boxQty').val("");//鎵樼洏涓婃暟閲� + } function clear1() { $('#outModel').val("");//鍑哄簱鍙� $('#standard').val("");//瑙勬牸 @@ -647,6 +691,16 @@ $('#boxNo').val(""); $('#boxNo3').val(""); }); + + form.on('switch(IsCheckCon)', function (obj) { + if (obj.elem.checked) { + isConCheck="1"; + } else { + isConCheck="0"; + } + $('#boxNo').val(""); + $('#boxNo3').val(""); + }); //绠辩爜鏂囨湰妗嗗洖杞︿簨浠� $("#boxNo").blur(function () { @@ -663,7 +717,7 @@ //妫�鏌ユ墭鐩樼姸鎬� function checkPalletState() { - + var param = { "PalletNo": $("#palletNo").val() } @@ -760,9 +814,22 @@ icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }); + clear5; + + $("#palletNo").val("");//鎵樼洏鍙� + $("#pickQty1").val("");//鎵樼洏鍙� + + $("#planQty").val(""); //璁″垝鏁伴噺 + $("#finishQty").val("");//瀹屾垚鏁伴噺 + //鐗╂枡鎵规 + $("#skuLotNo").empty(); + $("#skuLotNo").append('<option value =>' + '</option>'); + form.render('select'); } }); } + + //鍒濆鍖栨覆鏌� 鐗╂枡-鎵规 function updateSkuLotNoList() { @@ -831,6 +898,10 @@ $('#pickQty').val(res.data.PickQty); $('#pickedQty').val(res.data.PickedQty); } else { //涓嶆垚鍔� + if($("#planQty").val() == $("#finishQty").val() || $('#pickQty').val() == $('#pickedQty').val()) + { + return; + } layer.msg(res.msg, { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 @@ -852,6 +923,7 @@ console.log(list != null); console.log(list); + let pallnono = 0; if (list != null && list.length > 0) { //鎴愬姛 var arrTrs = new Array() @@ -868,6 +940,7 @@ tr.find("td[name='boxNo']").html(list[i].BoxNo); tr.find("td[name='qty']").html(list[i].Qty); tr.find("td[name='pickedQty']").html(list[i].PickedQty); + pallnono = pallnono + list[i].Qty; tr.show(); arrTrs[i] = tr @@ -883,10 +956,15 @@ // $("#boxNum").val(0) setPages(1, 0) } + $("#palletNoqty").val(pallnono) } //鑾峰彇鎵樼洏鐗╂枡鍚嶇粏 function GetBoxInfo() { + if ($('#pickQty').val() == $('#pickedQty').val()) + { + return; + } let param2 = { "SoDetailId": $("#skuLotNo").val(), "PalletNo": $("#palletNo").val(), @@ -899,6 +977,10 @@ refreshTable(tableData) } else { + // $("#planQty").val(); //璁″垝鏁伴噺 + // $("#finishQty").val();//瀹屾垚鏁伴噺 + // console.info($("#planQty").val(),$("#finishQty").val()) + layer.msg(res.msg, { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 @@ -942,7 +1024,50 @@ }); return; } - } + if(($('#boxNo3').val() != "" && ($('#pickQty1').val() != "" || $('#pickQty1').val() != 0))){ + layer.msg("杩芥函鏉$爜鍜屾嫞璐ф暟閲忎笉鑳藉悓鏃惰緭鍏ワ紒", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if($('#pickQty1').val() != "" && $('#pickQty1').val()>parseFloat($('#pickQty').val())){ + layer.msg("鎷h揣鏁伴噺涓嶈兘澶т簬寰呮嫞鏁伴噺锛�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + } + if(isConCheck=="0"){ + if ($('#boxNo').val() == "") { + layer.msg("璇疯緭鍏ョ鐮�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#boxQty').val() == "") { + layer.msg("绠卞唴鏁伴噺涓虹┖锛屼笉鑳芥嫞璐�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if(($('#boxNo3').val() != "" && ($('#pickQty1').val() != "" || $('#pickQty1').val() != 0))){ + layer.msg("杩芥函鏉$爜鍜屾嫞璐ф暟閲忎笉鑳藉悓鏃惰緭鍏ワ紒", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if($('#pickQty1').val() != "" && $('#pickQty1').val()>parseFloat($('#pickQty').val())){ + layer.msg("鎷h揣鏁伴噺涓嶈兘澶т簬寰呮嫞鏁伴噺锛�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + } // let boxQty = parseInt($('#boxQty').val()) // let qty = parseInt($('#qty').val()) // if (qty <= 0 || qty > boxQty) { @@ -969,12 +1094,30 @@ //纭鎷h揣 function reqPickScatter() { + if($('#pickQty1').val()!= "" && $('#pickQty1').val()!= undefined){ + // var reg = /^[1-9]\d*(\.\d{1,4})?$|^0\.\d{1,4}[1-9]\d*$/; + // if (!reg.test($("#pickQty1").val())) { + // layer.msg("鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }); + // return -1; + // } + if (!($('#pickQty1').val()>0)) { + layer.msg("鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return -1; + } + } var param = { "SoNo": $("#bar").val(), "SoDetailId": $("#skuLotNo").val(), "PalletNo": $('#palletNo').val(), "BoxNo": $('#boxNo').val(), "BoxNo3": $('#boxNo3').val(), + "PickQty":$('#pickQty1').val() } sendData(IP + "/PdaSo/SoSetPick", param, 'post', function (res) { //console.log(res); @@ -1191,14 +1334,17 @@ synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) { if (res.code == 0) { //鎴愬姛 updateBillList2(); - if ($('#bar').val() == "") { + console.log($('#bar2').val()) + if ($('#bar2').val() == "") { + console.log(1) clear21(); return; } else { + console.log(2) updateSkuLotNoList2(); updateQtyList2(); getBar2(); - GetBoxInfo(); + GetDataInfo(); } } else { //涓嶆垚鍔� @@ -1218,6 +1364,7 @@ var param = { PalletNo: $("#palletNo2").val(), }; + synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) { if (res.code == 0) { //鎴愬姛 console.log(res.data); @@ -1230,11 +1377,15 @@ } form.render('select'); - } else { //涓嶆垚鍔� + } + else + { //涓嶆垚鍔� + layer.msg(res.msg, { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }); + } }); } @@ -1250,10 +1401,20 @@ if (res.code == 0) { //鎴愬姛 for (var i = 0; i < res.data.length; i++) { if (i == 0) { - $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + ' selected>' + res.data[i].SkuName + " - " + res.data[i].LotNo + '</option>'); + $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + ' selected>' + res.data[i].SkuName); + if(res.data[i].LotNo == null) + { + $("#skuLotNo2").append(" - " + res.data[i].LotNo); + } + $("#skuLotNo2").append('</option>'); } else { - $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + '>' + res.data[i].SkuName + " - " + res.data[i].LotNo + '</option>'); + $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + '>' + res.data[i].SkuName); + if(res.data[i].LotNo == null) + { + $("#skuLotNo2").append(" - " + res.data[i].LotNo); + } + $("#skuLotNo2").append('</option>'); } } form.render('select'); @@ -1302,9 +1463,13 @@ $('#outModel2').val(res.data.OutModel); $('#standard2').val(res.data.Standard); - $('#pickQty2').val(res.data.PickQty); + $('#pickQty2').val(res.data.PickQty - res.data.PickedQty); $('#pickedQty2').val(res.data.PickedQty); } else { //涓嶆垚鍔� + if($("#planQty").val() == $("#finishQty").val() || $('#pickQty').val() == $('#pickedQty').val()) + { + return; + } layer.msg(res.msg, { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 @@ -1315,18 +1480,21 @@ } //鑾峰彇鎵樼洏鐗╂枡鍚嶇粏 - function GetBoxInfo() { + function GetDataInfo() { + if ($("#planQty").val() == $("#finishQty").val()) + { + return; + } let param2 = { "SoDetailId": $("#skuLotNo2").val(), "PalletNo": $("#palletNo2").val(), - "BoxNo": $("#boxNo").val(), - "BoxNo3": $("#boxNo3").val(), } - synData(IP + "/PdaSo/GetDataComBoxInfo", param2, 'post', function (res) { + console.log(param2); + synData(IP + "/PdaSo/GetAllotPlnInfo", param2, 'post', function (res) { if (res.code == 0) { - tableData = deepCopy(res.data) + tableData2 = deepCopy(res.data) - refreshTable(tableData) + refreshTable2(tableData2) } else { layer.msg(res.msg, { icon: 2, @@ -1336,6 +1504,145 @@ }); } + //娓叉煋琛ㄦ牸鏁版嵁 + function refreshTable2(list) { + //鍏堟竻绌轰竴涓嬩俊鎭垪琛� + let trs = $("#tableBoxList2 tr") + let len = trs.length + //console.log("tr 鏁伴噺 + " + trs.length) + for (i = len - 1; i >= 2; i--) { + trs[i].remove(); + } + + console.log(list != null); + console.log(list); + if (list != null && list.length > 0) { //鎴愬姛 + + var arrTrs = new Array() + let idx = 0 + for (var i in list) { + // list[i].BoxCode + var tr = $("#boxCell2").eq(0).clone(); + tr.appendTo("#tableBoxList2"); + // tr.attr('id', list[i].BoxCode) + idx++; + tr.attr('index', idx) + // tr.find("td[name='skuNo']").attr('style', 'max-width:90px;'); + // tr.find("td[name='skuName']").attr('style', 'max-width:120px;'); + tr.find("td[name='SkuNo']").html(list[i].BoxNo); + tr.find("td[name='Qty']").html(list[i].Qty); + tr.find("td[name='pickedQty']").html(list[i].PickedQty); + + tr.show(); + arrTrs[i] = tr + } + setPages(1, list.length) + canPickBox = true + + } else { //涓嶆垚鍔� + layer.msg("鏃犳暟鎹�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + // $("#boxNum").val(0) + setPages(1, 0) + } + } + + //鍗曟嫞璐э紙纭鎸夐挳锛� + form.on('submit(formPickScatter2)', function (data) { + + if ($('#bar2').val() == "") { + layer.msg("璇烽�夋嫨鍑哄簱鍗�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#skuLotNo2').val() == "") { + layer.msg("璇烽�夋嫨鐗╂枡-鎵规", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#palletNo2').val() == "") { + layer.msg("璇疯緭鍏ユ墭鐩樼爜", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + let pickedQty = parseFloat($('#pickedQty2').val()) //宸叉嫞鏁伴噺 + let pickQty = parseFloat($('#pickQty2').val()) //鎷h揣鏁伴噺 + if (pickQty <= 0) { + layer.msg("鎷h揣鏁伴噺闇�澶т簬0", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + if (canPickBox == false) { + + layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + reqPickScatter2() + + return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� + }); + + //纭鎷h揣 + function reqPickScatter2() { + if($('#pickQty2').val()!= "" && $('#pickQty2').val()!= undefined){ + // var reg = /^[1-9]\d*(\.\d{1,4})?$|^0\.\d{1,4}[1-9]\d*$/; + // if (!reg.test($("#pickQty2").val())) { + // layer.msg("鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }); + // return -1; + // } + if (!($('#pickQty2').val()>0)) { + layer.msg("鏁伴噺蹇呴』澶т簬0(鍙繚鐣�4浣嶅皬鏁�)", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return -1; + } + } + var param = { + "SoNo": $("#bar2").val(), + "SoDetailId": $("#skuLotNo2").val(), + "PalletNo": $('#palletNo2').val(), + "PickQty": $('#pickQty2').val(), + } + sendData(IP + "/PdaSo/SoSetQtyPick", param, 'post', function (res) { + //console.log(res); + + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + canPickBox = true//鍥炶皟 + updateQtyList2(); + getBar2(); + GetDataInfo(); + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + canPickBox = true;//鍥炶皟 + }); + } + }); + } + }) </script> -- Gitblit v1.8.0