| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo$', align: 'center',title: '库位号'} |
| | | ,{field: 'storeDate', align: 'center',title: '库龄(天)', sort:true} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: 'sku', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', align: 'center',title: '产地', hide: true} |
| | | ,{field: 'manu', align: 'center',title: '厂家', hide: true} |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: true} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true} |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
| | | ,{field: 'check$', align: 'center',title: '要求检验', hide: true} |
| | | ,{field: 'danger$', align: 'center',title: '危险品', hide: true} |
| | | {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: '修改人员',hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | 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; |
| | | } |
| | |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | if (typeof I18n !== 'undefined') { |
| | | I18n.updatePage($('.layui-table-tool')); |
| | | } |
| | | 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')}, |
| | |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, 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('正在导出...', {icon: 16, shade: 0.01, time: false}); |
| | | 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')}, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | }); |
| | | |
| | | |
| | | // 监听i18n更新事件,重新渲染表格 |
| | | $(document).on('i18n:updated', function() { |
| | | table.reload('locDetl', { |
| | | cols: [getCol()] |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | // 关闭动作 |