| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>详情报表</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link href="../css/init.css" rel="stylesheet" />
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link href="../css/Table/table1.css" rel="stylesheet" />
- <link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
- <style>
- .LY:hover {
- color: #fff;
- }
-
- .LY:active {
- color: #fff!important;
- }
-
- #Task thead td {
- color: #fff;
- background-color: #1ab394;
- text-align: center;
- }
-
- .table-head table thead {
- width: calc( 100% - 5px);
- }
-
- table thead,
- tbody tr {
- display: table;
- width: 100%;
- table-layout: fixed;
- text-align: center;
- }
-
- .table {
- margin-bottom: 0;
- }
-
- .table-body {
- width: 100%;
- height: 515px;
- overflow-y: scroll;
- overflow-x: scroll;
- }
-
- .seach-box ul {
- overflow: inherit;
- }
-
- .dropdown-menu li {
- float: none;
- }
- </style>
- </head>
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn><i class="syIcon"></i>位置:
- <a href="javaScript:;" id="ReIndex">首页</a>>
- <a href="javaScript:;">外呼管理</a>>
- <a href="javaScript:;">外呼报表</a>>
- <a href="" style="color: #000;">详情报表</a>
- </sapn>
- </div>
- </div>
- <div class="th-box">
- <div class="th-bar">
- <div class="seach-box">
- <ul class="clearfix">
- <li>
- <select class="form-control selectpicker" id="taskList" data-live-search="true"></select>
- </li>
- <li>
- <select class="form-control selectpicker" id="questionList" data-live-search="true"></select>
- </li>
- <li>
- <!--<select id="" multiple class="x-color select"></select>-->
- <select class="form-control selectpicker" id="optionsList" multiple data-live-search="true"></select>
- </li>
- <li>
- <input type="text" id="stime" class="photo size-14 laydate-icon" placeholder="请选择开始时间和结束时间" />
- </li>
- <li>
- <a class="sc_btn seach">搜索</a>
- </li>
- <li>
- <a class="sc_btn export">导出</a>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div style="width: 100%;padding: 10px;">
- <div class="table-head">
- <table id="Task" class="table table-hover table-striped table-bordered table-condensed">
- <colgroup>
- <col style="width: 80px;" />
- <col/>
- </colgroup>
- <thead>
- </thead>
- </table>
- </div>
- <div class="table-body">
- <table class="thTable hwbb table table-hover table-striped table-bordered table-condensed">
- <colgroup>
- <col style="width: 80px;" />
- <col/>
- </colgroup>
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <script src="../js/laydate/laydate.js"></script>
- <script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
- <script src="../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
- <script>
- $(document).ready(function() {
- getProLocations($('#taskList'), $('#questionList'), $('#optionsList'));
- laydate.render({
- elem: '#stime',
- range: '~',
- calendar: true,
- theme: '#1ab394',
- });
- $(".sc_btn").click(function() {
- if(!$.trim($('#taskList').val())) {
- layer.msg('请选择任务');
- return;
- }
- if(!$.trim($('#questionList').val())) {
- layer.msg('请选择任务');
- return;
- }
- $("#Task thead").empty();
- $(".thTable tbody").empty();
- getDataLists();
- })
- //导出功能
- $('.export').click(function() {
- if(!$.trim($('#taskList').val())) {
- layer.msg('请选择任务');
- return;
- }
- if(!$.trim($('#questionList').val())) {
- layer.msg('请选择任务');
- return;
- }
- dcexcel(this);
- })
- });
- //获取表头 和 数据
- function getDataLists() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallOutReport/GetColoumnBMY",
- dataType: 'json',
- data: {
- TaskID: $("#taskList").val(), //任务id(必选)
- quesid: $("#questionList").val(), //问题id(必选)
- token: $.cookie("token")
- },
- success: function(data) {
- $("#Task thead").empty();
- if(data.state.toLowerCase() == "success") {
- data = data.data;
- if(data && data.length > 0) {
- var $tr = $('<tr></tr>');
- for(var i = 0; i < data.length; i++) {
- $tr.append('<td>' + data[i] + '</td>');
- $("#Task thead").append($tr);
- }
- }
- }
- }
- })
- .then(function() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallOutReport/GetReportBMY",
- dataType: 'json',
- data: {
- TaskID: $("#taskList").val(), //任务id(必选)
- quesid: $("#questionList").val(), //问题id(必选)
- ansids: $("#optionsList").val() && $("#optionsList").val().join(','), //选项id(多选,默认可以不选,随着选中的问题id做联动)
- sdate: $("#stime").val() && $("#stime").val().split(' ~ ')[0], // 开始时间
- edate: $("#stime").val() && $("#stime").val().split(' ~ ')[1], // 结束时间
- token: $.cookie("token")
- },
- success: function(data) {
- $(".thTable tbody").empty();
- if(data.state.toLowerCase() == "success") {
- data = data.data;
- if(data && data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- $('<tr><td>' + data[i].name + ' </td>' +
- '<td> ' + data[i].phone + ' </td>' +
- '<td> ' + data[i].answer + ' </td>' +
- '</tr>').appendTo(".hwbb tbody");
- }
- } else {
- $(".thTable tbody").html('<p class="text-center">没有找到您想要的记录呢!我会努力的...</p>');
- }
- } else {
- $(".thTable tbody").html('<p class="text-center">没有找到您想要的记录呢!我会努力的...</p>');
- }
- }
- });
- });
- }
- function dcexcel(obj) {
- var url = huayi.config.callcenter_url + "CallOutReport/GetReportBMYExpt?token=" + $.cookie("token");
- url += "&TaskID=" + $("#taskList").val();
- url += "&quesid=" + $("#questionList").val();
- url += "&ansids=" + ($("#optionsList").val() && $("#optionsList").val().join(','));
- url += "&sdate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[0]); // string 否 开始时间
- url += "&edate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[1]); // string 否 开始时间
- obj.href = url;
- }
- //任务列表 问题列表 问题选项 三级联动
- function getProLocations(obj, obj1, obj2) {
- obj.empty();
- obj1.empty();
- obj2.empty();
- obj.append('<option selected="selected" value="">请选择任务</option>');
- obj1.append('<option selected="selected" value="">请选择问题</option>');
- obj2.append('<option selected="selected" value="">请选择选项</option>');
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallOutReport/GetTaskDDL",
- dataType: 'json',
- data: {
- token: $.cookie('token')
- },
- success: function(data) {
- var content = data.data; //任务列表
- //初始化 任务列表
- if(content && content.length > 0) {
- $(content).each(function(i, n) {
- $("<option value='" + n.F_TaskID + "'>" + n.F_TaskName + "</option>").appendTo(obj);
- });
- obj.selectpicker('refresh');
- }
- //问题列表
- obj.change(function() {
- obj1.empty();
- //获取问题列表
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallOutReport/GetQuesDDL",
- dataType: 'json',
- data: {
- taskid: obj.val(), //任务id(默认显示全部)
- token: $.cookie("token")
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var Count = data.data;
- if(Count && Count.length > 0) {
- for(var i = 0; i < Count.length; i++) {
- $(Count[i]).each(function(j, v) {
- $("<option value='" + v.F_QuestionId + "'>" + v.F_Title + "</option>").appendTo(obj1);
- });
- }
- }
- obj1.selectpicker('refresh');
- obj1.trigger('change');
- }
- }
- });
- });
- //选项
- obj1.change(function() {
- obj2.empty();
- //获取选项列表
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallOutReport/GetQuesItemDDL",
- dataType: 'json',
- data: {
- quesid: obj1.val(), //问题id(需选中问题后显示)
- token: $.cookie("token")
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var Count = data.data;
- if(Count && Count.length > 0) {
- for(var i = 0; i < Count.length; i++) {
- $(Count[i]).each(function(j, v) {
- $("<option value='" + v.F_ItemId + "'>" + v.F_ItemName + "</option>").appendTo(obj2);
- });
- }
- obj2.selectpicker('refresh');
- }
- }
- }
- });
- });
- },
- });
- }
- </script>
- </body>
- </html>
|