| | |
| | | var pageCurr; |
| | | var tableIns; |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'io_time', align: 'center', title: '出库日期', width: 200} |
| | | ,{field: 'loc_no', align: 'center',title: '库位号'} |
| | | ,{field: 'crn_str_time', align: 'center',title: '堆垛机启动时间'} |
| | | ,{field: 'crn_end_time', align: 'center',title: '堆垛机停止时间'} |
| | | {field: 'ioTime$', align: 'center', title: typeof I18n !== 'undefined' ? I18n.t('出库日期') : '出库日期', width: 200} |
| | | ,{field: 'loc_no', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('location_no') : '库位号'} |
| | | ,{field: 'crn_str_time', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('crane_start_time') : '堆垛机启动时间'} |
| | | ,{field: 'crn_end_time', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('crane_end_time') : '堆垛机停止时间'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | if (typeof getDetlCols === 'function') { |
| | | cols.push.apply(cols, getDetlCols()); |
| | | } else { |
| | | cols.push.apply(cols, detlCols); |
| | | } |
| | | return cols; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#workOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/report/viewWorkOutList.action', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'pageNumber', |
| | | limitName: 'pageSize' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | function initTable() { |
| | | tableIns = table.render({ |
| | | elem: '#workOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/report/viewWorkOutList.action', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'pageNumber', |
| | | limitName: 'pageSize' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | if (typeof I18n !== 'undefined' && typeof I18n.updatePage === 'function') { |
| | | I18n.updatePage(); |
| | | } |
| | | if (typeof I18n !== 'undefined' && typeof I18n.updateLayuiPagination === 'function') { |
| | | I18n.updateLayuiPagination(); |
| | | } |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | }); |
| | | } |
| | | |
| | | if (typeof I18n !== 'undefined' && I18n.isReady()) { |
| | | initTable(); |
| | | } else { |
| | | $(document).on('i18n:ready', function() { |
| | | initTable(); |
| | | }); |
| | | } |
| | | |
| | | $(document).on('i18n:languageChanged', function() { |
| | | if (tableIns) { |
| | | tableIns.reload({ |
| | | cols: [getCol()] |
| | | }); |
| | | } |
| | | }); |
| | | |
| | |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | layer.confirm(typeof I18n !== 'undefined' ? I18n.t('confirm_export_excel') : '确定导出Excel吗', { |
| | | shadeClose: true, |
| | | title: typeof I18n !== 'undefined' ? I18n.t('prompt') : '信息' |
| | | }, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'fields': fields |
| | | fields: fields, |
| | | exportData: exportData |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/report/viewWorkOutExport.action", |
| | |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (typeof I18n !== 'undefined' && typeof I18n.updatePage === 'function') { |
| | | I18n.updatePage(); |
| | | } |
| | | if (typeof I18n !== 'undefined' && typeof I18n.updateLayuiPagination === 'function') { |
| | | I18n.updateLayuiPagination(); |
| | | } |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |