| | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locAroundBind', |
| | | headers: { token: localStorage.getItem('token') }, |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/locAroundBind/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | { type: 'checkbox' } |
| | | , { field: 'id', align: 'center', title: 'ID' , hide: true } |
| | | , { field: 'devId', align: 'center', title: '机台ID', hide: true } |
| | | , { field: 'devNo', align: 'center', title: '机台号' } |
| | | , { field: 'devName', align: 'center', title: '设备名称' } |
| | | , { field: 'blocId', align: 'center', title: '库位ID', hide: true } |
| | | , { field: 'blocNo', align: 'center', title: '工位' } |
| | | ,{field: 'locType$', align:'center', title: '工位状态'} |
| | | , { field: 'def$', align: 'center', title: '工位类型' } |
| | | , { fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 120 } |
| | | {type: 'checkbox'} |
| | | , {field: 'id', align: 'center', title: 'ID', hide: true} |
| | | , {field: 'devId', align: 'center', title: '机台ID', hide: true} |
| | | , {field: 'devNo', align: 'center', title: '机台号'} |
| | | , {field: 'devName', align: 'center', title: '设备名称'} |
| | | , {field: 'blocId', align: 'center', title: '库位ID', hide: true} |
| | | , {field: 'blocNo', align: 'center', title: '工位'} |
| | | , {field: 'locType$', align: 'center', title: '工位状态'} |
| | | , {field: 'def$', align: 'center', title: '工位类型'} |
| | | , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 240} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { curr: 1 } |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', { icon: 2 }); |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', { shadeClose: true }, function () { |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function () { |
| | | var titles = []; |
| | | var fields = []; |
| | | obj.config.cols[0].map(function (col) { |
| | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl + "/locAroundBind/export/auth", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, { icon: 2 }) |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | case "init": |
| | | layer.prompt({ title: '请输入口令,并重置库位', formType: 1, shadeClose: true }, function (pass, idx) { |
| | | http.get(baseUrl + "/locMast/init/pwd", { pwd: pass }, function (res) { |
| | | layer.prompt({title: '请输入口令,并重置库位', formType: 1, shadeClose: true}, function (pass, idx) { |
| | | http.get(baseUrl + "/locMast/init/pwd", {pwd: pass}, function (res) { |
| | | if (res.data) { |
| | | layer.open({ |
| | | type: 1, |
| | |
| | | } |
| | | }); |
| | | |
| | | // iframe物料详情 |
| | | function locDetlToLayer(val) { |
| | | locNo = val; |
| | | layer.open({ |
| | | type: 2, |
| | | title: '库存明细', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../report/locDetl.html', |
| | | success: function(layero, index){ |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 初始化保存 |
| | | form.on('submit(initDo)', function (data) { |
| | | $.ajax({ |
| | | url: baseUrl + "/locAroundBind/bind/init", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(data.field), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | // 查看明细 |
| | | case 'locDetl': |
| | | if (data.locType.trim() === '' |
| | | || data.locType.trim() === 'S' |
| | | || data.locType.trim() === 'D' |
| | | || data.locType.trim() === 'O') { |
| | | layer.msg("工位的状态不存在物料"); |
| | | return; |
| | | } |
| | | locDetlToLayer(data.blocNo); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl + "/locAroundBind/" + (mData ? 'update' : 'add') + "/auth", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200) { |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, { icon: 1 }); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, { icon: 2 }); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl + "/locAroundBind/delete/auth", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | data: { ids: ids }, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg, { icon: 1 }); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, { icon: 2 }); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | |
| | | |
| | | }, 300); |
| | | } |
| | | |
| | | layDateRender(); |
| | | |
| | | }); |
| | |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { curr: pageCurr } |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |