| | |
| | | <div class="layui-input-block" id="selectRuku"> |
| | | <select id="Ruku" lay-filter="getRuku" lay-search> |
| | | <option value=""></option> |
| | | <option value="A">A</option> |
| | | <option value="B">B</option> |
| | | <option value="C">C</option> |
| | | <option value="D">D</option> |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | | </div> |
| | |
| | | <td style="width: 23%;"></td> |
| | | <td> |
| | | <button class="layout-btn layout-btn-red" lang type="button" lay-submit |
| | | lay-filter="formBind">叫小车</button> |
| | | lay-filter="formCall">叫小车</button> |
| | | </td> |
| | | <td style="width: 33%;"></td> |
| | | |
| | |
| | | <div class="layout-tbl-paging" id=""> |
| | | <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <th lang style="width: 15%;">编码</th> |
| | | <th lang style="width: 35%;">名称</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> |
| | | <th lang style="width: 15%;">物料数量</th> |
| | | </tr> |
| | | <tr id="boxCell" style="display: none;"> |
| | | <td name="code">AG000001</td> |
| | |
| | | <img src="/assets/down_arraw.png"> |
| | | </div> |
| | | </div> |
| | | <div id="" class="layui-form-item layout-input"> |
| | | <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <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 class="layui-input-block" id="selectPalletNo"> |
| | | <select id="PalletNo" lay-filter="getPalletNo" lay-search> |
| | | <option value=""></option> |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | | </div> |
| | | </div> |
| | | <div id="" class="layui-form-item layout-dropdownlist"> |
| | |
| | | <td style="width: 23%;"></td> |
| | | <td> |
| | | <button class="layout-btn layout-btn-red" lang type="button" lay-submit |
| | | lay-filter="formBind">叫小车</button> |
| | | lay-filter="formCall2">叫小车</button> |
| | | </td> |
| | | <td style="width: 33%;"></td> |
| | | |
| | |
| | | <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> |
| | | <!-- 分页 --> |
| | |
| | | |
| | | }); |
| | | }); |
| | | |
| | | //清楚文本框中数据 |
| | | // 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(""); |
| | | // } |
| | | |
| | | // } |
| | | |
| | | /*——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————*/ |
| | | |
| | |
| | | }); |
| | | return |
| | | } |
| | | if ($("#LocatNo").val() == "") { |
| | | layer.msg('请扫描正确的托盘条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return |
| | | } |
| | | var input = $('select[id="Quyu"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下目标区域 |
| | |
| | | |
| | | callback(res.data) |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //点击出库单据下拉框事件 |
| | | $("#selectOutNo").click(function () { |
| | | var input = $('select[id="OutNo"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下出库单 |
| | | updateBillList(function (data) { |
| | | $('select[id="OutNo"]').next().addClass('layui-form-selected') |
| | | $('select[id="OutNo"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | }) |
| | | |
| | | /* 绑定出库单信息 */ |
| | | function updateBillList(callback) { |
| | | var input = $('select[id="OutNo"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | $("#OutNo").empty() |
| | | $("#OutNo").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | |
| | | var param = { |
| | | |
| | | }; |
| | | sendData(IP + "/PdaCr/GetRunSoNoticeList", param, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | $("#OutNo").append('<option value =' + res.data[i] + '>' + res.data[i]+ |
| | | '</option>'); |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#OutNo').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#OutNo').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秒) |
| | |
| | | } |
| | | }); |
| | | } |
| | | //选中出库单事件 |
| | | form.on('select(getOutNo)', function (data) { |
| | | $("#PalletNo").empty() |
| | | $("#PalletNo").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | |
| | | //点击出库单据下拉框事件 |
| | | $("#selectOutNo").click(function () { |
| | | if (xianshiyemian == 1) { |
| | | var input = $('select[id="OutNo"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateBillList(function (data) { |
| | | $('select[id="OutNo"]').next().addClass('layui-form-selected') |
| | | $('select[id="OutNo"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | $("#Quyu2").empty() |
| | | $("#Quyu2").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | |
| | | refreshTable() |
| | | }); |
| | | |
| | | //点击托盘条码下拉框事件 |
| | | $("#selectPalletNo").click(function () { |
| | | if ($("#OutNo").val() == "") { |
| | | layer.msg('请先选择出库单', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return |
| | | } |
| | | var input = $('select[id="PalletNo"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | |
| | | updatePalletNoList(function (data) { |
| | | $('select[id="PalletNo"]').next().addClass('layui-form-selected') |
| | | $('select[id="PalletNo"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | }) |
| | | |
| | | /* 绑定入库单信息 */ |
| | | function updateBillList(callback) { |
| | | var input = $('select[id="OutNo"]').next().find('.layui-select-title input') |
| | | /* 绑定出库单下托盘条码信息 */ |
| | | function updatePalletNoList(callback) { |
| | | var input = $('select[id="PalletNo"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | $("#bar").empty() |
| | | $("#bar").append('<option value =>' + '</option>'); |
| | | $("#PalletNo").empty() |
| | | $("#PalletNo").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | |
| | | var param = { |
| | | Type: "0,1,3" |
| | | soNo:$("#OutNo").val() |
| | | }; |
| | | sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { |
| | | sendData(IP + "/PdaCr/GetPalletNoListBySoNo", param, 'get', 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 + |
| | | $("#PalletNo").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') |
| | | $('#PalletNo').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') |
| | | $('#PalletNo').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | |
| | | callback(res.data) |
| | |
| | | }); |
| | | } |
| | | |
| | | //选中托盘事件 |
| | | form.on('select(getPalletNo)', function (data) { |
| | | refreshTable() |
| | | |
| | | $("#Quyu2").empty() |
| | | $("#Quyu2").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | }); |
| | | |
| | | //点击目标区域下拉框事件 |
| | | $("#selectQuyu2").click(function () { |
| | | if ($("#PalletNo").val() == "") { |
| | | layer.msg('请先选择托盘条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return |
| | | } |
| | | var input = $('select[id="Quyu2"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下目标区域 |
| | | updateQuyuList2(function (data) { |
| | | $('select[id="Quyu2"]').next().addClass('layui-form-selected') |
| | | $('select[id="Quyu2"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | }) |
| | | |
| | | /* 绑定目标区域信息 */ |
| | | function updateQuyuList2(callback) { |
| | | var input = $('select[id="Quyu2"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | $("#Quyu2").empty() |
| | | $("#Quyu2").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | |
| | | var param = { |
| | | "PalletNo": $("#PalletNo").val() |
| | | }; |
| | | sendData(IP + "/PdaCr/GetStorageArea", param, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | $("#Quyu2").append('<option value =' + res.data[i].AreaNo + '>' + res.data[i] |
| | | .AreaNo + '-'+res.data[i].AreaName+ |
| | | '</option>'); |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#Quyu2').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#Quyu2').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() {}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //呼叫小车事件 |
| | | form.on('submit(formCall)', function (data) { |
| | | if (xianshiyemian == 0) { |
| | | if ($("#STOCKCODE").val() == "") { |
| | | layer.msg('请扫描托盘条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#LocatNo").val() == "") { |
| | | layer.msg('请扫描正确的托盘条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#Quyu").val() != "" && $("#Ruku").val() != "") { |
| | | layer.msg('目标区域和入库口不能同时选择', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | var param = { |
| | | PalletNo: $("#STOCKCODE").val(), |
| | | AreaNo: $("#Quyu").val(), |
| | | Ruku: $("#Ruku").val() |
| | | } |
| | | //呼叫小车 |
| | | sendData(IP + "/PdaCr/AgvTransport", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | //回调 |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | else if (xianshiyemian == 1) { |
| | | if ($("#OutNo").val() == "") { |
| | | layer.msg('请选择出库单', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#PalletNo").val() == "") { |
| | | layer.msg('请扫描托盘条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#Quyu2").val() == "") { |
| | | layer.msg('请选择目标区域', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | var param = { |
| | | SoNo: $("#OutNo").val(), //出库单据 |
| | | PalletNo: $("#PalletNo").val(), //托盘条码 |
| | | AreaNo: $("#Quyu").val()//目标区域 |
| | | } |
| | | //呼叫小车 |
| | | sendData(IP + "/PdaCr/AgvTransport2", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | //回调 |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 |
| | | }); |
| | | |
| | | |
| | | // 渲染箱码信息 |
| | | function refreshTable() { |
| | |
| | | for (i = len - 1; i >= 2; i--) { |
| | | trs[i].remove(); |
| | | } |
| | | if($("#STOCKCODE").val()==''){ |
| | | return; |
| | | } |
| | | |
| | | var param = { |
| | | PalletNo: $("#STOCKCODE").val(), |
| | | IsHuiKu:1 |
| | | }; |
| | | // 根据托盘号获取箱码信息 |
| | | sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) { |
| | | sendData(IP + "/PdaCr/GetSkuInfoByPalletNo", param, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | var list = res |
| | | var arrTrs = new Array() |
| | |
| | | for (i = len - 1; i >= 2; i--) { |
| | | trs[i].remove(); |
| | | } |
| | | |
| | | //设置托盘号 |
| | | $("#palletCode").val($.cookie('stockCode1')) |
| | | |
| | | if($("#PalletNo").val()==''){ |
| | | return; |
| | | } |
| | | var param = { |
| | | PalletNo: $.cookie('stockCode1') |
| | | PalletNo: $("#PalletNo").val() |
| | | }; |
| | | // 根据托盘号获取箱码信息 |
| | | sendData(IP + "/PdaAsn/GetPalletBindInfo", param, 'post', function (res) { |
| | | sendData(IP + "/PdaCr/GetSkuInfoByPalletNo", param, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | var list = res |
| | | var arrTrs = new Array() |
| | |
| | | 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 = { |
| | | 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 |
| | | } |