From c22266b4dfbe3f338d2dd0bb31b10df1b5c92fb5 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期六, 24 五月 2025 13:54:39 +0800 Subject: [PATCH] 13 --- src/main/webapp/static/js/locDetl/locDetl.js | 126 ++++++++++++++++++++++++++++++------------ 1 files changed, 90 insertions(+), 36 deletions(-) diff --git a/src/main/webapp/static/js/locDetl/locDetl.js b/src/main/webapp/static/js/locDetl/locDetl.js index 7c9a734..14c17ee 100644 --- a/src/main/webapp/static/js/locDetl/locDetl.js +++ b/src/main/webapp/static/js/locDetl/locDetl.js @@ -1,15 +1,16 @@ var pageCurr; function getCol() { var cols = [ - {field: 'locNo$', align: 'center',title: '搴撲綅鍙�'}, - {field: 'matnr', align: 'center',title: '鍟嗗搧缂栧彿', sort:true} + {type: 'checkbox'}, + {field: 'locNo$', align: 'center',title: '搴撲綅鍙�'} + ,{field: 'storeDate', 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, sort:true} + ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', hide: true} + ,{field: 'batch', align: 'center',title: '鎵瑰彿', width: 300, sort:true} ,{field: 'anfme', align: 'center',title: '鏁伴噺'} ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜'} - - ,{field: 'specs', align: 'center',title: '閰嶇疆'} + ,{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} @@ -35,7 +36,15 @@ ,{field: 'source$', align: 'center',title: '鍒惰喘', hide: true} ,{field: 'check$', align: 'center',title: '瑕佹眰妫�楠�', hide: true} ,{field: 'danger$', align: 'center',title: '鍗遍櫓鍝�', hide: true} - + ,{field: 'frozen$', align: 'center',title: '鍐荤粨鍚�', + templet: function(d) { + // 鏍规嵁鏉′欢鍒ゆ柇瀛椾綋棰滆壊 + if (d.frozen$ === '宸插喕缁�') { + return '<span style="color: #34a8de;">' +d.frozen$ + '</span>'; + } else { + return '<span">' +d.frozen$ + '</span>'; + } + }} ]; // cols.push.apply(cols, detlCols); @@ -58,11 +67,8 @@ headers: {token: localStorage.getItem('token')}, url: baseUrl+'/locDetl/list/auth', page: true, - limit: 20, - where:{ - unreason: false - }, - limits: [20, 30, 50, 100, 200, 500], + limit: 16, + limits: [16, 30, 50, 100, 200, 500], even: true, toolbar: '#toolbar', cellMinWidth: 50, @@ -214,6 +220,78 @@ } }); }); + break; + // 鍐荤粨 + case 'frozen': + let frozenData = checkStatus.data; + console.log(frozenData) + if (frozenData.length === 0){ + layer.msg('璇烽�夋嫨鏁版嵁'); + } else { + layer.confirm('纭畾鍐荤粨搴撳瓨鍚�?', function(){ + let requestData = frozenData.map(obj => ({ + locNo: obj.locNo, + matnr: obj.matnr, + batch: obj.batch + }) + ); + $.ajax({ + url: baseUrl+"/locDetl/frozenInventory", + headers: {'token': localStorage.getItem('token')}, + data: JSON.stringify(requestData), + dataType:'json', + contentType:'application/json;charset=UTF-8', + method: 'POST', + traditional:true, + success: function (res) { + if (res.code === 200){ + layer.closeAll(); + tableReload(false); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg) + } + } + }) + }); + } + break; + // 瑙e喕 + case 'unfreeze': + let unfreezeData = checkStatus.data; + console.log(unfreezeData) + if (unfreezeData.length === 0){ + layer.msg('璇烽�夋嫨鏁版嵁'); + } else { + layer.confirm('纭畾瑙e喕搴撳瓨鍚�?', function(){ + let requestData = unfreezeData.map(obj => ({ + locNo: obj.locNo, + matnr: obj.matnr, + batch: obj.batch + }) + ); + $.ajax({ + url: baseUrl+"/locDetl/unfreezeInventory", + headers: {'token': localStorage.getItem('token')}, + data: JSON.stringify(requestData), + dataType:'json', + contentType:'application/json;charset=UTF-8', + method: 'POST', + traditional:true, + success: function (res) { + if (res.code === 200){ + layer.closeAll(); + tableReload(false); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg) + } + } + }) + }); + } break; } }); @@ -458,29 +536,6 @@ tableReload(false); }); - //鏌ョ湅寮傚父鏁版嵁 - form.on('submit(unreason)', function (data) { - pageCurr = 1; - - tableIns.reload({ - where: { - unreason: true - }, - page: { - curr: pageCurr - }, - done: function (res, curr, count) { - - if (res.code === 403) { - top.location.href = baseUrl+"/"; - } - pageCurr=curr; - - limit(child); - } - }); - }); - // 鏃堕棿閫夋嫨鍣� layDate.render({ elem: '#modiTime\\$', @@ -501,7 +556,6 @@ function tableReload(child) { var searchData = { - unreason: false }; $.each($('#search-box [name]').serializeArray(), function() { searchData[this.name] = this.value; -- Gitblit v1.9.1