|  |  |  | 
|---|
|  |  |  | var pageCurr; | 
|---|
|  |  |  | function getCol() { | 
|---|
|  |  |  | var cols = [{field: 'locNo$', align: 'center',title: '库位号'}]; | 
|---|
|  |  |  | cols.push.apply(cols, detlCols); | 
|---|
|  |  |  | var cols = [ | 
|---|
|  |  |  | {field: 'locNo$', align: 'center',title: '库位号'} | 
|---|
|  |  |  | ,{field: 'storeDate', align: 'center',title: '库龄(天)', sort:true} | 
|---|
|  |  |  | ,{field: 'matnr', align: 'center',title: '商品模具名称', sort:true} | 
|---|
|  |  |  | ,{field: 'model', align: 'center',title: '套号'} | 
|---|
|  |  |  | ,{field: 'maktx', align: 'center',title: '商品型材型号', sort:true} | 
|---|
|  |  |  | ,{field: 'spgNO', align: 'center',title: '派工单号', hide:true,sort:true} | 
|---|
|  |  |  | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} | 
|---|
|  |  |  | ,{field: 'batch', align: 'center',title: '批号', width: 200,hide:true, sort:true} | 
|---|
|  |  |  | ,{field: 'outOrderNo', align: 'center',title: '合同号', hide: true} | 
|---|
|  |  |  | ,{field: 'anfme', align: 'center',title: '数量'} | 
|---|
|  |  |  | ,{field: 'zpallet', align: 'center',title: '托盘条码'} | 
|---|
|  |  |  | ,{field: 'specs', align: 'center',title: '规格'} | 
|---|
|  |  |  | ,{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} | 
|---|
|  |  |  | //,{fixed: 'right', title:'简图', align: 'center', toolbar: '#operate1', width: 300} | 
|---|
|  |  |  | // ,{fixed: 'right', align: 'center',title: '简图', templet:function(row){ | 
|---|
|  |  |  | //         var html = "<img  src='http://127.0.0.1:8080/czkhasrs/previewImage?maktx=" +row.maktx+"'/>"; | 
|---|
|  |  |  | //         return html; | 
|---|
|  |  |  | // }} | 
|---|
|  |  |  | ,{fixed: 'right', align: 'center', title: '简图', templet: function(row){ | 
|---|
|  |  |  | var html = "<a href='http://127.0.0.1:8080/czkhasrs/previewImage?maktx=" + row.maktx + "' target='_blank' rel='noopener noreferrer'>查看简图</a>"; | 
|---|
|  |  |  | return html; | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | ,{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: 'proType', align: 'center',title: '属性', hide: false} | 
|---|
|  |  |  | ,{field: 'temp1', align: 'center',title: '名称总称', hide: true} | 
|---|
|  |  |  | ,{field: 'temp2', align: 'center',title: '客户图号', hide: true} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ]; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // cols.push.apply(cols, detlCols); | 
|---|
|  |  |  | cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true} | 
|---|
|  |  |  | ,{field: 'modiTime$', align: 'center',title: '修改时间'} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | 
|---|
|  |  |  | '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')}, | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | // 查看简图 | 
|---|
|  |  |  | case 'showPic': | 
|---|
|  |  |  | let imgHtml = '<div style="height:100%;display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;">'; | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/previewImage", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | maktx: data.maktx | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | method: 'GET', | 
|---|
|  |  |  | traditional:true, | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | res.data.forEach((item) => { | 
|---|
|  |  |  | let maktx = item.maktx; | 
|---|
|  |  |  | let pics = item.pics; | 
|---|
|  |  |  | pics.forEach((pic) => { | 
|---|
|  |  |  | let tmp = '<div><div><img width="600" src="' + pic + '" /></div><div>' + maktx + '</div></div>'; | 
|---|
|  |  |  | imgHtml += tmp; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | imgHtml += "</div>"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | title: '查看简图', | 
|---|
|  |  |  | area: [top.detailWidth, top.detailHeight], | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: imgHtml, | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | console.log(imgHtml) | 
|---|
|  |  |  | break; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | tableReload(false); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 搜索栏重置事件 | 
|---|
|  |  |  | form.on('submit(reset)', function (data) { | 
|---|
|  |  |  | pageCurr = 1; | 
|---|
|  |  |  | clearFormVal($('#search-box')); | 
|---|
|  |  |  | tableReload(false); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | layDate.render({ | 
|---|
|  |  |  | elem: '.layui-laydate-range' | 
|---|
|  |  |  | ,type: 'datetime' | 
|---|
|  |  |  | ,range: true | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // 时间选择器 | 
|---|
|  |  |  | layDate.render({ | 
|---|
|  |  |  | elem: '#modiTime\\$', | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function tableReload(child) { | 
|---|
|  |  |  | var searchData = {}; | 
|---|
|  |  |  | var searchData = { | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | $.each($('#search-box [name]').serializeArray(), function() { | 
|---|
|  |  |  | searchData[this.name] = this.value; | 
|---|
|  |  |  | }); | 
|---|