From bc20e7dc43b97367b7b70b678e71140a33846ff0 Mon Sep 17 00:00:00 2001 From: tzsk <Administrator@qq.com> Date: 星期三, 30 七月 2025 22:36:49 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/agvLocDetl/locDetl.js | 93 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 86 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/static/js/agvLocDetl/locDetl.js b/src/main/webapp/static/js/agvLocDetl/locDetl.js index d6482fd..c9730cb 100644 --- a/src/main/webapp/static/js/agvLocDetl/locDetl.js +++ b/src/main/webapp/static/js/agvLocDetl/locDetl.js @@ -1,16 +1,17 @@ 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: 'zpallet', 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} @@ -54,18 +55,23 @@ // cols.push.apply(cols, detlCols); cols.push({field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',hide: true} + ,{field: 'proddate$', align: 'center',title: '鐢熶骇鏃ユ湡', hide:false} + ,{field: 'deadline$', align: 'center',title: '鍒版湡鏃ユ湡', hide:false} ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿'} ,{field: 'stockFreeze', align: 'center',title: '搴撳瓨鍐荤粨', templet: '#stockFreezeTpl'} ) 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({ @@ -75,7 +81,8 @@ page: true, limit: 20, where:{ - unreason: false + unreason: false, + expired: false }, limits: [20, 30, 50, 100, 200, 500], even: true, @@ -398,6 +405,29 @@ method("add"); }); + form.on('submit(expired)', function (data) { + pageCurr = 1; + + tableIns.reload({ + where: { + expired: true, + unreason: false + }, + page: { + curr: pageCurr + }, + done: function (res, curr, count) { + + if (res.code === 403) { + top.location.href = baseUrl+"/"; + } + pageCurr=curr; + + limit(child); + } + }); + }); + // 鏁版嵁淇敼鍔ㄤ綔 form.on('submit(edit)', function () { method("update") @@ -480,7 +510,8 @@ tableIns.reload({ where: { - unreason: true + unreason: true, + expired:false }, page: { curr: pageCurr @@ -495,6 +526,11 @@ limit(child); } }); + }); + + // 瀵煎叆閿�鍞崟 + $("#compareToEss").click(function () { + $("#importExcel").trigger("click"); }); // 鏃堕棿閫夋嫨鍣� @@ -530,7 +566,8 @@ function tableReload(child) { var searchData = { - unreason: false + unreason: false, + expired: false }; $.each($('#search-box [name]').serializeArray(), function() { searchData[this.name] = this.value; @@ -612,3 +649,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