Sin descripción

CallRecord.html 40KB

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