From 46a47d147ca58b48b83a2df50926f5fd2bab3f0c Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期三, 17 六月 2020 14:49:06 +0800 Subject: [PATCH] # --- src/main/webapp/views/pakStore/pakStore.html | 57 ++++++++++++------ src/main/webapp/static/js/matCode/matCode.js | 1 src/main/webapp/static/js/pakStore/pakStore.js | 84 ++++++++++++--------------- 3 files changed, 77 insertions(+), 65 deletions(-) diff --git a/src/main/webapp/static/js/matCode/matCode.js b/src/main/webapp/static/js/matCode/matCode.js index 65aa27a..0483179 100644 --- a/src/main/webapp/static/js/matCode/matCode.js +++ b/src/main/webapp/static/js/matCode/matCode.js @@ -15,6 +15,7 @@ url: baseUrl+'/matCode/list/auth', page: true, limit: 16, + limits: [16, 50, 100, 200, 500], even: true, toolbar: '#toolbar', cellMinWidth: 50, diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js index db45c39..ad04f6f 100644 --- a/src/main/webapp/static/js/pakStore/pakStore.js +++ b/src/main/webapp/static/js/pakStore/pakStore.js @@ -9,26 +9,6 @@ var layDate = layui.laydate; var form = layui.form; - // 鑾峰彇鍙敤鍏ュ簱绔欑偣 - $.ajax({ - url: baseUrl+"/available/put/site", - headers: {'token': localStorage.getItem('token')}, - method: 'POST', - success: function (res) { - if (res.code === 200){ - var tpl = $("#putSiteSelectTemplate").html(); - var template = Handlebars.compile(tpl); - var html = template(res); - $('#putSiteSelect').append(html); - form.render('select'); - } else if (res.code === 403){ - top.location.href = baseUrl+"/"; - }else { - layer.msg(res.msg) - } - } - }) - tableIns = table.render({ elem: '#chooseData', data: [], @@ -49,6 +29,7 @@ $('td[data-field=count] div').html(initCountVal); setMatCodeData(res.data); limit(); + getInBound(); } }); @@ -79,14 +60,26 @@ return; } } - layer.open({ - type: 1, - title: '閫夋嫨鍏ュ簱绔�', - maxmin: true, - shadeClose: true, - content: $('#combDiv'), - success: function (layero, index) { - + $.ajax({ + url: baseUrl+"/full/store/put/start", + headers: {'token': localStorage.getItem('token')}, + data: JSON.stringify({ + devpNo: $('#putSiteSelect').val(), + list: matCodeData + }), + contentType:'application/json;charset=UTF-8', + method: 'POST', + async: false, + success: function (res) { + if (res.code === 200){ + layer.msg("鍏ュ簱鍚姩鎴愬姛锛岀洰鏍囧簱浣嶏細" + res.data); + matCodeData = []; + tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}}); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + }else { + layer.msg(res.msg) + } } }) break; @@ -106,6 +99,7 @@ } tableIns.reload({data: matCodeData,done:function (res) { limit(); + getInBound(); // 瑕嗙洊render鏂规硶鐨刣one }}); break; @@ -136,36 +130,34 @@ tableIns.reload({data: matCodeData,done:function (res) { limit(); + getInBound(); // 瑕嗙洊render鏂规硶鐨刣one }}); } - // 琛ㄥ崟 --- 鍚姩鍏ュ簱 - form.on('submit(combDo)', function (data) { + // 鑾峰彇鍙敤鍏ュ簱绔欑偣 + function getInBound() { $.ajax({ - url: baseUrl+"/full/store/put/start", + url: baseUrl + "/available/put/site", headers: {'token': localStorage.getItem('token')}, - data: JSON.stringify({ - devpNo: $('#putSiteSelect').val(), - list: matCodeData - }), - contentType:'application/json;charset=UTF-8', method: 'POST', - async: false, success: function (res) { - if (res.code === 200){ - layer.closeAll(); - layer.msg("鍏ュ簱鍚姩鎴愬姛锛岀洰鏍囧簱浣嶏細" + res.data); - matCodeData = []; - tableIns.reload({data: matCodeData,done:function (res) { limit();}}); - } else if (res.code === 403){ - top.location.href = baseUrl+"/"; - }else { + if (res.code === 200) { + var tpl = $("#putSiteSelectTemplate").html(); + var template = Handlebars.compile(tpl); + var html = template(res); + $('#putSiteSelect').append(html); + form.render('select'); + } else if (res.code === 403) { + top.location.href = baseUrl + "/"; + } else { layer.msg(res.msg) } } }) - }); + } + + }); // 鎻愬彇鐗╂枡 diff --git a/src/main/webapp/views/pakStore/pakStore.html b/src/main/webapp/views/pakStore/pakStore.html index 3e617d1..f5bbca4 100644 --- a/src/main/webapp/views/pakStore/pakStore.html +++ b/src/main/webapp/views/pakStore/pakStore.html @@ -51,7 +51,35 @@ #mat-query { display: none; } + /*#btn-comb {*/ + /* display: none;*/ + /*}*/ + + + #staNoSpan { + text-align: center; + display: inline-block; + width: 100px; + font-size: 13px; + } + .layui-btn-container .layui-form-select { + display: inline-block; + width: 150px; + height: 30px; + } + .layui-btn-container .layui-form-select.layui-form-selected { + display: inline-block; + width: 150px; + } + .layui-btn-container .layui-select-title input { + font-size: 13px; + } + .layui-btn-container .layui-anim.layui-anim-upbit dd { + font-size: 13px; + } + #btn-comb { + margin-left: 60px; display: none; } </style> @@ -69,8 +97,16 @@ <!-- 澶撮儴 --> <script type="text/html" id="toolbar"> - <div class="layui-btn-container"> - <button class="layui-btn layui-btn-normal" id="btn-comb" lay-event="comb" style="">鍏ュ簱</button> + <div class="layui-form"> + <div class="layui-btn-container"> + <!-- 1.閫夋嫨鍏ュ簱鍙� --> + <span id="staNoSpan">鍏ュ簱鍙o細</span> + <select id="putSiteSelect" lay-verify="required"> + <option value="">璇烽�夋嫨绔欑偣</option> + </select> + <!-- 2.鍚姩鍑哄簱 --> + <button class="layui-btn layui-btn-normal layui-btn-lg" id="btn-comb" lay-event="comb" style="">鍚姩鍏ュ簱</button> + </div> </div> </script> @@ -88,23 +124,6 @@ <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> <script type="text/javascript" src="../../static/js/pakStore/pakStore.js" charset="utf-8"></script> - -<div id="combDiv" style="display: none; padding: 20px"> - <div class="layui-form"> - <div class="layui-form-item"> - <label class="layui-form-label" style="padding: 9px 0">鍏ュ簱绔欑偣锛�</label> - <div class="layui-input-block" style="margin-left: 90px;"> - <select id="putSiteSelect" lay-verify="required" lay-search=""> - <option value="">璇烽�夋嫨绔欑偣</option> - </select> - </div> - </div> - - <div style="text-align: center; margin-top: 20px"> - <button class="layui-btn layui-btn-radius layui-btn-normal" id="combDo" lay-submit lay-filter="combDo">鍚姩鍏ュ簱</button> - </div> - </div> -</div> <script type="text/template" id="putSiteSelectTemplate"> {{#each data}} -- Gitblit v1.9.1