Sin descripción

taskReportForm.html 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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="salesOffice" data-align="center">营业部</th>
  130. <th data-field="phone" data-align="center">电话</th>
  131. <th data-field="orderNature" data-align="center">用户分类</th>
  132. <th data-field="question1" data-align="center">问题1</th>
  133. <th data-field="result1" data-formatter="setNull" data-align="center">结果1</th>
  134. <th data-field="question2" data-align="center">问题2</th>
  135. <th data-field="result2" data-formatter="setNull" data-align="center">结果2</th>
  136. <th data-field="question3" data-align="center">问题3</th>
  137. <th data-field="result3" data-formatter="setNull" data-align="center">结果3</th>
  138. <th data-field="connect" data-align="center">是否接通</th>
  139. <th data-field="calltime" data-align="center">呼叫时间</th>
  140. <th data-field="totalTime" data-align="center">通话时长</th>
  141. </tr>
  142. </thead>
  143. </table>
  144. </div>
  145. </div>
  146. <script src="../js/laydate/laydate.js"></script>
  147. <script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
  148. <script src="../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
  149. <script>
  150. var table = $('#table1');
  151. var token = $.cookie("token");
  152. var pageSize = 10;
  153. var pasgeNumeber = 1
  154. $(document).ready(function() {
  155. getProLocations($('#taskList'));
  156. laydate.render({
  157. elem: '#stime',
  158. range: '~',
  159. calendar: true,
  160. theme: '#1ab394',
  161. });
  162. initTable()
  163. $(".seach").click(function() {
  164. // if(!$.trim($('#questionList').val())) {
  165. // layer.msg('请选择问题');
  166. // return;
  167. // }
  168. initTable()
  169. })
  170. //导出功能
  171. $('.export').click(function() {
  172. dcexcels(this);
  173. // if(!$.trim($('#questionList').val())) {
  174. // layer.msg('请选择任务');
  175. // return;
  176. // }
  177. // dcexcels(this);
  178. })
  179. });
  180. //获取表头 和 数据
  181. function initTable() {
  182. table.bootstrapTable('destroy');
  183. //初始化表格,动态从服务器加载数据
  184. table.bootstrapTable({
  185. method: "get", //使用get请求到服务器获取数据
  186. url: huayi.config.callcenter_url + "AutomaticCall/GetListExpt", //获取数据的Servlet地址
  187. contentType: 'application/x-www-form-urlencoded',
  188. striped: true, //表格显示条纹
  189. pagination: true, //启动分页
  190. pageSize: 10, //每页显示的记录数
  191. pageNumber: 1, //当前第几页
  192. pageList: [10, 15, 20, 50, 100], //记录数可选列表
  193. search: false, //是否启用查询
  194. showColumns: false, //显示下拉框勾选要显示的列
  195. showRefresh: false, //显示刷新按钮
  196. sidePagination: "server", //表示服务端请求
  197. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  198. //设置为limit可以获取limit, offset, search, sort, order
  199. queryParamsType: "undefined",
  200. queryParams: function queryParams(params) { //设置查询参数
  201. pageSize = params.pageSize
  202. pageNumber = params.pageNumber
  203. var param = {
  204. pageindex: params.pageNumber, //int 否 条数,默认为10
  205. pagesize: params.pageSize, //int 否 页码,默认为1
  206. phone: $("#phone").val(), //任务id(必选)
  207. callstate: $("#callstate").val(), //问题id(必选)
  208. salesOffice: $('#salesOffice').val(),
  209. orderNature:$('#mubiao').val(),
  210. taskid:$("#taskList").val(),
  211. sdate: $("#stime").val() && $("#stime").val().split(' ~ ')[0],
  212. edate: $("#stime").val() && $("#stime").val().split(' ~ ')[1],
  213. isexport: 0,
  214. token: token,
  215. };
  216. return param;
  217. },
  218. responseHandler: function(res) {
  219. return {
  220. "total": res.total, //总页数
  221. "rows": res.rows//数据
  222. };
  223. },
  224. onLoadSuccess: function() { //加载成功时执行
  225. //layer.msg("加载成功");
  226. },
  227. onLoadError: function() { //加载失败时执行
  228. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  229. }
  230. });
  231. }
  232. //编号
  233. function setCode(val, row, index) {
  234. //return index + 1;
  235. var page = table.bootstrapTable("getPageCode");
  236. return index + 1;
  237. }
  238. function dcexcels(obj) {
  239. console.log(pageSize, pageNumber)
  240. // debugger
  241. var url = huayi.config.callcenter_url + "AutomaticCall/GetListExpt?token=" + $.cookie("token");
  242. url += "&pagesize=" + pageSize;
  243. url += "&pageindex=" + pageNumber;
  244. url += "&isexport=" + 1;
  245. url += "&phone=" + $("#phone").val();
  246. url += "&callstate=" + $("#callstate").val();
  247. url += "&salesOffice=" + $("#salesOffice").val();
  248. url += "&orderNature=" + $("#mubiao").val();
  249. url += "&taskid=" + $("#taskList").val();
  250. url += "&sdate=" + ($("#stime ").val() && $("#stime").val().split(' ~ ')[0]); // string 否 开始时间
  251. url += "&edate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[1]); // string 否 开始时间
  252. console.log(url)
  253. obj.href = url;
  254. }
  255. function setNull(v){
  256. if(v==''){
  257. return null
  258. }else{
  259. return v
  260. }
  261. }
  262. //任务列表 问题列表 问题选项 三级联动
  263. function getProLocations(obj) {
  264. obj.empty();
  265. // obj1.empty();
  266. obj.append('<option selected="selected" value="0">请选择任务名</option>');
  267. // obj1.append('<option selected="selected" value="0">请选择问题</option>');
  268. $.ajax({
  269. type: "get",
  270. url: huayi.config.callcenter_url + "AutomaticCall/GetExportTaskList",
  271. dataType: 'json',
  272. data: {
  273. token: $.cookie('token')
  274. },
  275. success: function(data) {
  276. var content = data.data; //任务列表
  277. //初始化 任务列表
  278. if(content && content.length > 0) {
  279. $(content).each(function(i, n) {
  280. $("<option value='" + n.taskId + "'>" + n.taskName + "</option>").appendTo(obj);
  281. });
  282. obj.selectpicker('refresh');
  283. }
  284. },
  285. });
  286. }
  287. </script>
  288. </body>
  289. </html>