优化导出数据
This commit is contained in:
parent
6abb245f57
commit
da1acd272a
@ -2,7 +2,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<form class="layui-form gg-form-bar border-x border-t">
|
<form class="layui-form gg-form-bar border-x border-t" lay-filter="barsearchform">
|
||||||
<div id="barDate" class="layui-input-inline">
|
<div id="barDate" class="layui-input-inline">
|
||||||
<div class="layui-input-inline" style="width:110px;">
|
<div class="layui-input-inline" style="width:110px;">
|
||||||
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
||||||
@ -52,8 +52,9 @@
|
|||||||
|
|
||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '报销管理列表',
|
title: '报销打款列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
|
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||||
url: "/finance/expense/checkedlist", //数据接口
|
url: "/finance/expense/checkedlist", //数据接口
|
||||||
cellMinWidth: 100,
|
cellMinWidth: 100,
|
||||||
page: true, //开启分页
|
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) {
|
table.on('tool(test)', function(obj) {
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '报销管理列表',
|
title: '报销管理列表',
|
||||||
toolbar: '#toolbarDemo',
|
|
||||||
url: "/finance/expense/copy", //数据接口
|
url: "/finance/expense/copy", //数据接口
|
||||||
page: true, //开启分页
|
page: true, //开启分页
|
||||||
cellMinWidth: 100,
|
cellMinWidth: 100,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<form class="layui-form gg-form-bar border-x border-t">
|
<form class="layui-form gg-form-bar border-x border-t" lay-filter="barsearchform">
|
||||||
<div id="barDate" class="layui-input-inline">
|
<div id="barDate" class="layui-input-inline">
|
||||||
<div class="layui-input-inline" style="width:110px;">
|
<div class="layui-input-inline" style="width:110px;">
|
||||||
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
||||||
@ -57,6 +57,7 @@
|
|||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '报销管理列表',
|
title: '报销管理列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
|
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||||
url: "/finance/expense/index", //数据接口
|
url: "/finance/expense/index", //数据接口
|
||||||
page: true, //开启分页
|
page: true, //开启分页
|
||||||
cellMinWidth: 100,
|
cellMinWidth: 100,
|
||||||
@ -168,6 +169,18 @@
|
|||||||
tool.side("/finance/expense/add");
|
tool.side("/finance/expense/add");
|
||||||
return;
|
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) {
|
table.on('tool(test)', function(obj) {
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '报销管理列表',
|
title: '报销管理列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
|
defaultToolbar: false,
|
||||||
url: "/finance/expense/list", //数据接口
|
url: "/finance/expense/list", //数据接口
|
||||||
cellMinWidth: 100,
|
cellMinWidth: 100,
|
||||||
page: true, //开启分页
|
page: true, //开启分页
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<form class="layui-form gg-form-bar border-x border-t">
|
<form class="layui-form gg-form-bar border-x border-t" lay-filter="barsearchform">
|
||||||
<div id="barDate" class="layui-input-inline">
|
<div id="barDate" class="layui-input-inline">
|
||||||
<div class="layui-input-inline" style="width:110px;">
|
<div class="layui-input-inline" style="width:110px;">
|
||||||
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
||||||
@ -24,6 +24,11 @@
|
|||||||
</form>
|
</form>
|
||||||
<table class="layui-hide" id="test" lay-filter="test"></table>
|
<table class="layui-hide" id="test" lay-filter="test"></table>
|
||||||
</div>
|
</div>
|
||||||
|
<script type="text/html" id="toolbarDemo">
|
||||||
|
<div class="layui-btn-container">
|
||||||
|
<h3 class="h3-title" style="height:32px;">到账列表</h3>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
||||||
|
|
||||||
@ -51,6 +56,7 @@
|
|||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '到账列表',
|
title: '到账列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
|
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||||
url: "/finance/income/index", //数据接口
|
url: "/finance/income/index", //数据接口
|
||||||
cellMinWidth: 320,
|
cellMinWidth: 320,
|
||||||
page: true, //开启分页
|
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) {
|
table.on('tool(test)', function(obj) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<form class="layui-form gg-form-bar border-x border-t">
|
<form class="layui-form gg-form-bar border-x border-t" lay-filter="barsearchform">
|
||||||
<div id="barDate" class="layui-input-inline">
|
<div id="barDate" class="layui-input-inline">
|
||||||
<div class="layui-input-inline" style="width:110px;">
|
<div class="layui-input-inline" style="width:110px;">
|
||||||
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
||||||
@ -55,6 +55,7 @@
|
|||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '发票列表',
|
title: '发票列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
|
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||||
url: "/finance/invoice/checkedlist", //数据接口
|
url: "/finance/invoice/checkedlist", //数据接口
|
||||||
cellMinWidth: 300,
|
cellMinWidth: 300,
|
||||||
page: true, //开启分页
|
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) {
|
table.on('tool(test)', function(obj) {
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '发票列表',
|
title: '发票列表',
|
||||||
toolbar: '#toolbarDemo',
|
|
||||||
url: "/finance/invoice/copy", //数据接口
|
url: "/finance/invoice/copy", //数据接口
|
||||||
page: true, //开启分页
|
page: true, //开启分页
|
||||||
cellMinWidth: 300,
|
cellMinWidth: 300,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<form class="layui-form gg-form-bar border-x border-t">
|
<form class="layui-form gg-form-bar border-x border-t" lay-filter="barsearchform">
|
||||||
<div id="barDate" class="layui-input-inline">
|
<div id="barDate" class="layui-input-inline">
|
||||||
<div class="layui-input-inline" style="width:110px;">
|
<div class="layui-input-inline" style="width:110px;">
|
||||||
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
||||||
@ -58,6 +58,7 @@
|
|||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '发票列表',
|
title: '发票列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
|
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||||
url: "/finance/invoice/index", //数据接口
|
url: "/finance/invoice/index", //数据接口
|
||||||
page: true, //开启分页
|
page: true, //开启分页
|
||||||
cellMinWidth: 300,
|
cellMinWidth: 300,
|
||||||
@ -196,6 +197,18 @@
|
|||||||
tool.side("/finance/invoice/add");
|
tool.side("/finance/invoice/add");
|
||||||
return;
|
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) {
|
table.on('tool(test)', function(obj) {
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test',
|
elem: '#test',
|
||||||
title: '发票列表',
|
title: '发票列表',
|
||||||
|
defaultToolbar: false,
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
url: "/finance/invoice/list", //数据接口
|
url: "/finance/invoice/list", //数据接口
|
||||||
cellMinWidth: 300,
|
cellMinWidth: 300,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user