diff --git a/app/finance/view/expense/checkedlist.html b/app/finance/view/expense/checkedlist.html index 100474c..5f893e3 100644 --- a/app/finance/view/expense/checkedlist.html +++ b/app/finance/view/expense/checkedlist.html @@ -2,7 +2,7 @@ {block name="body"}
-
+
@@ -52,8 +52,9 @@ layui.pageTable = table.render({ elem: '#test', - title: '报销管理列表', + title: '报销打款列表', toolbar: '#toolbarDemo', + defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}], url: "/finance/expense/checkedlist", //数据接口 cellMinWidth: 100, page: true, //开启分页 @@ -152,6 +153,22 @@ ] ] }); + + //表头工具栏事件 + table.on('toolbar(test)', function(obj){ + if(obj.event === 'LAYTABLE_EXCEL'){ + var formSelect = form.val('barsearchform'); + formSelect.limit=99999; + $.ajax({ + url: '/finance/expense/checkedlist', + data: formSelect, + success:function(res){ + table.exportFile('test', res.data,'xls'); + } + }); + return; + } + }); //监听行工具事件 table.on('tool(test)', function(obj) { diff --git a/app/finance/view/expense/copy.html b/app/finance/view/expense/copy.html index 8718cb2..41c5f6c 100644 --- a/app/finance/view/expense/copy.html +++ b/app/finance/view/expense/copy.html @@ -41,7 +41,6 @@ layui.pageTable = table.render({ elem: '#test', title: '报销管理列表', - toolbar: '#toolbarDemo', url: "/finance/expense/copy", //数据接口 page: true, //开启分页 cellMinWidth: 100, diff --git a/app/finance/view/expense/index.html b/app/finance/view/expense/index.html index 98f69c7..78b0892 100644 --- a/app/finance/view/expense/index.html +++ b/app/finance/view/expense/index.html @@ -2,7 +2,7 @@ {block name="body"}
- +
@@ -57,6 +57,7 @@ elem: '#test', title: '报销管理列表', toolbar: '#toolbarDemo', + defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}], url: "/finance/expense/index", //数据接口 page: true, //开启分页 cellMinWidth: 100, @@ -168,6 +169,18 @@ tool.side("/finance/expense/add"); return; } + if(obj.event === 'LAYTABLE_EXCEL'){ + var formSelect = form.val('barsearchform'); + formSelect.limit=99999; + $.ajax({ + url: '/finance/expense/index', + data: formSelect, + success:function(res){ + table.exportFile('test', res.data,'xls'); + } + }); + return; + } }); //监听行工具事件 table.on('tool(test)', function(obj) { diff --git a/app/finance/view/expense/list.html b/app/finance/view/expense/list.html index a28664f..a8be8e0 100644 --- a/app/finance/view/expense/list.html +++ b/app/finance/view/expense/list.html @@ -37,6 +37,7 @@ elem: '#test', title: '报销管理列表', toolbar: '#toolbarDemo', + defaultToolbar: false, url: "/finance/expense/list", //数据接口 cellMinWidth: 100, page: true, //开启分页 diff --git a/app/finance/view/income/index.html b/app/finance/view/income/index.html index 17a7835..06426c8 100644 --- a/app/finance/view/income/index.html +++ b/app/finance/view/income/index.html @@ -2,7 +2,7 @@ {block name="body"}
- +
@@ -24,6 +24,11 @@
+ {/block} @@ -51,6 +56,7 @@ elem: '#test', title: '到账列表', toolbar: '#toolbarDemo', + defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}], url: "/finance/income/index", //数据接口 cellMinWidth: 320, page: true, //开启分页 @@ -166,6 +172,22 @@ ] ] }); + + //表头工具栏事件 + table.on('toolbar(test)', function(obj){ + if(obj.event === 'LAYTABLE_EXCEL'){ + var formSelect = form.val('barsearchform'); + formSelect.limit=99999; + $.ajax({ + url: '/finance/income/index', + data: formSelect, + success:function(res){ + table.exportFile('test', res.data,'xls'); + } + }); + return; + } + }) //监听行工具事件 table.on('tool(test)', function(obj) { diff --git a/app/finance/view/invoice/checkedlist.html b/app/finance/view/invoice/checkedlist.html index 855d3cd..5d6967f 100644 --- a/app/finance/view/invoice/checkedlist.html +++ b/app/finance/view/invoice/checkedlist.html @@ -2,7 +2,7 @@ {block name="body"}
-
+
@@ -55,6 +55,7 @@ elem: '#test', title: '发票列表', toolbar: '#toolbarDemo', + defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}], url: "/finance/invoice/checkedlist", //数据接口 cellMinWidth: 300, page: true, //开启分页 @@ -191,7 +192,22 @@ ] ] }); - + + //表头工具栏事件 + table.on('toolbar(test)', function(obj){ + if(obj.event === 'LAYTABLE_EXCEL'){ + var formSelect = form.val('barsearchform'); + formSelect.limit=99999; + $.ajax({ + url: '/finance/invoice/checkedlist', + data: formSelect, + success:function(res){ + table.exportFile('test', res.data,'xls'); + } + }); + return; + } + }) //监听行工具事件 table.on('tool(test)', function(obj) { var data = obj.data; diff --git a/app/finance/view/invoice/copy.html b/app/finance/view/invoice/copy.html index ddc7cb6..9133553 100644 --- a/app/finance/view/invoice/copy.html +++ b/app/finance/view/invoice/copy.html @@ -41,7 +41,6 @@ layui.pageTable = table.render({ elem: '#test', title: '发票列表', - toolbar: '#toolbarDemo', url: "/finance/invoice/copy", //数据接口 page: true, //开启分页 cellMinWidth: 300, diff --git a/app/finance/view/invoice/index.html b/app/finance/view/invoice/index.html index e5f9605..ebc8a97 100644 --- a/app/finance/view/invoice/index.html +++ b/app/finance/view/invoice/index.html @@ -2,7 +2,7 @@ {block name="body"}
- +
@@ -58,6 +58,7 @@ elem: '#test', title: '发票列表', toolbar: '#toolbarDemo', + defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}], url: "/finance/invoice/index", //数据接口 page: true, //开启分页 cellMinWidth: 300, @@ -196,6 +197,18 @@ tool.side("/finance/invoice/add"); return; } + if(obj.event === 'LAYTABLE_EXCEL'){ + var formSelect = form.val('barsearchform'); + formSelect.limit=99999; + $.ajax({ + url: '/finance/invoice/index', + data: formSelect, + success:function(res){ + table.exportFile('test', res.data,'xls'); + } + }); + return; + } }); //监听行工具事件 table.on('tool(test)', function(obj) { diff --git a/app/finance/view/invoice/list.html b/app/finance/view/invoice/list.html index 088bb9d..a32e333 100644 --- a/app/finance/view/invoice/list.html +++ b/app/finance/view/invoice/list.html @@ -35,6 +35,7 @@ layui.pageTable = table.render({ elem: '#test', title: '发票列表', + defaultToolbar: false, toolbar: '#toolbarDemo', url: "/finance/invoice/list", //数据接口 cellMinWidth: 300,