From c17701cbdca5e81020e9cbc21bd0ac0d9921d457 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期三, 10 六月 2020 17:10:08 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/pakStore/pakStore.js | 67 +++++++++++++++++++++++---------- 1 files changed, 46 insertions(+), 21 deletions(-) diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js index 0f2a8d4..c652138 100644 --- a/src/main/webapp/static/js/pakStore/pakStore.js +++ b/src/main/webapp/static/js/pakStore/pakStore.js @@ -18,12 +18,12 @@ toolbar: '#toolbar', cols: [[ {fixed: 'left', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:80}, + {fixed: 'left', field: 'count', title: '鏁伴噺(蹇呭~)', align: 'center', edit:'text', width: 120, style:'color: blue;'}, {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', field: 'count', title: '鏁伴噺', align: 'center', edit:'text', width: 100} + {field: 'str2', align: 'center', title: '鐗╂枡瑙勬牸'} ]], done: function (res, curr, count) { $('td[data-field=count] div').html(initCountVal); @@ -49,20 +49,28 @@ var data = checkStatus.data; switch(obj.event) { case 'comb': - if (data.length === 0){ - layer.msg('璇烽�夋嫨鏁版嵁'); - } else { - layer.open({ - type: 1, - title: '缁勭洏', - maxmin: true, - shadeClose: true, - content: $('#combDiv'), - success: function (layero, index) { - - } - }) + // 鍒ゆ柇鏄惁瀛樺湪鐗╂枡 + if (matCodeData.length === 0) { + layer.msg("璇峰厛娣诲姞鐗╂枡"); + return; } + // 鍒ゆ柇鐗╂枡鏁伴噺鏄惁瀛樺湪寮傚父 + for (var i=0;i<matCodeData.length;i++){ + if (matCodeData[i].count === 0){ + layer.msg("鏁伴噺涓嶈兘涓洪浂"); + return; + } + } + layer.open({ + type: 1, + title: '閫夋嫨鍏ュ簱绔�', + maxmin: true, + shadeClose: true, + content: $('#combDiv'), + success: function (layero, index) { + + } + }) break; } }); @@ -99,6 +107,29 @@ } } } + + // 琛ㄥ崟 + form.on('submit(combDo)', function (data) { + $.ajax({ + url: baseUrl+"/put/site/start", + 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 { + layer.msg(res.msg) + } + } + }) + }); }); // 鎻愬彇鐗╂枡 @@ -116,9 +147,3 @@ } }); } - -// 鍚姩鍏ュ簱 -function putMat() { - - -} \ No newline at end of file -- Gitblit v1.9.1