From 4ea00a26f7773e0ad27aeee512f34ff45fe0f18b Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 16 六月 2020 15:21:29 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/pakStore/stockOut.js | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/static/js/pakStore/stockOut.js b/src/main/webapp/static/js/pakStore/stockOut.js index 7cfd988..728dc60 100644 --- a/src/main/webapp/static/js/pakStore/stockOut.js +++ b/src/main/webapp/static/js/pakStore/stockOut.js @@ -10,10 +10,9 @@ tableIns = table.render({ elem: '#stockOut', headers: {token: localStorage.getItem('token')}, - url: baseUrl+'/locDetl/list/auth', + url: baseUrl+'/stock/out/list/auth', page: true, limit: 10, - skin: 'line', even: true, toolbar: '#toolbar', cellMinWidth: 50, @@ -68,7 +67,7 @@ }); // 鐩戝惉鎺掑簭浜嬩欢 - table.on('sort(locDetl)', function (obj) { + table.on('sort(stockOut)', function (obj) { var searchData = {}; $.each($('#search-box [name]').serializeArray(), function() { searchData[this.name] = this.value; @@ -90,6 +89,49 @@ }); }); + // 鐩戝惉澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(stockOut)', function (obj) { + var data = table.checkStatus(obj.config.id).data; + switch (obj.event) { + case 'outbound': + var staNo = $("#staNoSelect").val(); + if (staNo === "" || staNo === null){ + layer.msg("璇烽�夋嫨鍑哄簱鍙�"); + return; + } + var locNos = []; + data.forEach(function(elem) { + locNos.push(elem.locNo); + }); + if (data.length === 0){ + layer.msg('璇疯嚦灏戦�変腑涓�琛屾暟鎹�'); + } else { + $.ajax({ + url: baseUrl+"/plate/out/start", + headers: {'token': localStorage.getItem('token')}, + data: { + outSite: staNo, + locNos: locNos + }, + method: 'POST', + traditional:true, + success: function (res) { + if (res.code === 200){ + tableReload(); // 閲嶈浇琛ㄦ牸 + getOutBound(); // 閲嶈浇鍑哄簱鍙� + layer.msg(res.msg); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg) + } + } + }); + } + break; + } + }); + // 鎼滅储鏍忔悳绱簨浠� form.on('submit(search)', function (data) { pageCurr = 1; -- Gitblit v1.9.1