| New file | 
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var initCountVal = 0; | 
|---|
|  |  |  | var matCodeData = []; | 
|---|
|  |  |  | function getCol() { | 
|---|
|  |  |  | var cols = [ | 
|---|
|  |  |  | {fixed: 'left', field: 'count', title: '数量(必填)', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'} | 
|---|
|  |  |  | ]; | 
|---|
|  |  |  | cols.push.apply(cols, matCols); | 
|---|
|  |  |  | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) | 
|---|
|  |  |  | return cols; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | layui.config({ | 
|---|
|  |  |  | base: baseUrl + "/static/layui/lay/modules/" | 
|---|
|  |  |  | }).use(['table','laydate', 'form', 'admin', 'xmSelect', 'treeTable'], function() { | 
|---|
|  |  |  | var table = layui.table; | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var layer = layui.layer; | 
|---|
|  |  |  | var layDate = layui.laydate; | 
|---|
|  |  |  | var form = layui.form; | 
|---|
|  |  |  | var admin = layui.admin; | 
|---|
|  |  |  | var xmSelect = layui.xmSelect; | 
|---|
|  |  |  | var treeTable = layui.treeTable; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | tableIns = table.render({ | 
|---|
|  |  |  | elem: '#chooseData', | 
|---|
|  |  |  | data: [], | 
|---|
|  |  |  | even: true, | 
|---|
|  |  |  | limit: 500, | 
|---|
|  |  |  | cellMinWidth: 50, | 
|---|
|  |  |  | toolbar: '#toolbar', | 
|---|
|  |  |  | cols: [getCol()], | 
|---|
|  |  |  | done: function (res, curr, count) { | 
|---|
|  |  |  | $('td[data-field=count] div').html(initCountVal); | 
|---|
|  |  |  | setMatCodeData(res.data); | 
|---|
|  |  |  | limit(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 页面修改 | 
|---|
|  |  |  | table.on('edit(chooseData)', function (obj) { | 
|---|
|  |  |  | updateMatCodeData(obj.data.matnr, Number(obj.value)); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 监听头工具栏事件 | 
|---|
|  |  |  | table.on('toolbar(chooseData)', function (obj) { | 
|---|
|  |  |  | var checkStatus = table.checkStatus(obj.config.id); | 
|---|
|  |  |  | var data = checkStatus.data; | 
|---|
|  |  |  | switch(obj.event) { | 
|---|
|  |  |  | case 'confirm': | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 判断是否存在物料 | 
|---|
|  |  |  | if (matCodeData.length === 0) { | 
|---|
|  |  |  | layer.msg("请先添加物料"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 判断物料数量是否存在异常 | 
|---|
|  |  |  | for (var i=0;i<matCodeData.length;i++){ | 
|---|
|  |  |  | if (isNaN(matCodeData[i].count)) { | 
|---|
|  |  |  | layer.msg("请输入数字"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (matCodeData[i].count === 0){ | 
|---|
|  |  |  | layer.msg("数量不能为零"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | showNodeSelect(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // $.ajax({ | 
|---|
|  |  |  | //     url: baseUrl+"/full/store/put/start", | 
|---|
|  |  |  | //     headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | //     data: JSON.stringify({ | 
|---|
|  |  |  | //         devpNo: Number($('#putSiteSelect').val()), | 
|---|
|  |  |  | //         list: matCodeData | 
|---|
|  |  |  | //     }), | 
|---|
|  |  |  | //     contentType:'application/json;charset=UTF-8', | 
|---|
|  |  |  | //     method: 'POST', | 
|---|
|  |  |  | //     async: false, | 
|---|
|  |  |  | //     success: function (res) { | 
|---|
|  |  |  | //         if (res.code === 200){ | 
|---|
|  |  |  | //             layer.msg("入库启动成功,目标库位:" + res.data); | 
|---|
|  |  |  | //             matCodeData = []; | 
|---|
|  |  |  | //             tableIns.reload({data: matCodeData,done:function (res) { limit();}}); | 
|---|
|  |  |  | //         } else if (res.code === 403){ | 
|---|
|  |  |  | //             top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | //         }else { | 
|---|
|  |  |  | //             layer.msg(res.msg) | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  | // break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 监听行工具事件 | 
|---|
|  |  |  | table.on('tool(chooseData)', function(obj){ | 
|---|
|  |  |  | var data = obj.data; | 
|---|
|  |  |  | switch (obj.event) { | 
|---|
|  |  |  | case 'remove': | 
|---|
|  |  |  | for (var i = matCodeData.length - 1; i >= 0; i--) { | 
|---|
|  |  |  | if (matCodeData[i].matnr === data.matnr) { | 
|---|
|  |  |  | matCodeData.splice(i, 1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | tableIns.reload({data: matCodeData,done:function (res) { | 
|---|
|  |  |  | limit(); | 
|---|
|  |  |  | // 覆盖render方法的done | 
|---|
|  |  |  | }}); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function setMatCodeData(data) { | 
|---|
|  |  |  | matCodeData = data; | 
|---|
|  |  |  | for (var i=0;i<matCodeData.length;i++){ | 
|---|
|  |  |  | matCodeData[i]["count"] = initCountVal; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function updateMatCodeData(matnr, count) { | 
|---|
|  |  |  | if (isNaN(count)) { | 
|---|
|  |  |  | layer.msg("请输入数字"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (count > 0) { | 
|---|
|  |  |  | for (var i=0;i<matCodeData.length;i++){ | 
|---|
|  |  |  | if (matCodeData[i]["matnr"] === matnr){ | 
|---|
|  |  |  | matCodeData[i]["count"] = count; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg("数量必须大于零"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | tableIns.reload({data: matCodeData,done:function (res) { | 
|---|
|  |  |  | limit(); | 
|---|
|  |  |  | // 覆盖render方法的done | 
|---|
|  |  |  | }}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 显示表单弹窗 */ | 
|---|
|  |  |  | function showNodeSelect() { | 
|---|
|  |  |  | admin.open({ | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | area: '400px', | 
|---|
|  |  |  | title: '选择入库货位', | 
|---|
|  |  |  | content: $('#nodeSelect').html(), | 
|---|
|  |  |  | success: function (layero, dIndex) { | 
|---|
|  |  |  | // 表单提交事件 | 
|---|
|  |  |  | form.on('submit(pakin)', function (data) { | 
|---|
|  |  |  | data.field.nodeSel = insXmSel.getValue('valueStr'); | 
|---|
|  |  |  | var loadIndex = layer.load(2); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/work/stock/pakin", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: JSON.stringify({ | 
|---|
|  |  |  | nodeId: data.field.nodeSel, | 
|---|
|  |  |  | mats: matCodeData | 
|---|
|  |  |  | }), | 
|---|
|  |  |  | contentType:'application/json;charset=UTF-8', | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | layer.close(loadIndex); | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | layer.close(dIndex); | 
|---|
|  |  |  | matCodeData = []; | 
|---|
|  |  |  | tableIns.reload({data: matCodeData}); | 
|---|
|  |  |  | limit(); | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 1}); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // 渲染下拉树 | 
|---|
|  |  |  | var insXmSel = xmSelect.render({ | 
|---|
|  |  |  | el: '#nodeSel', | 
|---|
|  |  |  | height: '250px', | 
|---|
|  |  |  | data: insTb.options.data, | 
|---|
|  |  |  | initValue: [], | 
|---|
|  |  |  | model: {label: {type: 'text'}}, | 
|---|
|  |  |  | prop: { | 
|---|
|  |  |  | name: 'name', | 
|---|
|  |  |  | value: 'id' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | radio: true, | 
|---|
|  |  |  | clickClose: true, | 
|---|
|  |  |  | tree: { | 
|---|
|  |  |  | show: true, | 
|---|
|  |  |  | indent: 15, | 
|---|
|  |  |  | strict: false, | 
|---|
|  |  |  | expandedKeys: true | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // 弹窗不出现滚动条 | 
|---|
|  |  |  | $(layero).children('.layui-layer-content').css('overflow', 'visible'); | 
|---|
|  |  |  | layui.form.render('select'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var insTb = treeTable.render({ | 
|---|
|  |  |  | elem: '#node', | 
|---|
|  |  |  | url: baseUrl+'/node/tree/auth', | 
|---|
|  |  |  | headers: {token: localStorage.getItem('token')}, | 
|---|
|  |  |  | height: 'full-200', | 
|---|
|  |  |  | tree: { | 
|---|
|  |  |  | iconIndex: 2,           // 折叠图标显示在第几列 | 
|---|
|  |  |  | isPidData: true,        // 是否是id、pid形式数据 | 
|---|
|  |  |  | idName: 'id',           // id字段名称 | 
|---|
|  |  |  | pidName: 'parentId'     // pid字段名称 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'checkbox'} | 
|---|
|  |  |  | ,{type: 'numbers'} | 
|---|
|  |  |  | ,{field: 'name', align: 'left',title: '名称', minWidth: 150} | 
|---|
|  |  |  | ,{field: 'type$', align: 'center',title: '类型'} | 
|---|
|  |  |  | ,{field: 'leading', align: 'center',title: '负责人'} | 
|---|
|  |  |  | ,{field: 'sort', align: 'center',title: '排序', hide: true} | 
|---|
|  |  |  | ,{field: 'status$', align: 'center',title: '状态'} | 
|---|
|  |  |  | ,{field: 'updateTime$', align: 'center',title: '修改时间'} | 
|---|
|  |  |  | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} | 
|---|
|  |  |  | ,{field: 'memo', align: 'center',title: '备注', hide: true} | 
|---|
|  |  |  | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | done: function (data) { | 
|---|
|  |  |  | $('.ew-tree-table-box').css('height', '100%'); | 
|---|
|  |  |  | insTb.expandAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 提取物料 | 
|---|
|  |  |  | var matCodeLayerIdx; | 
|---|
|  |  |  | function getMat() { | 
|---|
|  |  |  | matCodeLayerIdx = layer.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: '提取物料', | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | area: [top.detailWidth, top.detailHeight], | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: 'matQuery.html', | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 添加表格数据 | 
|---|
|  |  |  | function addTableData(data) { | 
|---|
|  |  |  | for (var i=0;i<data.length;i++){ | 
|---|
|  |  |  | let pass = false; | 
|---|
|  |  |  | for (var j=0;j<matCodeData.length;j++){ | 
|---|
|  |  |  | if (data[i].matnr === matCodeData[j].matnr) { | 
|---|
|  |  |  | pass = true; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (pass) { | 
|---|
|  |  |  | data.splice(i--, 1); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | data[i]["count"] = initCountVal; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | matCodeData.push.apply(matCodeData, data); | 
|---|
|  |  |  | tableIns.reload({data: matCodeData}); | 
|---|
|  |  |  | layer.close(matCodeLayerIdx); | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var locDetlData = []; | 
|---|
|  |  |  | function getCol() { | 
|---|
|  |  |  | var cols = [ | 
|---|
|  |  |  | {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'} | 
|---|
|  |  |  | ,{field: 'anfme', align: 'center',title: '原数量'} | 
|---|
|  |  |  | ,{field: 'locNo', align: 'center',title: '库位号'} | 
|---|
|  |  |  | ]; | 
|---|
|  |  |  | arrRemove(detlCols,  'field', 'anfme'); | 
|---|
|  |  |  | cols.push.apply(cols, detlCols); | 
|---|
|  |  |  | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) | 
|---|
|  |  |  | return cols; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | layui.use(['table','laydate', 'form'], function() { | 
|---|
|  |  |  | var table = layui.table; | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var layer = layui.layer; | 
|---|
|  |  |  | var form = layui.form; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | tableIns = table.render({ | 
|---|
|  |  |  | elem: '#chooseData', | 
|---|
|  |  |  | headers: {token: localStorage.getItem('token')}, | 
|---|
|  |  |  | data: [], | 
|---|
|  |  |  | even: true, | 
|---|
|  |  |  | toolbar: '#toolbar', | 
|---|
|  |  |  | cellMinWidth: 50, | 
|---|
|  |  |  | cols: [getCol()], | 
|---|
|  |  |  | done: function(res, curr, count) { | 
|---|
|  |  |  | limit(); | 
|---|
|  |  |  | // getOutBound(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 页面修改 | 
|---|
|  |  |  | table.on('edit(chooseData)', function (obj) { | 
|---|
|  |  |  | updateLocDetlData(obj.data.locNo, obj.data.matnr, Number(obj.value)); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 监听头工具栏事件 | 
|---|
|  |  |  | table.on('toolbar(chooseData)', function (obj) { | 
|---|
|  |  |  | var data = locDetlData; | 
|---|
|  |  |  | switch (obj.event) { | 
|---|
|  |  |  | case 'outbound': | 
|---|
|  |  |  | if (data.length === 0){ | 
|---|
|  |  |  | layer.msg('请先添加库位物料'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | var locDetls = []; | 
|---|
|  |  |  | data.forEach(function(elem) { | 
|---|
|  |  |  | locDetls.push({nodeId: elem.nodeId, matnr: elem.matnr, count: elem.count}); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/work/stock/pakout", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: JSON.stringify(locDetls), | 
|---|
|  |  |  | contentType:'application/json;charset=UTF-8', | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | locDetlData = []; | 
|---|
|  |  |  | tableIns.reload({data: locDetlData,done:function (res) { | 
|---|
|  |  |  | limit(); | 
|---|
|  |  |  | // getOutBound(); | 
|---|
|  |  |  | }}); | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 1}); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 监听行工具事件 | 
|---|
|  |  |  | table.on('tool(chooseData)', function(obj){ | 
|---|
|  |  |  | var data = obj.data; | 
|---|
|  |  |  | switch (obj.event) { | 
|---|
|  |  |  | case 'remove': | 
|---|
|  |  |  | for (var i = locDetlData.length - 1; i >= 0; i--) { | 
|---|
|  |  |  | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) { | 
|---|
|  |  |  | locDetlData.splice(i, 1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | tableIns.reload({data: locDetlData,done:function (res) { | 
|---|
|  |  |  | limit(); | 
|---|
|  |  |  | // getOutBound(); | 
|---|
|  |  |  | }}); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function updateLocDetlData(locNo, matnr, count) { | 
|---|
|  |  |  | if (isNaN(count)) { | 
|---|
|  |  |  | layer.msg("请输入数字"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (count > 0) { | 
|---|
|  |  |  | for (var i=0;i<locDetlData.length;i++){ | 
|---|
|  |  |  | if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matnr"] === matnr){ | 
|---|
|  |  |  | if (count > locDetlData[i]["anfme"]) { | 
|---|
|  |  |  | layer.msg("不能超过原数量"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | locDetlData[i]["count"] = count; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg("数量必须大于零"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | tableIns.reload({data: locDetlData,done:function (res) { | 
|---|
|  |  |  | limit(); | 
|---|
|  |  |  | // getOutBound(); | 
|---|
|  |  |  | }}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 获取出库口 | 
|---|
|  |  |  | function getOutBound(){ | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/available/take/site", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | async: false, | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | var tpl = $("#takeSiteSelectTemplate").html(); | 
|---|
|  |  |  | var template = Handlebars.compile(tpl); | 
|---|
|  |  |  | var html = template(res); | 
|---|
|  |  |  | $('#staNoSelect').append(html); | 
|---|
|  |  |  | form.render('select'); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | layer.msg(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 提取物料 | 
|---|
|  |  |  | var locDetlLayerIdx; | 
|---|
|  |  |  | function getLocDetl() { | 
|---|
|  |  |  | locDetlLayerIdx = layer.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: '提取出货内容', | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | area: [top.detailWidth, top.detailHeight], | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: 'locDetlQuery.html', | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 添加表格数据 | 
|---|
|  |  |  | function addTableData(data) { | 
|---|
|  |  |  | for (var i=0;i<data.length;i++){ | 
|---|
|  |  |  | let pass = false; | 
|---|
|  |  |  | for (var j=0;j<locDetlData.length;j++){ | 
|---|
|  |  |  | if (data[i].matnr === locDetlData[j].matnr && data[i].locNo === locDetlData[j].locNo) { | 
|---|
|  |  |  | pass = true; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (pass) { | 
|---|
|  |  |  | data.splice(i--, 1); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | data[i]["count"] = data[i]["anfme"]; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | locDetlData.push.apply(locDetlData, data); | 
|---|
|  |  |  | tableIns.reload({data: locDetlData}); | 
|---|
|  |  |  | layer.close(locDetlLayerIdx); | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <!DOCTYPE html> | 
|---|
|  |  |  | <html lang="en"> | 
|---|
|  |  |  | <head> | 
|---|
|  |  |  | <meta charset="utf-8"> | 
|---|
|  |  |  | <title></title> | 
|---|
|  |  |  | <meta name="renderer" content="webkit"> | 
|---|
|  |  |  | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
|---|
|  |  |  | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/common.css" media="all"> | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | html { | 
|---|
|  |  |  | height: 100%; | 
|---|
|  |  |  | padding: 10px; | 
|---|
|  |  |  | background-color: #f1f1f1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | body { | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | border-radius: 5px; | 
|---|
|  |  |  | box-shadow: 0 0 3px rgba(0,0,0,.3); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .function-area { | 
|---|
|  |  |  | padding: 20px 50px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .function-btn { | 
|---|
|  |  |  | font-size: 16px; | 
|---|
|  |  |  | padding: 1px 1px 1px 1px; | 
|---|
|  |  |  | width: 100px; | 
|---|
|  |  |  | height: 50px; | 
|---|
|  |  |  | border-color: #2b425b; | 
|---|
|  |  |  | border-radius: 4px; | 
|---|
|  |  |  | border-width: 2px; | 
|---|
|  |  |  | background: none; | 
|---|
|  |  |  | border-style: solid; | 
|---|
|  |  |  | transition: 0.4s; | 
|---|
|  |  |  | cursor: pointer; | 
|---|
|  |  |  | letter-spacing: 3px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .function-btn:hover { | 
|---|
|  |  |  | background-color: #2b425b; | 
|---|
|  |  |  | color: #fff; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .layui-layer-page .layui-layer-content { | 
|---|
|  |  |  | position: relative; | 
|---|
|  |  |  | overflow: visible !important; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #mat-query { | 
|---|
|  |  |  | /*display: none;*/ | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #staNoSpan { | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | width: 100px; | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-btn-container .layui-form-select { | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | width: 150px; | 
|---|
|  |  |  | height: 30px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-btn-container .layui-form-select.layui-form-selected { | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | width: 150px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-btn-container .layui-select-title input { | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-btn-container .layui-anim.layui-anim-upbit dd { | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #btn-inbound { | 
|---|
|  |  |  | margin-left: 20px; | 
|---|
|  |  |  | /*display: none;*/ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #detail { | 
|---|
|  |  |  | margin: 0; | 
|---|
|  |  |  | padding: 25px 30px 0 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </head> | 
|---|
|  |  |  | <body> | 
|---|
|  |  |  | <!-- 功能区 --> | 
|---|
|  |  |  | <div class="function-area"> | 
|---|
|  |  |  | <button id="mat-query" class="function-btn" onclick="getMat()">新增</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <hr> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 表格 --> | 
|---|
|  |  |  | <div style="padding-bottom: 5px; margin-bottom: 45px"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 头部 --> | 
|---|
|  |  |  | <script type="text/html" id="toolbar"> | 
|---|
|  |  |  | <div class="layui-form"> | 
|---|
|  |  |  | <div class="layui-btn-container"> | 
|---|
|  |  |  | <!-- 启动出库 --> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-lg" id="btn-inbound" lay-event="confirm" style="">确认入库</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 行 --> | 
|---|
|  |  |  | <script type="text/html" id="operate"> | 
|---|
|  |  |  | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--<table id="node" style="display: none"></table>--> | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/ioWorks/stockInOrder.js" charset="utf-8"></script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script type="text/template" id="putSiteSelectTemplate"> | 
|---|
|  |  |  | {{#each data}} | 
|---|
|  |  |  | <option value="{{this}}">{{this}}</option> | 
|---|
|  |  |  | {{/each}} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="nodeSelect"> | 
|---|
|  |  |  | <form id="detail" lay-filter="detail" class="layui-form"> | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <label class="layui-form-label">上架货位</label> | 
|---|
|  |  |  | <div class="layui-input-block"> | 
|---|
|  |  |  | <div id="nodeSel" class="ew-xmselect-tree"></div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-form-item text-right"> | 
|---|
|  |  |  | <button class="layui-btn" lay-filter="pakin" lay-submit="">确认入库</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </form> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | </body> | 
|---|
|  |  |  | </html> | 
|---|
|  |  |  |  | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <!DOCTYPE html> | 
|---|
|  |  |  | <html lang="en"> | 
|---|
|  |  |  | <head> | 
|---|
|  |  |  | <meta charset="utf-8"> | 
|---|
|  |  |  | <title></title> | 
|---|
|  |  |  | <meta name="renderer" content="webkit"> | 
|---|
|  |  |  | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
|---|
|  |  |  | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/common.css" media="all"> | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | html { | 
|---|
|  |  |  | height: 100%; | 
|---|
|  |  |  | padding: 10px; | 
|---|
|  |  |  | background-color: #f1f1f1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | body { | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | border-radius: 5px; | 
|---|
|  |  |  | box-shadow: 0 0 3px rgba(0,0,0,.3); | 
|---|
|  |  |  | padding-bottom: 20px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #staNoSpan { | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | width: 100px; | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-btn-container .layui-form-select { | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | width: 150px; | 
|---|
|  |  |  | height: 30px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-btn-container .layui-form-select.layui-form-selected { | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | width: 150px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-btn-container .layui-select-title input { | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-btn-container .layui-anim.layui-anim-upbit dd { | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #btn-outbound { | 
|---|
|  |  |  | margin-left: 20px; | 
|---|
|  |  |  | /*display: none;*/ | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /*----------------------------------*/ | 
|---|
|  |  |  | .function-area { | 
|---|
|  |  |  | padding: 20px 50px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .function-btn { | 
|---|
|  |  |  | font-size: 16px; | 
|---|
|  |  |  | padding: 1px 1px 1px 1px; | 
|---|
|  |  |  | width: 100px; | 
|---|
|  |  |  | height: 50px; | 
|---|
|  |  |  | border-color: #2b425b; | 
|---|
|  |  |  | border-radius: 4px; | 
|---|
|  |  |  | border-width: 2px; | 
|---|
|  |  |  | background: none; | 
|---|
|  |  |  | border-style: solid; | 
|---|
|  |  |  | transition: 0.4s; | 
|---|
|  |  |  | cursor: pointer; | 
|---|
|  |  |  | letter-spacing: 3px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .function-btn:hover { | 
|---|
|  |  |  | background-color: #2b425b; | 
|---|
|  |  |  | color: #fff; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #mat-query { | 
|---|
|  |  |  | /*display: none;*/ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </head> | 
|---|
|  |  |  | <body> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 功能区 --> | 
|---|
|  |  |  | <div class="function-area"> | 
|---|
|  |  |  | <button id="mat-query" class="function-btn" onclick="getLocDetl()">新增</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <hr> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 表格 --> | 
|---|
|  |  |  | <div style="padding-bottom: 5px; margin-bottom: 45px"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 头部 --> | 
|---|
|  |  |  | <script type="text/html" id="toolbar"> | 
|---|
|  |  |  | <div class="layui-form"> | 
|---|
|  |  |  | <div class="layui-btn-container"> | 
|---|
|  |  |  | <!-- 启动出库 --> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-lg layui-btn-normal" id="btn-outbound" lay-event="outbound">确认出库</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 行 --> | 
|---|
|  |  |  | <script type="text/html" id="operate"> | 
|---|
|  |  |  | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/ioWorks/stockOut.js" charset="utf-8"></script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script type="text/template" id="takeSiteSelectTemplate"> | 
|---|
|  |  |  | {{#each data}} | 
|---|
|  |  |  | <option value="{{siteId}}">{{desc}}</option> | 
|---|
|  |  |  | {{/each}} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | </body> | 
|---|
|  |  |  | </html> | 
|---|
|  |  |  |  | 
|---|