diff --git a/app/customer/view/contact/index.html b/app/customer/view/contact/index.html index 9a81e78..c2cab0d 100644 --- a/app/customer/view/contact/index.html +++ b/app/customer/view/contact/index.html @@ -2,7 +2,7 @@ {block name="body"}
-
+
@@ -22,6 +22,7 @@ layui.pageTable = table.render({ elem: '#test' ,toolbar: '#toolbarDemo' + ,defaultToolbar:['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}] ,title:'联系人列表' ,url: "/customer/contact/index" ,cellMinWidth: 240 @@ -91,6 +92,22 @@ } }); + //表头工具栏事件 + table.on('toolbar(test)', function(obj){ + if(obj.event === 'LAYTABLE_EXCEL'){ + var formSelect = form.val('barsearchform'); + formSelect.limit=99999; + $.ajax({ + url: '/customer/contact/index', + data: formSelect, + success:function(res){ + table.exportFile('test', res.data,'xls'); + } + }); + return; + } + }) + //监听搜索提交 form.on('submit(webform)', function(data) { layui.pageTable.reload({ diff --git a/app/customer/view/grade/index.html b/app/customer/view/grade/index.html index 372ef82..b0cd466 100644 --- a/app/customer/view/grade/index.html +++ b/app/customer/view/grade/index.html @@ -21,6 +21,7 @@ layui.pageTable = table.render({ elem: '#test' ,toolbar: '#toolbarDemo' + ,defaultToolbar: false ,title:'客户等级列表' ,url: "/customer/grade/index" ,page: false diff --git a/app/customer/view/index/index.html b/app/customer/view/index/index.html index aeee98c..a5eae7c 100644 --- a/app/customer/view/index/index.html +++ b/app/customer/view/index/index.html @@ -12,7 +12,7 @@
- +