From 7ebe16b9abbee8e884db27d2ec360f17455b14f2 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 24 八月 2021 09:03:07 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/pakStore/pakStore.js | 86 +++++++++++++++++++++++++++++++++++--------
1 files changed, 70 insertions(+), 16 deletions(-)
diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js
index ad04f6f..66f396f 100644
--- a/src/main/webapp/static/js/pakStore/pakStore.js
+++ b/src/main/webapp/static/js/pakStore/pakStore.js
@@ -1,6 +1,17 @@
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(
+ {field: 'memo', title:'澶囨敞', align: 'center'},
+ {fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120}
+ )
+ return cols;
+}
layui.use(['table','laydate', 'form'], function() {
var table = layui.table;
@@ -16,15 +27,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);
@@ -44,12 +47,12 @@
var data = checkStatus.data;
switch(obj.event) {
case 'comb':
- // 鍒ゆ柇鏄惁瀛樺湪鐗╂枡
+ // 鍒ゆ柇鏄惁瀛樺湪浜у搧
if (matCodeData.length === 0) {
- layer.msg("璇峰厛娣诲姞鐗╂枡");
+ layer.msg("璇峰厛娣诲姞浜у搧");
return;
}
- // 鍒ゆ柇鐗╂枡鏁伴噺鏄惁瀛樺湪寮傚父
+ // 鍒ゆ柇浜у搧鏁伴噺鏄惁瀛樺湪寮傚父
for (var i=0;i<matCodeData.length;i++){
if (isNaN(matCodeData[i].count)) {
layer.msg("璇疯緭鍏ユ暟瀛�");
@@ -64,7 +67,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',
@@ -89,8 +92,8 @@
// 鐩戝惉琛屽伐鍏蜂簨浠�
table.on('tool(chooseData)', function(obj){
var data = obj.data;
+
switch (obj.event) {
- // 璇︽儏
case 'remove':
for (var i = matCodeData.length - 1; i >= 0; i--) {
if (matCodeData[i].matNo === data.matNo) {
@@ -102,6 +105,36 @@
getInBound();
// 瑕嗙洊render鏂规硶鐨刣one
}});
+ break;
+ case 'memo':
+ var memoLayer = layer.open({
+ type: 2,
+ title: '澶囨敞',
+ maxmin: true,
+ area: ['400px', '215px'],
+ shadeClose: false,
+ content: 'matMemo.html',
+ btn: ['淇濆瓨', '鍙栨秷'],
+ style: 'text-algin: center',
+ yes: function(index, layero){
+ var memo = layer.getChildFrame('body', index).find("#memo")[0].value;
+ matCodeData.map(function (item) {
+ if (item.matNo === data.matNo) {
+ item.memo = memo;
+ }
+ });
+ // 閲嶇疆琛ㄦ牸鏁版嵁
+ tableIns.reload({data: matCodeData,done:function (res) {
+ limit();
+ getInBound();
+ layer.close(memoLayer);
+ }});
+ },
+ success: function(layero, index){
+ var iframeWin = window[layero.find('iframe')[0]['name']];//寰楀埌iframe椤电殑绐楀彛瀵硅薄
+ iframeWin.setMatMemo(data.memo);
+ }
+ });
break;
}
});
@@ -160,12 +193,12 @@
});
-// 鎻愬彇鐗╂枡
+// 鎻愬彇浜у搧
var matCodeLayerIdx;
function getMat() {
matCodeLayerIdx = layer.open({
type: 2,
- title: '鎻愬彇鐗╂枡',
+ title: '鎻愬彇浜у搧',
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: true,
@@ -174,3 +207,24 @@
}
});
}
+
+// 娣诲姞琛ㄦ牸鏁版嵁
+function addTableData(data) {
+ for (var i=0;i<data.length;i++){
+ 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});
+ layer.close(matCodeLayerIdx);
+}
\ No newline at end of file
--
Gitblit v1.9.1