Sin descripción

CallRecord.html 40KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  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. </tr>
  281. </tbody>
  282. </table>
  283. </div>
  284. </div>
  285. <div style="width: 100%;padding: 10px;">
  286. <table id="list" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  287. <thead>
  288. <tr>
  289. <th data-field="" data-align="center" data-formatter="Code">编号</th>
  290. <th data-field="CallNumber" data-align="center" data-formatter="formatterCallNum">电话号码</th>
  291. <th data-field="FilePath" data-formatter="setCode" data-align="center">录音</th>
  292. <th data-field="CallType" data-formatter="callType" data-align="center">呼叫方向</th>
  293. <th data-field="CallState" data-formatter="states" data-align="center">呼叫状态</th>
  294. <th data-field="ActionType" data-formatter="ActionType" data-align="center">呼叫类型</th>
  295. <th data-field="TypeName" data-align="center">通话类型</th>
  296. <th data-field="MYD" data-align="center" data-formatter="MYD">满意度</th>
  297. <th data-field="UserCode" data-align="center">坐席工号</th>
  298. <th data-field="UserName1" data-align="center">坐席姓名</th>
  299. <th data-field="ExtNumber" data-align="center">分机号</th>
  300. <th data-field="BeginTime" data-align="center">开始时间</th>
  301. <th data-field="TalkStartTime" data-align="center">通话开始时间</th>
  302. <th data-field="TalkEndTime" data-align="center">通话结束时间</th>
  303. <th data-field="EndTime" data-align="center">结束时间</th>
  304. <th data-field="TalkLongTime" data-align="center" data-formatter="ftime">通话时长</th>
  305. <th data-field="RingLongTime" data-align="center" data-formatter="ftime">振铃时长</th>
  306. <th data-field="WaitTime" data-align="center">等待时长</th>
  307. <th data-field="LongTime" data-align="center" data-formatter="ftime">总时长</th>
  308. <th data-field="PhoneType" data-align="center">电话类别</th>
  309. <th data-field="TransferCall" data-align="center">转接号码</th>
  310. <th data-field="Business" data-align="center" data-formatter="formatBusinessType">电话方式</th>
  311. <th data-field="Callback" data-align="center" data-formatter="formatCallback">是否回拨</th>
  312. <th data-field="WorkOrderId" data-align="center" data-formatter="formatWorkOrderNum">工单号</th>
  313. <th data-field="CallId" data-align="center" data-formatter="operationFormatter">操作</th>
  314. </tr>
  315. </thead>
  316. </table>
  317. <!--高级搜索框-->
  318. </div>
  319. </div>
  320. <!--下载框-->
  321. <div class="t-shade">
  322. <div class="shade_k">
  323. <div class="shade_title">
  324. <span>录音播放<srong class="cknum"></srong></span>
  325. <span class="setwin"><a>x</a></span>
  326. </div>
  327. <div class="shade_content">
  328. <div class="Ly_box audiojs">
  329. </div>
  330. <div class="boxCon LY_box">
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. <script src="../js/bootstrap-select.js"></script>
  336. <script src="../My97DatePicker/WdatePicker.js"></script>
  337. <script src="../css/laydate/laydate.js"></script>
  338. <!-- <script src="../js/main.js"></script> -->
  339. <script src="../js/guid.js"></script>
  340. <!--<script src="../js/contabs.min.js"></script>-->
  341. <script>
  342. var stype = 1;
  343. var seatlist = [];
  344. $(document).ready(function () {
  345. laydate.skin('blue');
  346. laydate({
  347. elem: '#start',
  348. event: 'focus',
  349. istime: true,
  350. format: 'YYYY-MM-DD hh:mm:ss'
  351. });
  352. laydate({
  353. elem: '#end',
  354. event: 'focus',
  355. istime: true,
  356. format: 'YYYY-MM-DD hh:mm:ss'
  357. });
  358. /*获取选中行对象*/
  359. $('#list').on("click-row.bs.table", function (e, row, ele) {
  360. $('.success').removeClass('success'); //去除之前选中的行的,选中样式
  361. $(ele).addClass('success'); //添加当前选中的 success样式用于区别
  362. });
  363. $(".setwin").click(function () {
  364. $(".t-shade").removeClass("cx");
  365. $('audio')[0].pause();
  366. });
  367. //获取通话类型
  368. GetCallTypeList();
  369. //获取坐席
  370. getAgentGroup($("#agentGroup"));
  371. //获取坐席
  372. $.getJSON(huayi.config.callcenter_url + "UserAccount/GetSeatList", {
  373. token: $.cookie("token")
  374. }, function (result) {
  375. if (result.state.toLowerCase() == "success") {
  376. seatlist = result.data;
  377. bindseat($("#seat"));
  378. }
  379. });
  380. // 电话类别
  381. getPhoneType($("#phoneType"));
  382. //搜索
  383. $(".Ss").click(function () {
  384. stype = 1;
  385. initTable();
  386. });
  387. //高级搜索s
  388. $(".Gj").click(function () {
  389. var a = "WdatePicker()";
  390. layer.open({
  391. type: 1,
  392. title: '高级搜索',
  393. area: ['50%', '55%'], //宽高
  394. content: ' <div class="gjsu"><ul class="nav nav-tabs">' +
  395. '<li class="active"><a href="#">参数信息</a></li> ' +
  396. '</ul>' +
  397. '<ul>' +
  398. '<li>' +
  399. '<label for="">电话号码:</label>' +
  400. '<input type="text" id="ss_tel" class="photo"/>' +
  401. '</li>' +
  402. '<li>' +
  403. '<label for="">坐席工号:</label>' +
  404. '<select name="" id="ss_seat" class="selects usercode"></select>' +
  405. '</li>' +
  406. '<li>' +
  407. '<label for="">开始时间:</label>' +
  408. ' <input type="text" id="ss_kssj" class="photo"onClick="' + a + '"/>' +
  409. '</li>' +
  410. '<li>' +
  411. '<label for="">呼叫状态:</label>' +
  412. '<select id="ss_hjzt" class="selects callstate">' +
  413. '<option value="">全部</option>' +
  414. '<option value="0">未接通</option>' +
  415. '<option value="1">已接通</option>' +
  416. '<option value="2">黑名单拒接</option>' +
  417. '</select>' +
  418. '</li>' +
  419. '<li>' +
  420. '<label for="">结束时间:</label>' +
  421. '<input type="text" id="ss_jssj" class="photo" onClick="' + a + '"/>' +
  422. '</li>' +
  423. '<li>' +
  424. '<label for="">呼出方向:</label>' +
  425. '<select id="ss_hcfx" class=" selects calltype">' +
  426. '<option value="">全部</option>' +
  427. '<option value="0">呼入</option>' +
  428. '<option value="1">呼出</option>' +
  429. '</select>' +
  430. '</li>' +
  431. '</ul>' +
  432. '<div class=" add_time tc">' +
  433. '<button type="button" class="btn sc_btn Block " id="tc">保&nbsp;&nbsp;存</button>' +
  434. '</div>' +
  435. '</div>'
  436. });
  437. bindseat($("#ss_seat"));
  438. //获取通话记录列表
  439. $("#tc").click(function () {
  440. stype = 2;
  441. initTable();
  442. var index = layer.index; //获取当前弹层的索引号
  443. layer.close(index); //关闭当前弹层
  444. });
  445. });
  446. initTable();
  447. })
  448. function bindseat(obj) {
  449. obj.empty();
  450. obj.append('<option value="">全部</option>');
  451. $(seatlist).each(function (i, n) {
  452. obj.append('<option value="' + n.F_UserCode + '">' + n.F_UserName + '</option>');
  453. obj.selectpicker({
  454. noneSelectedText: '请选择' //默认显示内容
  455. });
  456. obj.selectpicker('refresh');
  457. })
  458. }
  459. /*
  460. 监听坐席数据变化
  461. 选中全部时候,取消其他选项
  462. clickedIndex:索引
  463. isSelected:是否选中
  464. previousValue:选中前的值
  465. */
  466. $("#seat").on("changed.bs.select", function (event, clickedIndex, isSelected, previousValue) {
  467. if (previousValue.indexOf("全部") == -1) {
  468. if (clickedIndex == 0) {
  469. $("#seat").selectpicker("deselectAll");
  470. $("#seat").val("");
  471. $("#seat").selectpicker('refresh');
  472. }
  473. } else {
  474. if (clickedIndex != 0) {
  475. $("#seat").selectpicker("deselectAll");
  476. $("#seat").val("");
  477. $("#seat").selectpicker('refresh');
  478. }
  479. }
  480. })
  481. function initTable() {
  482. //先销毁表格
  483. $('#list').bootstrapTable('destroy');
  484. //初始化表格,动态从服务器加载数据
  485. $("#list").bootstrapTable({
  486. method: "get", //使用get请求到服务器获取数据
  487. url: huayi.config.callcenter_url + "Callrecords/GetList", //获取数据的Servlet地址
  488. contentType: "application/x-www-form-urlencoded",
  489. striped: true, //表格显示条纹
  490. pagination: true, //启动分页
  491. pageSize: 10, //每页显示的记录数
  492. pageNumber: 1, //当前第几页
  493. pageList: [10, 20, 50, 100], //记录数可选列表
  494. search: false, //是否启用查询
  495. showColumns: false, //显示下拉框勾选要显示的列
  496. showRefresh: false, //显示刷新按钮
  497. sidePagination: "server", //表示服务端请求
  498. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  499. //设置为limit可以获取limit, offset, search, sort, order
  500. queryParamsType: "undefined",
  501. queryParams: function queryParams(params) { //设置查询参数
  502. var param = {
  503. page: params.pageNumber,
  504. pagesize: params.pageSize,
  505. token: $.cookie("token")
  506. };
  507. var usercode_ = $("#seat").val(); //坐席
  508. var usercodeID = "";
  509. if (usercode_ != null) {
  510. $(usercode_).each(function (i, n) {
  511. var obj1 = "";
  512. obj1 = n + ",";
  513. usercodeID += obj1;
  514. });
  515. usercodeID = usercodeID.slice(0, -1);
  516. } else {
  517. usercodeID = "";
  518. }
  519. var WaitTimeState = $("#WaitTimeState").val()
  520. if(WaitTimeState ==="1"){
  521. param.morewaitTime = $("#WaitTime").val(); // 大于waitTime时长
  522. } else if(WaitTimeState ==="2"){
  523. param.lesswaitTime = $("#WaitTime").val(); // 小于waitTime时长
  524. } else{
  525. param.WaitTime = $("#WaitTime").val(); // 等待时长
  526. }
  527. if (stype == '1') {
  528. param.usercode = usercodeID;
  529. param.phone = $("#tel").val().replace(/\s+/g, "");
  530. param.starttime = $("#start").val();
  531. param.endtime = $("#end").val();
  532. param.callstate = $("#ss_hjzt").val();
  533. param.calltype = $("#ss_hcfx").val();
  534. param.type = $("#callType").val(); //type=通话类型
  535. param.actiontype = $("#ss_HJLX").val(); //呼叫类型
  536. param.tasktype = $("#sf_hf").val(); //呼叫类型
  537. param.extnumber = $("#extnumber").val().replace(/\s+/g, "");
  538. param.phoneType = $("#phoneType").val();
  539. param.islike = $("#islike").val(); // 查询类型
  540. param.group = $("#agentGroup").val(); // 坐席组
  541. param.notconnected = $("#notconnected").val(); // 未接通
  542. param.callback = $("#callback").val(); // 是否回拨
  543. param.myd = $("#myd").val()
  544. param.Business = $("#Business").val()
  545. } else if (stype == '2') {
  546. param.usercode = $("#ss_seat").val();
  547. param.tel = $("#ss_tel").val();
  548. param.callstate = $("#ss_hjzt").val();
  549. param.calltype = $("#ss_hcfx").val();
  550. param.starttime = $("#ss_kssj").val();
  551. param.endtime = $("#ss_jssj").val();
  552. param.type = $("#callType").val(); //type=通话类型
  553. param.actiontype = $("#ss_HJLX").val(); //呼叫类型
  554. param.tasktype = $("#sf_hf").val(); //呼叫类型
  555. param.extnumber = $("#extnumber").val().replace(/\s+/g, "");
  556. param.phoneType = $("#phoneType").val();
  557. param.islike = $("#islike").val(); // 查询类型
  558. param.group = $("#agentGroup").val(); // 坐席组
  559. param.notconnected = $("#notconnected").val(); // 未接通
  560. param.callback = $("#callback").val(); // 是否回拨
  561. param.myd = $("#myd").val()
  562. param.Business = $("#Business").val()
  563. }
  564. return param;
  565. },
  566. onLoadSuccess: function () { //加载成功时执行
  567. //layer.msg("加载成功");
  568. },
  569. onLoadError: function () { //加载失败时执行
  570. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  571. }
  572. });
  573. }
  574. //音频
  575. function setCode(val) {
  576. if (val) {
  577. return '<div class="imgs">' +
  578. '<img src="../img/vice.png" alt="" onclick="helper.luyin.view(this)" item="' + val + '" />' +
  579. '</div>';
  580. } else {
  581. return '';
  582. }
  583. }
  584. //编号
  585. function Code(val, row, index) {
  586. return index + 1;
  587. }
  588. // 电话号码
  589. function formatterCallNum(val, row) {
  590. var phoneNumber
  591. if (val.length === 12) {
  592. phoneNumber = val.slice(1)
  593. } else if (val.length === 13) {
  594. phoneNumber = val.slice(2)
  595. } else {
  596. phoneNumber = val
  597. }
  598. return '<div class="imgs" ><p class="" onclick="viewList(\'' + phoneNumber + '\')" >' + phoneNumber +
  599. '</p></div>';
  600. }
  601. // 查看列表
  602. // function viewList(phoneNumber) {
  603. // layer.open({
  604. // type: 2,
  605. // content: "./CallRecordList.html?phoneNumber=" + phoneNumber, //iframe的url,no代表不显示滚动条
  606. // title: '通话记录',
  607. // area: ['90%', '90%'], //宽高
  608. // });
  609. // }
  610. //方向呼出
  611. function callType(val) {
  612. if (val == 0) {
  613. return '<div class="imgs">呼入</div>';
  614. } else {
  615. return '<div class="imgs">呼出</div>';
  616. }
  617. }
  618. //满意度
  619. function MYD(val, row) {
  620. var html = '';
  621. switch (val + '') {
  622. case '0':
  623. html = '未评价';
  624. break;
  625. case '1':
  626. html = '满意';
  627. if (row.CallState == 0) {
  628. html = '';
  629. }
  630. break;
  631. case '2':
  632. html = '一般';
  633. break;
  634. case '3':
  635. html = '不满意';
  636. break;
  637. }
  638. return html;
  639. }
  640. function states(val, row) {
  641. if (val == 0) { //CallState
  642. if(row.CallType == 0){ //呼入
  643. if(row.Business==1||row.Business==4){
  644. return '<div class="imgs">自主完成</div>';
  645. }else if( !row.UserCode){
  646. return '<div class="imgs">主动放弃</div>';
  647. }else{
  648. return '<div class="imgs">未接通</div>';
  649. }
  650. }else{
  651. return '<div class="imgs">未接通</div>';
  652. }
  653. } else if (val == 1) {
  654. return '<div class="imgs">已接通</div>';
  655. } else if (val == 2) {
  656. return '<div class="imgs">接通未达</div>';
  657. }
  658. }
  659. function ActionType(val) {
  660. if (val == 2) {
  661. return '<div class="imgs">转移</div>';
  662. } else if (val == 3) {
  663. return '<div class="imgs">三方通话</div>';
  664. } else {
  665. return '<div class="imgs">正常通话</div>';
  666. }
  667. }
  668. //处理
  669. function isDeal(val) {
  670. if (val == 0) {
  671. return '<div >未处理</div>';
  672. } else {
  673. return '<div >已处理</div>';
  674. }
  675. }
  676. function ftime(val) {
  677. if (val) {
  678. return helper.DateFormat.getFormatTime(val);
  679. } else {
  680. return '';
  681. }
  682. }
  683. // 回拨
  684. function formatCallback(val, row) {
  685. if (val) {
  686. return "已回拨";
  687. } else if(row.CallType ===0&&row.CallState ===0){
  688. return "未回拨";
  689. }
  690. }
  691. //格式化工单号
  692. function formatWorkOrderNum(val, row) {
  693. if (row.CallType ===0) {
  694. if (val == null || val == '') {
  695. return '<a class="xg" onclick="addWorkOrder(\'' + row.CallRecordsId + '\',\'' +row.CallNumber+'\')" title="添加工单">添加工单</a>';
  696. } else {
  697. return '<a class="xg" onclick="ckxq(\'' + val + '\')" title="点击查看工单详情">' + val + '</a>';
  698. }
  699. }
  700. }
  701. function formatBusinessType(val, row){
  702. if (row.CallType ===0) {
  703. if (val ===2) {
  704. return '市民咨询'
  705. } else if (val ===3) {
  706. return '营商环境'
  707. } else if (val ===4) {
  708. return '市长信箱'
  709. }else {
  710. return '市民咨询'
  711. }
  712. }
  713. }
  714. // 操作
  715. function operationFormatter(val, row) {
  716. // CallType ===0呼入 row.CallState ===0 未接通
  717. if (row.CallState ===0&&row.CallType ===0) {
  718. if (row.Callback) {
  719. return '<a class="operation" onclick="callbackRecord(\'' + row.CallId + '\')" title="">回拨记录</a>'
  720. } else {
  721. return '<a class="operation" onclick="backDial(\'' + row.CallNumber + '\',\'' + row.CallId +'\')" title="">回拨</a>'
  722. }
  723. }
  724. }
  725. //获取通话类型
  726. function GetCallTypeList() {
  727. $.getJSON(huayi.config.callcenter_url + 'Dictionary/GetDicValueListById', {
  728. id: 45,
  729. token: $.cookie("token")
  730. }, function (result) {
  731. if (result.state.toLowerCase() == "success") {
  732. var callTypeList = result.data;
  733. $('#callType').empty();
  734. $('#callType').append('<option value="">全部</option>');
  735. $(callTypeList).each(function (i, n) {
  736. $('#callType').append('<option value="' + n.F_ValueId + '">' + n.F_Value +
  737. '</option>');
  738. })
  739. }
  740. })
  741. }
  742. // 坐席
  743. function getAgentGroup(obj) {
  744. obj.empty();
  745. obj.append(
  746. '<option selected="selected" value="">请选择</option>'
  747. );
  748. $.getJSON(
  749. huayi.config.callcenter_url +
  750. "Dictionary/GetDicValueListById", {
  751. token: $.cookie("token"),
  752. id: 2522,
  753. },
  754. function (data) {
  755. if (data.state.toLowerCase() == "success") {
  756. var content = data.data;
  757. $(content).each(function (i, n) {
  758. $(
  759. "<option value='" +
  760. n.F_Value +
  761. "'>" +
  762. n.F_Value +
  763. "</option>"
  764. ).appendTo(obj);
  765. });
  766. }
  767. }
  768. );
  769. }
  770. // 查看工单详情
  771. function ckxq(str) {
  772. if (str) {
  773. layer.open({
  774. type: 2,
  775. content: "../CommonHtml/WorkDatil.html?wid=" + str, //iframe的url,no代表不显示滚动条
  776. title: '工单详情',
  777. area: ['100%', '100%'], //宽高
  778. });
  779. }
  780. }
  781. // 添加工单
  782. function addWorkOrder(CallRecordsId,CallNumber) {
  783. if (CallRecordsId) {
  784. layer.open({
  785. type: 2,
  786. content: "../Appeal/AddAppeal.html?CallRecordsId=" + CallRecordsId+"&callerNum="+CallNumber , //iframe的url,no代表不显示滚动条
  787. title: '工单详情',
  788. area: ['100%', '100%'], //宽高
  789. });
  790. }
  791. }
  792. // 外呼
  793. function backDial(phoneNumber, callId) {
  794. $.ajax({
  795. type: "get",
  796. url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
  797. async: true,
  798. dataType: "json",
  799. data: {
  800. token: $.cookie("token"),
  801. phone: "15838094023",
  802. },
  803. success: function (result) {
  804. if (result.state.toLowerCase() == "success") {
  805. top.callbackState = true
  806. var guid = uuid();
  807. top.obj.Type = "MakeCall";
  808. top.obj.DestinationNumber = result.data.phone;
  809. top.obj.Header = result.data.fix;
  810. top.obj.TaskType = "2"; //0:拨号外呼;1:未接来电外呼;2:回访外呼
  811. top.obj.TaskPhoneID = callId; //回访的电话ID
  812. top.obj.TaskID = guid; //回访记录编号
  813. top.obj.Callee = phoneNumber; //被叫号码
  814. top.obj.Caller = $.cookie("extno"); //操作人分机号
  815. top.Send();
  816. }
  817. },
  818. });
  819. }
  820. // 更新外呼记录前
  821. function beforeUpdateCallOut (callId) {
  822. $.ajax({
  823. type: "get",
  824. url: huayi.config.callcenter_url + "Callrecords/UpdateCallback",
  825. async: true,
  826. dataType: "json",
  827. data: {
  828. token: $.cookie("token"),
  829. callid: callId,
  830. },
  831. success: function (result) {
  832. if (result.state.toLowerCase() == "success") {
  833. }
  834. },
  835. });
  836. }
  837. // 更新外呼记录后
  838. function afterUpdateCallOut (callId) {
  839. $.ajax({
  840. type: "get",
  841. url: huayi.config.callcenter_url + "Callrecords/UpdateCallbackid",
  842. async: true,
  843. dataType: "json",
  844. data: {
  845. token: $.cookie("token"),
  846. callid: callId,
  847. p_callid: callId,
  848. },
  849. success: function (result) {
  850. if (result.state.toLowerCase() == "success") {
  851. }
  852. },
  853. });
  854. }
  855. // 回拨记录
  856. function callbackRecord(callId) {
  857. layer.open({
  858. type: 2,
  859. content: "./callbackRecordList.html?callId=" + callId, //iframe的url,no代表不显示滚动条
  860. title: '回拨记录',
  861. area: ['100%', '100%'], //宽高
  862. });
  863. }
  864. //电话类别
  865. function getPhoneType(obj) {
  866. obj.empty();
  867. $("<option value=''>请选择</option>").appendTo(obj);
  868. $.ajax({
  869. type: "get",
  870. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  871. dataType: "json",
  872. async: true,
  873. data: {
  874. "token": $.cookie("token"),
  875. id: 2498,
  876. },
  877. success: function (data) {
  878. if (data.state.toLowerCase() == "success") {
  879. var content = data.data;
  880. $(content).each(function (i, n) {
  881. $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  882. .appendTo(obj);
  883. })
  884. }
  885. }
  886. });
  887. }
  888. $(".exportFile").click(function () {
  889. var usercode_ = $("#seat").val(); //坐席
  890. var usercodeID = "";
  891. if (usercode_ != null) {
  892. $(usercode_).each(function (i, n) {
  893. var obj1 = "";
  894. obj1 = n + ",";
  895. usercodeID += obj1;
  896. });
  897. usercodeID = usercodeID.slice(0, -1);
  898. } else {
  899. usercodeID = "";
  900. }
  901. var usercode = usercodeID;
  902. var phone = $("#tel").val();
  903. var starttime = $("#start").val();
  904. var endtime = $("#end").val();
  905. var callstate = $("#ss_hjzt").val();
  906. var calltype = $("#ss_hcfx").val();
  907. var type = $("#callType").val(); //type=通话类型
  908. var actiontype = $("#ss_HJLX").val(); //呼叫类型
  909. var tasktype = $("#sf_hf").val(); //呼叫类型
  910. var extnumber = $("#extnumber").val();
  911. var phoneType = $("#phoneType").val();
  912. var islike = $("#islike").val(); // 查询类型
  913. var notconnected = $("#notconnected").val(); // 未接通
  914. var url = huayi.config.callcenter_url + "Callrecords/GetList?token=" + $.cookie("token") +
  915. "&isdc=1";
  916. url += "&usercode=" + usercode + "&phone=" + phone + "&starttime=" + starttime + "&endtime=" +
  917. endtime + "&callstate=" + callstate + "&calltype=" + calltype + "&type=" + type +
  918. "&actiontype=" + actiontype + "&tasktype=" + tasktype + "&extnumber=" + extnumber +
  919. "&phoneType=" + phoneType + "&islike=" + islike + "&notconnected=" + notconnected;
  920. window.location.href = url;
  921. })
  922. document.onkeydown = function (e) { // 回车提交表单
  923. var theEvent = window.event || e;
  924. var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
  925. if (code == 13) {
  926. initTable();
  927. }
  928. }
  929. </script>
  930. </body>
  931. </html>