| | |
| | | </ul> |
| | | </div> |
| | | |
| | | <!-- <ul> |
| | | <li id="option1">标签</li> |
| | | <li id="option2">数量</li> |
| | | </ul> --> |
| | | |
| | | <button id="option1" class="layout-btn" type="button">标签</button> |
| | | <button id="option2" class="layout-btn" type="button">数量</button> |
| | | <br /><br /> |
| | |
| | | <div id="content1"> |
| | | <div id="zongDiv" class="layout-bill-info" style="height: 285px;"> |
| | | <form class="layui-form" action=""> |
| | | <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <!-- <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <label class="layui-form-label" lang>入库单:</label> |
| | | <div class="layui-input-block" id="selectDiv"> |
| | | <select id="bar" lay-filter="getbar" lay-search> |
| | |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | | </div> |
| | | </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"> |
| | |
| | | <div id="BOX" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>外箱条码:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="BOXCODE" type="text" lay-verify="required" lang langholder |
| | | <input id="BOXCODE" type="text" lang langholder |
| | | placeholder="请扫描外箱条码" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div id="BOX" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>追溯条码:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="BOXCODE3" type="text" lang langholder |
| | | placeholder="请扫描追溯条码" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div id="" class="layui-form-item layout-input"> |
| | |
| | | <div id="content2"> |
| | | <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> |
| | | <form class="layui-form" id="form2" action=""> |
| | | <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <!-- <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <label class="layui-form-label" lang>入库单:</label> |
| | | <div class="layui-input-block" id="selectDiv1"> |
| | | <select id="bar1" lay-filter="getbar1" lay-search> |
| | |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | | </div> |
| | | </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="goodDiv1"> |
| | |
| | | <br> |
| | | <br> |
| | | <div id="demodiv1"> |
| | | <br><br><br><br><br><br><br> |
| | | <br><br><br><!--<br><br><br><br> --> |
| | | </div> |
| | | |
| | | |
| | |
| | | checkBoxInfo() |
| | | } |
| | | }); |
| | | //箱码回车事件 |
| | | $("#BOXCODE3").keydown(function (e) { |
| | | if (e.keyCode === 13) { |
| | | if ($("#BOXCODE3").val() == "") { |
| | | layer.msg('请先扫描追溯码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return |
| | | } |
| | | |
| | | // if ($("#STOCKCODE").val() == "") { |
| | | // layer.msg('请先扫描托盘码', { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }); |
| | | // $("#BOXCODE").val(""); |
| | | // $("#STOCKCODE").focus(); |
| | | // return; |
| | | // } |
| | | checkBoxInfo3() |
| | | } |
| | | }); |
| | | /* 入库单据下拉框 */ |
| | | //点击入库单据下拉框事件 |
| | | $("#selectDiv").click(function () { |
| | | if (xianshiyemian == 0) { |
| | | var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateBillList(function (data) { |
| | | $('select[id="bar"]').next().addClass('layui-form-selected') |
| | | $('select[id="bar"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | } |
| | | }) |
| | | //点击入库单据下拉框事件 |
| | | $("#selectDiv1").click(function () { |
| | | if (xianshiyemian == 1) { |
| | | var input = $('select[id="bar1"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateBillList(function (data) { |
| | | $('select[id="bar1"]').next().addClass('layui-form-selected') |
| | | $('select[id="bar1"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | } |
| | | }) |
| | | // $("#selectDiv").click(function () { |
| | | // if (xianshiyemian == 0) { |
| | | // var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | // var val = input.val() |
| | | // //先更新一下入库单 |
| | | // updateBillList(function (data) { |
| | | // $('select[id="bar"]').next().addClass('layui-form-selected') |
| | | // $('select[id="bar"]').next().find('.layui-select-title input').val(val) |
| | | // }) |
| | | // } |
| | | // }) |
| | | // //点击入库单据下拉框事件 |
| | | // $("#selectDiv1").click(function () { |
| | | // if (xianshiyemian == 1) { |
| | | // var input = $('select[id="bar1"]').next().find('.layui-select-title input') |
| | | // var val = input.val() |
| | | // //先更新一下入库单 |
| | | // updateBillList(function (data) { |
| | | // $('select[id="bar1"]').next().addClass('layui-form-selected') |
| | | // $('select[id="bar1"]').next().find('.layui-select-title input').val(val) |
| | | // }) |
| | | // } |
| | | // }) |
| | | |
| | | /*————————————————————————————————————————————————————————————————————————————————————————————————*/ |
| | | |
| | | |
| | | /* 绑定入库单信息 */ |
| | | |
| | | function updateBillList(callback) { |
| | | if (xianshiyemian == 0) { |
| | | var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | $("#bar").empty() |
| | | $("#bar").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | // function updateBillList(callback) { |
| | | // if (xianshiyemian == 0) { |
| | | // var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | // var val = input.val() |
| | | // $("#bar").empty() |
| | | // $("#bar").append('<option value =>' + '</option>'); |
| | | // form.render('select'); |
| | | |
| | | var param = { |
| | | Type: "0,1,3" |
| | | }; |
| | | sendData(IP + "/PdaAsn/GetArrivalNotices", 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>'); |
| | | } |
| | | form.render('select'); |
| | | // var param = { |
| | | // Type: "0" |
| | | // }; |
| | | // sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { |
| | | // if (res.code == 0) { //成功 |
| | | // for (var i = 0; i < res.data.length; i++) { |
| | | // $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); |
| | | // } |
| | | // form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | // if (!val) { |
| | | // $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | // } else { |
| | | // var sel = 'dd[lay-value=' + val + ']'; |
| | | // $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | // } |
| | | |
| | | callback(res.data) |
| | | } else { //不成功 |
| | | // layer.msg(res.msg, { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | } |
| | | }); |
| | | } |
| | | else if (xianshiyemian == 1) { |
| | | var input = $('select[id="bar1"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | $("#bar1").empty() |
| | | $("#bar1").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | // callback(res.data) |
| | | // } else { //不成功 |
| | | // // layer.msg(res.msg, { |
| | | // // icon: 2, |
| | | // // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // // }, function() {}); |
| | | // } |
| | | // }); |
| | | // } |
| | | // else if (xianshiyemian == 1) { |
| | | // var input = $('select[id="bar1"]').next().find('.layui-select-title input') |
| | | // var val = input.val() |
| | | // $("#bar1").empty() |
| | | // $("#bar1").append('<option value =>' + '</option>'); |
| | | // form.render('select'); |
| | | |
| | | var param = { |
| | | Type: "1,2,3,4,5,6,7" |
| | | }; |
| | | sendData(IP + "/PdaAsn/GetArrivalNotices", 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>'); |
| | | } |
| | | form.render('select'); |
| | | // var param = { |
| | | // Type: "1" |
| | | // }; |
| | | // sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { |
| | | // if (res.code == 0) { //成功 |
| | | // console.log(res.data); |
| | | // for (var i = 0; i < res.data.length; i++) { |
| | | // $("#bar1").append('<option value =' + res.data[i] + '>' + res.data[i] +'</option>'); |
| | | // } |
| | | // form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#bar1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#bar1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | // if (!val) { |
| | | // $('#bar1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | // } else { |
| | | // var sel = 'dd[lay-value=' + val + ']'; |
| | | // $('#bar1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | // } |
| | | |
| | | callback(res.data) |
| | | } else { //不成功 |
| | | // layer.msg(res.msg, { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | } |
| | | }); |
| | | } |
| | | // callback(res.data) |
| | | // } else { //不成功 |
| | | // // layer.msg(res.msg, { |
| | | // // icon: 2, |
| | | // // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // // }, function() {}); |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | } |
| | | // } |
| | | |
| | | /*————————————————————————————————————————————————————————————————————————————————————————————————*/ |
| | | |
| | | //点击物料下拉框事件 |
| | | $("#goodDiv").click(function () { |
| | | if ($("#bar").val() == null || $("#bar").val() == "" || $("#bar").val() == undefined) { |
| | | layer.msg("请先选择入库单", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateGoodListNew(function (data) { |
| | | $('select[id="goodSelect"]').next().addClass('layui-form-selected') |
| | | $('select[id="goodSelect"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | |
| | | }) |
| | | //点击物料下拉框事件-数量 |
| | | $("#goodDiv1").click(function () { |
| | | if ($("#bar1").val() == null || $("#bar1").val() == "" || $("#bar1").val() == undefined) { |
| | | layer.msg("请先选择入库单", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | var input = $('select[id="goodSelect1"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateGoodListNew(function (data) { |
| | | $('select[id="goodSelect1"]').next().addClass('layui-form-selected') |
| | | $('select[id="goodSelect1"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | |
| | | }) |
| | | //选中入库单事件 |
| | | form.on('select(getbar)', function (data) { |
| | |
| | | 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 ($("#bar").val() == "") { |
| | | // layer.msg('请选择入库单', { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }); |
| | | // return; |
| | | // } |
| | | if ($("#goodSelect").val() == "") { |
| | | layer.msg('请选择物料及明细', { |
| | | icon: 2, |
| | |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#BOXCODE").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(), |
| | | AsnNo: $("#goodSelect").val(), |
| | | PalletNo: $("#STOCKCODE").val(), |
| | | AsnDetailId: parseInt($("#goodSelect").val()), |
| | | //AsnDetailId: parseInt($("#goodSelect").val()), |
| | | LotNo: $("#goodSelect").find("option:selected").text(), |
| | | BoxNo: $("#BOXCODE").val(), |
| | | BoxNo01: $("#BOXCODE3").val(), |
| | | IsContinue: isContinue, |
| | | TailBoxNo: $("#BOXCODE2").val(), |
| | | Origin: "PDA", |
| | |
| | | }); |
| | | } |
| | | else if (xianshiyemian == 1) { |
| | | if ($("#bar1").val() == "") { |
| | | layer.msg('请选择入库单', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | // if ($("#bar1").val() == "") { |
| | | // layer.msg('请选择入库单', { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }); |
| | | // return; |
| | | // } |
| | | var reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,4})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; |
| | | if ($("#goodSelect1").val() == "") { |
| | | layer.msg('请选择物料及明细', { |
| | | icon: 2, |
| | |
| | | }); |
| | | return; |
| | | } |
| | | if (!reg.test($("#SkuQty").val())) { |
| | | layer.msg("入库数量必须大于0(可保留4位小数)", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return -1; |
| | | } |
| | | var param = { |
| | | AsnNo: $("#bar1").val(), //出库单据 |
| | | AsnNo: $("#goodSelect1").val(), //出库单据 |
| | | PalletNo: $("#STOCKCODE1").val(), //托盘条码 |
| | | AsnDetailId: parseInt($("#goodSelect1").val()), //入库单明细ID |
| | | //AsnDetailId: parseInt($("#goodSelect1").val()), //入库单明细ID |
| | | LotNo: $("#goodSelect1").find("option:selected").text(), //物料批次 |
| | | SkuQty: parseInt($("#SkuQty").val()), //物料数量 |
| | | SkuQty: parseFloat($("#SkuQty").val()), //物料数量 |
| | | Demo: $("#NoticeDemo").val(), //物料数量 |
| | | Origin: "PDA", |
| | | TableType: xianshiyemian, |
| | |
| | | $("#ImportQuantity").val(res.data.Qty); |
| | | $("#Standard").val(res.data.Standard); |
| | | $("#ImportFactQuantity").val(res.data.FactQty + ""); |
| | | |
| | | } |
| | | }); |
| | | } |
| | |
| | | $("#ImportQuantity1").val(res.data.Qty); |
| | | $("#Standard1").val(res.data.Standard); |
| | | $("#ImportFactQuantity1").val(res.data.FactQty + ""); |
| | | if (res.data.SkuNo == "100088") { |
| | | $("textarea[name='NoticeDemo']").val(res.data.UDF5); //备注 |
| | | $('#demodiv').show(); |
| | | $('#demodiv1').show(); |
| | | }else{ |
| | | $('#demodiv').hide(); |
| | | $('#demodiv1').hide(); |
| | | |
| | | } |
| | | } |
| | | else { } |
| | | else { |
| | | $('#demodiv').hide(); |
| | | $('#demodiv1').hide(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | var asnDetails = ""; |
| | | |
| | | /* 绑定入库单物料及批次 */ |
| | | function updateGoodList(skuNo) { |
| | | function updateGoodListNew(callback) { |
| | | if (xianshiyemian == 0) { |
| | | console.log("aaaa"); |
| | | var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | |
| | |
| | | $("#goodSelect").append('<option value =>' + '</option>'); |
| | | |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | Type: "0", |
| | | }; |
| | | synData(IP + "/PdaAsn/GetBindArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | synData(IP + "/PdaAsn/GetArrivalNoticesInfo", param, 'post', function (res) { |
| | | |
| | | if (res.code == 0) { //成功 |
| | | asnDetails = res.data; |
| | | if (asnDetails.length <= 0) { |
| | | layer.msg('当前单据下不存在贴标物料', { |
| | | layer.msg('当前未查询到贴标物料信息', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (skuNo != '' && skuNo == res.data[i].SkuNo) { |
| | | if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i] |
| | | .SkuName + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | |
| | | if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id+'-'+res.data[i] |
| | | .SkuName + '>' + res.data[i].Id+'-'+res.data[i].SkuName + |
| | | '</option>'); |
| | | } else { |
| | | if (i == 0) { |
| | | if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i] |
| | | .SkuName + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | |
| | | } else { |
| | | if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + '>' + res.data[i] |
| | | .SkuName + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + '>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | } |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id +'-'+ res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + '>' +res.data[i].Id+'-'+ res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | |
| | | console.log(val +"+1"); |
| | | $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | |
| | | console.log(val +"+1"); |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | callback(res.data); |
| | | } else { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | } |
| | | }); |
| | | } |
| | |
| | | $("#goodSelect1").append('<option value =>' + '</option>'); |
| | | |
| | | var param = { |
| | | AsnNo: $("#bar1").val(), |
| | | Type: "1", |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | synData(IP + "/PdaAsn/GetArrivalNoticesInfo", param, 'post', function (res) { |
| | | |
| | | if (res.code == 0) { //成功 |
| | | asnDetails = res.data; |
| | | // console.log(asnDetails.length) |
| | |
| | | return; |
| | | } |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (skuNo != '' && skuNo == res.data[i].SkuNo) { |
| | | |
| | | if (i == 0) { |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName); |
| | | } else { |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i] |
| | | .SkuName); |
| | | } |
| | | if (res.data[i].LotNo != null) { |
| | | $("#goodSelect1").append("-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | |
| | | if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id+'-'+res.data[i] |
| | | .SkuName + '>' + res.data[i].Id+'-'+res.data[i].SkuName + |
| | | '</option>'); |
| | | } else { |
| | | if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id +'-'+ res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + '>' +res.data[i].Id+'-'+ res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | |
| | | |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#goodSelect1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#goodSelect1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | callback(res.data); |
| | | } else { |
| | | |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | // /* 绑定入库单物料及批次 */ |
| | | // function updateGoodList(skuNo) { |
| | | // if (xianshiyemian == 0) { |
| | | // console.log("aaaa"); |
| | | // var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') |
| | | // var val = input.val() |
| | | |
| | | // $("#goodSelect").empty() |
| | | // $("#goodSelect").append('<option value =>' + '</option>'); |
| | | |
| | | // var param = { |
| | | // AsnNo: $("#bar").val(), |
| | | // }; |
| | | // synData(IP + "/PdaAsn/GetBindArrivalNoticeDetails", param, 'post', function (res) { |
| | | // console.log("出库口:" + JSON.stringify(res)) |
| | | // if (res.code == 0) { //成功 |
| | | // asnDetails = res.data; |
| | | // if (asnDetails.length <= 0) { |
| | | // layer.msg('当前单据下不存在贴标物料', { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }); |
| | | // return; |
| | | // } |
| | | // for (var i = 0; i < res.data.length; i++) { |
| | | // if (skuNo != '' && skuNo == res.data[i].SkuNo) { |
| | | // if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | // $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i] |
| | | // .SkuName + |
| | | // '</option>'); |
| | | // } else { |
| | | // $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i] |
| | | // .SkuName + "-" + res.data[i].LotNo + |
| | | // '</option>'); |
| | | // } |
| | | // } else { |
| | | // if (i == 0) { |
| | | // if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | // $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i] |
| | | // .SkuName + |
| | | // '</option>'); |
| | | // } else { |
| | | // $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i] |
| | | // .SkuName + "-" + res.data[i].LotNo + |
| | | // '</option>'); |
| | | // } |
| | | |
| | | // } else { |
| | | // if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | // $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + '>' + res.data[i] |
| | | // .SkuName + |
| | | // '</option>'); |
| | | // } else { |
| | | // $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + '>' + res.data[i] |
| | | // .SkuName + "-" + res.data[i].LotNo + |
| | | // '</option>'); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // form.render('select'); |
| | | |
| | | // if (!val) { |
| | | // $('#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') |
| | | // } |
| | | // } else { |
| | | // } |
| | | // }); |
| | | // } |
| | | // else if (xianshiyemian == 1) { |
| | | // console.log("bbbb"); |
| | | // var input = $('select[id="goodSelect1"]').next().find('.layui-select-title input') |
| | | // var val = input.val() |
| | | |
| | | // $("#goodSelect1").empty() |
| | | // $("#goodSelect1").append('<option value =>' + '</option>'); |
| | | |
| | | // var param = { |
| | | // AsnNo: $("#bar1").val(), |
| | | // }; |
| | | // synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | // console.log("出库口:" + JSON.stringify(res)) |
| | | // if (res.code == 0) { //成功 |
| | | // asnDetails = res.data; |
| | | // // console.log(asnDetails.length) |
| | | // if (asnDetails.length <= 0) { |
| | | // layer.msg('当前单据下不存在不贴标物料', { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }); |
| | | // return; |
| | | // } |
| | | // for (var i = 0; i < res.data.length; i++) { |
| | | // if (skuNo != '' && skuNo == res.data[i].SkuNo) { |
| | | |
| | | // if (i == 0) { |
| | | // $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | // .SkuName); |
| | | // } else { |
| | | // $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i] |
| | | // .SkuName); |
| | | // } |
| | | // if (res.data[i].LotNo != null) { |
| | | // $("#goodSelect1").append("-" + res.data[i].LotNo + |
| | | // '</option>'); |
| | | // } |
| | | // } else { |
| | | // if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { |
| | | // $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | // .SkuName + |
| | | // '</option>'); |
| | | // } else { |
| | | // $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | // .SkuName + "-" + res.data[i].LotNo + |
| | | // '</option>'); |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | // form.render('select'); |
| | | |
| | | // if (!val) { |
| | | // $('#goodSelect1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | // } else { |
| | | // var sel = 'dd[lay-value=' + val + ']'; |
| | | // $('#goodSelect1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | // } |
| | | // } else { |
| | | |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | // } |
| | | |
| | | // 渲染箱码信息 |
| | | function refreshTable() { |
| | |
| | | function checkBoxInfo() { |
| | | var param = { |
| | | "BoxNo": $("#BOXCODE").val(), |
| | | "AsnNo":$("#goodSelect").val(), |
| | | } |
| | | sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | |
| | | }); |
| | | return; |
| | | } |
| | | if (res.data[0].ASNNo != '' && res.data[0].ASNNo != null) { |
| | | $("#bar").empty() |
| | | $("#bar").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | // 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>'); |
| | | // $("#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; |
| | | } |
| | | } |
| | | // // updateGoodList(res.data[0].SkuNo) |
| | | // setOrderGoods(); |
| | | // } else { |
| | | // if (asnDetails == '') { |
| | | // layer.msg("请先选择入库单据!", { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }); |
| | | // return; |
| | | // } |
| | | // } |
| | | asnDetails.forEach(element => { |
| | | console.log(element); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | function checkBoxInfo3() { |
| | | var param = { |
| | | "BoxNo3": $("#BOXCODE3").val(), |
| | | "AsnNo":$("#goodSelect").val(), |
| | | } |
| | | sendData(IP + "/PdaAsn/GetBindBoxInfo2s", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | var bl = false; |
| | | if (res.data.length == 0) { |
| | | 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); |
| | | } |
| | | |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /* 分页 */ |
| | | //设置分页 |