| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('location_no') : 'Location No.'} |
| | | ,{field: 'storeDate', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('age_days') : 'Age(Days)', sort:true} |
| | | ,{field: 'matnr', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('product_code') : 'Item No.', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('product_name') : 'Item Name', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('order_no') : 'Order No.', hide: true} |
| | | ,{field: 'batch', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('batch_no') : 'Batch No.', width: 300, sort:true} |
| | | ,{field: 'anfme', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('quantity') : 'Quantity'} |
| | | ,{field: 'zpallet', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('pallet_barcode') : 'Pallet Code'} |
| | | ,{field: 'specs', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('spec') : 'Spec'} |
| | | ,{field: 'model', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('code') : 'Code', hide: true} |
| | | ,{field: 'color', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('color') : 'Color', hide: true} |
| | | ,{field: 'brand', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('brand') : 'Brand', hide: true} |
| | | ,{field: 'unit', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('unit') : 'Unit', hide: true} |
| | | ,{field: 'price', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('price') : 'Price', hide: true} |
| | | ,{field: 'sku', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('sku') : 'SKU', hide: true} |
| | | ,{field: 'units', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('unit_qty') : 'Unit Qty', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('barcode') : 'Barcode', hide: true} |
| | | ,{field: 'origin', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('origin') : 'Origin', hide: true} |
| | | ,{field: 'manu', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('manufacturer') : 'Manufacturer', hide: true} |
| | | ,{field: 'manuDate', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('mfg_date') : 'Mfg Date', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('item_count') : 'Item Count', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('safety_stock') : 'Safety Stock', hide: true} |
| | | ,{field: 'weight', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('net_weight_box') : 'Net Weight/Box', hide: true} |
| | | ,{field: 'length', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('gross_weight_box') : 'Gross Weight/Box', hide: true} |
| | | ,{field: 'volume', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('volume_box') : 'Volume/Box', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('box_size') : 'Box Size', hide: true} |
| | | ,{field: 'supp', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('supplier') : 'Supplier', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('supplier_code') : 'Supplier Code', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('batch_managed') : 'Batch Managed', hide: true} |
| | | ,{field: 'deadTime', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('shelf_life') : 'Shelf Life', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('warning_days') : 'Warning Days', hide: true} |
| | | ,{field: 'source$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('make_buy') : 'Make/Buy', hide: true} |
| | | ,{field: 'check$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('inspection_reqd') : 'Inspection Reqd', hide: true} |
| | | ,{field: 'danger$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('hazardous') : 'Hazardous', hide: true} |
| | | |
| | | ]; |
| | | |
| | | // cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('modifier') : 'Modifier',hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('modify_time') : 'Modify Time'} |
| | | ) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locDetl/list/auth', |
| | | page: true, |
| | | limit: 10, |
| | | skin: 'line', |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号',event: 'locNo', style: 'cursor:pointer'} |
| | | ,{field: 'matnr', align: 'center',title: '物料'} |
| | | ,{field: 'lgnum', align: 'center',title: '仓库号', width:80} |
| | | ,{field: 'tbnum', align: 'center',title: '转储请求编号'} |
| | | // ,{field: 'tbpos', align: 'center',title: '行项目'} |
| | | ,{field: 'zmatid', align: 'center',title: '物料标签ID', width:200} |
| | | ,{field: 'maktx', align: 'center',title: '物料描述', width:150} |
| | | ,{field: 'werks', align: 'center',title: '工厂'} |
| | | ,{field: 'anfme', align: 'center',title: '数量', width:80} |
| | | ,{field: 'altme', align: 'center',title: '单位', width:80} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '用户ID'} |
| | | // ,{field: 'memo', align: 'center',title: '备注'} |
| | | |
| | | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = "/"; |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | if (typeof I18n !== 'undefined') { |
| | | I18n.updatePage($('.layui-table-tool')); |
| | | setTimeout(function() { |
| | | I18n.updateLayuiPagination(); |
| | | }, 50); |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = "/"; |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | if (typeof I18n !== 'undefined') { |
| | | I18n.updatePage($('.layui-table-tool')); |
| | | setTimeout(function() { |
| | | I18n.updateLayuiPagination(); |
| | | }, 50); |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | title: I18n.t('add'), |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | layer.msg(I18n.t('please_select_data')); |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | layer.confirm(I18n.t('confirm_delete_prefix') + (data.length===1 ? I18n.t('this') : data.length) + I18n.t('confirm_delete_suffix'), function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = "/"; |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', function(){ |
| | | layer.confirm(I18n.t('confirm_export_excel'), {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | |
| | | 'locDetl': exportData, |
| | | 'fields': fields |
| | | }; |
| | | var loadIndex = layer.msg(I18n.t('exporting'), {icon: 16, shade: 0.01, time: false}); |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = "/"; |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | title: I18n.t('detail'), |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | title: I18n.t('modify'), |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | |
| | | case 'locNo': |
| | | var param = top.reObject(data).locNo; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | layer.msg(I18n.t('no_data_found')); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '库位号详情', |
| | | title: I18n.t('location_no') + I18n.t('detail'), |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | |
| | | case 'modiUser': |
| | | var param = top.reObject(data).modiUser; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | layer.msg(I18n.t('no_data_found')); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改人员详情', |
| | | title: I18n.t('modifier_detail'), |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | |
| | | case 'appeUser': |
| | | var param = top.reObject(data).appeUser; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | layer.msg(I18n.t('no_data_found')); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '创建者详情', |
| | | title: I18n.t('creator_detail'), |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = "/"; |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2}) |
| | | } |
| | | layer.close(index); |
| | | } |
| | |
| | | tableReload(false); |
| | | }); |
| | | |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | |
| | | }); |
| | | |
| | | |
| | | // 监听语言切换事件 |
| | | $(document).on('i18n:languageChanged', function() { |
| | | tableIns.reload({ |
| | | cols: [getCol()], |
| | | text: { |
| | | none: I18n.t('no_data') |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (typeof I18n !== 'undefined') { |
| | | I18n.updatePage($('.layui-table-tool')); |
| | | setTimeout(function() { |
| | | I18n.updateLayuiPagination(); |
| | | }, 50); |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | // 关闭动作 |
| | |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | var searchData = { |
| | | }; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = "/"; |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | if (typeof I18n !== 'undefined') { |
| | | I18n.updatePage($('.layui-table-tool')); |
| | | setTimeout(function() { |
| | | I18n.updateLayuiPagination(); |
| | | }, 50); |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |