From 7f07ca76b0f76066823d4649ce4a30cb43fd6743 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期三, 10 六月 2020 11:24:16 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/pakStore/pakStore.js | 69 ++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 1 deletions(-) diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js index ad5f908..0fbe465 100644 --- a/src/main/webapp/static/js/pakStore/pakStore.js +++ b/src/main/webapp/static/js/pakStore/pakStore.js @@ -5,15 +5,82 @@ var layDate = layui.laydate; var form = layui.form; + tableIns = table.render({ + elem: '#chooseData', + data: [], + even: true, + limit: 500, + cellMinWidth: 50, + toolbar: '#toolbar', + cols: [[ + {type: 'checkbox'}, + {field: 'matNo', align: 'center', title: '鐗╂枡缂栫爜', sort: 'true'}, + {field: 'barcode', align: 'center', title: '鏉$爜'}, + {field: 'matName', align: 'center', title: '鐗╂枡鍚嶇О'}, + {field: 'str1', align: 'center', title: '鐗╂枡鍗曚綅'}, + {field: 'str2', align: 'center', title: '鐗╂枡瑙勬牸'}, + {field: 'count', title: '鏁伴噺', align: 'center', edit:'text', width: 100} + ]], + done: function (res, curr, count) { + } + }); + // 鐩戝惉鎺掑簭浜嬩欢 + table.on('sort(chooseData)', function (obj) { + var searchData = {}; + $.each($('#search-box [name]').serializeArray(), function() { + searchData[this.name] = this.value; + }); + searchData['orderByField'] = obj.field; + searchData['orderByType'] = obj.type; + matQueryTable.reload({ + where: searchData, + page: { + curr: 1 + }, + done: function (res, curr, count) { + if (res.code === 403) { + top.location.href = baseUrl+"/"; + } + pageCurr=curr; + limit(); + } + }); + }); + + // 鐩戝惉澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(chooseData)', function (obj) { + var checkStatus = table.checkStatus(obj.config.id); + 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) { + + } + }) + } + break; + } + }); }); + // 鎻愬彇鐗╂枡 var matCodeLayerIdx; function getMat() { + tableIns.reload({data: []}); matCodeLayerIdx = layer.open({ type: 2, - title: '搴撲綅鐗╂枡', + title: '鎻愬彇鐗╂枡', maxmin: true, area: [top.detailWidth, top.detailHeight], shadeClose: true, -- Gitblit v1.9.1