Нет описания

CallRecord.html 40KB

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