优化导出数据
This commit is contained in:
parent
fe42ceac45
commit
c44e292747
@ -19,6 +19,7 @@
|
|||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test'
|
elem: '#test'
|
||||||
,toolbar: '#toolbarDemo'
|
,toolbar: '#toolbarDemo'
|
||||||
|
,defaultToolbar: false
|
||||||
,title:'审批列表'
|
,title:'审批列表'
|
||||||
,url: "/oa/approve/copy"
|
,url: "/oa/approve/copy"
|
||||||
,page: true //开启分页
|
,page: true //开启分页
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test'
|
elem: '#test'
|
||||||
,toolbar: '#toolbarDemo'
|
,toolbar: '#toolbarDemo'
|
||||||
|
,defaultToolbar: false
|
||||||
,title:'审批列表'
|
,title:'审批列表'
|
||||||
,url: "/oa/approve/index"
|
,url: "/oa/approve/index"
|
||||||
,page: true //开启分页
|
,page: true //开启分页
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test'
|
elem: '#test'
|
||||||
,toolbar: '#toolbarDemo'
|
,toolbar: '#toolbarDemo'
|
||||||
|
,defaultToolbar: false
|
||||||
,title:'审批列表'
|
,title:'审批列表'
|
||||||
,url: "/oa/approve/list"
|
,url: "/oa/approve/list"
|
||||||
,page: true //开启分页
|
,page: true //开启分页
|
||||||
|
@ -7,7 +7,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">
|
||||||
@ -85,6 +85,7 @@
|
|||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test'
|
elem: '#test'
|
||||||
,toolbar: '#toolbarDemo'
|
,toolbar: '#toolbarDemo'
|
||||||
|
,defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}]
|
||||||
,title:'日程安排列表'
|
,title:'日程安排列表'
|
||||||
,url: "/oa/plan/index"
|
,url: "/oa/plan/index"
|
||||||
,page: true //开启分页
|
,page: true //开启分页
|
||||||
@ -129,6 +130,22 @@
|
|||||||
]]
|
]]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//表头工具栏事件
|
||||||
|
table.on('toolbar(test)', function(obj){
|
||||||
|
if(obj.event === 'LAYTABLE_EXCEL'){
|
||||||
|
var formSelect = form.val('barsearchform');
|
||||||
|
formSelect.limit=99999;
|
||||||
|
$.ajax({
|
||||||
|
url: '/oa/plan/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){
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
@ -153,6 +170,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if(obj.event === 'view'){
|
else if(obj.event === 'view'){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -165,6 +183,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -7,7 +7,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">
|
||||||
@ -84,6 +84,7 @@
|
|||||||
layui.scheduleTable = table.render({
|
layui.scheduleTable = table.render({
|
||||||
elem: '#test'
|
elem: '#test'
|
||||||
,toolbar: '#toolbarDemo'
|
,toolbar: '#toolbarDemo'
|
||||||
|
,defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}]
|
||||||
,title:'工作记录列表'
|
,title:'工作记录列表'
|
||||||
,url: "/oa/schedule/index"
|
,url: "/oa/schedule/index"
|
||||||
,page: true //开启分页
|
,page: true //开启分页
|
||||||
@ -124,6 +125,22 @@
|
|||||||
]]
|
]]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//表头工具栏事件
|
||||||
|
table.on('toolbar(test)', function(obj){
|
||||||
|
if(obj.event === 'LAYTABLE_EXCEL'){
|
||||||
|
var formSelect = form.val('barsearchform');
|
||||||
|
formSelect.limit=99999;
|
||||||
|
$.ajax({
|
||||||
|
url: '/oa/schedule/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){
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="layui-tab-content" style="padding:0">
|
<div class="layui-tab-content" style="padding:0">
|
||||||
<div class="layui-tab-item layui-show">
|
<div class="layui-tab-item layui-show">
|
||||||
<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 class="layui-inline" id="date">
|
<div class="layui-inline" id="date">
|
||||||
<div class="layui-input-inline" style="width:112px">
|
<div class="layui-input-inline" style="width:112px">
|
||||||
<input type="text" autocomplete="off" id="start_time" name="start_time" class="layui-input" placeholder="接收开始日期">
|
<input type="text" autocomplete="off" id="start_time" name="start_time" class="layui-input" placeholder="接收开始日期">
|
||||||
@ -33,7 +33,7 @@
|
|||||||
<table class="layui-hide" id="test" lay-filter="test"></table>
|
<table class="layui-hide" id="test" lay-filter="test"></table>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-tab-item">
|
<div class="layui-tab-item">
|
||||||
<form class="layui-form gg-form-bar border-x border-t">
|
<form class="layui-form gg-form-bar border-x border-t" lay-filter="barsearchform2">>
|
||||||
<div class="layui-inline" id="date1">
|
<div class="layui-inline" id="date1">
|
||||||
<div class="layui-input-inline" style="width:112px">
|
<div class="layui-input-inline" style="width:112px">
|
||||||
<input type="text" autocomplete="off" id="start_time1" name="start_time" class="layui-input" placeholder="接收开始日期">
|
<input type="text" autocomplete="off" id="start_time1" name="start_time" class="layui-input" placeholder="接收开始日期">
|
||||||
@ -100,6 +100,7 @@
|
|||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#test',
|
elem: '#test',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
|
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||||
title:'工作汇报列表',
|
title:'工作汇报列表',
|
||||||
url: "/oa/work/index", //数据接口
|
url: "/oa/work/index", //数据接口
|
||||||
where:{'send':1},
|
where:{'send':1},
|
||||||
@ -152,6 +153,19 @@
|
|||||||
addNew();
|
addNew();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(obj.event === 'LAYTABLE_EXCEL'){
|
||||||
|
var formSelect = form.val('barsearchform');
|
||||||
|
formSelect.limit=99999;
|
||||||
|
formSelect.send=1;
|
||||||
|
$.ajax({
|
||||||
|
url: '/oa/work/index',
|
||||||
|
data: formSelect,
|
||||||
|
success:function(res){
|
||||||
|
table.exportFile('test', res.data,'xls');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//监听搜索提交
|
//监听搜索提交
|
||||||
@ -171,6 +185,7 @@
|
|||||||
layui.pageTable1 = table.render({
|
layui.pageTable1 = table.render({
|
||||||
elem: '#test1',
|
elem: '#test1',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
|
defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}],
|
||||||
title:'工作汇报列表',
|
title:'工作汇报列表',
|
||||||
url: "/oa/work/index", //数据接口
|
url: "/oa/work/index", //数据接口
|
||||||
where:{'send':0},
|
where:{'send':0},
|
||||||
@ -234,6 +249,19 @@
|
|||||||
addNew();
|
addNew();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(obj.event === 'LAYTABLE_EXCEL'){
|
||||||
|
var formSelect = form.val('barsearchform1');
|
||||||
|
formSelect.limit=99999;
|
||||||
|
formSelect.send=0;
|
||||||
|
$.ajax({
|
||||||
|
url: '/oa/work/index',
|
||||||
|
data: formSelect,
|
||||||
|
success:function(res){
|
||||||
|
table.exportFile('test1', res.data,'xls');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function addNew(){
|
function addNew(){
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<div id="depament"></div>
|
<div id="depament"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="body-table" style="margin-left:228px;">
|
<div class="body-table" style="margin-left:228px;">
|
||||||
<form class="layui-form gg-form-bar border-t border-x" lay-filter="seachform">
|
<form class="layui-form gg-form-bar border-t border-x" lay-filter="barsearchform">
|
||||||
<div class="layui-input-inline" style="width:136px">
|
<div class="layui-input-inline" style="width:136px">
|
||||||
<select name="status">
|
<select name="status">
|
||||||
<option value="">选择员工状态</option>
|
<option value="">选择员工状态</option>
|
||||||
@ -320,9 +320,8 @@
|
|||||||
table.on('toolbar(test)', function(obj){
|
table.on('toolbar(test)', function(obj){
|
||||||
var checkStatus = table.checkStatus(obj.config.id); //获取选中行状态
|
var checkStatus = table.checkStatus(obj.config.id); //获取选中行状态
|
||||||
var data = checkStatus.data;
|
var data = checkStatus.data;
|
||||||
console.log(obj.event);
|
|
||||||
if(obj.event === 'LAYTABLE_EXCEL'){
|
if(obj.event === 'LAYTABLE_EXCEL'){
|
||||||
var formSelect = form.val('seachform');
|
var formSelect = form.val('barsearchform');
|
||||||
formSelect.limit=99999;
|
formSelect.limit=99999;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/user/user/index',
|
url: '/user/user/index',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user