Bez popisu

taskReportForm.html 9.7KB

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