| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- var myChart;
- var tabIndex = 0;
- $(document).ready(function() {
- layui.use('laydate', function() {
- var laydate = layui.laydate;
- //日期
- laydate.render({
- elem: '#sc_times',
- range: "~",
- theme: '#249fea',
- });
- });
- //搜索事件
- $("#sc_btns").click(function() {
- getDataList();
- });
- getDataList();
- })
- function getDataList() {
- var colsArr = [];
- var dataArr = [];
- var keys = [];
- var loadindex;
- $.ajax({
- type: 'get',
- url: huayi.config.callcenter_url + "callcenterapi/api/daystalktime/getcolumnlist",
- async: true,
- dataType: 'json',
- success:function(data){
- if(data.state.toLowerCase() == "success") {
- var cons = data.data;
- var legends=[];
- if(cons && cons.length > 0) {
- var newArr = [];
- for (var j=0;j<cons.length;j++){
- keys.push(cons[j]);
- }
- newArr.push({
- field: keys[0],
- title: keys[0],
- align: 'center',
- fixed: true,
- //sort: true,
- width: 150,
- });
- for(var i = 1, colNL = keys.length; i < colNL; i++) {
- newArr.push({
- field: keys[i],
- title: keys[i],
- align: 'center',
- //fixed: true,
- //sort: true,
- //width: 150,
- });
- }
- colsArr.push(newArr);
- }
- }
- }
- });
- $.ajax({
- type: 'get',
- url: huayi.config.callcenter_url + "callcenterapi/api/daystalktime/getdatalist",
- async: true,
- dataType: 'json',
- beforeSend: function() {
- loadindex = layer.load()
- },
- data: {
- stime: $('#sc_times').val() && $('#sc_times').val().split(' ~ ')[0],
- endtime: $('#sc_times').val() && $('#sc_times').val().split(' ~ ')[1],
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var result = data.data;
- if(result && result.length > 0) {
- dataArr = result;
- layui.use('table', function() {
- var table = layui.table;
- //方法级渲染
- table.render({
- elem: '#t_callTotal',
- skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
- even: true, //开启隔行背景
- size: 'lg', //sm,lg尺寸的表格
- cellMinWidth: 100,
- page: true,
- cols: colsArr,
- data: dataArr,
- height: 'full-150'
- });
- });
- }
- }
- },
- }).then(function() {
- layer.close(loadindex);
- });
- }
- //导出
- function dcexcel(obj) {
- var beginyear=$('#sc_times').val() && $('#sc_times').val().split(' ~ ')[0];
- var endyear=$('#sc_times').val() && $('#sc_times').val().split(' ~ ')[1];
- var url=huayi.config.callcenter_url +"callcenterapi/api/daystalktime/exportexcel?stime="+ beginyear +"&endtime="+endyear ;
- obj.href = url;
- }
-
-
-
-
-
-
|