| | |
| | | height: 40px; |
| | | margin-right: 0; |
| | | } |
| | | #warehouse { |
| | | #uuid { |
| | | width: 65%; |
| | | height: 40px; |
| | | margin-right: 0; |
| | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | var tips2; |
| | | // 是否存在校验 |
| | | function exist(id, domain, dom) { |
| | | var param = { |
| | | key: id, |
| | | val: $('#'+ (dom ? dom : id)).val() |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/"+domain+"/check/column/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | tips2 = layer.tips( |
| | | "<span style='color:red;'>不存在</span>", |
| | | '#'+(dom ? dom : id), |
| | | { |
| | | // tipsMore: true, |
| | | tips: [3,'#fff'], |
| | | time:0 |
| | | ,area: 'auto' |
| | | ,maxWidth:500 |
| | | }); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else if (res.code === 407) { |
| | | layer.close(tips2); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库区</label> |
| | | <input class="layui-input" type="number" id="warehouse" onkeyup="findCode(this)" placeholder="扫码 / 输入" |
| | | <input class="layui-input" id="uuid" onkeyup="exist(this.id, 'locArea')" placeholder="扫码 / 输入" |
| | | autocomplete="off"> |
| | | </div> |
| | | </div> |
| | |
| | | }); |
| | | |
| | | window.onload = function () { |
| | | document.getElementById("warehouse").focus(); |
| | | document.getElementById("uuid").focus(); |
| | | } |
| | | |
| | | function findCode(el) { |
| | | if (el.value.length === 7) { |
| | | $('#mat-btn').focus(); |
| | | getMat(); |
| | | } |
| | | |
| | | } |
| | | |
| | | 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(); |
| | | if (isEmpty(barcode)) { |
| | | tips("库区条码为空", true); |
| | | document.getElementById("warehouse").focus(); |
| | | document.getElementById("uuid").focus(); |
| | | return; |
| | | } |
| | | if (matData.length === 0) { |
| | |
| | | $("#comb-btn").focus(); |
| | | comb(); |
| | | } else if (key === 113) { |
| | | $("#warehouse").val(""); |
| | | $("#warehouse").focus(); |
| | | $("#uuid").val(""); |
| | | $("#uuid").focus(); |
| | | } |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $('#uuid').val(""); |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | layer.closeAll(); |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label" style="margin-left: 16px">源库区</label> |
| | | <input class="layui-input" type="number" id="warehouse1" onkeyup="find()" placeholder="扫码 / 输入" |
| | | <input class="layui-input" id="warehouse1" onkeyup="find(true)" placeholder="扫码 / 输入" |
| | | autocomplete="off" style="width: 60%"> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">目标库区</label> |
| | | <input class="layui-input" type="number" id="warehouse2" placeholder="扫码 / 输入" |
| | | autocomplete="off" style="width: 60%"> |
| | | <input class="layui-input" id="warehouse2" placeholder="扫码 / 输入" |
| | | autocomplete="off" style="width: 60%" onkeyup="exist('uuid', 'locArea', 'warehouse2')"> |
| | | </div> |
| | | </div> |
| | | </header> |
| | |
| | | return; |
| | | } |
| | | if (warehouse1 == warehouse2) { |
| | | layer.msg("目标库区和源库区一致"); |
| | | layer.msg("目标库区和源库区不能一致"); |
| | | return; |
| | | } |
| | | // 判断勾选数据是否为空 |
| | |
| | | } |
| | | |
| | | /* 根据库区号检索物料信息 */ |
| | | find = () => { |
| | | find = (flag) => { |
| | | if (flag) { |
| | | exist('uuid', 'locArea', 'warehouse1'); |
| | | } |
| | | var warehouse = $("#warehouse1").val(); |
| | | var matnr = $("#matnr").val(); |
| | | // 查询接口 |
| | |
| | | if (res.code === 200) { |
| | | tableIns.reload({ |
| | | data: res.data, |
| | | }) |
| | | }); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn?2:1}) |
| | | layer.msg(msg, {icon: warn ? 2 : 1}) |
| | | } |
| | | |
| | | function reset() { |
| | |
| | | $('#warehouse2').val(""); |
| | | $('#matnr').val(""); |
| | | tableIns.reload({data: []}); |
| | | layer.closeAll(); |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label" style="margin-left: 32px">库区</label> |
| | | <input class="layui-input" type="number" id="warehouse" onkeyup="findCode(this, 'warehouse')" placeholder="扫码 / 输入" |
| | | <input class="layui-input" id="uuid" onkeyup="findCode(this, 'uuid')" placeholder="扫码 / 输入" |
| | | autocomplete="off"> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | |
| | | // 表格数据 |
| | | var normalOutList = []; |
| | | window.onload = function () { |
| | | document.getElementById("warehouse").focus(); |
| | | document.getElementById("uuid").focus(); |
| | | } |
| | | |
| | | /** |
| | |
| | | /* 扫码、输入库区和物料编码 */ |
| | | function findCode(el, type) { |
| | | switch (type) { |
| | | case 'warehouse': |
| | | case 'uuid': |
| | | warehouseBar = el.value; |
| | | exist('uuid', 'locArea'); |
| | | break; |
| | | case 'matnr': |
| | | matnrBar = el.value; |
| | |
| | | return; |
| | | } |
| | | // 库区赋值 |
| | | var warehouse = $('#warehouse').val(); |
| | | var warehouse = $('#uuid').val(); |
| | | data.map(function (item) { |
| | | item.warehouse = warehouse; |
| | | }); |
| | |
| | | if (res.code === 200) { |
| | | layer.msg("出库成功"); |
| | | $("#matnr").val(null); |
| | | $("#warehouse").val(null); |
| | | $("#uuid").val(null); |
| | | warehouseBar = null; |
| | | matnrBar = null; |
| | | normalOutList = []; |
| | |
| | | } |
| | | |
| | | function reset() { |
| | | $("#warehouse").val(null); |
| | | $("#uuid").val(null); |
| | | $("#matnr").val(null); |
| | | normalOutList = []; |
| | | tableIns.reload({data: normalOutList}); |
| | | layer.closeAll(); |
| | | } |
| | | </script> |
| | | </html> |