|  |  |  | 
|---|
|  |  |  | var admin; | 
|---|
|  |  |  | var matCodeLayerIdx; | 
|---|
|  |  |  | var initCountVal = 0; | 
|---|
|  |  |  | var matCodeData = []; | 
|---|
|  |  |  | function getCol() { | 
|---|
|  |  |  | var cols = [ | 
|---|
|  |  |  | {fixed: 'left', field: 'anfme', title: '数量(必填)', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}, | 
|---|
|  |  |  | {field: 'batch', title: '批号(选填)', align: 'center', edit:'text', width: 200,  style:'color: block;font-weight: bold'} | 
|---|
|  |  |  | {field: 'batch', title: '箱号(选填)', align: 'center', edit:'text', width: 200,  style:'color: block;font-weight: bold'} | 
|---|
|  |  |  | ]; | 
|---|
|  |  |  | cols.push.apply(cols, matCols); | 
|---|
|  |  |  | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80}) | 
|---|
|  |  |  | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var layer = layui.layer; | 
|---|
|  |  |  | var form = layui.form; | 
|---|
|  |  |  | admin = layui.admin; | 
|---|
|  |  |  | var admin = layui.admin; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | tableIns = table.render({ | 
|---|
|  |  |  | elem: '#chooseData', | 
|---|
|  |  |  | 
|---|
|  |  |  | layer.msg("请选择入库站", {icon: 2}); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | console.log(matCodeData) | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/full/store/put/start", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 监听行工具事件 | 
|---|
|  |  |  | table.on('tool(chooseData)', function(obj){ | 
|---|
|  |  |  | var data = obj.data; | 
|---|
|  |  |  | switch (obj.event) { | 
|---|
|  |  |  | case 'remove': | 
|---|
|  |  |  | for (let i = matCodeData.length - 1; i >= 0; i--) { | 
|---|
|  |  |  | if (matCodeData[i].matNo === data.matNo && matCodeData[i].batch === data.batch) { | 
|---|
|  |  |  | matCodeData.splice(i, 1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | let index = obj.tr.attr("data-index"); | 
|---|
|  |  |  | matCodeData.splice(index, 1); | 
|---|
|  |  |  | tableIns.reload({data: matCodeData}); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 提取物料 | 
|---|
|  |  |  | $(document).on('click','#mat-query', function () { | 
|---|
|  |  |  | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); | 
|---|
|  |  |  | matCodeLayerIdx = admin.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: false, | 
|---|
|  |  |  | closeBtn: false, | 
|---|
|  |  |  | maxmin: false, | 
|---|
|  |  |  | area: ['90%', '85%'], | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: 'matQuery.html', | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | layer.close(loadIndex); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 提取物料 | 
|---|
|  |  |  | var matCodeLayerIdx; | 
|---|
|  |  |  | function getMat() { | 
|---|
|  |  |  | matCodeLayerIdx = admin.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: false, | 
|---|
|  |  |  | closeBtn: false, | 
|---|
|  |  |  | maxmin: false, | 
|---|
|  |  |  | area: ['90%', '85%'], | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: 'matQuery.html', | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 扫码 | 
|---|
|  |  |  | function focusMat(el) { | 
|---|
|  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/matCode/" + el.value + "/auth", | 
|---|
|  |  |  | url: baseUrl + "/mat/" + el.value + "/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | method: 'GET', | 
|---|
|  |  |  | success: function (res) { | 
|---|