From 786b7ba9ac838c1d947de03be3ee98d199ca9dc9 Mon Sep 17 00:00:00 2001 From: LSH Date: 星期五, 02 十二月 2022 17:00:21 +0800 Subject: [PATCH] #修改合同号 --- src/main/webapp/static/js/locMast/locMast.js | 156 ++++++++++++++++++++++++++++++--------------------- 1 files changed, 92 insertions(+), 64 deletions(-) diff --git a/src/main/webapp/static/js/locMast/locMast.js b/src/main/webapp/static/js/locMast/locMast.js index c305e94..26fa8a5 100644 --- a/src/main/webapp/static/js/locMast/locMast.js +++ b/src/main/webapp/static/js/locMast/locMast.js @@ -10,28 +10,30 @@ tableIns = table.render({ elem: '#locMast', headers: {token: localStorage.getItem('token')}, - url: '/locMast/list/auth', + url: baseUrl+'/locMast/list/auth', page: true, limit: 16, + limits: [16, 30, 50, 100, 200, 500], even: true, + // size: 'sm', toolbar: '#toolbar', cellMinWidth: 50, cols: [[ {type: 'checkbox', fixed: 'left'} // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�',sort:true} - ,{field: 'locType$', align: 'center',title: '搴撲綅鐘舵��',width:200} - ,{field: 'whsType$', align: 'center',title: '搴撲綅绫诲瀷'} + ,{field: 'locSts$', align: 'center',title: '搴撲綅鐘舵��',width:200} + // ,{field: 'whsType$', align: 'center',title: '搴撲綅绫诲瀷'} // ,{field: 'pltType', align: 'center',title: ''} // ,{field: 'ctnType', align: 'center',title: ''} // ,{field: 'locSts', align: 'center',title: ''} // ,{field: 'sheetNo', align: 'center',title: ''} ,{field: 'crnNo', align: 'center',title: '鍫嗗灈鏈哄彿'} - ,{field: 'row1', align: 'center',title: '鎺�'} - ,{field: 'bay1', align: 'center',title: '鍒�'} + ,{field: 'row1', align: 'center',title: '鎺�', sort:true} + ,{field: 'bay1', align: 'center',title: '鍒�', sort:true} ,{field: 'lev1', align: 'center',title: '灞�', sort:true} ,{field: 'fullPlt', align: 'center',title: '婊℃澘', templet:function(row){ - var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; + var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' disabled table-index='"+row.LAY_TABLE_INDEX+"'"; if(row.fullPlt === 'Y'){html += " checked ";} html += ">"; return html; @@ -39,8 +41,8 @@ // ,{field: 'outEnable', align: 'center',title: ''} // ,{field: 'ioTime$', align: 'center',title: ''} // ,{field: 'firstTime$', align: 'center',title: ''} - // ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',event: 'modiUser', style: 'text-decoration: underline;cursor:pointer'} - // ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿'} + ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide:true} + ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide:true} // ,{field: 'appeUser$', align: 'center',title: '鍒涘缓鑰�',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'} // ,{field: 'appeTime$', align: 'center',title: '娣诲姞鏃堕棿'} // ,{field: 'errorTime$', align: 'center',title: ''} @@ -52,8 +54,11 @@ // ,{field: 'barcode', align: 'center',title: ''} // ,{field: 'PdcType', align: 'center',title: ''} // ,{field: 'ctnNo', align: 'center',title: ''} + ,{field: 'locType1$', align: 'center',title: '楂樹綆绫诲瀷'} + // ,{field: 'locType2$', align: 'center',title: '瀹界獎绫诲瀷'} + // ,{field: 'locType3$', align: 'center',title: '杞婚噸绫诲瀷'} - ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150} + ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:100} ]], request: { pageName: 'curr', @@ -72,7 +77,7 @@ }, done: function(res, curr, count) { if (res.code === 403) { - top.location.href = "/"; + top.location.href = baseUrl+"/"; } pageCurr=curr; limit(); @@ -102,7 +107,7 @@ }, done: function (res, curr, count) { if (res.code === 403) { - top.location.href = "/"; + top.location.href = baseUrl+"/"; } pageCurr=curr; limit(); @@ -119,12 +124,13 @@ type: 2, title: '鏂板', maxmin: true, - area: [top.detailWidth, top.detailHeight], + area: ['500px', top.detailHeight], shadeClose: false, content: 'locMast_detail.html', success: function(layero, index){ layer.getChildFrame('#data-detail-submit-edit', index).hide(); clearFormVal(layer.getChildFrame('#detail', index)); + top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); } }); @@ -144,7 +150,7 @@ } else { layer.confirm('纭畾鍒犻櫎'+(data.length===1?'姝�':data.length)+'鏉℃暟鎹悧', function(){ $.ajax({ - url: "/locMast/delete/auth", + url: baseUrl+"/locMast/delete/auth", headers: {'token': localStorage.getItem('token')}, data: {param: JSON.stringify(data)}, method: 'POST', @@ -154,7 +160,7 @@ layer.closeAll(); tableReload(false); } else if (res.code === 403){ - top.location.href = "/"; + top.location.href = baseUrl+"/"; } else { layer.msg(res.msg) } @@ -164,7 +170,7 @@ } break; case 'exportData': - layer.confirm('纭畾瀵煎嚭Excel鍚�', function(){ + layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){ var titles=[]; var fields=[]; obj.config.cols[0].map(function (col) { @@ -182,7 +188,7 @@ 'fields': fields }; $.ajax({ - url: "/locMast/export/auth", + url: baseUrl+"/locMast/export/auth", headers: {'token': localStorage.getItem('token')}, data: JSON.stringify(param), dataType:'json', @@ -193,12 +199,34 @@ if (res.code === 200) { table.exportFile(titles,res.data,'xls'); } else if (res.code === 403) { - top.location.href = "/"; + top.location.href = baseUrl+"/"; } else { layer.msg(res.msg) } } }); + }); + break; + case "init": + layer.prompt({title: '璇疯緭鍏ュ彛浠わ紝骞堕噸缃簱浣�', formType: 1, shadeClose: true}, function(pass, idx){ + http.get(baseUrl+"/locMast/init/pwd", {pwd: pass}, function (res) { + if (res.data) { + layer.open({ + type: 1, + title: '鍒濆鍖栧簱浣�', + area: ["400px"], + maxmin: true, + shadeClose: true, + content: $("#resetLocDiv"), + success: function (layero, index) { + + } + }) + } else { + layer.msg("鍙d护閿欒"); + } + layer.close(idx); + }) }); break; } @@ -234,13 +262,13 @@ type: 2, title: '淇敼', maxmin: true, - area: [top.detailWidth, top.detailHeight], + area: ['500px', top.detailHeight], shadeClose: false, content: 'locMast_detail.html', success: function(layero, index){ layer.getChildFrame('#data-detail-submit-save', index).hide(); setFormVal(layer.getChildFrame('#detail', index), data, false); - top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); + // top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); top.convertDisabled(layer.getChildFrame('#locNo', index), true); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); layero.find('iframe')[0].contentWindow.layui.form.render('select'); @@ -262,43 +290,7 @@ content: '../basWhs/basWhs_detail.html', success: function(layero, index){ $.ajax({ - url: "/basWhs/"+ param +"/auth", - headers: {'token': localStorage.getItem('token')}, - method: 'GET', - success: function (res) { - if (res.code === 200){ - setFormVal(layer.getChildFrame('#detail', index), res.data, true); - top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); - layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); - layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); - layero.find('iframe')[0].contentWindow.layui.form.render('select'); - layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); - } else if (res.code === 403){ - parent.location.href = "/"; - }else { - layer.msg(res.msg) - } - } - }) - } - }); - } - break; - case 'locType': - var param = top.reObject(data).locType; - if (param === undefined) { - layer.msg("鏃犳暟鎹�"); - } else { - layer.open({ - type: 2, - title: '搴撲綅璇︽儏', - maxmin: true, - area: [top.detailWidth, top.detailHeight], - shadeClose: false, - content: '../basLocType/basLocType_detail.html', - success: function(layero, index){ - $.ajax({ - url: "/basLocType/"+ param +"/auth", + url: baseUrl+"/basWhs/"+ param +"/auth", headers: {'token': localStorage.getItem('token')}, method: 'GET', success: function (res) { @@ -334,7 +326,7 @@ content: '../user/user_detail.html', success: function(layero, index){ $.ajax({ - url: "/user/"+ param +"/auth", + url: baseUrl+"/user/"+ param +"/auth", headers: {'token': localStorage.getItem('token')}, method: 'GET', success: function (res) { @@ -371,7 +363,7 @@ content: '../user/user_detail.html', success: function(layero, index){ $.ajax({ - url: "/user/"+ param +"/auth", + url: baseUrl+"/user/"+ param +"/auth", headers: {'token': localStorage.getItem('token')}, method: 'GET', success: function (res) { @@ -397,20 +389,45 @@ } }); + // 鍒濆鍖栦繚瀛� + form.on('submit(initDo)', function (data) { + $.ajax({ + url: baseUrl+"/locMast/init/auth", + headers: {'token': localStorage.getItem('token')}, + data: data.field, + method: 'POST', + async: false, + success: function (res) { + if (res.code === 200){ + layer.msg(res.msg); + layer.closeAll(); + tableReload(false); + } else if (res.code === 403){ + parent.location.href = "/"; + }else { + layer.msg(res.msg) + } + } + }) + }); + // 鏁版嵁淇濆瓨鍔ㄤ綔 form.on('submit(save)', function () { if (banMsg != null){ layer.msg(banMsg); return; } - method("add"); + method("/locMast/add/auth"); }); // 鏁版嵁淇敼鍔ㄤ綔 form.on('submit(edit)', function () { - method("update") + method("/locMast/update/auth") }); - + // 鏁版嵁淇敼鍔ㄤ綔 + form.on('submit(pakoutPreview)', function () { + method("/locDetl/updateBatch/auth") + }); function method(name){ var index = layer.load(1, { shade: [0.5,'#000'] //0.1閫忔槑搴︾殑鑳屾櫙 @@ -445,10 +462,17 @@ barcode: $('#barcode').val(), PdcType: $('#PdcType').val(), ctnNo: $('#ctnNo').val(), + batch: $('#batch').val(), + anfme: $('#anfme').val(), + matnr: $('#matnr').val(), + maktx: $('#maktx').val(), + zpallet: $('#zpallet').val(), + specs: $('#specs').val(), + sku: $('#sku').val(), }; $.ajax({ - url: "/locMast/"+name+"/auth", + url: baseUrl+name, headers: {'token': localStorage.getItem('token')}, data: top.reObject(data), method: 'POST', @@ -460,7 +484,11 @@ $(this).val(""); }); } else if (res.code === 403){ - top.location.href = "/"; + top.location.href = baseUrl+"/"; + }else if (res.code===201){ + layer.msg(res.msg); + parent.layer.closeAll(); + parent.parent.layer.closeAll(); }else { layer.msg(res.msg) } @@ -534,7 +562,7 @@ }, done: function (res, curr, count) { if (res.code === 403) { - top.location.href = "/"; + top.location.href = baseUrl+"/"; } pageCurr=curr; if (res.data.length === 0 && count !== 0) { -- Gitblit v1.9.1