From 98de20f08240e3252c93e4896b911095e2928552 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 17 六月 2020 15:35:25 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/pakStore/pakStore.js | 95 ++++++++++++++++++++++++++++++-----------------
1 files changed, 61 insertions(+), 34 deletions(-)
diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js
index 2cffe9f..ad04f6f 100644
--- a/src/main/webapp/static/js/pakStore/pakStore.js
+++ b/src/main/webapp/static/js/pakStore/pakStore.js
@@ -28,19 +28,14 @@
done: function (res, curr, count) {
$('td[data-field=count] div').html(initCountVal);
setMatCodeData(res.data);
+ limit();
+ getInBound();
}
});
// 椤甸潰淇敼
table.on('edit(chooseData)', function (obj) {
- if (!isNaN(obj.value)) {
- updateMatCodeData(obj.data.matNo, Number(obj.value));
- tableIns.reload({data: matCodeData,done:function (res) {
- // 瑕嗙洊render鏂规硶鐨刣one
- }});
- } else {
- layer.msg("璇疯緭鍏ユ暟瀛�");
- }
+ updateMatCodeData(obj.data.matNo, Number(obj.value));
});
// 鐩戝惉澶村伐鍏锋爮浜嬩欢
@@ -56,19 +51,35 @@
}
// 鍒ゆ柇鐗╂枡鏁伴噺鏄惁瀛樺湪寮傚父
for (var i=0;i<matCodeData.length;i++){
+ if (isNaN(matCodeData[i].count)) {
+ layer.msg("璇疯緭鍏ユ暟瀛�");
+ return;
+ }
if (matCodeData[i].count === 0){
layer.msg("鏁伴噺涓嶈兘涓洪浂");
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;
@@ -87,6 +98,8 @@
}
}
tableIns.reload({data: matCodeData,done:function (res) {
+ limit();
+ getInBound();
// 瑕嗙洊render鏂规硶鐨刣one
}});
break;
@@ -101,41 +114,55 @@
}
function updateMatCodeData(matNo, count) {
- for (var i=0;i<matCodeData.length;i++){
- if (matCodeData[i]["matNo"] === matNo){
- matCodeData[i]["count"] = count;
+ if (isNaN(count)) {
+ layer.msg("璇疯緭鍏ユ暟瀛�");
+ } else {
+ if (count > 0) {
+ for (var i=0;i<matCodeData.length;i++){
+ if (matCodeData[i]["matNo"] === matNo){
+ matCodeData[i]["count"] = count;
+ }
+ }
+ } else {
+ layer.msg("鏁伴噺蹇呴』澶т簬闆�");
}
}
+
+ tableIns.reload({data: matCodeData,done:function (res) {
+ limit();
+ getInBound();
+ // 瑕嗙洊render鏂规硶鐨刣one
+ }});
}
- // 琛ㄥ崟
- form.on('submit(combDo)', function (data) {
+ // 鑾峰彇鍙敤鍏ュ簱绔欑偣
+ function getInBound() {
$.ajax({
- url: baseUrl+"/put/site/start",
+ url: baseUrl + "/available/put/site",
headers: {'token': localStorage.getItem('token')},
- data: null,
method: 'POST',
- async: false,
success: function (res) {
- if (res.code === 200){
- layer.closeAll();
- layer.msg(res.msg);
- matCodeData = [];
- tableIns.reload({data: matCodeData,done:function (res) {}});
- } 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)
}
}
})
- });
+ }
+
+
});
// 鎻愬彇鐗╂枡
var matCodeLayerIdx;
function getMat() {
- // tableIns.reload({data: []});
matCodeLayerIdx = layer.open({
type: 2,
title: '鎻愬彇鐗╂枡',
--
Gitblit v1.9.1