|  |  |  | 
|---|
|  |  |  | var pageCurr; | 
|---|
|  |  |  | function getCol() { | 
|---|
|  |  |  | var cols = [{field: 'locNo$', align: 'center',title: '库位号'}]; | 
|---|
|  |  |  | cols.push.apply(cols, detlCols); | 
|---|
|  |  |  | var cols = [ | 
|---|
|  |  |  | {field: 'locNo$', align: 'center',title: '库位号'} | 
|---|
|  |  |  | // ,{field: 'maktx', align: 'center',title: '商品名称', sort:true,hide: true} | 
|---|
|  |  |  | // ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} | 
|---|
|  |  |  | // ,{field: 'batch', align: 'center',title: '批次', width: 250, sort:true,hide: true} | 
|---|
|  |  |  | ,{field: 'anfme', align: 'center',title: '数量'} | 
|---|
|  |  |  | ,{field: 'zpallet', align: 'center',title: '托盘条码'} | 
|---|
|  |  |  | ,{field: 'matnr', align: 'center',title: '规格', sort:true,width: 150} | 
|---|
|  |  |  | ,{field: 'batch', align: 'center',title: '空箱尺寸', hide: true} | 
|---|
|  |  |  | ,{field: 'memo', align: 'center',title: '空箱备注', hide: true} | 
|---|
|  |  |  | ,{field: 'brand', align: 'center',title: '包装组号', hide: false,width: 150} | 
|---|
|  |  |  | ,{field: 'model', align: 'center',title: '卷号', hide: false,width: 150} | 
|---|
|  |  |  | ,{field: 'unit', align: 'center',title: '箱号', hide: false,width: 150} | 
|---|
|  |  |  | ,{field: 'color', align: 'center',title: '木箱类型', hide: false} | 
|---|
|  |  |  | ,{field: 'manu', align: 'center',title: '管芯类型', hide: true} | 
|---|
|  |  |  | ,{field: 'sku', align: 'center',title: '实测宽幅', hide: true} | 
|---|
|  |  |  | ,{field: 'itemNum', align: 'center',title: '生箔厚度', hide: true} | 
|---|
|  |  |  | ,{field: 'manuDate', align: 'center',title: '分切下料时间', hide: true,width: 180} | 
|---|
|  |  |  | ,{field: 'brand$', align: 'center',title: '木箱类型', hide: true} | 
|---|
|  |  |  | // ,{field: 'price', align: 'center',title: '价格', hide: true} | 
|---|
|  |  |  | // ,{field: 'units', align: 'center',title: '单位量', hide: true} | 
|---|
|  |  |  | // ,{field: 'barcode', align: 'center',title: '条码', hide: true} | 
|---|
|  |  |  | ,{field: 'origin', align: 'center',title: '木箱位置', hide: true} | 
|---|
|  |  |  | // ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} | 
|---|
|  |  |  | ,{field: 'weight', align: 'center',title: '单箱净重', hide: false} | 
|---|
|  |  |  | ,{field: 'length', align: 'center',title: '长度', hide: false} | 
|---|
|  |  |  | ,{field: 'volume', align: 'center',title: '单箱毛重', hide: true} | 
|---|
|  |  |  | ,{field: 'specs', align: 'center',title: '接头', hide:true} | 
|---|
|  |  |  | ,{field: 'suppCode', align: 'center',title: '新旧', hide:true} | 
|---|
|  |  |  | ,{field: 'deadWarn$', align: 'center',title: '理货状态', hide: false} | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ,{ | 
|---|
|  |  |  | field: 'threeCode', | 
|---|
|  |  |  | align: 'center', | 
|---|
|  |  |  | title: '合格否', | 
|---|
|  |  |  | hide: false, | 
|---|
|  |  |  | templet: function(d) { | 
|---|
|  |  |  | return d.threeCode ? d.threeCode : '待判'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // ,{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} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ]; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // cols.push.apply(cols, detlCols); | 
|---|
|  |  |  | cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true} | 
|---|
|  |  |  | ,{field: 'modiTime$', align: 'center',title: '修改时间'} | 
|---|
|  |  |  | ,{field: 'modiTime$', align: 'center',title: '修改时间',width: 200} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | return cols; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | layui.use(['table','laydate', 'form'], function(){ | 
|---|
|  |  |  | layui.use(['table','laydate', 'form','upload','layer'], function(){ | 
|---|
|  |  |  | var table = layui.table; | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var layer = layui.layer; | 
|---|
|  |  |  | var layDate = layui.laydate; | 
|---|
|  |  |  | var form = layui.form; | 
|---|
|  |  |  | var upload = layui.upload; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 数据渲染 | 
|---|
|  |  |  | tableIns = table.render({ | 
|---|
|  |  |  | 
|---|
|  |  |  | headers: {token: localStorage.getItem('token')}, | 
|---|
|  |  |  | url: baseUrl+'/locDetl/list/auth', | 
|---|
|  |  |  | page: true, | 
|---|
|  |  |  | limit: 20, | 
|---|
|  |  |  | limits: [20, 30, 50, 100, 200, 500], | 
|---|
|  |  |  | limit: 16, | 
|---|
|  |  |  | limits: [16, 30, 50, 100, 200, 500], | 
|---|
|  |  |  | even: true, | 
|---|
|  |  |  | toolbar: '#toolbar', | 
|---|
|  |  |  | cellMinWidth: 50, | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | upload.render({ | 
|---|
|  |  |  | elem: '#uploadExcel', // 绑定元素 | 
|---|
|  |  |  | url: baseUrl+'/productCalibration', // 上传接口,替换为你的后端接口 | 
|---|
|  |  |  | headers:{'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | accept: 'file', // 允许上传的文件类型 | 
|---|
|  |  |  | exts: 'xls|xlsx', // 允许上传的文件后缀 | 
|---|
|  |  |  | done: function(res){ | 
|---|
|  |  |  | // 上传完毕回调 | 
|---|
|  |  |  | if(res.code === 200){ | 
|---|
|  |  |  | layer.msg(res.msg); | 
|---|
|  |  |  | console.log('文件数据:', res.data); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg || '上传失败'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | error: function(){ | 
|---|
|  |  |  | // 请求异常回调 | 
|---|
|  |  |  | layer.msg('上传失败,请重试'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 监听排序事件 | 
|---|
|  |  |  | table.on('sort(locDetl)', function (obj) { | 
|---|
|  |  |  | 
|---|
|  |  |  | 'locDetl': exportData, | 
|---|
|  |  |  | 'fields': fields | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | var loadIndex = layer.load(2); | 
|---|
|  |  |  | var loadIndex = layer.msg('正在导出...', {icon: 16, shade: 0.01, time: false}); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/locDetl/export/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | 
|---|
|  |  |  | tableReload(false); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 搜索栏重置事件 | 
|---|
|  |  |  | form.on('submit(reset)', function (data) { | 
|---|
|  |  |  | pageCurr = 1; | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function tableReload(child) { | 
|---|
|  |  |  | var searchData = {}; | 
|---|
|  |  |  | var searchData = { | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | $.each($('#search-box [name]').serializeArray(), function() { | 
|---|
|  |  |  | searchData[this.name] = this.value; | 
|---|
|  |  |  | }); | 
|---|