| | |
| | | if (res.code === 200){ |
| | | layer.msg("入库启动成功,目标库位:" + res.data); |
| | | matCodeData = []; |
| | | $('#focusMatByMat').val(""); |
| | | tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}}); |
| | | document.getElementById("focusMatByMat").focus(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | |
| | | }); |
| | | } |
| | | |
| | | // 扫码 |
| | | function focusMat(el) { |
| | | if (isEmpty(el.value)) { |
| | | return |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/matCode/" + el.value + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | matCodeData = []; |
| | | var param = new Array(); |
| | | param[0] = res.data; |
| | | addTableData(param); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | for (var i=0;i<data.length;i++){ |
| | |
| | | matCodeData.push.apply(matCodeData, data); |
| | | tableIns.reload({data: matCodeData}); |
| | | layer.close(matCodeLayerIdx); |
| | | } |
| | | } |