Bez popisu

CallRecord.html 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  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. </style>
  128. </head>
  129. <body class="gray-bg">
  130. <div class="wrapper wrapper-content animated fadeInRight">
  131. <div class="daoHang clearfix">
  132. <div class="dhLeft">
  133. <sapn><i class="syIcon"></i>位置:<a href="javaScript:;" id="ReIndex">首页</a>&gt;<a
  134. href="javaScript:;">话务管理</a>&gt;<a href="" class="nowPosition">通话记录查询</a></sapn>
  135. </div>
  136. <div class="dhRight">
  137. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  138. </div>
  139. </div>
  140. <div class="th-box">
  141. <div class="box_content">
  142. <table id="sqzx" style="width: 100%" border="0">
  143. <tbody>
  144. <tr>
  145. <th>电话号码:</th>
  146. <td><input id="tel" class="form-control" type="text" /></td>
  147. <th>呼叫状态:</th>
  148. <td>
  149. <select id="ss_hjzt" class="callstate form-control">
  150. <option value="">全部</option>
  151. <option value="0">未接通</option>
  152. <option value="1">已接通</option>
  153. <option value="2">接通未达</option>
  154. <option value="3">主动放弃</option>
  155. </select>
  156. </td>
  157. <th><span class="nameJustified">分机号:</span></th>
  158. <td>
  159. <input id="extnumber" class="form-control" type="text" />
  160. </td>
  161. <th>呼出方向:</th>
  162. <td>
  163. <select id="ss_hcfx" class="form-control calltype">
  164. <option value="">全部</option>
  165. <option value="0">呼入</option>
  166. <option value="1">呼出</option>
  167. <option value="3">呼出回访</option>
  168. </select>
  169. </td>
  170. </tr>
  171. <tr>
  172. <th>呼叫类型:</th>
  173. <td>
  174. <select id="ss_HJLX" class="form-control calltype">
  175. <option value="">全部</option>
  176. <option value="1">正常通话</option>
  177. <option value="2">转移</option>
  178. <option value="3">三方通话</option>
  179. </select>
  180. </td>
  181. <th>是否回访:</th>
  182. <td>
  183. <select id="sf_hf" class="form-control calltype">
  184. <option value="">全部</option>
  185. <option value="2">是</option>
  186. <option value="0">否</option>
  187. </select>
  188. </td>
  189. <th>受话坐席:</th>
  190. <td>
  191. <select id="seat" class="selectpicker show-tick form-control" multiple
  192. data-live-search="true">
  193. <!-- <option value="">全部</option> -->
  194. </select>
  195. </td>
  196. <th>通话类型:</th>
  197. <td>
  198. <select id="callType" class="form-control callstate">
  199. <option value="">全部</option>
  200. </select>
  201. </td>
  202. </tr>
  203. <tr>
  204. <th>电话类别:</th>
  205. <td>
  206. <select class="form-control" id="phoneType">
  207. <option value="">请选择</option>
  208. </select>
  209. </td>
  210. <th>查询类型:</th>
  211. <td>
  212. <select id="islike" class="form-control" name="select">
  213. <option value="1">
  214. 模糊查询
  215. </option>
  216. <option value="0">
  217. 精确查询
  218. </option>
  219. </select>
  220. </td>
  221. <th><span class="nameJustified">时间:</span></th>
  222. <td colspan="3">
  223. <input id="start" class="photo x-color laydate-icon" type="text" autocomplete="off" /> -
  224. <input id="end" class="photo x-color laydate-icon" type="text" autocomplete="off" />
  225. <a class="sc_btn Ss">搜索</a>
  226. <a class="sc_btn exportFile">导出</a>
  227. </td>
  228. </tr>
  229. <tr>
  230. <th><span class="nameJustified">坐席组:</span></th>
  231. <td>
  232. <select id="agentGroup" class="form-control" name="select">
  233. <option value="">
  234. 请选择
  235. </option>
  236. </select>
  237. </td>
  238. <th><span class="nameJustified">未接通:</span></th>
  239. <td>
  240. <select id="notconnected" class="form-control" name="select">
  241. <option value="">
  242. 请选择
  243. </option>
  244. <option value="1">
  245. 呼入至今未接通
  246. </option>
  247. </select>
  248. </td>
  249. </tr>
  250. <!-- <tr>
  251. <td colspan="2">
  252. </td>
  253. </tr> -->
  254. </tbody>
  255. </table>
  256. </div>
  257. <!-- <ul> -->
  258. <!-- <a class="sc_btn Ss Block">搜索</a> -->
  259. <!--<li>
  260. <a class="sc_btn Gj Block">高级搜索</a>
  261. </li>-->
  262. <!-- </ul> -->
  263. </div>
  264. <div style="width: 100%;padding: 10px;">
  265. <table id="list" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  266. <thead>
  267. <tr>
  268. <th data-field="" data-align="center" data-formatter="Code">编号</th>
  269. <th data-field="CallNumber" data-align="center" data-formatter="formatterCallNum">电话号码</th>
  270. <th data-field="FilePath" data-formatter="setCode" data-align="center">录音</th>
  271. <th data-field="CallType" data-formatter="callType" data-align="center">呼叫方向</th>
  272. <!--<th data-field="DealType" data-formatter="dealType" data-align="center">是否回访</th>-->
  273. <th data-field="CallState" data-formatter="states" data-align="center">呼叫状态</th>
  274. <th data-field="ActionType" data-formatter="ActionType" data-align="center">呼叫类型</th>
  275. <th data-field="TypeName" data-align="center">通话类型</th>
  276. <th data-field="MYD" data-align="center" data-formatter="MYD">满意度</th>
  277. <th data-field="UserCode" data-align="center">坐席工号</th>
  278. <th data-field="UserName1" data-align="center">坐席姓名</th>
  279. <th data-field="ExtNumber" data-align="center">分机号</th>
  280. <th data-field="BeginTime" data-align="center">开始时间</th>
  281. <th data-field="TalkStartTime" data-align="center">通话开始时间</th>
  282. <th data-field="TalkEndTime" data-align="center">通话结束时间</th>
  283. <th data-field="EndTime" data-align="center">结束时间</th>
  284. <th data-field="TalkLongTime" data-align="center" data-formatter="ftime">通话时长</th>
  285. <th data-field="RingLongTime" data-align="center" data-formatter="ftime">振铃时长</th>
  286. <th data-field="LongTime" data-align="center" data-formatter="ftime">总时长</th>
  287. <th data-field="PhoneType" data-align="center">电话类别</th>
  288. <th data-field="WorkOrderId" data-align="center" data-formatter="formatWorkOrderNum">工单号</th>
  289. <!-- <th data-field="CallId" data-align="center" data-formatter="operationFormatter">操作</th> -->
  290. </tr>
  291. </thead>
  292. </table>
  293. <!--高级搜索框-->
  294. </div>
  295. </div>
  296. <!--下载框-->
  297. <div class="t-shade">
  298. <div class="shade_k">
  299. <div class="shade_title">
  300. <span>录音播放<srong class="cknum"></srong></span>
  301. <span class="setwin"><a>x</a></span>
  302. </div>
  303. <div class="shade_content">
  304. <div class="Ly_box audiojs">
  305. </div>
  306. <div class="boxCon LY_box">
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. <script src="../js/bootstrap-select.js"></script>
  312. <script src="../My97DatePicker/WdatePicker.js"></script>
  313. <script src="../css/laydate/laydate.js"></script>
  314. <!-- <script src="../js/main.js"></script> -->
  315. <script src="../js/guid.js"></script>
  316. <script>
  317. var stype = 1;
  318. var seatlist = [];
  319. $(document).ready(function () {
  320. laydate.skin('blue');
  321. laydate({
  322. elem: '#start',
  323. event: 'focus',
  324. istime: true,
  325. format: 'YYYY-MM-DD hh:mm:ss'
  326. });
  327. laydate({
  328. elem: '#end',
  329. event: 'focus',
  330. istime: true,
  331. format: 'YYYY-MM-DD hh:mm:ss'
  332. });
  333. /*获取选中行对象*/
  334. $('#list').on("click-row.bs.table", function (e, row, ele) {
  335. $('.success').removeClass('success'); //去除之前选中的行的,选中样式
  336. $(ele).addClass('success'); //添加当前选中的 success样式用于区别
  337. });
  338. $(".setwin").click(function () {
  339. $(".t-shade").removeClass("cx");
  340. $('audio')[0].pause();
  341. });
  342. //获取通话类型
  343. GetCallTypeList();
  344. //获取坐席
  345. getAgentGroup($("#agentGroup"));
  346. //获取坐席
  347. $.getJSON(huayi.config.callcenter_url + "UserAccount/GetSeatList", {
  348. token: $.cookie("token")
  349. }, function (result) {
  350. if (result.state.toLowerCase() == "success") {
  351. seatlist = result.data;
  352. bindseat($("#seat"));
  353. }
  354. });
  355. // 电话类别
  356. getPhoneType($("#phoneType"));
  357. //搜索
  358. $(".Ss").click(function () {
  359. stype = 1;
  360. initTable();
  361. });
  362. //高级搜索s
  363. $(".Gj").click(function () {
  364. var a = "WdatePicker()";
  365. layer.open({
  366. type: 1,
  367. title: '高级搜索',
  368. area: ['50%', '55%'], //宽高
  369. content: ' <div class="gjsu"><ul class="nav nav-tabs">' +
  370. '<li class="active"><a href="#">参数信息</a></li> ' +
  371. '</ul>' +
  372. '<ul>' +
  373. '<li>' +
  374. '<label for="">电话号码:</label>' +
  375. '<input type="text" id="ss_tel" class="photo"/>' +
  376. '</li>' +
  377. '<li>' +
  378. '<label for="">坐席工号:</label>' +
  379. '<select name="" id="ss_seat" class="selects usercode"></select>' +
  380. '</li>' +
  381. '<li>' +
  382. '<label for="">开始时间:</label>' +
  383. ' <input type="text" id="ss_kssj" class="photo"onClick="' + a + '"/>' +
  384. '</li>' +
  385. '<li>' +
  386. '<label for="">呼叫状态:</label>' +
  387. '<select id="ss_hjzt" class="selects callstate">' +
  388. '<option value="">全部</option>' +
  389. '<option value="0">未接通</option>' +
  390. '<option value="1">已接通</option>' +
  391. '<option value="2">黑名单拒接</option>' +
  392. '</select>' +
  393. '</li>' +
  394. '<li>' +
  395. '<label for="">结束时间:</label>' +
  396. '<input type="text" id="ss_jssj" class="photo" onClick="' + a + '"/>' +
  397. '</li>' +
  398. '<li>' +
  399. '<label for="">呼出方向:</label>' +
  400. '<select id="ss_hcfx" class=" selects calltype">' +
  401. '<option value="">全部</option>' +
  402. '<option value="0">呼入</option>' +
  403. '<option value="1">呼出</option>' +
  404. '</select>' +
  405. '</li>' +
  406. '</ul>' +
  407. '<div class=" add_time tc">' +
  408. '<button type="button" class="btn sc_btn Block " id="tc">保&nbsp;&nbsp;存</button>' +
  409. '</div>' +
  410. '</div>'
  411. });
  412. bindseat($("#ss_seat"));
  413. //获取通话记录列表
  414. $("#tc").click(function () {
  415. stype = 2;
  416. initTable();
  417. var index = layer.index; //获取当前弹层的索引号
  418. layer.close(index); //关闭当前弹层
  419. });
  420. });
  421. initTable();
  422. })
  423. function bindseat(obj) {
  424. obj.empty();
  425. obj.append('<option value="">全部</option>');
  426. $(seatlist).each(function (i, n) {
  427. obj.append('<option value="' + n.F_UserCode + '">' + n.F_UserName + '</option>');
  428. obj.selectpicker({
  429. noneSelectedText: '请选择' //默认显示内容
  430. });
  431. obj.selectpicker('refresh');
  432. })
  433. }
  434. /*
  435. 监听坐席数据变化
  436. 选中全部时候,取消其他选项
  437. clickedIndex:索引
  438. isSelected:是否选中
  439. previousValue:选中前的值
  440. */
  441. $("#seat").on("changed.bs.select", function (event, clickedIndex, isSelected, previousValue) {
  442. if (previousValue.indexOf("全部") == -1) {
  443. if (clickedIndex == 0) {
  444. $("#seat").selectpicker("deselectAll");
  445. $("#seat").val("");
  446. $("#seat").selectpicker('refresh');
  447. }
  448. } else {
  449. if (clickedIndex != 0) {
  450. $("#seat").selectpicker("deselectAll");
  451. $("#seat").val("");
  452. $("#seat").selectpicker('refresh');
  453. }
  454. }
  455. })
  456. function initTable() {
  457. //先销毁表格
  458. $('#list').bootstrapTable('destroy');
  459. //初始化表格,动态从服务器加载数据
  460. $("#list").bootstrapTable({
  461. method: "get", //使用get请求到服务器获取数据
  462. url: huayi.config.callcenter_url + "Callrecords/GetList", //获取数据的Servlet地址
  463. contentType: "application/x-www-form-urlencoded",
  464. striped: true, //表格显示条纹
  465. pagination: true, //启动分页
  466. pageSize: 10, //每页显示的记录数
  467. pageNumber: 1, //当前第几页
  468. pageList: [10, 20, 50, 100], //记录数可选列表
  469. search: false, //是否启用查询
  470. showColumns: false, //显示下拉框勾选要显示的列
  471. showRefresh: false, //显示刷新按钮
  472. sidePagination: "server", //表示服务端请求
  473. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  474. //设置为limit可以获取limit, offset, search, sort, order
  475. queryParamsType: "undefined",
  476. queryParams: function queryParams(params) { //设置查询参数
  477. var param = {
  478. page: params.pageNumber,
  479. pagesize: params.pageSize,
  480. token: $.cookie("token")
  481. };
  482. var usercode_ = $("#seat").val(); //坐席
  483. var usercodeID = "";
  484. if (usercode_ != null) {
  485. $(usercode_).each(function (i, n) {
  486. var obj1 = "";
  487. obj1 = n + ",";
  488. usercodeID += obj1;
  489. });
  490. usercodeID = usercodeID.slice(0, -1);
  491. } else {
  492. usercodeID = "";
  493. }
  494. if (stype == '1') {
  495. param.usercode = usercodeID;
  496. param.phone = $("#tel").val().replace(/\s+/g, "");
  497. param.starttime = $("#start").val();
  498. param.endtime = $("#end").val();
  499. param.callstate = $("#ss_hjzt").val();
  500. param.calltype = $("#ss_hcfx").val();
  501. param.type = $("#callType").val(); //type=通话类型
  502. param.actiontype = $("#ss_HJLX").val(); //呼叫类型
  503. param.tasktype = $("#sf_hf").val(); //呼叫类型
  504. param.extnumber = $("#extnumber").val().replace(/\s+/g, "");
  505. param.phoneType = $("#phoneType").val();
  506. param.islike = $("#islike").val(); // 查询类型
  507. param.group = $("#agentGroup").val(); // 坐席组
  508. param.notconnected = $("#notconnected").val(); // 未接通
  509. } else if (stype == '2') {
  510. param.usercode = $("#ss_seat").val();
  511. param.tel = $("#ss_tel").val();
  512. param.callstate = $("#ss_hjzt").val();
  513. param.calltype = $("#ss_hcfx").val();
  514. param.starttime = $("#ss_kssj").val();
  515. param.endtime = $("#ss_jssj").val();
  516. param.type = $("#callType").val(); //type=通话类型
  517. param.actiontype = $("#ss_HJLX").val(); //呼叫类型
  518. param.tasktype = $("#sf_hf").val(); //呼叫类型
  519. param.extnumber = $("#extnumber").val().replace(/\s+/g, "");
  520. param.phoneType = $("#phoneType").val();
  521. param.islike = $("#islike").val(); // 查询类型
  522. param.group = $("#agentGroup").val(); // 坐席组
  523. param.notconnected = $("#notconnected").val(); // 未接通
  524. }
  525. return param;
  526. },
  527. onLoadSuccess: function () { //加载成功时执行
  528. //layer.msg("加载成功");
  529. },
  530. onLoadError: function () { //加载失败时执行
  531. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  532. }
  533. });
  534. }
  535. //音频
  536. function setCode(val) {
  537. if (val) {
  538. return '<div class="imgs">' +
  539. '<img src="../img/vice.png" alt="" onclick="helper.luyin.view(this)" item="' + val + '" />' +
  540. '</div>';
  541. } else {
  542. return '';
  543. }
  544. }
  545. //编号
  546. function Code(val, row, index) {
  547. return index + 1;
  548. }
  549. // 电话号码
  550. function formatterCallNum(val, row) {
  551. if (val.length === 12) {
  552. return val.slice(1)
  553. } else if (val.length === 13) {
  554. return val.slice(2)
  555. } else {
  556. return val
  557. }
  558. }
  559. //方向呼出
  560. function callType(val) {
  561. if (val == 0) {
  562. return '<div class="imgs">呼入</div>';
  563. } else {
  564. return '<div class="imgs">呼出</div>';
  565. }
  566. }
  567. //满意度
  568. function MYD(val, row) {
  569. var html = '';
  570. switch (val + '') {
  571. case '0':
  572. html = '未评价';
  573. break;
  574. case '1':
  575. html = '满意';
  576. if (row.CallState == 0) {
  577. html = '';
  578. }
  579. break;
  580. case '2':
  581. html = '一般';
  582. break;
  583. case '3':
  584. html = '不满意';
  585. break;
  586. }
  587. return html;
  588. }
  589. function states(val, row) {
  590. if (val == 0) {
  591. if (row.CallType == 0 && !row.UserCode) {
  592. return '<div class="imgs">主动放弃</div>';
  593. } else {
  594. return '<div class="imgs">未接通</div>';
  595. }
  596. } else if (val == 1) {
  597. return '<div class="imgs">已接通</div>';
  598. } else if (val == 2) {
  599. return '<div class="imgs">接通未达</div>';
  600. }
  601. }
  602. function ActionType(val) {
  603. if (val == 2) {
  604. return '<div class="imgs">转移</div>';
  605. } else if (val == 3) {
  606. return '<div class="imgs">三方通话</div>';
  607. } else {
  608. return '<div class="imgs">正常通话</div>';
  609. }
  610. }
  611. ////回访
  612. //function dealType(val) {
  613. // if (val == 1) {
  614. // return '<div >已回访</div>';
  615. // } else {
  616. // return '';
  617. // }
  618. //}
  619. //处理
  620. function isDeal(val) {
  621. if (val == 0) {
  622. return '<div >未处理</div>';
  623. } else {
  624. return '<div >已处理</div>';
  625. }
  626. }
  627. function ftime(val) {
  628. if (val) {
  629. return helper.DateFormat.getFormatTime(val);
  630. } else {
  631. return '';
  632. }
  633. }
  634. //格式化工单号
  635. function formatWorkOrderNum(val, row) {
  636. if (val == null) {
  637. val = '-'
  638. } else {
  639. return '<a class="xg" onclick="ckxq(\'' + val + '\')" title="点击查看工单详情">' + val + '</a>';
  640. }
  641. }
  642. // 操作
  643. function operationFormatter(val, row) {
  644. if (String(row.Callback) === "1") {
  645. return "-"
  646. } else {
  647. beforeUpdateCallOut(row.CallId);
  648. return '<a class="operation" onclick="backDial(\'' + row.CallNumber + '\')" title="">回拨</a>';
  649. }
  650. }
  651. //获取通话类型
  652. function GetCallTypeList() {
  653. $.getJSON(huayi.config.callcenter_url + 'Dictionary/GetDicValueListById', {
  654. id: 45,
  655. token: $.cookie("token")
  656. }, function (result) {
  657. if (result.state.toLowerCase() == "success") {
  658. var callTypeList = result.data;
  659. $('#callType').empty();
  660. $('#callType').append('<option value="">全部</option>');
  661. $(callTypeList).each(function (i, n) {
  662. $('#callType').append('<option value="' + n.F_ValueId + '">' + n.F_Value +
  663. '</option>');
  664. })
  665. }
  666. })
  667. }
  668. // 坐席
  669. function getAgentGroup(obj) {
  670. obj.empty();
  671. obj.append(
  672. '<option selected="selected" value="">请选择</option>'
  673. );
  674. $.getJSON(
  675. huayi.config.callcenter_url +
  676. "Dictionary/GetDicValueListById", {
  677. token: $.cookie("token"),
  678. id: 2522,
  679. },
  680. function (data) {
  681. if (data.state.toLowerCase() == "success") {
  682. var content = data.data;
  683. $(content).each(function (i, n) {
  684. $(
  685. "<option value='" +
  686. n.F_Value +
  687. "'>" +
  688. n.F_Value +
  689. "</option>"
  690. ).appendTo(obj);
  691. });
  692. }
  693. }
  694. );
  695. }
  696. // 查看工单详情
  697. function ckxq(str) {
  698. if (str) {
  699. layer.open({
  700. type: 2,
  701. content: "../CommonHtml/WorkDatil.html?wid=" + str, //iframe的url,no代表不显示滚动条
  702. title: '工单详情',
  703. area: ['100%', '100%'], //宽高
  704. });
  705. }
  706. }
  707. // 外呼
  708. function backDial(phoneNumber) {
  709. $.ajax({
  710. type: "get",
  711. url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
  712. async: true,
  713. dataType: "json",
  714. data: {
  715. token: $.cookie("token"),
  716. phone: phoneNumber,
  717. },
  718. success: function (result) {
  719. if (result.state.toLowerCase() == "success") {
  720. var guid = uuid();
  721. top.obj.Type = "MakeCall";
  722. top.obj.DestinationNumber = result.data.phone;
  723. top.obj.Header = result.data.fix;
  724. // obj.TaskType = "0"; //0:拨号外呼;1:未接来电外呼;2:回访外呼
  725. top.obj.TaskPhoneID = ""; //回访的电话ID
  726. top.obj.TaskID = guid; //回访记录编号
  727. top.obj.Callee = phoneNumber; //被叫号码
  728. top.obj.Caller = $.cookie("extno"); //操作人分机号
  729. top.Send();
  730. }
  731. },
  732. });
  733. }
  734. // 更新外呼记录前
  735. function beforeUpdateCallOut (callid) {
  736. $.ajax({
  737. type: "get",
  738. url: huayi.config.callcenter_url + "Callrecords/UpdateCallback",
  739. async: true,
  740. dataType: "json",
  741. data: {
  742. token: $.cookie("token"),
  743. callid: callid,
  744. },
  745. success: function (result) {
  746. if (result.state.toLowerCase() == "success") {
  747. }
  748. },
  749. });
  750. }
  751. // 更新外呼记录后
  752. // function afterUpdateCallOut (callid) {
  753. // $.ajax({
  754. // type: "get",
  755. // url: huayi.config.callcenter_url + "Callrecords/UpdateCallback",
  756. // async: true,
  757. // dataType: "json",
  758. // data: {
  759. // token: $.cookie("token"),
  760. // callid: callid,
  761. // p_callid: callid,
  762. // },
  763. // success: function (result) {
  764. // if (result.state.toLowerCase() == "success") {
  765. // }
  766. // },
  767. // });
  768. // }
  769. //电话类别
  770. function getPhoneType(obj) {
  771. obj.empty();
  772. $("<option value=''>请选择</option>").appendTo(obj);
  773. $.ajax({
  774. type: "get",
  775. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  776. dataType: "json",
  777. async: true,
  778. data: {
  779. "token": $.cookie("token"),
  780. id: 2498,
  781. },
  782. success: function (data) {
  783. if (data.state.toLowerCase() == "success") {
  784. var content = data.data;
  785. $(content).each(function (i, n) {
  786. $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  787. .appendTo(obj);
  788. })
  789. }
  790. }
  791. });
  792. }
  793. $(".exportFile").click(function () {
  794. var usercode_ = $("#seat").val(); //坐席
  795. var usercodeID = "";
  796. if (usercode_ != null) {
  797. $(usercode_).each(function (i, n) {
  798. var obj1 = "";
  799. obj1 = n + ",";
  800. usercodeID += obj1;
  801. });
  802. usercodeID = usercodeID.slice(0, -1);
  803. } else {
  804. usercodeID = "";
  805. }
  806. var usercode = usercodeID;
  807. var phone = $("#tel").val();
  808. var starttime = $("#start").val();
  809. var endtime = $("#end").val();
  810. var callstate = $("#ss_hjzt").val();
  811. var calltype = $("#ss_hcfx").val();
  812. var type = $("#callType").val(); //type=通话类型
  813. var actiontype = $("#ss_HJLX").val(); //呼叫类型
  814. var tasktype = $("#sf_hf").val(); //呼叫类型
  815. var extnumber = $("#extnumber").val();
  816. var phoneType = $("#phoneType").val();
  817. var islike = $("#islike").val(); // 查询类型
  818. var url = huayi.config.callcenter_url + "Callrecords/GetList?token=" + $.cookie("token") +
  819. "&isdc=1";
  820. url += "&usercode=" + usercode + "&phone=" + phone + "&starttime=" + starttime + "&endtime=" +
  821. endtime + "&callstate=" + callstate + "&calltype=" + calltype + "&type=" + type +
  822. "&actiontype=" + actiontype + "&tasktype=" + tasktype + "&extnumber=" + extnumber +
  823. "&phoneType=" + phoneType + "&islike=" + islike;
  824. window.location.href = url;
  825. })
  826. document.onkeydown = function (e) { // 回车提交表单
  827. var theEvent = window.event || e;
  828. var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
  829. if (code == 13) {
  830. initTable();
  831. }
  832. }
  833. </script>
  834. </body>
  835. </html>