| | |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | 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', |
| | |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var data = checkStatus.data; |
| | | switch(obj.event) { |
| | | case 'comb': |
| | | case 'confirm': |
| | | // 判断是否存在物料 |
| | | if (matCodeData.length === 0) { |
| | | layer.msg("请先添加物料"); |
| | |
| | | return; |
| | | } |
| | | } |
| | | $.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; |
| | | |
| | | 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; |
| | | } |
| | | }); |
| | | |
| | |
| | | }}); |
| | | } |
| | | |
| | | /* 显示表单弹窗 */ |
| | | 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(); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 提取物料 |