| | |
| | | var pageCurr; |
| | | var currPick; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | |
| | | table.on('tool(leftTable)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'complete': |
| | | complete(data); |
| | | case 'printOrder': |
| | | printPick(data); |
| | | break; |
| | | case "del": |
| | | var ids = [data.id]; |
| | |
| | | /* 监听行单击事件 */ |
| | | var selObj; |
| | | table.on('row(leftTable)', function (obj) { |
| | | currPick = obj.data.id; |
| | | selObj = obj; |
| | | obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click'); |
| | | tableIns.reload({where: {head_id: obj.data.id}, page: {curr: 1}}); |
| | | |
| | | }); |
| | | |
| | | /* 删除 */ |
| | |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | |
| | | if (res.code === 200){ |
| | | |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | leftTB.reload({where: null,page: {curr: 1}}); |
| | | tableIns.reload({where: null,page: {curr: 1}}); |
| | | } |
| | | }) |
| | | }); |
| | |
| | | leftTB.reload({where: {wrk_no: data.field.docName}}); |
| | | return false; |
| | | }); |
| | | // 重置 |
| | | form.on('submit(leftReset)', function (data) { |
| | | |
| | | leftTB.reload({where: null,page: {curr: 1}}); |
| | | $("#docName").val(""); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | function printPick(data){ |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | limit(); |
| | | } |
| | | }); |
| | | /* 表格2搜索 */ |
| | | form.on('submit(rightSearch)', function (data) { |
| | | |
| | | tableIns.reload({where: data.field , page: {curr: 1}}); |
| | | return false; |
| | | }); |
| | | // /* 表格2搜索 */ |
| | | // form.on('submit(rightSearch)', function (data) { |
| | | // |
| | | // tableIns.reload({where: data.field , page: {curr: 1}}); |
| | | // return false; |
| | | // }); |
| | | // // 监听排序事件 |
| | | // table.on('sort(pickout)', function (obj) { |
| | | // var searchData = {}; |
| | |
| | | // }); |
| | | // |
| | | // |
| | | // // 搜索 |
| | | // form.on('submit(search)', function (data) { |
| | | // pageCurr = 1; |
| | | // tableReload(false); |
| | | // }); |
| | | // |
| | | // // 重置 |
| | | // form.on('submit(reset)', function (data) { |
| | | // pageCurr = 1; |
| | | // clearFormVal($('#search-box')); |
| | | // tableReload(false); |
| | | // }); |
| | | // 搜索 |
| | | form.on('submit(rightSearch)', function (data) { |
| | | data.field.head_id = currPick; |
| | | tableIns.reload({ |
| | | where: data.field, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | |
| | | tableIns.reload({where: null,page: {curr: 1}}); |
| | | $("#matnr").val(""); |
| | | tableReload(false); |
| | | }); |
| | | // |
| | | // 时间选择器 |
| | | function layDateRender() { |
| | |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |