| | |
| | | <title>平仓入库</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.css" media="all"> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header> |
| | | <header class="layui-form"> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">单号</label> |
| | | <div class="layui-input-inline" style="width: 175px"> |
| | | <input id="billNo" class="layui-input" autocomplete="off" oninput="find(this)"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库区</label> |
| | | <input class="layui-input" type="number" id="warehouse" onkeyup="findCode(this)" placeholder="扫码 / 输入" |
| | | autocomplete="off"> |
| | | <div class="layui-input-inline" style="width: 175px"> |
| | | <select id="uuid"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | document.getElementById("billNo").focus(); |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | |
| | | } |
| | | }); |
| | | |
| | | var areaType = getQueryVariable('areaType'); |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth?areaType=" + (areaType ? areaType : ""), |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#uuid').append(html); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | window.onload = function () { |
| | | document.getElementById("warehouse").focus(); |
| | | } |
| | | |
| | | function findCode(el) { |
| | | if (el.value.length === 7) { |
| | | $('#mat-btn').focus(); |
| | | getMat(); |
| | | } |
| | | document.getElementById("uuid").focus(); |
| | | } |
| | | |
| | | var matCodeLayerIdx; |
| | |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $('#warehouse').val(""); |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | |
| | | // 组托 |
| | | function comb() { |
| | | let barcode = $('#warehouse').val(); |
| | | let barcode = $('#uuid').val(); |
| | | console.log('barcode', barcode); |
| | | if (isEmpty(barcode)) { |
| | | tips("库区条码为空", true); |
| | | document.getElementById("warehouse").focus(); |
| | | tips("请选择库区", true); |
| | | document.getElementById("uuid").focus(); |
| | | return; |
| | | } |
| | | if (matData.length === 0) { |
| | |
| | | maktx: item.matName, |
| | | anfme: item.count, |
| | | warehouse: barcode, |
| | | mnemonic: item.mnemonic, |
| | | supplier: item.supplier, |
| | | lgnum: item.lgnum, |
| | | type: item.type, |
| | | altme: item.altme, |
| | | }); |
| | | }); |
| | | |
| | |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | reset(true); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 根据通知单号查询物料详情 |
| | | */ |
| | | function find(el) { |
| | | var billNo = el.value; |
| | | if (isEmpty(billNo)) { |
| | | return; |
| | | } |
| | | // 赋值前清空表格 |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/bill/query/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | billNo: billNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | console.log('单号数据', res.data); |
| | | var data = res.data; |
| | | if (data.length > 0) { |
| | | for (var i = 0; i < data.length; i++) { |
| | | addTableData(data[i]); |
| | | } |
| | | } |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | |
| | | $("#comb-btn").focus(); |
| | | comb(); |
| | | } else if (key === 113) { |
| | | $("#warehouse").val(""); |
| | | $("#warehouse").focus(); |
| | | $("#uuid").val(""); |
| | | $("#uuid").focus(); |
| | | } |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | layer.closeAll(); |
| | | $("#billNo").val(""); |
| | | $("#uuid").val(""); |
| | | layui.form.render('select'); |
| | | } |
| | | </script> |
| | | </html> |