From 76e6628a6a238a1a742d04b30fbba588884a0f62 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 31 五月 2021 10:07:43 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/pakStore/pakStore.js | 33 ++++++++++++++++++++++-----------
1 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js
index 1bccce2..d40dd18 100644
--- a/src/main/webapp/static/js/pakStore/pakStore.js
+++ b/src/main/webapp/static/js/pakStore/pakStore.js
@@ -1,6 +1,14 @@
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'}
+ ];
+ cols.push.apply(cols, matCols);
+ cols.push({fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:80})
+ return cols;
+}
layui.use(['table','laydate', 'form'], function() {
var table = layui.table;
@@ -16,15 +24,7 @@
limit: 500,
cellMinWidth: 50,
toolbar: '#toolbar',
- cols: [[
- {fixed: 'left', field: 'count', title: '鏁伴噺(蹇呭~)', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'},
- {field: 'matNo', align: 'center', title: '鐗╂枡缂栫爜'},
- {field: 'barcode', align: 'center', title: '鏉$爜'},
- {field: 'matName', align: 'center', title: '鐗╂枡鍚嶇О'},
- {field: 'str1', align: 'center', title: '鐗╂枡鍗曚綅'},
- {field: 'str2', align: 'center', title: '鐗╂枡瑙勬牸'},
- {fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:80}
- ]],
+ cols: [getCol()],
done: function (res, curr, count) {
$('td[data-field=count] div').html(initCountVal);
setMatCodeData(res.data);
@@ -64,7 +64,7 @@
url: baseUrl+"/full/store/put/start",
headers: {'token': localStorage.getItem('token')},
data: JSON.stringify({
- devpNo: $('#putSiteSelect').val(),
+ devpNo: Number($('#putSiteSelect').val()),
list: matCodeData
}),
contentType:'application/json;charset=UTF-8',
@@ -177,7 +177,18 @@
// 娣诲姞琛ㄦ牸鏁版嵁
function addTableData(data) {
for (var i=0;i<data.length;i++){
- data[i]["count"] = initCountVal;
+ let pass = false;
+ for (var j=0;j<matCodeData.length;j++){
+ if (data[i].matNo === matCodeData[j].matNo) {
+ pass = true;
+ break;
+ }
+ }
+ if (pass) {
+ data.splice(i--, 1);
+ } else {
+ data[i]["count"] = initCountVal;
+ }
}
matCodeData.push.apply(matCodeData, data);
tableIns.reload({data: matCodeData});
--
Gitblit v1.9.1