| | |
| | | <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> |
| | | <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 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> |
| | | <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 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="请扫描托盘条码" |
| | | <input id="STOCKCODE" 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="请输入物料数量" |
| | | <input id="SkuQty" type="text" lay-verify="stock" lang langholder placeholder="请输入物料数量" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | <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" |
| | | <input id="Standard1" type="text" disabled placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | <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="" |
| | | <input id="ImportQuantity1" type="text" disabled placeholder="" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | <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="" |
| | | <input id="ImportFactQuantity1" type="text" disabled placeholder="" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | checkPalletStat() |
| | | }) |
| | | |
| | | // 托盘码文本改变时触发-数量 |
| | | $("#STOCKCODEw").on('input', function () { |
| | | |
| | | if ($("#STOCKCODEw").val() == "" || $("#STOCKCODEw").val().length < 8) { |
| | | return |
| | | } |
| | | if ($("#STOCKCODEw").val().length >= 8) { |
| | | $("#STOCKCODEw").val($("#STOCKCODEw").val().substr(-8)) |
| | | } |
| | | checkPalletStat() |
| | | }) |
| | | |
| | | //箱码回车事件 |
| | | $("#BOXCODE").keydown(function (e) { |
| | | if (e.keyCode === 13) { |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | /* 入库单据下拉框 */ |
| | | //点击入库单据下拉框事件 |
| | | $("#selectDiv").click(function () { |
| | | 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) |
| | | }) |
| | | 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) |
| | | }) |
| | | } |
| | | }) |
| | | //点击入库单据下拉框事件-数量 |
| | | $("#selectDivw").click(function () { |
| | | var input = $('select[id="barw"]').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) |
| | | }) |
| | | //点击入库单据下拉框事件 |
| | | $("#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'); |
| | | |
| | | 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: "0,1" |
| | | }; |
| | | 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(); |
| | | }); |
| | | |
| | | |
| | | //选中物料事件 |
| | | form.on('select(goodSelect)', function (data) { |
| | | setOrderGoods(); |
| | | }); |
| | | //选中物料事件-数量 |
| | | form.on('select(goodSelectw)', function (data) { |
| | | //选中物料事件-数量 |
| | | form.on('select(goodSelect1)', function (data) { |
| | | setOrderGoods(); |
| | | }); |
| | | |
| | | |
| | | //绑定到托盘事件 |
| | | form.on('submit(formBind)', function (data) { |
| | |
| | | |
| | | // 根据入库明细ID 获取详细信息 |
| | | function setOrderGoods() { |
| | | $("#ImportQuantity").val(""); |
| | | $("#Standard").val(""); |
| | | $("#ImportFactQuantity").val(""); |
| | | if (xianshiyemian == 0) |
| | | { |
| | | $("#ImportQuantity").val(""); |
| | | $("#Standard").val(""); |
| | | $("#ImportFactQuantity").val(""); |
| | | |
| | | var param = { |
| | | Id: parseInt($("#goodSelect").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 + ""); |
| | | } |
| | | }); |
| | | 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(""); |
| | | |
| | | 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 + ""); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // 根据入库明细ID 获取详细信息-数量 |
| | | function setOrderGoodsw() { |
| | | $("#ImportQuantity").val(""); |
| | | $("#Standard").val(""); |
| | | $("#ImportFactQuantity").val(""); |
| | | |
| | | var param = { |
| | | Id: parseInt($("#goodSelectw").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 + ""); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 绑定入库单信息 |
| | | 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() { |
| | | console.log("aaaa"); |
| | | var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | 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>'); |
| | | $("#goodSelect").empty() |
| | | $("#goodSelect").append('<option value =>' + '</option>'); |
| | | |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | if (res.code == 0) { //成功 |
| | | asnDetails = res.data; |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | 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>'); |
| | | } |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | if (res.code == 0) { //成功 |
| | | asnDetails = res.data; |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | 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'); |
| | | } |
| | | 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 { |
| | | } |
| | | }); |
| | | 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; |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (i == 0) { |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelect1").append('<option value =' + 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') |
| | | } |
| | | } else { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // 绑定入库单物料及批次-数量 |
| | | function updateGoodList() { |
| | | console.log("aaaa"); |
| | | var input = $('select[id="goodSelectw"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | |
| | | $("#goodSelectw").empty() |
| | | $("#goodSelectw").append('<option value =>' + '</option>'); |
| | | |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | if (res.code == 0) { //成功 |
| | | 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] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelectw").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') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#goodSelectw').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | } else { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 渲染箱码信息 |
| | | function refreshTable() { |
| | | //先清空一下箱子列表 |
| | |
| | | } |
| | | }); |
| | | } |
| | | // 判断托盘码是否可用 |
| | | function checkPalletStatw() { |
| | | var param = { |
| | | "PalletNo": $("#STOCKCODEw").val() |
| | | } |
| | | sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | |
| | | $.cookie('STOCKCODEw', $("#STOCKCODEw").val()); |
| | | refreshTable() |
| | | // $("#BOXCODE").focus(); |
| | | |
| | | } else { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | function checkBoxInfo() { |
| | | var param = { |