| | |
| | | var pageCurr = 0; |
| | | var tableIns; |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | {field: 'locNo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('location_no') : '库位号', merge: true, style: 'font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | var dCols = []; |
| | | if (typeof getDetlCols === 'function') { |
| | | dCols = getDetlCols(); |
| | | } else { |
| | | dCols = typeof detlCols !== 'undefined' ? detlCols.slice() : []; |
| | | } |
| | | cols.push.apply(cols, dCols); |
| | | return cols; |
| | | } |
| | | |
| | |
| | | var form = layui.form; |
| | | var tableMerge = layui.tableMerge; |
| | | |
| | | window.initTable = function() { |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locMatCode', |
| | |
| | | even: true, |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | text: { |
| | | none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '暂无相关数据' |
| | | }, |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | |
| | | pageCurr=curr; |
| | | limit(); |
| | | clearSelect(); |
| | | if (typeof I18n !== 'undefined') { |
| | | I18n.updatePage(); |
| | | setTimeout(function() { |
| | | I18n.updateLayuiPagination(); |
| | | }, 50); |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | if (typeof I18n !== 'undefined' && I18n.isReady()) { |
| | | initTable(); |
| | | } else { |
| | | $(document).on('i18n:ready', initTable); |
| | | } |
| | | |
| | | $(document).on('i18n:languageChanged', function() { |
| | | initTable(); |
| | | $('[data-i18n-placeholder]').each(function() { |
| | | var key = $(this).attr('data-i18n-placeholder'); |
| | | $(this).attr('placeholder', I18n.t(key)); |
| | | }); |
| | | I18n.updatePage(); |
| | | form.render('select'); |
| | | }); |
| | | |
| | | }); |