| | |
| | | <!-- 有码 --> |
| | | <div id="content1"> |
| | | <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> |
| | | <form class="layui-form" action=""> |
| | | <form class="layui-form" id="form1" action=""> |
| | | <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <label class="layui-form-label" lang>入库单:</label> |
| | | <div class="layui-input-block" id="selectDiv"> |
| | |
| | | |
| | | </table> |
| | | |
| | | </form> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 无码 --> |
| | | <div id="content2"> |
| | | <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> |
| | | <form class="layui-form" action=""> |
| | | <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <label class="layui-form-label" lang>入库单:</label> |
| | | <div class="layui-input-block" id="selectDivw"> |
| | | <select id="barw" lay-filter="getbar" lay-search> |
| | | <option value=""></option> |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | | </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="goodDivw"> |
| | | <select id="goodSelectw" lay-filter="goodSelectw" lay-search> |
| | | <option value=""></option> |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>托盘条码:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="STOCKCODEw" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>物料数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="SkuQtyw" type="text" lay-verify="stock" lang langholder placeholder="请输入物料数量" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <table class="layout-tbl-input" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td> |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>规格/型号:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="Standardw" type="text" disabled placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>计划数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="ImportQuantityw" type="text" disabled placeholder="" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </td> |
| | | |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>已组数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="ImportFactQuantityw" type="text" disabled placeholder="" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | |
| | | </table> |
| | | |
| | | </form> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td style="width: 23%;"></td> |
| | |
| | | |
| | | </tr> |
| | | </table> |
| | | |
| | | </form> |
| | | </div> |
| | | |
| | | <br> |
| | | |
| | |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding=""> |
| | | <tr style="display: ;"> |
| | | <td class="page-prev">上一页</td> |
| | | <td class="page-num page-num-select">1</td> |
| | | <td class="page-num">2</td> |
| | | <td class="page-num">3</td> |
| | | <td class="page-num">4</td> |
| | | <td class="page-num">5</td> |
| | | <td class="page-next">下一页</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 无码 --> |
| | | <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"> |
| | | <label class="layui-form-label" lang>入库单:</label> |
| | | <div class="layui-input-block" id="selectDiv1"> |
| | | <select id="bar1" lay-filter="getbar" lay-search> |
| | | <option value=""></option> |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | | </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"> |
| | | <select id="goodSelect1" lay-filter="goodSelect1" lay-search> |
| | | <option value=""></option> |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>托盘条码:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="STOCKCODE1" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>物料数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="SkuQty" type="text" lay-verify="stock" lang langholder placeholder="请输入物料数量" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <table class="layout-tbl-input" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td> |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>规格/型号:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="Standard1" type="text" disabled placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>计划数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="ImportQuantity1" type="text" disabled placeholder="" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </td> |
| | | |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>已组数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="ImportFactQuantity1" type="text" disabled placeholder="" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | |
| | | </table> |
| | | |
| | | <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td style="width: 23%;"></td> |
| | | <td> |
| | | <button class="layout-btn layout-btn-red" lang type="button" lay-submit |
| | | lay-filter="formBind">绑定到托盘</button> |
| | | </td> |
| | | <td style="width: 33%;"></td> |
| | | |
| | | </tr> |
| | | </table> |
| | | |
| | | </form> |
| | | </div> |
| | | |
| | | <br> |
| | | |
| | | <div id="" class="cut-line"> |
| | | <img src="/assets/fengexian.png"> |
| | | </div> |
| | | |
| | | <div class="layout-tbl-paging" id=""> |
| | | <table id="tableBoxList1" class="tbl-box-list" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <th lang style="width: 15%;">编码</th> |
| | | <th lang style="width: 35%;">名称</th> |
| | | <th lang style="width: 25%;">批次</th> |
| | | <th lang style="width: 15%;">数量</th> |
| | | <th lang style="width: 10%;">操作</th> |
| | | </tr> |
| | | <tr id="boxCell" style="display: none;"> |
| | | <td name="code">AG000001</td> |
| | | <td name="name">疫苗名称名称名称</td> |
| | | <td name="lotNo">批次号</td> |
| | | <td name="num">30</td> |
| | | <td name="del"> |
| | | <div id="" class="tbl-btn-del" lang> |
| | | 删除 |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding=""> |
| | | <tr style="display: ;"> |
| | | <td class="page-prev">上一页</td> |
| | | <td class="page-num page-num-select">1</td> |
| | | <td class="page-num">2</td> |
| | | <td class="page-num">3</td> |
| | | <td class="page-num">4</td> |
| | | <td class="page-num">5</td> |
| | | <td class="page-next">下一页</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | |
| | | $('#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;"); //选中后颜色 |
| | |
| | | }); |
| | | |
| | | $('#option2').click(function() { |
| | | // qingkong(); |
| | | xianshiyemian = 1; |
| | | $('#content1').hide(); |
| | | $('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //默认颜色 |
| | |
| | | }); |
| | | }); |
| | | |
| | | //清空两个标签页内容 |
| | | function qingkong() |
| | | { |
| | | //入库单据 |
| | | // $('#form1').reset() |
| | | // $('#form2').reset() |
| | | |
| | | // //表格内容 |
| | | // let trs = $("#tableBoxList tr") |
| | | // let len = trs.length |
| | | |
| | | // for (i = len - 1; i >= 2; i--) { |
| | | // trs[i].remove(); |
| | | // } |
| | | // let trs1 = $("#tableBoxList1 tr") |
| | | // let len1 = trs1.length |
| | | |
| | | // for (i = len1 - 1; i >= 2; i--) { |
| | | // trs1[i].remove(); |
| | | // } |
| | | } |
| | | |
| | | /*——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————*/ |
| | | |
| | | initLanguage() |
| | | setLanguage() |
| | |
| | | } |
| | | checkPalletStat() |
| | | }) |
| | | // 托盘码文本改变时触发 |
| | | $("#STOCKCODE1").on('input', function () { |
| | | |
| | | // 托盘码文本改变时触发-数量 |
| | | $("#STOCKCODEw").on('input', function () { |
| | | |
| | | if ($("#STOCKCODEw").val() == "" || $("#STOCKCODEw").val().length < 8) { |
| | | if ($("#STOCKCODE1").val() == "" || $("#STOCKCODE1").val().length < 8) { |
| | | return |
| | | } |
| | | if ($("#STOCKCODEw").val().length >= 8) { |
| | | $("#STOCKCODEw").val($("#STOCKCODEw").val().substr(-8)) |
| | | if ($("#STOCKCODE1").val().length >= 8) { |
| | | $("#STOCKCODE1").val($("#STOCKCODE1").val().substr(-8)) |
| | | } |
| | | checkPalletStat() |
| | | }) |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | /* 入库单据下拉框 */ |
| | | //点击入库单据下拉框事件 |
| | | $("#selectDiv").click(function () { |
| | | if (xianshiyemian == 0) |
| | | { |
| | | var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | |
| | | $('select[id="bar"]').next().addClass('layui-form-selected') |
| | | $('select[id="bar"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | } |
| | | }) |
| | | //点击入库单据下拉框事件-数量 |
| | | $("#selectDivw").click(function () { |
| | | var input = $('select[id="barw"]').next().find('.layui-select-title input') |
| | | //点击入库单据下拉框事件 |
| | | $("#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="barw"]').next().addClass('layui-form-selected') |
| | | $('select[id="barw"]').next().find('.layui-select-title input').val(val) |
| | | $('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'); |
| | | |
| | | var param = { |
| | | Type: "0,1" |
| | | }; |
| | | 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'); |
| | | |
| | | 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'); |
| | | |
| | | var param = { |
| | | Type: "2" |
| | | }; |
| | | 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'); |
| | | |
| | | 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() {}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | /*————————————————————————————————————————————————————————————————————————————————————————————————*/ |
| | | |
| | | //点击物料下拉框事件 |
| | | $("#goodDiv").click(function () { |
| | |
| | | }, function () { }); |
| | | } |
| | | }) |
| | | //点击物料下拉框事件-数量 |
| | | $("#goodDivw").click(function () { |
| | | if ($("#barw").val() == null || $("#barw").val() == "" || $("#barw").val() == undefined) { |
| | | layer.msg("请先选择入库单", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }) |
| | | |
| | | //选中入库单事件 |
| | | form.on('select(getbar)', function (data) { |
| | | updateGoodList() |
| | | setOrderGoods(); |
| | | }); |
| | | //选中入库单事件-数量 |
| | | form.on('select(getbarw)', function (data) { |
| | | updateGoodListw() |
| | | setOrderGoodsw(); |
| | | }); |
| | | |
| | | //选中物料事件 |
| | |
| | | setOrderGoods(); |
| | | }); |
| | | //选中物料事件-数量 |
| | | form.on('select(goodSelectw)', function (data) { |
| | | form.on('select(goodSelect1)', function (data) { |
| | | setOrderGoods(); |
| | | }); |
| | | |
| | | |
| | | //绑定到托盘事件 |
| | | form.on('submit(formBind)', function (data) { |
| | | if(xianshiyemian == 0) |
| | | { |
| | | console.log(isContinue); |
| | | console.log($("#goodSelect").val()); |
| | | if ($("#bar").val() == "") { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | 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()), //物料批次 |
| | | SkuQty: parseInt($("#SkuQty").val()), //物料数量 |
| | | Origin:"PDA" |
| | | } |
| | | |
| | | 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; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 |
| | | }); |
| | | |
| | | |
| | | // 根据入库明细ID 获取详细信息 |
| | | function setOrderGoods() { |
| | | if (xianshiyemian == 0) |
| | | { |
| | | $("#ImportQuantity").val(""); |
| | | $("#Standard").val(""); |
| | | $("#ImportFactQuantity").val(""); |
| | |
| | | } |
| | | }); |
| | | } |
| | | // 根据入库明细ID 获取详细信息-数量 |
| | | function setOrderGoodsw() { |
| | | $("#ImportQuantity").val(""); |
| | | $("#Standard").val(""); |
| | | $("#ImportFactQuantity").val(""); |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | $("#ImportQuantity1").val(""); |
| | | $("#Standard1").val(""); |
| | | $("#ImportFactQuantity1").val(""); |
| | | |
| | | var param = { |
| | | Id: parseInt($("#goodSelectw").val()) |
| | | Id: parseInt($("#goodSelect1").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 + ""); |
| | | $("#ImportQuantity1").val(res.data.Qty); |
| | | $("#Standard1").val(res.data.Standard); |
| | | $("#ImportFactQuantity1").val(res.data.FactQty + ""); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 绑定入库单信息 |
| | | function updateBillList(callback) { |
| | | 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" |
| | | }; |
| | | 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'); |
| | | |
| | | 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() {}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | var asnDetails = ""; |
| | | |
| | | // 绑定入库单物料及批次 |
| | | /* 绑定入库单物料及批次 */ |
| | | function updateGoodList() { |
| | | if (xianshiyemian == 0) |
| | | { |
| | | console.log("aaaa"); |
| | | var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | |
| | | } |
| | | }); |
| | | } |
| | | // 绑定入库单物料及批次-数量 |
| | | function updateGoodList() { |
| | | console.log("aaaa"); |
| | | var input = $('select[id="goodSelectw"]').next().find('.layui-select-title input') |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | console.log("bbbb"); |
| | | var input = $('select[id="goodSelect1"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | |
| | | $("#goodSelectw").empty() |
| | | $("#goodSelectw").append('<option value =>' + '</option>'); |
| | | $("#goodSelect1").empty() |
| | | $("#goodSelect1").append('<option value =>' + '</option>'); |
| | | |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | AsnNo: $("#bar1").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | |
| | | asnDetails = res.data; |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (i == 0) { |
| | | $("#goodSelectw").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelectw").append('<option value =' + res.data[i].Id + '>' + res.data[i] |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#goodSelectw').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | $('#goodSelect1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#goodSelectw').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | $('#goodSelect1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | } else { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 渲染箱码信息 |
| | | function refreshTable() { |
| | | if (xianshiyemian == 0) |
| | | { |
| | | |
| | | //先清空一下箱子列表 |
| | | let trs = $("#tableBoxList tr") |
| | | let len = trs.length |
| | |
| | | arrTrs[i] = tr |
| | | } |
| | | |
| | | //设置分页 |
| | | setPages(1, list.length) |
| | | } else { //不成功 |
| | | layer.msg("无数据", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | $("#boxNum").val(0) |
| | | setPages(1, 0) |
| | | } |
| | | }); |
| | | |
| | | } |
| | | 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')) |
| | | |
| | | var param = { |
| | | PalletNo: $.cookie('stockCode1') |
| | | }; |
| | | // 根据托盘号获取箱码信息 |
| | | 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("#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].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 = { |
| | | Id: Id, |
| | | }; |
| | | sendData(IP + "/PdaAsn/DelBoxInfo", 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, list.length) |
| | | |
| | | } else { //不成功 |
| | | layer.msg("无数据", { |
| | |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | $("#boxNum").val(0) |
| | | setPages(1, 0) |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 判断托盘码是否可用 |
| | | function checkPalletStat() { |
| | | if (xianshiyemian == 0) |
| | | { |
| | | var param = { |
| | | "PalletNo": $("#STOCKCODE").val() |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | // 判断托盘码是否可用 |
| | | function checkPalletStatw() { |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | var param = { |
| | | "PalletNo": $("#STOCKCODEw").val() |
| | | "PalletNo": $("#STOCKCODE1").val() |
| | | } |
| | | sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | |
| | | $.cookie('STOCKCODEw', $("#STOCKCODEw").val()); |
| | | $.cookie('stockCode1', $("#STOCKCODE1").val()); |
| | | refreshTable() |
| | | // $("#BOXCODE").focus(); |
| | | $("#SkuQty").focus(); |
| | | |
| | | } else { |
| | | layer.msg(res.msg, { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | function checkBoxInfo() { |
| | | var param = { |
| | |
| | | } |
| | | |
| | | |
| | | /* 分页 */ |
| | | //设置分页 |
| | | function setPages(pageIndex, boxNum){ |
| | | |
| | | if (xianshiyemian == 0) |
| | | { |
| | | 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) |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | if(boxNum <= 0){ |
| | | //列表为空,隐藏分页页码 |
| | | $("#tableBoxPages1").hide() |
| | | return |
| | | } |
| | | |
| | | let pageNum = Math.floor(boxNum / 10); |
| | | if(boxNum % 10 > 0){ |
| | | pageNum += 1; |
| | | } |
| | | //console.log("pageNum is " + pageNum) |
| | | |
| | | $("#tableBoxPages1").find("tr").remove() |
| | | let table = $("#tableBoxPages1") |
| | | $("<tr></tr>").appendTo("#tableBoxPages1") |
| | | |
| | | // let newTr = table.append("<tr></tr>") |
| | | // newTr.append("<td class='page-prev'>上一页</td>") |
| | | $("<td id='prevPage' class='page-prev'>上一页</td>").appendTo("#tableBoxPages1 tr") |
| | | $("#tableBoxPages1 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("#tableBoxPages1 tr") |
| | | } |
| | | // newTr.append("<td class='page-next'>下一页</td>") |
| | | $("<td id='nextPage' class='page-next'>下一页</td>").appendTo("#tableBoxPages1 tr") |
| | | $("#tableBoxPages1 tr").eq(0).find("td[id^='nextPage']").click(function(){ |
| | | onClickNextPage() |
| | | }) |
| | | // pages.show() |
| | | $("#tableBoxPages1").show() |
| | | |
| | | setCurPage(1) |
| | | } |
| | | |
| | | } |
| | | |
| | | //设置当前分页 |
| | | function setCurPage(pageIndex){ |
| | | if (xianshiyemian == 0) |
| | | { |
| | | 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 |
| | | } |
| | | |
| | | 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") |
| | | } |
| | | } |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | let totalTrNum = $("#tableBoxList1 tr").length |
| | | if(totalTrNum <= 2 ){ |
| | | 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 |
| | | } |
| | | |
| | | let trs = $("#tableBoxList1 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 = $("#tableBoxPages1 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") |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /*——————————————————————————————————————————————————————————*/ |
| | | |
| | | form.on('switch(IsLianXu)', function (obj) { |
| | | if (obj.elem.checked) { |