|  |  |  | 
|---|
|  |  |  | var pageCurr; | 
|---|
|  |  |  | layui.use(['table','laydate', 'form'], function(){ | 
|---|
|  |  |  | function getCol() { | 
|---|
|  |  |  | var cols = [ {type: 'checkbox'} ]; | 
|---|
|  |  |  | cols.push.apply(cols, detlCols); | 
|---|
|  |  |  | cols.push({field: 'status', align: 'center',title: '数据状态', templet:function(row){ | 
|---|
|  |  |  | var html = "<input value='status' type='checkbox' lay-skin='switch' lay-text='正常|锁定'' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; | 
|---|
|  |  |  | if(row.status === 'Y'){html += " checked ";} | 
|---|
|  |  |  | html += ">"; | 
|---|
|  |  |  | return html; | 
|---|
|  |  |  | }, hide: true} | 
|---|
|  |  |  | ,{field: 'ioStatus', align: 'center',title: '入出状态', templet:function(row){ | 
|---|
|  |  |  | var html = "<input value='ioStatus' type='checkbox' lay-skin='switch' lay-text='入库中|待入库' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; | 
|---|
|  |  |  | if(row.ioStatus === 'Y'){html += " checked ";} | 
|---|
|  |  |  | html += ">"; | 
|---|
|  |  |  | return html; | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} | 
|---|
|  |  |  | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true}) | 
|---|
|  |  |  | return cols; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | layui.config({ | 
|---|
|  |  |  | base: baseUrl + "/static/layui/lay/modules/" | 
|---|
|  |  |  | }).use(['table','laydate', 'form', 'tableMerge'], function(){ | 
|---|
|  |  |  | var table = layui.table; | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var layer = layui.layer; | 
|---|
|  |  |  | var layDate = layui.laydate; | 
|---|
|  |  |  | var form = layui.form; | 
|---|
|  |  |  | var tableMerge = layui.tableMerge; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 数据渲染 | 
|---|
|  |  |  | tableIns = table.render({ | 
|---|
|  |  |  | 
|---|
|  |  |  | even: true, | 
|---|
|  |  |  | toolbar: '#toolbar', | 
|---|
|  |  |  | cellMinWidth: 50, | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | // {type: 'checkbox'} | 
|---|
|  |  |  | //            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} | 
|---|
|  |  |  | //             ,{field: 'id', align: 'center',title: '编号', sort: true} | 
|---|
|  |  |  | {field: 'barcode', align: 'center',title: '托盘码'} | 
|---|
|  |  |  | ,{field: 'matnr', align: 'center',title: '物料编码'} | 
|---|
|  |  |  | ,{field: 'maktx', align: 'center',title: '物料描述'} | 
|---|
|  |  |  | ,{field: 'anfme', align: 'center',title: '数量'} | 
|---|
|  |  |  | ,{field: 'unit', align: 'center',title: '单位'} | 
|---|
|  |  |  | ,{field: 'status', align: 'center',title: '状态', templet:function(row){ | 
|---|
|  |  |  | var html = "<input value='status' type='checkbox' lay-skin='switch' lay-text='待入库|已启动' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; | 
|---|
|  |  |  | if(row.status !== 'Y'){html += " checked ";} | 
|---|
|  |  |  | html += ">"; | 
|---|
|  |  |  | return html; | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | ,{field: 'memo', align: 'center',title: '备注',hide: true} | 
|---|
|  |  |  | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide: true} | 
|---|
|  |  |  | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide: true} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | cols: [getCol()], | 
|---|
|  |  |  | request: { | 
|---|
|  |  |  | pageName: 'curr', | 
|---|
|  |  |  | pageSize: 'limit' | 
|---|
|  |  |  | 
|---|
|  |  |  | statusCode: 200 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | done: function(res, curr, count) { | 
|---|
|  |  |  | // tableMerge.render(this); | 
|---|
|  |  |  | if (res.code === 403) { | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | table.on('toolbar(waitPakin)', function (obj) { | 
|---|
|  |  |  | var checkStatus = table.checkStatus(obj.config.id); | 
|---|
|  |  |  | switch(obj.event) { | 
|---|
|  |  |  | case 'addWrk': | 
|---|
|  |  |  | if (checkStatus.data.length === 0){ | 
|---|
|  |  |  | layer.msg('请至少选择一条数据', {icon: 2}); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.confirm('确定生成工作档任务吗', function(){ | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/create/waitPain/wrkMast/start", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: JSON.stringify(checkStatus.data), | 
|---|
|  |  |  | contentType:'application/json;charset=UTF-8', | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | traditional:true, | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | tableReload(false); | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 1}) | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 'addData': | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type: 2, | 
|---|