Nav apraksta

taskReportForm.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>任务报表</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link href="../css/init.css" rel="stylesheet" />
  8. <script src="../Script/Common/huayi.load.js"></script>
  9. <script src="../Script/Common/huayi.config.js"></script>
  10. <link href="../css/Table/table1.css" rel="stylesheet" />
  11. <link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
  12. <style>
  13. .LY:hover {
  14. color: #fff;
  15. }
  16. .LY:active {
  17. color: #fff!important;
  18. }
  19. #Task thead td {
  20. color: #fff;
  21. background-color: #1ab394;
  22. text-align: center;
  23. }
  24. .table-head table thead {
  25. width: calc( 100% - 5px);
  26. }
  27. table thead,
  28. tbody tr {
  29. display: table;
  30. width: 100%;
  31. table-layout: fixed;
  32. text-align: center;
  33. }
  34. .table {
  35. margin-bottom: 0;
  36. }
  37. .table-body {
  38. width: 100%;
  39. height: 515px;
  40. overflow-y: scroll;
  41. overflow-x: scroll;
  42. }
  43. .seach-box ul {
  44. overflow: inherit;
  45. }
  46. .dropdown-menu li {
  47. float: none;
  48. }
  49. .bootstrap-select.btn-group:not(.input-group-btn),
  50. .bootstrap-select.btn-group[class*="col-"] {
  51. width: 150px !important;
  52. }
  53. .bootstrap-select .dropdown-toggle:focus,
  54. .form-control:focus,
  55. .single-line:focus {
  56. outline: none !important;
  57. border: 1px solid rgb(221, 221, 221) !important;
  58. }
  59. .photo{
  60. width: 200px;
  61. }
  62. </style>
  63. </head>
  64. <body class="gray-bg">
  65. <div class="wrapper wrapper-content animated fadeInRight">
  66. <div class="daoHang clearfix">
  67. <div class="dhLeft">
  68. <sapn><i class="syIcon"></i>位置:
  69. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  70. <a href="javaScript:;">任务管理</a>&gt;
  71. <a href="" style="color: #000;">任务报表</a>
  72. </sapn>
  73. </div>
  74. </div>
  75. <div class="th-box">
  76. <div class="th-bar">
  77. <div class="seach-box">
  78. <ul class="clearfix">
  79. <li>
  80. <select class="form-control selectpicker" id="taskList" data-live-search="true"></select>
  81. </li>
  82. <!--<li>
  83. <select class="form-control selectpicker" id="questionList" data-live-search="true"></select>
  84. </li>
  85. <li>
  86. <select class="form-control selectpicker" id="result" data-live-search="true">
  87. <option value="null">请选择结果</option>
  88. <option value="">无评价</option>
  89. <option value="十分满意">十分满意</option>
  90. <option value="满意">满意</option>
  91. <option value="不满意">不满意</option>
  92. </select>
  93. </li>-->
  94. <li style="margin-top: 4px;">
  95. <input type="text" id="phone" class="form-control size-14" placeholder="请输入电话" />
  96. </li>
  97. <li style="margin-top: 4px;">
  98. <input type="text" id="salesOffice" class="form-control size-14" placeholder="请输入营业部" />
  99. </li>
  100. <li style="margin-top: 4px;">
  101. <input type="text" id="mubiao" class="form-control size-14" placeholder="请输入用户分类" />
  102. </li>
  103. <li>
  104. <select class="form-control selectpicker" id="callstate" data-live-search="true">
  105. <option value="">请输入通话结果</option>
  106. <option value="1">已接通</option>
  107. <option value="0">未接通</option>
  108. </select>
  109. <!--<input type="text" id="callstate" class="form-control size-14" placeholder="请输入通话结果" />-->
  110. </li>
  111. <li>
  112. <input type="text" id="stime" class="photo size-14 laydate-icon" placeholder="请选择开始时间和结束时间" />
  113. </li>
  114. <li>
  115. <a class="sc_btn seach">搜索</a>
  116. </li>
  117. <li>
  118. <a class="sc_btn export">导出</a>
  119. </li>
  120. </ul>
  121. </div>
  122. </div>
  123. </div>
  124. <div style="width: 100%;padding: 10px;">
  125. <table id="table1" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  126. <thead>
  127. <tr>
  128. <th data-field="" data-formatter="setCode" data-align="center">编号</th>
  129. <th data-field="FilePath" data-formatter="setVice" data-align="center">录音</th>
  130. <th data-field="salesOffice" data-align="center">营业部</th>
  131. <th data-field="phone" data-align="center">电话</th>
  132. <th data-field="orderNature" data-align="center">用户分类</th>
  133. <th data-field="question1" data-align="center">问题1</th>
  134. <th data-field="result1" data-formatter="setNull" data-align="center">结果1</th>
  135. <th data-field="question2" data-align="center">问题2</th>
  136. <th data-field="result2" data-formatter="setNull" data-align="center">结果2</th>
  137. <th data-field="question3" data-align="center">问题3</th>
  138. <th data-field="result3" data-formatter="setNull" data-align="center">结果3</th>
  139. <th data-field="connect" data-align="center">是否接通</th>
  140. <th data-field="calltime" data-align="center">呼叫时间</th>
  141. <th data-field="totalTime" data-align="center">通话时长</th>
  142. </tr>
  143. </thead>
  144. </table>
  145. </div>
  146. </div>
  147. <!--下载框-->
  148. <div class="t-shade">
  149. <div class="shade_k">
  150. <div class="shade_title">
  151. <span>录音播放与下载<srong class="cknum"></srong></span>
  152. <span class="setwin"><a>x</a></span>
  153. </div>
  154. <div class="shade_content">
  155. <div class="Ly_box audiojs "></div>
  156. <div class="boxCon LY_box"></div>
  157. </div>
  158. </div>
  159. </div>
  160. <script src="../js/laydate/laydate.js"></script>
  161. <script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
  162. <script src="../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
  163. <script>
  164. var table = $('#table1');
  165. var token = $.cookie("token");
  166. var pageSize = 10;
  167. var pasgeNumeber = 1
  168. $(document).ready(function() {
  169. getProLocations($('#taskList'));
  170. laydate.render({
  171. elem: '#stime',
  172. range: '~',
  173. calendar: true,
  174. theme: '#1ab394',
  175. });
  176. initTable()
  177. $(".seach").click(function() {
  178. // if(!$.trim($('#questionList').val())) {
  179. // layer.msg('请选择问题');
  180. // return;
  181. // }
  182. initTable()
  183. })
  184. //导出功能
  185. $('.export').click(function() {
  186. dcexcels(this);
  187. // if(!$.trim($('#questionList').val())) {
  188. // layer.msg('请选择任务');
  189. // return;
  190. // }
  191. // dcexcels(this);
  192. })
  193. });
  194. //获取表头 和 数据
  195. function initTable() {
  196. table.bootstrapTable('destroy');
  197. //初始化表格,动态从服务器加载数据
  198. table.bootstrapTable({
  199. method: "get", //使用get请求到服务器获取数据
  200. url: huayi.config.callcenter_url + "AutomaticCall/GetListExpt", //获取数据的Servlet地址
  201. contentType: 'application/x-www-form-urlencoded',
  202. striped: true, //表格显示条纹
  203. pagination: true, //启动分页
  204. pageSize: 10, //每页显示的记录数
  205. pageNumber: 1, //当前第几页
  206. pageList: [10, 15, 20, 50, 100], //记录数可选列表
  207. search: false, //是否启用查询
  208. showColumns: false, //显示下拉框勾选要显示的列
  209. showRefresh: false, //显示刷新按钮
  210. sidePagination: "server", //表示服务端请求
  211. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  212. //设置为limit可以获取limit, offset, search, sort, order
  213. queryParamsType: "undefined",
  214. queryParams: function queryParams(params) { //设置查询参数
  215. pageSize = params.pageSize
  216. pageNumber = params.pageNumber
  217. var param = {
  218. pageindex: params.pageNumber, //int 否 条数,默认为10
  219. pagesize: params.pageSize, //int 否 页码,默认为1
  220. phone: $("#phone").val(), //任务id(必选)
  221. callstate: $("#callstate").val(), //问题id(必选)
  222. salesOffice: $('#salesOffice').val(),
  223. orderNature:$('#mubiao').val(),
  224. taskid:$("#taskList").val(),
  225. sdate: $("#stime").val() && $("#stime").val().split(' ~ ')[0],
  226. edate: $("#stime").val() && $("#stime").val().split(' ~ ')[1],
  227. isexport: 0,
  228. token: token,
  229. };
  230. return param;
  231. },
  232. responseHandler: function(res) {
  233. return {
  234. "total": res.total, //总页数
  235. "rows": res.rows//数据
  236. };
  237. },
  238. onLoadSuccess: function() { //加载成功时执行
  239. //layer.msg("加载成功");
  240. },
  241. onLoadError: function() { //加载失败时执行
  242. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  243. }
  244. });
  245. }
  246. //编号
  247. function setCode(val, row, index) {
  248. //return index + 1;
  249. var page = table.bootstrapTable("getPageCode");
  250. return index + 1;
  251. }
  252. //音频
  253. function setVice(val, row) {
  254. if(val) {
  255. return '<div class="imgs">' +
  256. '<img src="../img/vice.png" alt="" onclick= ck(this,"' + row.CallId + '") item="' + val + '" />' +
  257. '</div>';
  258. } else {
  259. return '-';
  260. }
  261. }
  262. function ck(val, callId) {
  263. var path = $(val).attr("item");
  264. $(".t-shade").addClass("cx");
  265. $(".Ly_box").empty();
  266. $(".LY_box").empty();
  267. $('<audio style="width:100%;"class=" " type="audio/v3" src="' + path + '" loop="loop" controls="controls"></audio>').appendTo(".Ly_box");
  268. }
  269. $(".setwin").click(function() {
  270. $(".t-shade").removeClass("cx");
  271. $('audio')[0].pause();
  272. });
  273. function dcexcels(obj) {
  274. console.log(pageSize, pageNumber)
  275. // debugger
  276. var url = huayi.config.callcenter_url + "AutomaticCall/GetListExpt?token=" + $.cookie("token");
  277. url += "&pagesize=" + pageSize;
  278. url += "&pageindex=" + pageNumber;
  279. url += "&isexport=" + 1;
  280. url += "&phone=" + $("#phone").val();
  281. url += "&callstate=" + $("#callstate").val();
  282. url += "&salesOffice=" + $("#salesOffice").val();
  283. url += "&orderNature=" + $("#mubiao").val();
  284. url += "&taskid=" + $("#taskList").val();
  285. url += "&sdate=" + ($("#stime ").val() && $("#stime").val().split(' ~ ')[0]); // string 否 开始时间
  286. url += "&edate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[1]); // string 否 开始时间
  287. console.log(url)
  288. obj.href = url;
  289. }
  290. function setNull(v){
  291. if(v==''){
  292. return null
  293. }else{
  294. return v
  295. }
  296. }
  297. //任务列表 问题列表 问题选项 三级联动
  298. function getProLocations(obj) {
  299. obj.empty();
  300. // obj1.empty();
  301. obj.append('<option selected="selected" value="0">请选择任务名</option>');
  302. // obj1.append('<option selected="selected" value="0">请选择问题</option>');
  303. $.ajax({
  304. type: "get",
  305. url: huayi.config.callcenter_url + "AutomaticCall/GetExportTaskList",
  306. dataType: 'json',
  307. data: {
  308. token: $.cookie('token')
  309. },
  310. success: function(data) {
  311. var content = data.data; //任务列表
  312. //初始化 任务列表
  313. if(content && content.length > 0) {
  314. $(content).each(function(i, n) {
  315. $("<option value='" + n.taskId + "'>" + n.taskName + "</option>").appendTo(obj);
  316. });
  317. obj.selectpicker('refresh');
  318. }
  319. },
  320. });
  321. }
  322. </script>
  323. </body>
  324. </html>