| | |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库位</label> |
| | | <input class="layui-input" type="text" id="locNo" onkeyup="findLocDetl(this)" autocomplete="off"> |
| | | <input class="layui-input" type="text" id="locNo" onkeyup="findByLocNo(this)" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">物料</label> |
| | | <input class="layui-input" type="text" id="matNo" autocomplete="off"> |
| | | <input class="layui-input" type="text" id="matNo" onkeyup="findByMatNo(this)" autocomplete="off"> |
| | | </div> |
| | | </header> |
| | | <!-- 主体 --> |
| | |
| | | /** |
| | | * 根据库位号查找库存明细 |
| | | */ |
| | | function findLocDetl(el){ |
| | | function findByLocNo(el){ |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | $("#matNo").val(""); |
| | | find(el.value, null); |
| | | } |
| | | |
| | | /** |
| | | * 根据物料号查找库存明细 |
| | | */ |
| | | function findByMatNo(el){ |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | $("#locNo").val(""); |
| | | find(null, el.value); |
| | | } |
| | | function find(locNo, matNo) { |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/locDetl", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | locNo: el.value |
| | | locNo: locNo, |
| | | matNo: matNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $("#matNo").val(""); |
| | | $("#locNo").val(""); |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | $('input:radio[name="site"]').prop('checked',false); |
| | | tips(""); |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | let tips = $('#tips'); |
| | | tips.html(msg); |
| | | tips.css("color", warn?"red":'#666'); |
| | | } |
| | | </script> |
| | | <script type="text/template" id="outSitesTemplate"> |
| | | {{#each data}} |