From aec8fb5f857231f10dc4a58fc86ecdac2b5d6250 Mon Sep 17 00:00:00 2001 From: chengsc <11752@DESKTOP-DS49RCP> Date: 星期三, 25 六月 2025 12:16:30 +0800 Subject: [PATCH] 添加拆托功能 --- Pda/View/HouseDataSetting/SkuDismantling.html | 250 ++++++------------------------------------------- 1 files changed, 32 insertions(+), 218 deletions(-) diff --git a/Pda/View/HouseDataSetting/SkuDismantling.html b/Pda/View/HouseDataSetting/SkuDismantling.html index 9905e2c..a45e59e 100644 --- a/Pda/View/HouseDataSetting/SkuDismantling.html +++ b/Pda/View/HouseDataSetting/SkuDismantling.html @@ -378,7 +378,7 @@ synData(IP + "/PdaCr/GetBoxInfo", param, 'post', function (res) { if (res.code == 0) { //鎴愬姛 - $("#boxNo").focus();//鍏夋爣榛樿閫変腑 + $("#palletNo3").focus();//鍏夋爣榛樿閫変腑 } else { //涓嶆垚鍔� layer.msg(res.msg, { icon: 2, @@ -431,14 +431,7 @@ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }); return; } - if ($('#boxQty').val() == "") { - layer.msg("绠卞唴鏁伴噺涓虹┖锛屼笉鑳芥嫞璐�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - + } @@ -463,9 +456,8 @@ "BoxNo": $('#boxNo').val(), "palletNoNew": $('#palletNo3').val(), } - sendData(IP + "/PdaSo/SoSetPinPick", param, 'post', function (res) { - //console.log(res); - + sendData(IP + "/PdaCr/UpPalletByBox", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 layer.msg(res.msg, { icon: 1, @@ -509,29 +501,14 @@ //鏁伴噺鏍囩------------------------------------------------------------------------------- - function clear21() { - $('#outModel2').val("");//鍑哄簱鍙� - $('#standard2').val("");//瑙勬牸 - - $('#pickQty2').val("");//寰呮嫞鏁伴噺 - $('#pickedQty2').val("");//宸叉嫞鏁伴噺 - } + function clear22() { //鐗╂枡鎵规 $("#skuLotNo2").empty() $("#skuLotNo2").append('<option value =>' + '</option>'); form.render('select'); } - function clear23() { - $("#planQty2").val(""); //璁″垝鏁伴噺 - $("#finishQty2").val("");//瀹屾垚鏁伴噺 - } - function clear24() { - $('#boxNo2').val("");//绠辩爜 - $('#boxQty2').val("");//绠卞唴鏁伴噺 - } - - + //褰撴墭鐩樻潯鐮佽緭鍏ユ鏂囨湰鏀瑰彉鏃�,妫�鏌ヤ竴涓嬫墭鐩樼姸鎬� $("#palletNo2").on('input', function () { if ($("#palletNo2").val() == "" || $("#palletNo2").val().length < 8) { @@ -542,61 +519,21 @@ } checkPalletState2() }) - //妫�鏌ユ墭鐩樼姸鎬� + + //妫�鏌ユ墭鐩樼姸鎬� function checkPalletState2() { var param = { "PalletNo": $("#palletNo2").val() } synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) { if (res.code == 0) { //鎴愬姛 - updateBillList2(); - console.log($('#bar2').val()) - if ($('#bar2').val() == "") { - console.log(1) - clear21(); - return; - } else { - console.log(2) - updateSkuLotNoList2(); - updateQtyList2(); - getBar2(); - // GetDataInfo(); - } - + $("#palletNo4").focus(); + updateSkuLotNoList2(); } else { //涓嶆垚鍔� layer.msg(res.msg, { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }, function () { }); - } - }); - } - //鍒濆鍖栨覆鏌� 鍑哄簱鍗� - function updateBillList2() { - $("#bar2").empty() - $("#bar2").append('<option value =>' + '</option>'); - form.render('select'); - - var param = { - PalletNo: $("#palletNo2").val(), - }; - synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - console.log(res.data); - for (var i = 0; i < res.data.length; i++) { - if (i == 0) { - $("#bar2").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>'); - } else { - $("#bar2").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); - } - } - form.render('select'); - - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); } }); } @@ -606,26 +543,27 @@ clear22(); var param = { PalletNo: $("#palletNo2").val(), - SoNo: $("#bar2").val(), }; - synData(IP + "/PdaSo/GetSoSkuLotNoListByPallet", param, 'post', function (res) { + synData(IP + "/PdaCr/GetSelectSkuLotNo", param, 'post', function (res) { console.log(res); 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); - if (res.data[i].LotNo != null) { - $("#skuLotNo2").append(" - " + res.data[i].LotNo); - } - $("#skuLotNo2").append('</option>'); - + $("#skuLotNo2").append('<option value =' + res.data[i].DetailId + ' selected>' + res.data[i].SkuName+' - ' + res.data[i].LotNo+'</option>'); + //$("#skuLotNo2").append(' - ' + res.data[i].LotNo+'</option>'); + // if (res.data[i].LotNo != null) { + // console.log(res.data[i].LotNo); + + // $("#skuLotNo2").append(' - ' + res.data[i].LotNo); + // } + //$("#skuLotNo2").append('</option>'); } else { - $("#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>'); + $("#skuLotNo2").append('<option value =' + res.data[i].DetailId + '>' + res.data[i].SkuName+' - ' + res.data[i].LotNo+'</option>'); + // if (res.data[i].LotNo != null) { + // $("#skuLotNo2").append(' - ' + res.data[i].LotNo); + // } + // $("#skuLotNo2").append('</option>'); } } form.render('select'); @@ -639,130 +577,10 @@ }); } - //鍒濆鍖栨覆鍗曟嵁鐨勮鍒掓暟閲忓拰瀹屾垚鏁伴噺 - function updateQtyList2() { - clear23(); - console.log("AA"); - var param = { - SoDetailId: $("#skuLotNo2").val(), - }; - synData(IP + "/PdaSo/GetPlanAndFinishQty", param, 'post', function (res) { - console.log(res); - console.log(res.data); - if (res.code == 0) { //鎴愬姛 - $("#planQty2").val(res.data.PlanQty) - $("#finishQty2").val(res.data.FinishQty) - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); - } - - //鏍规嵁鍗曟嵁鑾峰彇鍑哄簱鍙c�佽鏍笺�佸緟妫�鏁伴噺銆佸凡鎷f暟閲� - function getBar2() { - clear21(); - - var param = { - PalletNo: $("#palletNo2").val(), - SoDetailId: $("#skuLotNo2").val(), - } - synData(IP + "/PdaSo/GetOutlets", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - let data = res.data - console.log(res.data); - $('#outModel2').val(res.data.OutModel); - $('#standard2').val(res.data.Standard); - - $('#pickQty2').val(res.data.PickQty - res.data.PickedQty); - $('#pickedQty2').val(res.data.PickedQty); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); - - } - - //鑾峰彇鎵樼洏鐗╂枡鍚嶇粏 - function GetDataInfo() { - let param2 = { - "SoDetailId": $("#skuLotNo2").val(), - "PalletNo": $("#palletNo2").val(), - } - console.log(param2); - synData(IP + "/PdaSo/GetAllotPlnInfo", param2, 'post', function (res) { - if (res.code == 0) { - tableData2 = deepCopy(res.data) - - refreshTable2(tableData2) - } else { - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); - } - - //娓叉煋琛ㄦ牸鏁版嵁 - 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, @@ -781,8 +599,7 @@ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }); return; } - let pickedQty = parseInt($('#pickedQty2').val()) //宸叉嫞鏁伴噺 - let pickQty = parseInt($('#pickQty2').val()) //鎷h揣鏁伴噺 + let pickQty = parseFloat($('#pickQty2').val()) //鎷h揣鏁伴噺 if (pickQty <= 0) { layer.msg("鎷h揣鏁伴噺闇�澶т簬0", { icon: 2, @@ -808,24 +625,21 @@ //纭鎷h揣 function reqPickScatter2() { var param = { - "SoNo": $("#bar2").val(), - "SoDetailId": $("#skuLotNo2").val(), + "DetailId": $("#skuLotNo2").val(), "PalletNo": $('#palletNo2').val(), - "PickQty": $('#pickQty2').val(), + "Qty": parseFloat($('#pickQty2').val()), "PalletNoNew": $('#palletNo4').val(), } - sendData(IP + "/PdaSo/SoSetQtyPinPick", param, 'post', function (res) { - //console.log(res); - + sendData(IP + "/PdaCr/UpPalletByQty", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 layer.msg(res.msg, { icon: 1, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }, function () { canPickBox = true//鍥炶皟 - updateQtyList2(); - getBar2(); - GetDataInfo(); + checkPalletState2(); + $('#pickQty2').val('') }); } else { //涓嶆垚鍔� layer.msg(res.msg, { -- Gitblit v1.8.0