Нет описания

CallRecord.html 37KB

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