|  |  |  | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> | 
|---|
|  |  |  | <div id="zongDiv" class="layout-bill-info" style="height: 285px;"> | 
|---|
|  |  |  | <form class="layui-form" action=""> | 
|---|
|  |  |  | <div id="" class="layui-form-item layout-dropdownlist"> | 
|---|
|  |  |  | <label class="layui-form-label" lang>入库单:</label> | 
|---|
|  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> | 
|---|
|  |  |  | <tr> | 
|---|
|  |  |  | <th lang style="width: 15%;">编码</th> | 
|---|
|  |  |  | <th lang style="width: 15%;">箱码</th> | 
|---|
|  |  |  | <th lang style="width: 35%;">名称</th> | 
|---|
|  |  |  | <th lang style="width: 25%;">批次</th> | 
|---|
|  |  |  | <th lang style="width: 15%;">数量</th> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //当前分页 | 
|---|
|  |  |  | var curPageIndex = 1; | 
|---|
|  |  |  | //是否连续组托 | 
|---|
|  |  |  | //是否连续外箱组托 | 
|---|
|  |  |  | isContinue = "0"; | 
|---|
|  |  |  | //清楚文本框中数据 | 
|---|
|  |  |  | function clear() { | 
|---|
|  |  |  | function clear() { | 
|---|
|  |  |  | $("#BOXCODE").val(""); | 
|---|
|  |  |  | $("#BOXCODE2").val(""); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $("#ImportQuantity").val(""); | 
|---|
|  |  |  | $("#GoodsCode").val(""); | 
|---|
|  |  |  | $("#Standard").val(""); | 
|---|
|  |  |  | $("#ImportFactQuantity").val(""); | 
|---|
|  |  |  | $("#ImportQty").val(""); | 
|---|
|  |  |  | $("#BoxQty").val(""); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if ($("#STOCKCODE").val() == "") { | 
|---|
|  |  |  | layer.msg('请先扫描托盘码', { | 
|---|
|  |  |  | icon: 2, | 
|---|
|  |  |  | time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | $("#BOXCODE").val(""); | 
|---|
|  |  |  | $("#STOCKCODE").focus(); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // if ($("#STOCKCODE").val() == "") { | 
|---|
|  |  |  | //    layer.msg('请先扫描托盘码', { | 
|---|
|  |  |  | //       icon: 2, | 
|---|
|  |  |  | //       time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|---|
|  |  |  | //    }); | 
|---|
|  |  |  | //    $("#BOXCODE").val(""); | 
|---|
|  |  |  | //    $("#STOCKCODE").focus(); | 
|---|
|  |  |  | //    return; | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | checkBoxInfo() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //选中入库单事件 | 
|---|
|  |  |  | form.on('select(getbar)', function (data) { | 
|---|
|  |  |  | clear(); | 
|---|
|  |  |  | updateGoodList() | 
|---|
|  |  |  | setOrderGoods(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //选中物料事件 | 
|---|
|  |  |  | form.on('select(goodSelect)', function (data) { | 
|---|
|  |  |  | clear(); | 
|---|
|  |  |  | setOrderGoods(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | form.render('select'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var param = { | 
|---|
|  |  |  | Type: "0,1" | 
|---|
|  |  |  | Type: "0,1,2,3,4,5,6" | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { | 
|---|
|  |  |  | if (res.code == 0) { //成功 | 
|---|
|  |  |  | 
|---|
|  |  |  | var asnDetails = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 绑定入库单物料及批次 | 
|---|
|  |  |  | function updateGoodList() { | 
|---|
|  |  |  | console.log("aaaa"); | 
|---|
|  |  |  | function updateGoodList(skuNo) { | 
|---|
|  |  |  | var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') | 
|---|
|  |  |  | var val = input.val() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if (res.code == 0) { //成功 | 
|---|
|  |  |  | asnDetails = res.data; | 
|---|
|  |  |  | for (var i = 0; i < res.data.length; i++) { | 
|---|
|  |  |  | if (i == 0) { | 
|---|
|  |  |  | if(skuNo!='' && skuNo==res.data[i].SkuNo){ | 
|---|
|  |  |  | $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] | 
|---|
|  |  |  | .SkuName + "-" + res.data[i].LotNo + | 
|---|
|  |  |  | '</option>'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i] | 
|---|
|  |  |  | .SkuName + "-" + res.data[i].LotNo + | 
|---|
|  |  |  | '</option>'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | if (i == 0) { | 
|---|
|  |  |  | $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] | 
|---|
|  |  |  | .SkuName + "-" + res.data[i].LotNo + | 
|---|
|  |  |  | '</option>'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i] | 
|---|
|  |  |  | .SkuName + "-" + res.data[i].LotNo + | 
|---|
|  |  |  | '</option>'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | form.render('select'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | time: 0, //2秒关闭(如果不配置,默认是3秒) | 
|---|
|  |  |  | btn: ['删除', '取消'], | 
|---|
|  |  |  | yes: function () { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | console.log(Id); | 
|---|
|  |  |  | var param = { | 
|---|
|  |  |  | Id: Id, | 
|---|
|  |  |  | boxNo: res.data[i].BoxNo, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | sendData(IP + "/PdaAsn/DelBoxInfo", param, 'post', function (res) { | 
|---|
|  |  |  | sendData(IP + "/BllAsn/DelBindBoxInfo", param, 'get', function (res) { | 
|---|
|  |  |  | if (res.code == 0) { //成功 | 
|---|
|  |  |  | layer.msg(res.msg, { | 
|---|
|  |  |  | icon: 1, | 
|---|
|  |  |  | 
|---|
|  |  |  | var param = { | 
|---|
|  |  |  | "BoxNo": $("#BOXCODE").val(), | 
|---|
|  |  |  | } | 
|---|
|  |  |  | sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) { | 
|---|
|  |  |  | sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) { | 
|---|
|  |  |  | if (res.code == 0) { //成功 | 
|---|
|  |  |  | var bl = false; console.log(res.data); | 
|---|
|  |  |  | 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{ | 
|---|
|  |  |  | if(asnDetails==''){ | 
|---|
|  |  |  | layer.msg("请先选择入库单据!", { | 
|---|
|  |  |  | icon: 2, | 
|---|
|  |  |  | time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | asnDetails.forEach(element => { | 
|---|
|  |  |  | console.log(element); | 
|---|
|  |  |  | 
|---|
|  |  |  | form.on('switch(IsLianXu)', function (obj) { | 
|---|
|  |  |  | if (obj.elem.checked) { | 
|---|
|  |  |  | $('#BOX2').attr("style", "display:block") | 
|---|
|  |  |  | $('#zongDiv').attr("style", "height: 285px;") | 
|---|
|  |  |  | isContinue = "1"; | 
|---|
|  |  |  | $('#zongDiv').attr("style", "height: 305px;") | 
|---|
|  |  |  | isContinue = "1"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $('.BOX01').attr("style", "display:none") | 
|---|
|  |  |  | $('.BOX02').attr("style", "display:none") | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | $('#BOX2').attr("style", "display:none") | 
|---|
|  |  |  | $('#zongDiv').attr("style", "height: 255px;") | 
|---|
|  |  |  | $('#zongDiv').attr("style", "height: 285px;") | 
|---|
|  |  |  | isContinue = "0"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $('.BOX01').attr("style", "display:block"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | $('#BOXCODE2').val(""); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|