No Description

CallRecord.html 43KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  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. <script src="../Script/Common/huayi.load.js"></script>
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <link rel="stylesheet" href="../css/bootstrap-select.css" />
  10. <link rel="stylesheet" href="../css/Table/table1.css" />
  11. <link rel="stylesheet" href="../css/init.css" />
  12. <style>
  13. body {
  14. font-family: "微软雅黑";
  15. font-size: 14px;
  16. }
  17. /* ul li {
  18. list-style: none;
  19. float: left;
  20. } */
  21. .fr {
  22. float: right;
  23. }
  24. .fl {
  25. float: right;
  26. }
  27. /*标头*/
  28. .th-box {
  29. width: 100%;
  30. padding: 5px;
  31. border-bottom: 1px solid #e7eaec;
  32. }
  33. .sc_btn {
  34. width: 100px;
  35. color: #fff;
  36. font-size: 12px;
  37. margin-left: 15px;
  38. box-sizing: border-box;
  39. background: #00a1cb;
  40. padding: 6px 10px;
  41. outline: none;
  42. border-width: 0px;
  43. border-style: initial;
  44. border-color: initial;
  45. border-image: initial;
  46. border-radius: 3px;
  47. margin-top: 5px;
  48. text-align: center;
  49. }
  50. .photo {
  51. /*background-color: #FFF;
  52. background-image: none;*/
  53. border: 1px solid #e5e6e7;
  54. border-radius: 1px;
  55. color: inherit;
  56. padding: 6px 12px;
  57. }
  58. .selects {
  59. background-color: #FFF;
  60. background-image: none;
  61. border: 1px solid #e5e6e7;
  62. border-radius: 1px;
  63. color: inherit;
  64. padding: 6px 12px;
  65. }
  66. #Select:focus {
  67. outline: none;
  68. border-color: #00BFFF;
  69. }
  70. input:focus {
  71. outline: none;
  72. border-color: #00BFFF;
  73. }
  74. .spiner-example {
  75. position: absolute;
  76. top: 50%;
  77. left: 50%;
  78. z-index: 111;
  79. margin-left: -85px;
  80. margin-top: -100px;
  81. display: none;
  82. }
  83. .sk-spinner-three-bounce {
  84. width: 170px !important;
  85. }
  86. .sk-spinner p {
  87. display: inline-block;
  88. font-size: 18px;
  89. margin-left: 10px;
  90. }
  91. .gjsu ul {
  92. overflow: hidden;
  93. }
  94. .gjsu ul li {
  95. width: 50%;
  96. margin-bottom: 5px;
  97. padding-top: 10px;
  98. }
  99. .selects {
  100. width: 105px;
  101. }
  102. .tc {
  103. margin-top: 30px;
  104. text-align: center;
  105. }
  106. #sqzx th {
  107. padding: 5px 8px 5px 0;
  108. text-align: center;
  109. width: 6%;
  110. }
  111. #sqzx td {
  112. padding: 6px 0 5px 10px;
  113. width: 18%;
  114. }
  115. .nameJustified {
  116. width: 5em;
  117. display: inline-block;
  118. text-align: justify;
  119. text-align-last: justify;
  120. }
  121. .dropdown-menu li {
  122. width: 100%;
  123. }
  124. .operation {
  125. white-space: nowrap;
  126. }
  127. .Min-width{
  128. width: 48%;
  129. display: inline-block;
  130. margin: 0;
  131. }
  132. </style>
  133. </head>
  134. <body class="gray-bg">
  135. <div class="wrapper wrapper-content animated fadeInRight">
  136. <div class="daoHang clearfix">
  137. <div class="dhLeft">
  138. <sapn><i class="syIcon"></i>位置:<a href="javaScript:;" id="ReIndex">首页</a>&gt;<a
  139. href="javaScript:;">话务管理</a>&gt;<a href="" class="nowPosition">通话记录查询</a></sapn>
  140. </div>
  141. <div class="dhRight">
  142. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  143. </div>
  144. </div>
  145. <div class="th-box">
  146. <div class="box_content">
  147. <table id="sqzx" style="width: 100%" border="0">
  148. <tbody>
  149. <tr>
  150. <th>电话号码:</th>
  151. <td><input id="tel" class="form-control" type="text" /></td>
  152. <th>呼叫状态:</th>
  153. <td>
  154. <select id="ss_hjzt" class="callstate form-control">
  155. <option value="">全部</option>
  156. <option value="0">未接通</option>
  157. <option value="1">已接通</option>
  158. <option value="2">接通未达</option>
  159. <option value="3">主动放弃</option>
  160. <option value="4">自主完成</option>
  161. </select>
  162. </td>
  163. <th><span class="nameJustified">分机号:</span></th>
  164. <td>
  165. <input id="extnumber" class="form-control" type="text" />
  166. </td>
  167. <th>呼出方向:</th>
  168. <td>
  169. <select id="ss_hcfx" class="form-control calltype">
  170. <option value="">全部</option>
  171. <option value="0">呼入</option>
  172. <option value="1">呼出</option>
  173. <option value="3">呼出回访</option>
  174. </select>
  175. </td>
  176. </tr>
  177. <tr>
  178. <th>呼叫类型:</th>
  179. <td>
  180. <select id="ss_HJLX" class="form-control calltype">
  181. <option value="">全部</option>
  182. <option value="1">正常通话</option>
  183. <option value="2">转移</option>
  184. <option value="3">三方通话</option>
  185. </select>
  186. </td>
  187. <th>是否回访:</th>
  188. <td>
  189. <select id="sf_hf" class="form-control calltype">
  190. <option value="">全部</option>
  191. <option value="2">是</option>
  192. <option value="0">否</option>
  193. </select>
  194. </td>
  195. <th>受话坐席:</th>
  196. <td class="maxWidthSelect">
  197. <select id="seat" class="selectpicker show-tick form-control" multiple data-live-search="true"></select>
  198. </td>
  199. <th>通话类型:</th>
  200. <td>
  201. <select id="callType" class="form-control callstate">
  202. <option value="">全部</option>
  203. </select>
  204. </td>
  205. </tr>
  206. <tr>
  207. <th>电话类别:</th>
  208. <td>
  209. <select class="form-control" id="phoneType">
  210. <option value="">请选择</option>
  211. </select>
  212. </td>
  213. <th>查询类型:</th>
  214. <td>
  215. <select id="islike" class="form-control" name="select">
  216. <option value="1">模糊查询</option>
  217. <option value="0">精确查询</option>
  218. </select>
  219. </td>
  220. <th><span class="nameJustified">时间:</span></th>
  221. <td colspan="3">
  222. <input id="start" class="photo x-color laydate-icon" type="text" autocomplete="off" /> -
  223. <input id="end" class="photo x-color laydate-icon" type="text" autocomplete="off" />
  224. <a class="sc_btn Ss">搜索</a>
  225. <a class="sc_btn exportFile">导出</a>
  226. </td>
  227. </tr>
  228. <tr>
  229. <th><span class="nameJustified">坐席组:</span></th>
  230. <td>
  231. <select id="agentGroup" class="form-control" name="select">
  232. <option value="">请选择</option>
  233. </select>
  234. </td>
  235. <th><span class="nameJustified">未接通:</span></th>
  236. <td>
  237. <select id="notconnected" class="form-control" name="select">
  238. <option value="">请选择</option>
  239. <option value="1">呼入至今未接通</option>
  240. </select>
  241. </td>
  242. <th>是否回拨</th>
  243. <td>
  244. <select id="callback" class="form-control" name="select">
  245. <option value="">请选择</option>
  246. <option value="1">已回拨</option>
  247. <option value="2">未回拨</option>
  248. </select>
  249. </td>
  250. </tr>
  251. <tr>
  252. <th><span>等待时长:</span></th>
  253. <td >
  254. <input id="WaitTime" class="form-control Min-width" type="text"placeholder="输入数字,单位s"/>
  255. <select id="WaitTimeState" class="form-control Min-width" name="select">
  256. <option value="">等于</option>
  257. <option value="1">大于</option>
  258. <option value="2">小于</option>
  259. </select>
  260. </td>
  261. <th><span>满意度:</span></th>
  262. <td >
  263. <select id="myd" class="form-control" name="select">
  264. <option value="">请选择</option>
  265. <option value="0">未评价</option>
  266. <option value="1">满意</option>
  267. <option value="2">一般</option>
  268. <option value="3">不满意</option>
  269. </select>
  270. </td>
  271. <th><span>电话方式:</span></th>
  272. <td >
  273. <select id="Business" class="form-control" name="select">
  274. <option value="">请选择</option>
  275. <option value="2">市民咨询</option>
  276. <option value="3">营商环境</option>
  277. <option value="4">市长信箱</option>
  278. </select>
  279. </td>
  280. <th><span>工单编号:</span></th>
  281. <td>
  282. <input id="worknumber" class="form-control" type="text" />
  283. </td>
  284. </tr>
  285. </tbody>
  286. </table>
  287. </div>
  288. </div>
  289. <div style="width: 100%;padding: 10px;">
  290. <table id="list" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  291. <thead>
  292. <tr>
  293. <th data-field="" data-align="center" data-formatter="Code">编号</th>
  294. <th data-field="CallNumber" data-align="center" data-formatter="phoneTableHtml">电话号码</th>
  295. <th data-field="FilePath" data-formatter="setCode" data-align="center">录音</th>
  296. <th data-field="CallType" data-formatter="callType" data-align="center">呼叫方向</th>
  297. <th data-field="CallState" data-formatter="states" data-align="center">呼叫状态</th>
  298. <th data-field="ActionType" data-formatter="ActionType" data-align="center">呼叫类型</th>
  299. <th data-field="TypeName" data-align="center">通话类型</th>
  300. <th data-field="MYD" data-align="center" data-formatter="MYD">满意度</th>
  301. <th data-field="UserCode" data-align="center">坐席工号</th>
  302. <th data-field="UserName1" data-align="center">坐席姓名</th>
  303. <th data-field="ExtNumber" data-align="center">分机号</th>
  304. <th data-field="BeginTime" data-align="center">开始时间</th>
  305. <th data-field="TalkStartTime" data-align="center">通话开始时间</th>
  306. <th data-field="TalkEndTime" data-align="center">通话结束时间</th>
  307. <th data-field="EndTime" data-align="center">结束时间</th>
  308. <th data-field="TalkLongTime" data-align="center" data-formatter="ftime">通话时长</th>
  309. <th data-field="RingLongTime" data-align="center" data-formatter="ftime">振铃时长</th>
  310. <th data-field="WaitTime" data-align="center">等待时长</th>
  311. <th data-field="LongTime" data-align="center" data-formatter="ftime">总时长</th>
  312. <th data-field="PhoneType" data-align="center">电话类别</th>
  313. <th data-field="TransferCall" data-align="center">转接号码</th>
  314. <th data-field="Business" data-align="center" data-formatter="formatBusinessType">电话方式</th>
  315. <th data-field="Callback" data-align="center" data-formatter="formatCallback">是否回拨</th>
  316. <th data-field="WorkOrderId" data-align="center" data-formatter="formatWorkOrderNum">工单号</th>
  317. <th data-field="CallId" data-align="center" data-formatter="operationFormatter">操作</th>
  318. </tr>
  319. </thead>
  320. </table>
  321. <!--高级搜索框-->
  322. </div>
  323. </div>
  324. <!--下载框-->
  325. <div class="t-shade">
  326. <div class="shade_k">
  327. <div class="shade_title">
  328. <span>录音播放<srong class="cknum"></srong></span>
  329. <span class="setwin"><a>x</a></span>
  330. </div>
  331. <div class="shade_content">
  332. <div class="Ly_box audiojs">
  333. </div>
  334. <div class="boxCon LY_box">
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. <script src="../js/bootstrap-select.js"></script>
  340. <script src="../My97DatePicker/WdatePicker.js"></script>
  341. <script src="../css/laydate/laydate.js"></script>
  342. <!-- <script src="../js/main.js"></script> -->
  343. <script src="../js/guid.js"></script>
  344. <script src="../js/sm2/sm2.js"></script>
  345. <script src="../js/sm2/decrypt.js"></script>
  346. <!--<script src="../js/contabs.min.js"></script>-->
  347. <script>
  348. var stype = 1;
  349. var seatlist = [];
  350. $(document).ready(function () {
  351. laydate.skin('blue');
  352. laydate({
  353. elem: '#start',
  354. event: 'focus',
  355. istime: true,
  356. format: 'YYYY-MM-DD hh:mm:ss'
  357. });
  358. laydate({
  359. elem: '#end',
  360. event: 'focus',
  361. istime: true,
  362. format: 'YYYY-MM-DD hh:mm:ss'
  363. });
  364. $("#start").val(helper.DateFormat.getNowDate()+" 00:00:00")
  365. $("#end").val(helper.DateFormat.getNowDate()+" 23:59:59")
  366. /*获取选中行对象*/
  367. $('#list').on("click-row.bs.table", function (e, row, ele) {
  368. $('.success').removeClass('success'); //去除之前选中的行的,选中样式
  369. $(ele).addClass('success'); //添加当前选中的 success样式用于区别
  370. });
  371. $(".setwin").click(function () {
  372. $(".t-shade").removeClass("cx");
  373. $('audio')[0].pause();
  374. });
  375. //获取通话类型
  376. GetCallTypeList();
  377. //获取坐席
  378. getAgentGroup($("#agentGroup"));
  379. //获取坐席
  380. $.getJSON(huayi.config.callcenter_url + "UserAccount/GetSeatList", {
  381. token: $.cookie("token")
  382. }, function (result) {
  383. if (result.state.toLowerCase() == "success") {
  384. seatlist = result.data;
  385. bindseat($("#seat"));
  386. }
  387. });
  388. // 电话类别
  389. getPhoneType($("#phoneType"));
  390. //搜索
  391. $(".Ss").click(function () {
  392. stype = 1;
  393. initTable();
  394. });
  395. //高级搜索s
  396. $(".Gj").click(function () {
  397. var a = "WdatePicker()";
  398. layer.open({
  399. type: 1,
  400. title: '高级搜索',
  401. area: ['50%', '55%'], //宽高
  402. content: ' <div class="gjsu"><ul class="nav nav-tabs">' +
  403. '<li class="active"><a href="#">参数信息</a></li> ' +
  404. '</ul>' +
  405. '<ul>' +
  406. '<li>' +
  407. '<label for="">电话号码:</label>' +
  408. '<input type="text" id="ss_tel" class="photo"/>' +
  409. '</li>' +
  410. '<li>' +
  411. '<label for="">坐席工号:</label>' +
  412. '<select name="" id="ss_seat" class="selects usercode"></select>' +
  413. '</li>' +
  414. '<li>' +
  415. '<label for="">开始时间:</label>' +
  416. ' <input type="text" id="ss_kssj" class="photo"onClick="' + a + '"/>' +
  417. '</li>' +
  418. '<li>' +
  419. '<label for="">呼叫状态:</label>' +
  420. '<select id="ss_hjzt" class="selects callstate">' +
  421. '<option value="">全部</option>' +
  422. '<option value="0">未接通</option>' +
  423. '<option value="1">已接通</option>' +
  424. '<option value="2">黑名单拒接</option>' +
  425. '</select>' +
  426. '</li>' +
  427. '<li>' +
  428. '<label for="">结束时间:</label>' +
  429. '<input type="text" id="ss_jssj" class="photo" onClick="' + a + '"/>' +
  430. '</li>' +
  431. '<li>' +
  432. '<label for="">呼出方向:</label>' +
  433. '<select id="ss_hcfx" class=" selects calltype">' +
  434. '<option value="">全部</option>' +
  435. '<option value="0">呼入</option>' +
  436. '<option value="1">呼出</option>' +
  437. '</select>' +
  438. '</li>' +
  439. '</ul>' +
  440. '<div class=" add_time tc">' +
  441. '<button type="button" class="btn sc_btn Block " id="tc">保&nbsp;&nbsp;存</button>' +
  442. '</div>' +
  443. '</div>'
  444. });
  445. bindseat($("#ss_seat"));
  446. //获取通话记录列表
  447. $("#tc").click(function () {
  448. stype = 2;
  449. initTable();
  450. var index = layer.index; //获取当前弹层的索引号
  451. layer.close(index); //关闭当前弹层
  452. });
  453. });
  454. initTable();
  455. })
  456. function bindseat(obj) {
  457. obj.empty();
  458. obj.append('<option value="">全部</option>');
  459. $(seatlist).each(function (i, n) {
  460. obj.append('<option value="' + n.F_UserCode + '">' + n.F_UserName + '</option>');
  461. obj.selectpicker({
  462. noneSelectedText: '请选择' //默认显示内容
  463. });
  464. obj.selectpicker('refresh');
  465. })
  466. }
  467. /*
  468. 监听坐席数据变化
  469. 选中全部时候,取消其他选项
  470. clickedIndex:索引
  471. isSelected:是否选中
  472. previousValue:选中前的值
  473. */
  474. $("#seat").on("changed.bs.select", function (event, clickedIndex, isSelected, previousValue) {
  475. if (previousValue.indexOf("全部") == -1) {
  476. if (clickedIndex == 0) {
  477. $("#seat").selectpicker("deselectAll");
  478. $("#seat").val("");
  479. $("#seat").selectpicker('refresh');
  480. }
  481. } else {
  482. if (clickedIndex != 0) {
  483. $("#seat").selectpicker("deselectAll");
  484. $("#seat").val("");
  485. $("#seat").selectpicker('refresh');
  486. }
  487. }
  488. })
  489. function initTable() {
  490. //先销毁表格
  491. $('#list').bootstrapTable('destroy');
  492. //初始化表格,动态从服务器加载数据
  493. $("#list").bootstrapTable({
  494. method: "get", //使用get请求到服务器获取数据
  495. url: huayi.config.callcenter_url + "Callrecords/GetList", //获取数据的Servlet地址
  496. contentType: "application/x-www-form-urlencoded",
  497. striped: true, //表格显示条纹
  498. pagination: true, //启动分页
  499. pageSize: 10, //每页显示的记录数
  500. pageNumber: 1, //当前第几页
  501. pageList: [10, 20, 50, 100], //记录数可选列表
  502. search: false, //是否启用查询
  503. showColumns: false, //显示下拉框勾选要显示的列
  504. showRefresh: false, //显示刷新按钮
  505. sidePagination: "server", //表示服务端请求
  506. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  507. //设置为limit可以获取limit, offset, search, sort, order
  508. queryParamsType: "undefined",
  509. queryParams: function queryParams(params) { //设置查询参数
  510. var param = {
  511. page: params.pageNumber,
  512. pagesize: params.pageSize,
  513. token: $.cookie("token")
  514. };
  515. var usercode_ = $("#seat").val(); //坐席
  516. var usercodeID = "";
  517. if (usercode_ != null) {
  518. $(usercode_).each(function (i, n) {
  519. var obj1 = "";
  520. obj1 = n + ",";
  521. usercodeID += obj1;
  522. });
  523. usercodeID = usercodeID.slice(0, -1);
  524. } else {
  525. usercodeID = "";
  526. }
  527. var WaitTimeState = $("#WaitTimeState").val()
  528. if(WaitTimeState ==="1"){
  529. param.morewaitTime = $("#WaitTime").val(); // 大于waitTime时长
  530. } else if(WaitTimeState ==="2"){
  531. param.lesswaitTime = $("#WaitTime").val(); // 小于waitTime时长
  532. } else{
  533. param.WaitTime = $("#WaitTime").val(); // 等待时长
  534. }
  535. if (stype == '1') {
  536. param.usercode = usercodeID;
  537. param.phone = $("#tel").val().replace(/\s+/g, "");
  538. param.starttime = $("#start").val();
  539. param.endtime = $("#end").val();
  540. param.callstate = $("#ss_hjzt").val();
  541. param.calltype = $("#ss_hcfx").val();
  542. param.type = $("#callType").val(); //type=通话类型
  543. param.actiontype = $("#ss_HJLX").val(); //呼叫类型
  544. param.tasktype = $("#sf_hf").val(); //呼叫类型
  545. param.extnumber = $("#extnumber").val().replace(/\s+/g, "");
  546. param.phoneType = $("#phoneType").val();
  547. param.islike = $("#islike").val(); // 查询类型
  548. param.group = $("#agentGroup").val(); // 坐席组
  549. param.notconnected = $("#notconnected").val(); // 未接通
  550. param.callback = $("#callback").val(); // 是否回拨
  551. param.myd = $("#myd").val()
  552. param.Business = $("#Business").val()
  553. param.workOrderId = $("#worknumber").val()
  554. } else if (stype == '2') {
  555. param.usercode = $("#ss_seat").val();
  556. param.tel = $("#ss_tel").val();
  557. param.callstate = $("#ss_hjzt").val();
  558. param.calltype = $("#ss_hcfx").val();
  559. param.starttime = $("#ss_kssj").val();
  560. param.endtime = $("#ss_jssj").val();
  561. param.type = $("#callType").val(); //type=通话类型
  562. param.actiontype = $("#ss_HJLX").val(); //呼叫类型
  563. param.tasktype = $("#sf_hf").val(); //呼叫类型
  564. param.extnumber = $("#extnumber").val().replace(/\s+/g, "");
  565. param.phoneType = $("#phoneType").val();
  566. param.islike = $("#islike").val(); // 查询类型
  567. param.group = $("#agentGroup").val(); // 坐席组
  568. param.notconnected = $("#notconnected").val(); // 未接通
  569. param.callback = $("#callback").val(); // 是否回拨
  570. param.myd = $("#myd").val()
  571. param.Business = $("#Business").val()
  572. param.workOrderId = $("#worknumber").val()
  573. }
  574. return param;
  575. },
  576. onLoadSuccess: function () { //加载成功时执行
  577. //layer.msg("加载成功");
  578. },
  579. onLoadError: function () { //加载失败时执行
  580. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  581. }
  582. });
  583. }
  584. //音频
  585. function setCode(val, data) {
  586. console.log(val, data, 'ssss')
  587. if (val) {
  588. return '<div class="imgs">' +
  589. '<img src="../img/vice.png" alt="" onclick="inputPwd(' +data.CallRecordsId+ ')" item="' + val + '" />' +
  590. '</div>';
  591. } else {
  592. return '';
  593. }
  594. }
  595. //编号
  596. function Code(val, row, index) {
  597. return index + 1;
  598. }
  599. function inputPwd(val) {
  600. layer.prompt({
  601. formType: 1,
  602. title: '请输入密码',
  603. }, function(value, index, elem) {
  604. if(!value) {
  605. layer.msg('请输入密码')
  606. return
  607. }
  608. $.ajax({
  609. type: "get",
  610. url: huayi.config.callcenter_url + "Callrecords/GetCallFilePath", //获取数据的Servlet地址,
  611. async: true,
  612. dataType: "json",
  613. data: {
  614. CallRecordsId: val,
  615. password: value,
  616. token: $.cookie("token")
  617. },
  618. success: function(res) {
  619. if(res.state.toLowerCase() === "success") {
  620. layer.close(index);
  621. helper.luyin.view(null, res.data)
  622. }
  623. }
  624. });
  625. });
  626. }
  627. // 电话号码
  628. function formatterCallNum(val, row) {
  629. var phoneNumber
  630. if (val.length === 12) {
  631. phoneNumber = val.slice(1)
  632. } else if (val.length === 13) {
  633. phoneNumber = val.slice(2)
  634. } else {
  635. phoneNumber = val
  636. }
  637. return '<div class="imgs" ><p class="" onclick="viewList(\'' + phoneNumber + '\')" >' + phoneNumber +
  638. '</p></div>';
  639. }
  640. function phoneTableHtml(val, row){
  641. return '<a onclick="phoneTableClick(this ,\'' +row.CallNumberShow+'\')"> ' + val + '</a>'
  642. }
  643. // 查看列表
  644. function viewList(phoneNumber) {
  645. // layer.open({
  646. // type: 2,
  647. // content: "./CallRecordList.html?phoneNumber=" + phoneNumber, //iframe的url,no代表不显示滚动条
  648. // title: '通话记录',
  649. // area: ['90%', '90%'], //宽高
  650. // });
  651. }
  652. //方向呼出
  653. function callType(val) {
  654. if (val == 0) {
  655. return '<div class="imgs">呼入</div>';
  656. } else {
  657. return '<div class="imgs">呼出</div>';
  658. }
  659. }
  660. //满意度
  661. function MYD(val, row) {
  662. var html = '';
  663. switch (val + '') {
  664. case '0':
  665. html = '未评价';
  666. break;
  667. case '1':
  668. html = '满意';
  669. if (row.CallState == 0) {
  670. html = '';
  671. }
  672. break;
  673. case '2':
  674. html = '一般';
  675. break;
  676. case '3':
  677. html = '不满意';
  678. break;
  679. }
  680. return html;
  681. }
  682. function states(val, row) {
  683. if (val == 0) { //CallState
  684. if(row.CallType == 0){ //呼入
  685. if(row.Business==1||row.Business==4){
  686. return '<div class="imgs">自主完成</div>';
  687. }else if( !row.UserCode){
  688. return '<div class="imgs">主动放弃</div>';
  689. }else{
  690. return '<div class="imgs">未接通</div>';
  691. }
  692. }else{
  693. return '<div class="imgs">未接通</div>';
  694. }
  695. } else if (val == 1) {
  696. return '<div class="imgs">已接通</div>';
  697. } else if (val == 2) {
  698. return '<div class="imgs">接通未达</div>';
  699. }
  700. }
  701. function ActionType(val) {
  702. if (val == 2) {
  703. return '<div class="imgs">转移</div>';
  704. } else if (val == 3) {
  705. return '<div class="imgs">三方通话</div>';
  706. } else {
  707. return '<div class="imgs">正常通话</div>';
  708. }
  709. }
  710. //处理
  711. function isDeal(val) {
  712. if (val == 0) {
  713. return '<div >未处理</div>';
  714. } else {
  715. return '<div >已处理</div>';
  716. }
  717. }
  718. function ftime(val) {
  719. if (val) {
  720. return helper.DateFormat.getFormatTime(val);
  721. } else {
  722. return '';
  723. }
  724. }
  725. // 回拨
  726. function formatCallback(val, row) {
  727. if (val) {
  728. return "已回拨";
  729. } else if(row.CallType ===0&&row.CallState ===0){
  730. return "未回拨";
  731. }
  732. }
  733. //格式化工单号
  734. function formatWorkOrderNum(val, row) {
  735. if (row.CallType ===0) {
  736. if (val == null || val == '') {
  737. var callNumber = decryptFn(row.CallNumberShow)
  738. return '<a class="xg" onclick="addWorkOrder(\'' + row.CallRecordsId + '\',\'' +callNumber+'\')" title="添加工单">添加工单</a>';
  739. } else {
  740. return '<a class="xg" onclick="ckxq(\'' + val + '\')" title="点击查看工单详情">' + val + '</a>';
  741. }
  742. }
  743. }
  744. function formatBusinessType(val, row){
  745. if (row.CallType ===0) {
  746. if (val ===2) {
  747. return '市民咨询'
  748. } else if (val ===3) {
  749. return '营商环境'
  750. } else if (val ===4) {
  751. return '市长信箱'
  752. }else {
  753. return '市民咨询'
  754. }
  755. }
  756. }
  757. // 操作
  758. function operationFormatter(val, row) {
  759. // CallType ===0呼入 row.CallState ===0 未接通
  760. if (row.CallState ===0&&row.CallType ===0) {
  761. if (row.Callback) {
  762. return '<a class="operation" onclick="callbackRecord(\'' + row.CallId + '\')" title="">回拨记录</a>'
  763. } else {
  764. var callNumber = decryptFn(row.CallNumberShow)
  765. return '<a class="operation" onclick="backDial(\'' + callNumber + '\',\'' + row.CallId +'\')" title="">回拨</a>'
  766. }
  767. }
  768. }
  769. //获取通话类型
  770. function GetCallTypeList() {
  771. $.getJSON(huayi.config.callcenter_url + 'Dictionary/GetDicValueListById', {
  772. id: 45,
  773. token: $.cookie("token")
  774. }, function (result) {
  775. if (result.state.toLowerCase() == "success") {
  776. var callTypeList = result.data;
  777. $('#callType').empty();
  778. $('#callType').append('<option value="">全部</option>');
  779. $(callTypeList).each(function (i, n) {
  780. $('#callType').append('<option value="' + n.F_ValueId + '">' + n.F_Value +
  781. '</option>');
  782. })
  783. }
  784. })
  785. }
  786. // 坐席
  787. function getAgentGroup(obj) {
  788. obj.empty();
  789. obj.append(
  790. '<option selected="selected" value="">请选择</option>'
  791. );
  792. $.getJSON(
  793. huayi.config.callcenter_url +
  794. "Dictionary/GetDicValueListById", {
  795. token: $.cookie("token"),
  796. id: 2522,
  797. },
  798. function (data) {
  799. if (data.state.toLowerCase() == "success") {
  800. var content = data.data;
  801. $(content).each(function (i, n) {
  802. $(
  803. "<option value='" +
  804. n.F_Value +
  805. "'>" +
  806. n.F_Value +
  807. "</option>"
  808. ).appendTo(obj);
  809. });
  810. }
  811. }
  812. );
  813. }
  814. // 查看工单详情
  815. function ckxq(str) {
  816. if (str) {
  817. layer.open({
  818. type: 2,
  819. content: "../CommonHtml/WorkDatil.html?wid=" + str, //iframe的url,no代表不显示滚动条
  820. title: '工单详情',
  821. area: ['100%', '100%'], //宽高
  822. });
  823. }
  824. }
  825. // 添加工单
  826. function addWorkOrder(CallRecordsId,CallNumber) {
  827. if (CallRecordsId) {
  828. layer.open({
  829. type: 2,
  830. content: "../Appeal/AddAppeal.html?CallRecordsId=" + CallRecordsId+"&callerNum="+CallNumber+"&isaddorder=1" , //iframe的url,no代表不显示滚动条
  831. title: '工单详情',
  832. area: ['100%', '100%'], //宽高
  833. });
  834. }
  835. }
  836. // 外呼
  837. function backDial(phoneNumber, callId) {
  838. layer.open({
  839. type: 2,
  840. content: "./callbackRecordOldList.html?phoneNumber=" + phoneNumber, //iframe的url,no代表不显示滚动条
  841. title: '历史工单和记录',
  842. area: ['100%', '100%'], //宽高
  843. });
  844. console.log(phoneNumber)
  845. $.ajax({
  846. type: "get",
  847. url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
  848. async: true,
  849. dataType: "json",
  850. data: {
  851. token: $.cookie("token"),
  852. phone: phoneNumber,
  853. },
  854. success: function (result) {
  855. if (result.state.toLowerCase() == "success") {
  856. console.log(result.data.phone)
  857. top.callbackState = true
  858. var guid = uuid();
  859. top.obj.Type = "MakeCall";
  860. top.obj.DestinationNumber = result.data.phone;
  861. top.obj.Header = result.data.fix;
  862. top.obj.TaskType = "2"; //0:拨号外呼;1:未接来电外呼;2:回访外呼
  863. top.obj.TaskPhoneID = callId; //回访的电话ID
  864. top.obj.TaskID = guid; //回访记录编号
  865. top.obj.Callee = phoneNumber; //被叫号码
  866. top.obj.Caller = $.cookie("extno"); //操作人分机号
  867. top.Send();
  868. }
  869. },
  870. });
  871. }
  872. // 更新外呼记录前
  873. function beforeUpdateCallOut (callId) {
  874. $.ajax({
  875. type: "get",
  876. url: huayi.config.callcenter_url + "Callrecords/UpdateCallback",
  877. async: true,
  878. dataType: "json",
  879. data: {
  880. token: $.cookie("token"),
  881. callid: callId,
  882. },
  883. success: function (result) {
  884. if (result.state.toLowerCase() == "success") {
  885. }
  886. },
  887. });
  888. }
  889. // 更新外呼记录后
  890. function afterUpdateCallOut (callId) {
  891. $.ajax({
  892. type: "get",
  893. url: huayi.config.callcenter_url + "Callrecords/UpdateCallbackid",
  894. async: true,
  895. dataType: "json",
  896. data: {
  897. token: $.cookie("token"),
  898. callid: callId,
  899. p_callid: callId,
  900. },
  901. success: function (result) {
  902. if (result.state.toLowerCase() == "success") {
  903. }
  904. },
  905. });
  906. }
  907. // 回拨记录
  908. function callbackRecord(callId) {
  909. layer.open({
  910. type: 2,
  911. content: "./callbackRecordList.html?callId=" + callId, //iframe的url,no代表不显示滚动条
  912. title: '回拨记录',
  913. area: ['100%', '100%'], //宽高
  914. });
  915. }
  916. //电话类别
  917. function getPhoneType(obj) {
  918. obj.empty();
  919. $("<option value=''>请选择</option>").appendTo(obj);
  920. $.ajax({
  921. type: "get",
  922. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  923. dataType: "json",
  924. async: true,
  925. data: {
  926. "token": $.cookie("token"),
  927. id: 2498,
  928. },
  929. success: function (data) {
  930. if (data.state.toLowerCase() == "success") {
  931. var content = data.data;
  932. $(content).each(function (i, n) {
  933. $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  934. .appendTo(obj);
  935. })
  936. }
  937. }
  938. });
  939. }
  940. $(".exportFile").click(function () {
  941. var usercode_ = $("#seat").val(); //坐席
  942. var usercodeID = "";
  943. if (usercode_ != null) {
  944. $(usercode_).each(function (i, n) {
  945. var obj1 = "";
  946. obj1 = n + ",";
  947. usercodeID += obj1;
  948. });
  949. usercodeID = usercodeID.slice(0, -1);
  950. } else {
  951. usercodeID = "";
  952. }
  953. var usercode = usercodeID;
  954. var phone = $("#tel").val();
  955. var starttime = $("#start").val();
  956. var endtime = $("#end").val();
  957. var callstate = $("#ss_hjzt").val();
  958. var calltype = $("#ss_hcfx").val();
  959. var type = $("#callType").val(); //type=通话类型
  960. var actiontype = $("#ss_HJLX").val(); //呼叫类型
  961. var tasktype = $("#sf_hf").val(); //呼叫类型
  962. var extnumber = $("#extnumber").val();
  963. var phoneType = $("#phoneType").val();
  964. var islike = $("#islike").val(); // 查询类型
  965. var notconnected = $("#notconnected").val(); // 未接通
  966. var workOrderId = $("#worknumber").val()
  967. var url = huayi.config.callcenter_url + "Callrecords/GetList?token=" + $.cookie("token") +
  968. "&isdc=1";
  969. url += "&usercode=" + usercode + "&phone=" + phone + "&starttime=" + starttime + "&endtime=" +
  970. endtime + "&callstate=" + callstate + "&calltype=" + calltype + "&type=" + type +
  971. "&actiontype=" + actiontype + "&tasktype=" + tasktype + "&extnumber=" + extnumber +
  972. "&phoneType=" + phoneType + "&islike=" + islike + "&notconnected=" + notconnected+"&workOrderId="+ workOrderId;
  973. window.location.href = url;
  974. })
  975. document.onkeydown = function (e) { // 回车提交表单
  976. var theEvent = window.event || e;
  977. var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
  978. if (code == 13) {
  979. initTable();
  980. }
  981. }
  982. </script>
  983. </body>
  984. </html>