From eb13b96cc3b01a3d44fbce6a730004e158418ab5 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 09 四月 2021 14:06:58 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/safeSto/safeSto.js | 98 +++++++++++++++--------------------------------- 1 files changed, 31 insertions(+), 67 deletions(-) diff --git a/src/main/webapp/static/js/safeSto/safeSto.js b/src/main/webapp/static/js/safeSto/safeSto.js index d79a870..d53037b 100644 --- a/src/main/webapp/static/js/safeSto/safeSto.js +++ b/src/main/webapp/static/js/safeSto/safeSto.js @@ -15,7 +15,6 @@ page: true, limit: 16, limits: [16, 30, 50, 100, 200, 500], - even: true, toolbar: '#toolbar', cellMinWidth: 50, cols: [[ @@ -23,10 +22,11 @@ ,{field: 'node_name', align: 'center',title: '璐т綅'} ,{field: 'matnr', align: 'center',title: '鍟嗗搧缂栧彿'} ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О'} - ,{field: 'progress', align: 'center',title: '浣跨敤鎯呭喌', templet: '#progressTpl'} + ,{field: 'progress', align: 'center',title: '浣跨敤鎯呭喌', templet: '#progressTpl', width: 350} + ,{field: 'status', align: 'center',title: '璀︽姤', templet: '#statusTpl', width: 100} ,{field: 'safe_qua', align: 'center',title: '瀹夊叏搴撳瓨閲�', style: 'font-weight: bold'} ,{field: 'amount', align: 'center',title: '褰撳墠搴撳瓨閲�', style: 'font-weight: bold'} - ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150} + ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120} ]], request: { pageName: 'curr', @@ -103,56 +103,36 @@ table.on('tool(safeSto)', function(obj){ var data = obj.data; switch (obj.event) { - // 璇︽儏 - case 'detail': - layer.open({ - type: 2, - title: '璇︽儏', - maxmin: true, - area: ['30%', top.detailHeight], - shadeClose: true, - content: 'prior_detail.html', - success: function(layero, index){ - setFormVal(layer.getChildFrame('#detail', index), 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'); - } + // 琛ヤ粨 + case 'allot': + layer.confirm(data.node_name +'琛ヤ粨 '+ data.matnr + '锛屾暟閲忥細' + (data.safe_qua - data.amount), function(){ + var index = layer.load(1, {shade: [0.1,'#000']}); + $.ajax({ + url: baseUrl+"/work/stock/transfer", + headers: {'token': localStorage.getItem('token')}, + contentType:'application/json;charset=UTF-8', + data: JSON.stringify({ + node_id: data.node_id, + matnr: data.matnr, + safe_qua: data.safe_qua, + amount: data.amount + }), + dataType:'json', + method: 'POST', + success: function (res) { + if (res.code === 200) { + layer.msg(res.msg, {icon: 1}) + $(".layui-laypage-btn")[0].click(); + } else if (res.code === 403) { + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}) + } + layer.close(index); + } + }); }); break; - // 缂栬緫 - case 'edit': - layer.open({ - type: 2, - title: '淇敼', - maxmin: true, - area: ['30%', top.detailHeight], - content: 'prior_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('#id', 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'); - layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); - } - }); - break; - - } - }); - - - // 澶嶉�夋浜嬩欢 - form.on('checkbox(detailCheckbox)', function (data) { - var el = data.elem; - if (el.checked) { - $(el).val('Y'); - } else { - $(el).val('N'); } }); @@ -196,22 +176,6 @@ where: searchData, page: { curr: pageCurr - }, - done: function (res, curr, count) { - if (res.code === 403) { - top.location.href = baseUrl+"/"; - } - pageCurr=curr; - if (res.data.length === 0 && count !== 0) { - tableIns.reload({ - where: searchData, - page: { - curr: pageCurr-1 - } - }); - pageCurr -= 1; - } - limit(child); } }); } -- Gitblit v1.9.1