From 405e94c5d08e89c9bf2bd0820d39ceeaa049211d Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期三, 16 十月 2024 08:11:11 +0800 Subject: [PATCH] 流水记录表 --- src/main/webapp/static/js/agvLocDetl/locDetl.js | 63 ++++++++++++++++++++++++++++--- 1 files changed, 57 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/static/js/agvLocDetl/locDetl.js b/src/main/webapp/static/js/agvLocDetl/locDetl.js index 66b8d65..81bb933 100644 --- a/src/main/webapp/static/js/agvLocDetl/locDetl.js +++ b/src/main/webapp/static/js/agvLocDetl/locDetl.js @@ -1,21 +1,22 @@ 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: '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} ,{field: 'anfme', align: 'center',title: '鏁伴噺'} - ,{field: 'suppCode', align: 'center',title: '鏂欑鐮�'} + ,{field: 'suppCode', align: 'center',title: '璐ф灦鐮�'} ,{field: 'threeCode', align: 'center',title: '閿�鍞鍗曞彿'} ,{field: 'deadTime', align: 'center',title: '閿�鍞鍗曡鍙�'} ,{field: 'specs', align: 'center',title: '瑙勬牸鍨嬪彿', hide: false} ,{field: 'model', align: 'center',title: '閫氱敤鍨嬪彿', hide: false} - ,{field: 'brand', align: 'center',title: '瀛樿揣鍒嗙被缂栫爜', hide: true} - ,{field: 'color', align: 'center',title: '瀛樿揣鍒嗙被鍚嶇О', hide: true} + ,{field: 'brand', align: 'center',title: '鍟嗗搧鍒嗙被缂栫爜', hide: true} + ,{field: 'color', align: 'center',title: '鍟嗗搧鍒嗙被鍚嶇О', hide: true} ,{field: 'unit', align: 'center',title: '璁¢噺鍗曚綅', hide: true} ,{field: 'price', align: 'center',title: '杩涢」绋�', hide: true} ,{field: 'units', align: 'center',title: '閿�椤圭◣', hide: true} @@ -60,12 +61,15 @@ 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({ @@ -497,6 +501,11 @@ }); }); + // 瀵煎叆閿�鍞崟 + $("#compareToEss").click(function () { + $("#importExcel").trigger("click"); + }); + // 鏃堕棿閫夋嫨鍣� layDate.render({ elem: '#modiTime\\$', @@ -612,3 +621,45 @@ $("#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}); +} -- Gitblit v1.9.1