From f3603d9f0eb85d2a42edbcadd0950889af2c24d2 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期一, 19 二月 2024 18:14:05 +0800 Subject: [PATCH] #库存迁移逻辑修改,从工作明细档进行处理 --- src/main/webapp/static/js/agvLocDetl/locDetl.js | 140 ++++++++++++++++++++++++++++++++++------------ 1 files changed, 102 insertions(+), 38 deletions(-) diff --git a/src/main/webapp/static/js/agvLocDetl/locDetl.js b/src/main/webapp/static/js/agvLocDetl/locDetl.js index 8b71add..d408a1d 100644 --- a/src/main/webapp/static/js/agvLocDetl/locDetl.js +++ b/src/main/webapp/static/js/agvLocDetl/locDetl.js @@ -1,41 +1,55 @@ 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: '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} + ,{field: 'batch', align: 'center',title: '搴忓垪鐮�', width: 300} ,{field: 'anfme', align: 'center',title: '鏁伴噺'} - ,{field: 'zpallet', 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: 'specs', align: 'center',title: '瑙勬牸'} - ,{field: 'model', align: 'center',title: '浠g爜', 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: '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} + ,{field: 'dsDate', align: 'center',title: '鍚敤鏃ユ湡', hide: true} + ,{field: 'supp', align: 'center',title: '寤烘。浜�', hide: true} + ,{field: 'dInvCreateDatetime', align: 'center',title: '寤烘。鏃ユ湡', hide: true} + + // ,{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} ]; @@ -47,18 +61,21 @@ 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({ elem: '#agvLocDetl', headers: {token: localStorage.getItem('token')}, - url: baseUrl+'/agvLocDetl/list/auth', + url: baseUrl+'/agv/locDetl/list/auth', page: true, limit: 20, where:{ @@ -159,7 +176,7 @@ } else { layer.confirm('纭畾鍒犻櫎'+(data.length===1?'姝�':data.length)+'鏉℃暟鎹悧', function(){ $.ajax({ - url: baseUrl+"/locDetl/delete/auth", + url: baseUrl+"/agv/locDetl/delete/auth", headers: {'token': localStorage.getItem('token')}, data: {param: JSON.stringify(data)}, method: 'POST', @@ -198,7 +215,7 @@ }; var loadIndex = layer.msg('姝e湪瀵煎嚭...', {icon: 16, shade: 0.01, time: false}); $.ajax({ - url: baseUrl+"/locDetl/export/auth", + url: baseUrl+"/agv/locDetl/export/auth", headers: {'token': localStorage.getItem('token')}, data: JSON.stringify(param), dataType:'json', @@ -278,7 +295,7 @@ content: '../locMast/locMast_detail.html', success: function(layero, index){ $.ajax({ - url: baseUrl+"/locMast/"+ param +"/auth", + url: baseUrl+"/agv/locMast/"+ param +"/auth", headers: {'token': localStorage.getItem('token')}, method: 'GET', success: function (res) { @@ -416,7 +433,7 @@ }; $.ajax({ - url: baseUrl+"/locDetl/"+name+"/auth", + url: baseUrl+"/agv/locDetl/"+name+"/auth", headers: {'token': localStorage.getItem('token')}, data: top.reObject(data), method: 'POST', @@ -484,6 +501,11 @@ }); }); + // 瀵煎叆閿�鍞崟 + $("#compareToEss").click(function () { + $("#importExcel").trigger("click"); + }); + // 鏃堕棿閫夋嫨鍣� layDate.render({ elem: '#modiTime\\$', @@ -498,7 +520,7 @@ let index = obj.othis.parents('tr').attr("data-index"); let data = tableData[index]; data[this.stockFreeze] = obj.elem.checked?1:0; - http.post(baseUrl + "/locDetl/updateStockFreeze/auth", { + http.post(baseUrl + "/agv/locDetl/updateStockFreeze/auth", { locNo: data.locNo, matnr: data.matnr, stockFreeze: data[this.stockFreeze] @@ -599,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