From 88f285842419bdc871ba1a5da897e0ac90ee08fb Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期三, 30 三月 2022 10:09:37 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/pakStore/pakStore.js | 65 +++++++++++++++++++++++++++-----
1 files changed, 55 insertions(+), 10 deletions(-)
diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js
index d40dd18..344d0e8 100644
--- a/src/main/webapp/static/js/pakStore/pakStore.js
+++ b/src/main/webapp/static/js/pakStore/pakStore.js
@@ -1,21 +1,25 @@
-
+var admin;
var initCountVal = 0;
var matCodeData = [];
function getCol() {
var cols = [
- {fixed: 'left', field: 'count', title: '鏁伴噺(蹇呭~)', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'}
+ {fixed: 'left', field: 'count', title: '鏁伴噺锛堝繀濉級', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'},
+ {field: 'batch', title: '鎵瑰彿锛堥�夊~锛�', align: 'center', edit:'text', width: 200, style:'color: blue;font-weight: bold'}
];
cols.push.apply(cols, matCols);
- cols.push({fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:80})
+ cols.push({fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width: 80})
return cols;
}
-layui.use(['table','laydate', 'form'], function() {
+layui.config({
+ base: baseUrl + "/static/layui/lay/modules/"
+}).use(['admin', 'table','laydate', 'form'], function() {
var table = layui.table;
var $ = layui.jquery;
var layer = layui.layer;
var layDate = layui.laydate;
var form = layui.form;
+ admin = layui.admin;
tableIns = table.render({
elem: '#chooseData',
@@ -35,6 +39,23 @@
// 椤甸潰淇敼
table.on('edit(chooseData)', function (obj) {
+ let index = obj.tr.attr("data-index");
+ let data = matCodeData[index];
+ if (obj.field === 'anfme'){
+ let vle = Number(obj.value);
+ if (isNaN(vle)) {
+ layer.msg("璇疯緭鍏ユ暟瀛�", {icon: 2});
+ return false;
+ } else {
+ if (vle <= 0) {
+ layer.msg("鏁伴噺蹇呴』澶т簬闆�", {icon: 2});
+ return false;
+ }
+ }
+ }
+ data[obj.field] = obj.value;
+ tableIns.reload({data: matCodeData});
+
updateMatCodeData(obj.data.matNo, Number(obj.value));
});
@@ -74,7 +95,9 @@
if (res.code === 200){
layer.msg("鍏ュ簱鍚姩鎴愬姛锛岀洰鏍囧簱浣嶏細" + res.data);
matCodeData = [];
+ $('#focusMatByMat').val("");
tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}});
+ document.getElementById("focusMatByMat").focus();
} else if (res.code === 403){
top.location.href = baseUrl+"/";
}else {
@@ -91,7 +114,7 @@
var data = obj.data;
switch (obj.event) {
case 'remove':
- for (var i = matCodeData.length - 1; i >= 0; i--) {
+ for (let i = matCodeData.length - 1; i >= 0; i--) {
if (matCodeData[i].matNo === data.matNo) {
matCodeData.splice(i, 1);
}
@@ -99,7 +122,6 @@
tableIns.reload({data: matCodeData,done:function (res) {
limit();
getInBound();
- // 瑕嗙洊render鏂规硶鐨刣one
}});
break;
}
@@ -130,7 +152,6 @@
tableIns.reload({data: matCodeData,done:function (res) {
limit();
getInBound();
- // 瑕嗙洊render鏂规硶鐨刣one
}});
}
@@ -150,7 +171,7 @@
} else if (res.code === 403) {
top.location.href = baseUrl + "/";
} else {
- layer.msg(res.msg)
+ layer.msg(res.msg, {icon: 2})
}
}
})
@@ -162,7 +183,7 @@
// 鎻愬彇鐗╂枡
var matCodeLayerIdx;
function getMat() {
- matCodeLayerIdx = layer.open({
+ matCodeLayerIdx = admin.open({
type: 2,
title: '鎻愬彇鐗╂枡',
maxmin: true,
@@ -172,6 +193,30 @@
success: function(layero, index){
}
});
+}
+
+// 鎵爜
+function focusMat(el) {
+ if (isEmpty(el.value)) {
+ return
+ }
+ $.ajax({
+ url: baseUrl + "/matCode/" + el.value + "/auth",
+ headers: {'token': localStorage.getItem('token')},
+ method: 'GET',
+ success: function (res) {
+ if (res.code === 200) {
+ matCodeData = [];
+ var param = new Array();
+ param[0] = res.data;
+ addTableData(param);
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
+ layer.msg(res.msg, {icon: 2})
+ }
+ }
+ })
}
// 娣诲姞琛ㄦ牸鏁版嵁
@@ -193,4 +238,4 @@
matCodeData.push.apply(matCodeData, data);
tableIns.reload({data: matCodeData});
layer.close(matCodeLayerIdx);
-}
\ No newline at end of file
+}
--
Gitblit v1.9.1