Нет описания

CallRecord.html 40KB

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