From 1c2541b283ce6ba855e67c476412dffe2c693480 Mon Sep 17 00:00:00 2001 From: chengsc <11752@DESKTOP-DS49RCP> Date: 星期三, 11 六月 2025 13:56:23 +0800 Subject: [PATCH] Merge branch 'csc' --- Pda/View/AsnSetting/productEnterQuantity.html | 932 ++++++++++++++++++--------------------------------------- 1 files changed, 299 insertions(+), 633 deletions(-) diff --git a/Pda/View/AsnSetting/productEnterQuantity.html b/Pda/View/AsnSetting/productEnterQuantity.html index f72aa08..ed63d72 100644 --- a/Pda/View/AsnSetting/productEnterQuantity.html +++ b/Pda/View/AsnSetting/productEnterQuantity.html @@ -265,7 +265,7 @@ </div> <!-- 鏃犵爜 --> <div id="content2"> - <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> + <div id="zongDiv2" class="layout-bill-info" style="height: 255px;"> <form class="layui-form" id="form2" action=""> <div id="" class="layui-form-item layout-dropdownlist"> <label class="layui-form-label" lang>鍏ュ簱鍗曪細</label> @@ -358,7 +358,7 @@ <label class="layui-form-label" lang>瀵勫瓨澶囨敞锛�</label> <div class="layui-input-block"> <textarea placeholder="璇疯緭鍏ュ唴瀹�" id="Demo" name="Demo" class="layui-textarea" ></textarea> - + </div> </div> --> <!-- 缁存姢澶囨敞寮规 --> @@ -418,7 +418,7 @@ </td> </tr> </table> - + <table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding=""> <tr> <td class="page-prev">涓婁竴椤�</td> @@ -477,38 +477,12 @@ }); }); - //娓呮鏂囨湰妗嗕腑鏁版嵁 - // function clear() { - // if (xianshiyemian == "0") - // { - // $("#BOXCODE").val(""); - // $("#BOXCODE2").val(""); - - // $("#ImportQuantity").val(""); - // $("#Standard").val(""); - // $("#ImportFactQuantity").val(""); - // $("#BoxQty").val(""); - // } - // else if (xianshiyemian == "1") - // { - // $("#BOXCODE").val(""); - // $("#BOXCODE2").val(""); - - // $("#ImportQuantity").val(""); - // $("#Standard").val(""); - // $("#ImportFactQuantity").val(""); - // $("#BoxQty").val(""); - // } - - // } - /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ initLanguage() setLanguage() - //褰撳墠鍒嗛〉 - var curPageIndex = 1; + //鏄惁杩炵画缁勬墭 isContinue = "0"; @@ -536,6 +510,50 @@ checkPalletStat() }) + // 鍒ゆ柇鎵樼洏鐮佹槸鍚﹀彲鐢� + function checkPalletStat() { + if (xianshiyemian == 0) { + var param = { + "PalletNo": $("#STOCKCODE").val() + } + sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { + if (res.code == 0) { + + $.cookie('stockCode', $("#STOCKCODE").val()); + //refreshTable() + $("#BOXCODE").focus(); + + } else { + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + else if (xianshiyemian == 1) { + var param = { + "PalletNo": $("#STOCKCODE1").val() + } + sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { + if (res.code == 0) { + + $.cookie('stockCode1', $("#STOCKCODE1").val()); + //refreshTable() + $("#SkuQty").focus(); + + } else { + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + } + + //绠辩爜鍥炶溅浜嬩欢 $("#BOXCODE").keydown(function (e) { if (e.keyCode === 13) { @@ -547,20 +565,11 @@ return } - // if ($("#STOCKCODE").val() == "") { - // layer.msg('璇峰厛鎵弿鎵樼洏鐮�', { - // icon: 2, - // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - // }); - // $("#BOXCODE").val(""); - // $("#STOCKCODE").focus(); - // return; - // } checkBoxInfo() } }); - /* 鍏ュ簱鍗曟嵁涓嬫媺妗� */ + //鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠� $("#selectDiv").click(function () { if (xianshiyemian == 0) { @@ -586,11 +595,7 @@ } }) - /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ - - - /* 缁戝畾鍏ュ簱鍗曚俊鎭� */ - + /* 鑾峰彇鍏ュ簱鍗曚俊鎭� */ function updateBillList(callback) { if (xianshiyemian == 0) { var input = $('select[id="bar"]').next().find('.layui-select-title input') @@ -600,14 +605,12 @@ form.render('select'); var param = { - Type: "0,3" + //Type: "0,3" }; - sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { + sendData(IP + "/PdaAsn/GetPasteAsnNoStrList", param, 'post', function (res) { if (res.code == 0) { //鎴愬姛 for (var i = 0; i < res.data.length; i++) { - $("#bar").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i] - .ASNNo + - '</option>'); + $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] +'</option>'); } form.render('select'); @@ -635,14 +638,12 @@ form.render('select'); var param = { - Type: "1,2,4" + //Type: "1,2,4" }; - sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { + sendData(IP + "/PdaAsn/GetNoPasteAsnNoStrList", param, 'post', function (res) { if (res.code == 0) { //鎴愬姛 for (var i = 0; i < res.data.length; i++) { - $("#bar1").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i] - .ASNNo + - '</option>'); + $("#bar1").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); } form.render('select'); @@ -665,8 +666,6 @@ } - /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ - //鐐瑰嚮鐗╂枡涓嬫媺妗嗕簨浠� $("#goodDiv").click(function () { if ($("#bar").val() == null || $("#bar").val() == "" || $("#bar").val() == undefined) { @@ -685,6 +684,7 @@ }, function () { }); } }) + //閫変腑鍏ュ簱鍗曚簨浠� form.on('select(getbar)', function (data) { updateGoodList() @@ -692,7 +692,7 @@ }); //閫変腑鍏ュ簱鍗曚簨浠�-鏁伴噺 form.on('select(getbar1)', function (data) { - updateDemoDiv(); + //updateDemoDiv(); updateGoodList() setOrderGoods(); }); @@ -705,212 +705,7 @@ form.on('select(goodSelect1)', function (data) { setOrderGoods(); }); - - //缁戝畾鍒版墭鐩樹簨浠� - form.on('submit(formBind)', function (data) { - if (xianshiyemian == 0) { - console.log($("#goodSelect").val()); - if ($("#bar").val() == "") { - layer.msg('璇烽�夋嫨鍏ュ簱鍗�', { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - if ($("#goodSelect").val() == "") { - layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - if ($("#STOCKCODE").val() == "") { - layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - if ($("#BOXCODE").val() == "") { - layer.msg('璇锋壂鎻忓绠辨潯鐮�', { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - var param = { - AsnNo: $("#bar").val(), - PalletNo: $("#STOCKCODE").val(), - AsnDetailId: parseInt($("#goodSelect").val()), - LotNo: $("#goodSelect").find("option:selected").text(), - BoxNo: $("#BOXCODE").val(), - IsContinue: isContinue, - TailBoxNo: $("#BOXCODE2").val(), - Origin: "PDA", - TableType: xianshiyemian, - } - console.log(param) - //缁勭洏 - sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - setOrderGoods(); - refreshTable(); - $("#BOXCODE").val(""); - $("#BOXCODE2").val(""); - $("#QTY").val(""); - }); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - //鍥炶皟 - }); - } - }); - } - else if (xianshiyemian == 1) { - if ($("#bar1").val() == "") { - layer.msg('璇烽�夋嫨鍏ュ簱鍗�', { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - if ($("#goodSelect1").val() == "") { - layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - if ($("#STOCKCODE1").val() == "") { - layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - var param = { - AsnNo: $("#bar1").val(), //鍑哄簱鍗曟嵁 - PalletNo: $("#STOCKCODE1").val(), //鎵樼洏鏉$爜 - AsnDetailId: parseInt($("#goodSelect1").val()), //鍏ュ簱鍗曟槑缁咺D - LotNo: $("#goodSelect1").find("option:selected").text(), //鐗╂枡鎵规 - SkuQty: parseInt($("#SkuQty").val()), //鐗╂枡鏁伴噺 - Demo: $("#NoticeDemo").val(), //鐗╂枡鏁伴噺 - Origin: "PDA", - TableType: xianshiyemian, - } - - console.log(param) - //缁勭洏 - sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - setOrderGoods(); - refreshTable(); - $("#STOCKCODE").val(""); - $("#SkuQty").val(""); - }); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - //鍥炶皟 - }); - } - }); - } - - return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� - }); - - - // 鏍规嵁鍏ュ簱鍗曞彿 鑾峰彇澶囨敞鏄惁鏄剧ず鍙婂娉ㄤ俊鎭� - function updateDemoDiv() { - var param = { - AsnNo: $("#bar1").val(), - }; - synData(IP + "/PdaAsn/GetArrivalNotice", param, 'post', function (res) { - console.log(res) - if (res.code == 0 && res.data != null) { //鎴愬姛 - - //鍒ゆ柇榛樿閫変腑鏄惁涓哄瘎瀛樼墿鏂� - if (res.data[0].Type == "7") { - $("textarea[name='NoticeDemo']").val(res.data[0].Demo); //澶囨敞 - $('#demodiv').show(); - $('#demodiv1').show(); - } - else { - $('#demodiv').hide(); - $('#demodiv1').hide(); - } - } - else { - $('#demodiv').hide(); - $('#demodiv1').hide(); - } - }); - } - - // 鏍规嵁鍏ュ簱鏄庣粏ID 鑾峰彇璇︾粏淇℃伅 - function setOrderGoods() { - if (xianshiyemian == 0) { - $("#ImportQuantity").val(""); - $("#Standard").val(""); - $("#ImportFactQuantity").val(""); - $("#BoxQty").val(""); - //$("#FullQty").val("123"); - // $("#BOXCODE").val(""); - - var param = { - Id: parseInt($("#goodSelect").val()) - }; - - synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { - console.log(JSON.stringify(res)) - if (res.code == 0 && res.data != null) { //鎴愬姛 - $("#ImportQuantity").val(res.data.Qty); - $("#Standard").val(res.data.Standard); - $("#ImportFactQuantity").val(res.data.FactQty + ""); - } - }); - } - else if (xianshiyemian == 1) { - // 鏁伴噺 - $("#ImportQuantity1").val(""); - $("#Standard1").val(""); - $("#ImportFactQuantity1").val(""); - $("#FullQty").val(""); - - var param = { - Id: parseInt($("#goodSelect1").val()) - }; - - synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { - console.log(JSON.stringify(res)) - if (res.code == 0 && res.data != null) { //鎴愬姛 - $("#ImportQuantity1").val(res.data.Qty); - $("#Standard1").val(res.data.Standard); - $("#ImportFactQuantity1").val(res.data.FactQty + ""); - $("#FullQty").val(res.data.UDF1); - } - else { } - }); - } - - } - var asnDetails = ""; - /* 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规 */ function updateGoodList(skuNo) { if (xianshiyemian == 0) { @@ -976,7 +771,7 @@ $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') } else { var sel = 'dd[lay-value=' + val + ']'; - $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + //$('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') } } else { } @@ -1048,283 +843,280 @@ } - // 娓叉煋绠辩爜淇℃伅 - function refreshTable() { + // 鏍规嵁鍏ュ簱鏄庣粏ID 鑾峰彇璇︾粏淇℃伅 + function setOrderGoods() { if (xianshiyemian == 0) { - //鍏堟竻绌轰竴涓嬬瀛愬垪琛� - let trs = $("#tableBoxList tr") - let len = trs.length - - for (i = len - 1; i >= 2; i--) { - trs[i].remove(); - } - - //璁剧疆鎵樼洏鍙� - $("#palletCode").val($.cookie('stockCode')) + $("#ImportQuantity").val(""); + $("#Standard").val(""); + $("#ImportFactQuantity").val(""); + $("#BoxQty").val(""); + //$("#FullQty").val("123"); + // $("#BOXCODE").val(""); var param = { - PalletNo: $.cookie('stockCode') + Id: parseInt($("#goodSelect").val()) }; - // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭� - sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - var list = res - var arrTrs = new Array() - let idx = 0 - for (var i in res.data) { - var tr = $("#boxCell").eq(0).clone(); - tr.appendTo("#tableBoxList"); - tr.attr('id', res.data[i].Id) - tr.attr('boxno', res.data[i].BoxNo) - tr.attr('BindNo', res.data[i].BindNo) - idx++; - tr.attr('index', idx) - tr.find("td[name='code']").html(res.data[i].BoxNo); - tr.find("td[name='name']").html(res.data[i].SkuName); - tr.find("td[name='lotNo']").html(res.data[i].LotNo); - tr.find("td[name='num']").html(res.data[i].Qty); - tr.find("td[name='del']").click(function () { - var elem = $(this).parent() - var boxno = elem.attr('boxno') - var BindNo = elem.attr('BindNo') - var Id = elem.attr('id') - layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖涓鐗╂枡鍚楋紵<br>" + boxno, { - icon: 2, - time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - btn: ['鍒犻櫎', '鍙栨秷'], - yes: function () { - var param = { - boxNo: boxno, - }; - sendData(IP + "/BllAsn/DelBindBoxInfo", param, 'get', function (res) { - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - elem.remove() - setOrderGoods(); - refreshTable(); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); - } - }) - }) - tr.show(); - arrTrs[i] = tr - } - //璁剧疆鍒嗛〉 - setPages(1, res.data.length) - - } else { //涓嶆垚鍔� - layer.msg("鏃犳暟鎹�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - $("#boxNum").val(0) - setPages(1, 0) + synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { + console.log(JSON.stringify(res)) + if (res.code == 0 && res.data != null) { //鎴愬姛 + $("#ImportQuantity").val(res.data.Qty); + $("#Standard").val(res.data.Standard); + $("#ImportFactQuantity").val(res.data.FactQty + ""); } }); } else if (xianshiyemian == 1) { - //鍏堟竻绌轰竴涓嬬瀛愬垪琛� - let trs = $("#tableBoxList1 tr") - let len = trs.length - - for (i = len - 1; i >= 2; i--) { - trs[i].remove(); - } - - //璁剧疆鎵樼洏鍙� - $("#palletCode").val($.cookie('stockCode1')) + // 鏁伴噺 + $("#ImportQuantity1").val(""); + $("#Standard1").val(""); + $("#ImportFactQuantity1").val(""); + $("#FullQty").val(""); var param = { - PalletNo: $.cookie('stockCode1') + Id: parseInt($("#goodSelect1").val()) }; - // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭� - sendData(IP + "/PdaAsn/GetPalletBindInfo", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - var list = res - var arrTrs = new Array() - let idx = 0 - for (var i in res.data) { - var tr = $("#boxCell").eq(0).clone(); - tr.appendTo("#tableBoxList1"); - tr.attr('id', res.data[i].Id) - tr.attr('boxno', res.data[i].BoxNo) - tr.attr('BindNo', res.data[i].BindNo) - idx++; - tr.attr('index', idx) - tr.find("td[name='code']").html(res.data[i].SkuNo); - tr.find("td[name='name']").html(res.data[i].SkuName); - tr.find("td[name='lotNo']").html(res.data[i].LotNo); - tr.find("td[name='num']").html(res.data[i].Qty); - tr.find("td[name='del']").click(function () { - var elem = $(this).parent() - // var boxno = elem.attr('boxno') - var BindNo = elem.attr('BindNo') - console.log(res) - var Id = elem.attr('id') - layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖鎵樼墿鏂欏悧锛�<br>" + res.data[0].PalletNo, { - icon: 2, - time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - btn: ['鍒犻櫎', '鍙栨秷'], - yes: function () { - var param = { - Id: parseInt(Id), - PalletNo: res.data[0].PalletNo, - }; - console.log(Id) - console.log(param) - sendData(IP + "/PdaAsn/DelPalletBind", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - elem.remove() - setOrderGoods(); - refreshTable(); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); - } - }) - }) - tr.show(); - arrTrs[i] = tr - } - - //璁剧疆鍒嗛〉 - setPages(1, res.data.length) - - } else { //涓嶆垚鍔� - layer.msg("鏃犳暟鎹�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - $("#boxNum").val(0) - setPages(1, 0) + synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { + console.log(JSON.stringify(res)) + if (res.code == 0 && res.data != null) { //鎴愬姛 + $("#ImportQuantity1").val(res.data.Qty); + $("#Standard1").val(res.data.Standard); + $("#ImportFactQuantity1").val(res.data.FactQty + ""); + $("#FullQty").val(res.data.UDF1); } - }); - } - - } - - // 鍒ゆ柇鎵樼洏鐮佹槸鍚﹀彲鐢� - function checkPalletStat() { - if (xianshiyemian == 0) { - var param = { - "PalletNo": $("#STOCKCODE").val() - } - sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { - if (res.code == 0) { - - $.cookie('stockCode', $("#STOCKCODE").val()); - refreshTable() - $("#BOXCODE").focus(); - - } else { - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); - } - else if (xianshiyemian == 1) { - var param = { - "PalletNo": $("#STOCKCODE1").val() - } - sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { - if (res.code == 0) { - - $.cookie('stockCode1', $("#STOCKCODE1").val()); - refreshTable() - $("#SkuQty").focus(); - - } else { - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } + else { } }); } } + //缁戝畾鍒版墭鐩樹簨浠� + form.on('submit(formBind)', function (data) { + if (xianshiyemian == 0) { + console.log($("#goodSelect").val()); + if ($("#bar").val() == "") { + layer.msg('璇烽�夋嫨鍏ュ簱鍗�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#goodSelect").val() == "") { + layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#STOCKCODE").val() == "") { + layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#BOXCODE").val() == "") { + layer.msg('璇锋壂鎻忓绠辨潯鐮�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + var param = { + AsnNo: $("#bar").val(), + PalletNo: $("#STOCKCODE").val(), + AsnDetailId: parseInt($("#goodSelect").val()), + LotNo: $("#goodSelect").find("option:selected").text(), + BoxNo: $("#BOXCODE").val(), + IsContinue: isContinue, + TailBoxNo: $("#BOXCODE2").val(), + Origin: "PDA", + TableType: xianshiyemian, + } + console.log(param) + //缁勭洏 + sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + setOrderGoods(); + //refreshTable(); + $("#BOXCODE").val(""); + $("#BOXCODE2").val(""); + $("#QTY").val(""); + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + //鍥炶皟 + }); + } + }); + } + else if (xianshiyemian == 1) { + if ($("#bar1").val() == "") { + layer.msg('璇烽�夋嫨鍏ュ簱鍗�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#goodSelect1").val() == "") { + layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#STOCKCODE1").val() == "") { + layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + var param = { + AsnNo: $("#bar1").val(), //鍑哄簱鍗曟嵁 + PalletNo: $("#STOCKCODE1").val(), //鎵樼洏鏉$爜 + AsnDetailId: parseInt($("#goodSelect1").val()), //鍏ュ簱鍗曟槑缁咺D + LotNo: $("#goodSelect1").find("option:selected").text(), //鐗╂枡鎵规 + SkuQty: parseInt($("#SkuQty").val()), //鐗╂枡鏁伴噺 + Demo: $("#NoticeDemo").val(), //鐗╂枡鏁伴噺 + Origin: "PDA", + TableType: xianshiyemian, + } + + console.log(param) + //缁勭洏 + sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + setOrderGoods(); + //refreshTable(); + $("#STOCKCODE").val(""); + $("#SkuQty").val(""); + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + //鍥炶皟 + }); + } + }); + } + + return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� + }); + + + // 鏍规嵁鍏ュ簱鍗曞彿 鑾峰彇澶囨敞鏄惁鏄剧ず鍙婂娉ㄤ俊鎭� + function updateDemoDiv() { + var param = { + AsnNo: $("#bar1").val(), + }; + synData(IP + "/PdaAsn/GetArrivalNotice", param, 'post', function (res) { + console.log(res) + if (res.code == 0 && res.data != null) { //鎴愬姛 + + //鍒ゆ柇榛樿閫変腑鏄惁涓哄瘎瀛樼墿鏂� + if (res.data[0].Type == "7") { + $("textarea[name='NoticeDemo']").val(res.data[0].Demo); //澶囨敞 + $('#demodiv').show(); + $('#demodiv1').show(); + } + else { + $('#demodiv').hide(); + $('#demodiv1').hide(); + } + } + else { + $('#demodiv').hide(); + $('#demodiv1').hide(); + } + }); + } + + //绠卞洖杞︿簨浠� function checkBoxInfo() { var param = { "BoxNo": $("#BOXCODE").val(), + "ASNNo":$("#bar").val() } sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) { - BoxLevelVal = "0"; + + if (res.code == 0) { //鎴愬姛 - //鍒ゆ柇鏄惁涓洪浂绠盉itBoxMark - if (res.data[0].BitBoxMark == '1') { - getFMBoxinfo(); + + var bl = false; + if (res.data.length == 0) { + layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + if (res.data[0].ASNNo != '' && res.data[0].ASNNo != null) { + $("#bar").empty() + $("#bar").append('<option value =>' + '</option>'); + form.render('select'); + + $("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo + '</option>'); + + updateGoodList(res.data[0].SkuNo) + setOrderGoods(); } else { - var bl = false; - if (res.data.length == 0) { - layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", { + if (asnDetails == '') { + layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗曟嵁!", { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }); return; } - - if (res.data[0].ASNNo != '' && res.data[0].ASNNo != null) { - $("#bar").empty() - $("#bar").append('<option value =>' + '</option>'); - form.render('select'); - - $("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo + '</option>'); - - updateGoodList(res.data[0].SkuNo) - setOrderGoods(); - } else { - if (asnDetails == '') { - layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗曟嵁!", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - } - asnDetails.forEach(element => { - console.log(element); - - if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) { - var sel = 'dd[lay-value=' + element.id + ']'; - $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this'); - bl = true; - } - }); - if (!bl) { - layer.msg("姝ょ鐗╂枡涓嶇鍚堣鍏ュ簱鍗曪紝璇锋牳瀹�!", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - } else { - $("#BoxQty").val(res.data[0].Qty); - } } + asnDetails.forEach(element => { + console.log(element.SkuNo ); + console.log( res.data[0].SkuNo); + console.log(element.SkuNo == res.data[0].SkuNo); + console.log(element.LotNo == res.data[0].LotNo); + + if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) { + console.log("asdfasdfsadf"); + + var sel = 'dd[lay-value=' + element.id + ']'; + $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this'); + bl = true; + } + }); + console.log(bl); + + if (!bl) { + layer.msg("姝ょ鐗╂枡涓嶇鍚堣鍏ュ簱鍗曪紝璇锋牳瀹�!", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + } else { + $("#BoxQty").val(res.data[0].Qty); + } + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); //绠辩爜涓嶅瓨鍦紝璋冪敤璧嬬爜鎺ュ彛鑾峰彇绠变俊鎭� - getFMBoxinfo(); + //getFMBoxinfo(); } }); @@ -1334,6 +1126,7 @@ "BoxNo": $("#BOXCODE").val(), } sendData(IP + "/UpApi/GetFMBindBoxInfos", param, 'post', function (res) { + console.log(res); if (res.code == 0) { //鎴愬姛//鏍规嵁瀵规帴鎺ュ彛瀹氫箟鍚勫瓧娈靛垽鏂潯浠� var bl = false; if (res.data.length == 0) { @@ -1388,133 +1181,6 @@ }) } - - /* 鍒嗛〉 */ - //璁剧疆鍒嗛〉 - function setPages(pageIndex, boxNum) { - if (boxNum <= 0) { - //鍒楄〃涓虹┖锛岄殣钘忓垎椤甸〉鐮� - $("#tableBoxPages").hide() - return - } - - let pageNum = Math.floor(boxNum / 10); - if (boxNum % 10 > 0) { - pageNum += 1; - } - //console.log("pageNum is " + pageNum) - - $("#tableBoxPages").find("tr").remove() - let table = $("#tableBoxPages") - $("<tr></tr>").appendTo("#tableBoxPages") - - // let newTr = table.append("<tr></tr>") - // newTr.append("<td class='page-prev'>涓婁竴椤�</td>") - $("<td id='prevPage' class='page-prev'>涓婁竴椤�</td>").appendTo("#tableBoxPages tr") - $("#tableBoxPages tr").eq(0).find("td[id^='prevPage']").click(function () { - onClickPrevPage() - }) - for (i = 1; i < pageNum + 1; i++) { - // newTr.append("<td class='page-num'>"+ i +"</td>") - $("<td class='page-num'>" + i + "</td>").appendTo("#tableBoxPages tr") - } - // newTr.append("<td class='page-next'>涓嬩竴椤�</td>") - $("<td id='nextPage' class='page-next'>涓嬩竴椤�</td>").appendTo("#tableBoxPages tr") - $("#tableBoxPages tr").eq(0).find("td[id^='nextPage']").click(function () { - onClickNextPage() - }) - // pages.show() - $("#tableBoxPages").show() - - setCurPage(1) - } - - //璁剧疆褰撳墠鍒嗛〉 - function setCurPage(pageIndex) { - let totalTrNum = $("#tableBoxList tr").length - if (totalTrNum <= 2) { - //console.log("tableBoxList 涓虹┖ totalTrNum: " + totalTrNum) - //curPageIndex = 1 - return - } - - let pageNum = getBoxPageNum() - if (pageIndex > pageNum) { - //console.log("璁剧疆鐨勯〉鐮佽秴鍑洪〉鏁�, pageIndex : " + pageIndex) - //curPageIndex = 1 - return - } - - let startIndex = (pageIndex - 1) * 10 + 1 - let n = totalTrNum - startIndex - let endIndex = 0 - if (n > 9) { - endIndex = startIndex + 9 - } else { - endIndex = startIndex + n - } - //console.log("startIndex is "+startIndex) - //console.log("endIndex is "+endIndex) - //startIndex =2 - //endIndex = 2 - let trs = $("#tableBoxList tr") - //console.log("琛屾暟 "+trs.length) - let d = 0 - for (let i = 2; i < trs.length; i++) { - //console.log("琛岀储寮� " + trs.eq(i).attr('index')) - let t = trs.eq(i) - d = t.attr('index') - if (d >= startIndex && d <= endIndex) { - //console.log("闇�瑕佹樉绀�") - //鏄剧ず琛� - t.show() - } else { - //闅愯棌琛� - t.hide() - } - } - - curPageIndex = pageIndex - - let ptr = $("#tableBoxPages tr") - for (let i = 1; i < pageNum + 1; i++) { - ptr.eq(0).find("td").eq(i).removeClass("page-num-select") - if (i == curPageIndex) { - ptr.eq(0).find("td").eq(i).addClass("page-num-select") - } - } - //console.log("totalTrNum is " + totalTrNum) - } - - function onClickPrevPage() { - //console.log("涓婁竴椤垫寜閽鐐瑰嚮") - if (curPageIndex == 1) { - return - } - setCurPage(curPageIndex - 1) - } - - function onClickNextPage() { - //console.log("涓嬩竴椤垫寜閽鐐瑰嚮") - let n = getBoxPageNum() - if (curPageIndex == n - 1) { - return - } - setCurPage(curPageIndex + 1) - } - function getBoxPageNum() { - let num = $("#tableBoxList tr").length - if (num <= 2) { - return 0 - } - - let pageNum = Math.floor(num / 10); - if (num % 10 > 0) { - pageNum += 1; - } - - return pageNum - } /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ -- Gitblit v1.8.0