Açıklama Yok

CallRecord.html 41KB

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