|  |  | 
 |  |  | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> | 
 |  |  | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> | 
 |  |  | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> | 
 |  |  | <script type="text/javascript" src="../../static/js/pakStore/pakStore.js" charset="utf-8"></script> | 
 |  |  |  | 
 |  |  | </body> | 
 |  |  | <script> | 
 |  |  | 
 |  |  |             toolbar: '#toolbar', | 
 |  |  |             cols: [[ | 
 |  |  |                 {type: 'checkbox', fixed: 'left'}, | 
 |  |  |                 {field: 'matNo', align: 'center', title: '物料编码', sort: 'true'}, | 
 |  |  |                 {field: 'matNo', align: 'center', title: '物料编码'}, | 
 |  |  |                 {field: 'barcode', align: 'center', title: '条码'}, | 
 |  |  |                 {field: 'matName', align: 'center', title: '物料名称'}, | 
 |  |  |                 {field: 'str1', align: 'center', title: '物料单位'}, | 
 |  |  | 
 |  |  |                 if (res.code === 403) { | 
 |  |  |                     top.location.href = baseUrl + "/"; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         // 监听排序事件 | 
 |  |  |         table.on('sort(matCode)', 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(); | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         // 监听头工具栏事件 | 
 |  |  | 
 |  |  |             var data = checkStatus.data; | 
 |  |  |             switch(obj.event) { | 
 |  |  |                 case 'confirm': | 
 |  |  |                     if (data.length === 0){ | 
 |  |  |                         layer.msg("请选择数据"); | 
 |  |  |                         return; | 
 |  |  |                     } | 
 |  |  |                     for (var i=0;i<data.length;i++){ | 
 |  |  |                         data[i]["count"] = parent.initCountVal; | 
 |  |  |                     } | 
 |  |  |                     parent.matCodeData.push.apply(parent.matCodeData, data); | 
 |  |  |                     parent.tableIns.reload({data: parent.matCodeData}); | 
 |  |  |                     parent.layer.close(parent.matCodeLayerIdx); |