| | |
| | | |
| | | /****************************************** 左边表 *************************************************/ |
| | | |
| | | var initTable = function() { |
| | | insTb = table.render({ |
| | | elem: '#originTable', |
| | | url: baseUrl + '/order/nav/list/auth', |
| | |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | text: {none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '暂无数据'}, |
| | | // toolbar: ['<p>', |
| | | // '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon"></i>添加</button> ', |
| | | // '<button lay-event="edit" class="layui-btn layui-btn-sm layui-btn-warm icon-btn"><i class="layui-icon"></i>修改</button> ', |
| | |
| | | defaultToolbar: [], |
| | | cols: [[ |
| | | // {type: 'numbers', title: '#'}, |
| | | {field: 'orderTime', title: '日期'}, |
| | | {field: 'orderNo', title: '单据编号', align: 'center'} |
| | | {field: 'orderTime', title: typeof I18n !== 'undefined' ? I18n.t('date') : '日期'}, |
| | | {field: 'orderNo', title: typeof I18n !== 'undefined' ? I18n.t('order_no') : '单据编号', align: 'center'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | if (typeof I18n !== 'undefined' && I18n.isReady()) { |
| | | I18n.updatePage(); |
| | | if (count === 0) { |
| | | $('.layui-table-empty').text(I18n.t('no_data')); |
| | | } |
| | | } |
| | | $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click'); |
| | | |
| | | // 绑定鼠标右键 |
| | |
| | | return [ |
| | | { |
| | | icon: 'layui-icon layui-icon-ok', |
| | | name: '一键出库', |
| | | name: typeof I18n !== 'undefined' ? I18n.t('one_click_outbound') : '一键出库', |
| | | click: function (d) { |
| | | autoOut(d.id); |
| | | } |
| | |
| | | }) |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (typeof I18n !== 'undefined' && I18n.isReady()) { |
| | | initTable(); |
| | | } else { |
| | | $(document).on('i18n:ready', function() { |
| | | initTable(); |
| | | }); |
| | | } |
| | | |
| | | // 监听语言切换 |
| | | $(document).on('i18n:languageChanged', function () { |
| | | insTb.reload({ |
| | | text: {none: I18n.t('no_data')}, |
| | | cols: [[ |
| | | {field: 'orderTime', title: I18n.t('date')}, |
| | | {field: 'orderNo', title: I18n.t('order_no'), align: 'center'} |
| | | ]] |
| | | }); |
| | | }); |
| | | |
| | | /* 表格搜索 */ |
| | |
| | | function showEdit(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | title: (mData ? '修改' : '添加') + '项目', |
| | | title: (mData ? (typeof I18n !== 'undefined' ? I18n.t('modify_project') : '修改项目') : (typeof I18n !== 'undefined' ? I18n.t('add_project') : '添加项目')), |
| | | content: $('#hostEditDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | I18n.updatePage($(layero)); |
| | | // 回显表单数据 |
| | | form.val('hostEditForm', mData); |
| | | // 表单提交事件 |
| | |
| | | |
| | | /* 删除 */ |
| | | function doDel(obj) { |
| | | layer.confirm('确定要删除此单据类型吗?', { |
| | | layer.confirm(typeof I18n !== 'undefined' ? I18n.t('confirm_delete_doc_type') : '确定要删除此单据类型吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |