| | |
| | | var pageCurr; |
| | | var tableData; |
| | | var admin; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo', align: 'center',title: '库位号'}, |
| | | {field: 'matnr', align: 'center',title: '存货编码', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '存货名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'batch', align: 'center',title: '序列码', width: 300, sort:true, hide: true} |
| | | ,{field: 'batch', align: 'center',title: '序列码', width: 300} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'suppCode', align: 'center',title: '料箱码'} |
| | | ,{field: 'threeCode', align: 'center',title: '销售订单号'} |
| | | ,{field: 'dead_time', align: 'center',title: '销售订单行号'} |
| | | ,{field: 'deadTime', align: 'center',title: '销售订单行号'} |
| | | ,{field: 'specs', align: 'center',title: '规格型号', hide: false} |
| | | ,{field: 'model', align: 'center',title: '通用型号', hide: false} |
| | | |
| | |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate','admin','form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | }); |
| | | }); |
| | | |
| | | // 导入销售单 |
| | | $("#compareToEss").click(function () { |
| | | $("#importExcel").trigger("click"); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | | function upload(obj){ |
| | | if(!obj.files) { |
| | | return; |
| | | } |
| | | var file = obj.files[0]; |
| | | admin.confirm('确认导入 [' + file.name +'] 文件吗?', function (index) { |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | var url = baseUrl + "/agv/locDetl/compare/auth"; |
| | | var form = new FormData(); |
| | | form.append("file", file); |
| | | let xhr = new XMLHttpRequest(); |
| | | xhr.open("post", url, true); |
| | | xhr.setRequestHeader('token', localStorage.getItem('token')); |
| | | xhr.onload = uploadComplete; |
| | | xhr.onerror = uploadFailed; |
| | | xhr.onloadend = function () { |
| | | layer.closeAll('loading'); |
| | | }; |
| | | // xhr.upload.onprogress = progressFunction; |
| | | xhr.upload.onloadstart = function(){ |
| | | ot = new Date().getTime(); |
| | | oloaded = 0; |
| | | }; |
| | | xhr.send(form); |
| | | }, function(index){ |
| | | }); |
| | | } |
| | | function uploadComplete(evt) { |
| | | let res = JSON.parse(evt.target.responseText); |
| | | if(res.code === 200) { |
| | | layer.msg(res.msg, {icon: 1}); |
| | | insTb.reload({page: {curr: 1}}); |
| | | } else { |
| | | alert(res.msg); |
| | | // layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | function uploadFailed(evt) { |
| | | let res = JSON.parse(evt.target.responseText); |
| | | alert(res.msg); |
| | | // layer.msg(res.msg, {icon: 2}); |
| | | } |