Nessuna descrizione

SeatMonitor.html 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link href="../css/init.css" rel="stylesheet" />
  7. <script src="../Script/Common/huayi.load.js"></script>
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <title>坐席管理</title>
  10. <style>
  11. body {
  12. background-color: #EEEEEE;
  13. font-family: "微软雅黑";
  14. background-color: #fdfdfd;
  15. }
  16. ul li {
  17. float: left;
  18. }
  19. .zx-title {
  20. background-color: #2e4050;
  21. color: #FFFFFF;
  22. padding: 5px 20px;
  23. border-top-left-radius: 5px;
  24. border-top-right-radius: 5px;
  25. letter-spacing: 3px;
  26. }
  27. ul {
  28. overflow: hidden;
  29. }
  30. ul li {
  31. list-style: none;
  32. }
  33. .fenxian {
  34. list-style: none;
  35. width: 136px;
  36. padding: 0;
  37. height: 10px;
  38. }
  39. .fenxian li {
  40. width: 50%;
  41. list-style: none;
  42. height: 8px;
  43. float: left;
  44. }
  45. .left_red {
  46. background: #65c2ca;
  47. }
  48. .rg_green {
  49. background: #F95A83;
  50. }
  51. .zx-box {
  52. background: #F5F5F5;
  53. /*height: 200px;*/
  54. border-radius: 5px;
  55. box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  56. margin-bottom: 30px;
  57. overflow: hidden;
  58. }
  59. .m-b {
  60. margin-bottom: 0;
  61. }
  62. /*坐席数量*/
  63. .zt-content ul {
  64. width: 100%;
  65. overflow: hidden;
  66. padding-left: 0px;
  67. padding-top: 20px;
  68. }
  69. .zt-content ul li {
  70. width: 40%;
  71. font-size: 14px;
  72. float: left;
  73. margin-bottom: 20px;
  74. /*text-align: center;*/
  75. margin-left: 10%;
  76. }
  77. .zt-content ul li i {
  78. display: inline-block;
  79. width: 20px;
  80. height: 21px;
  81. vertical-align: middle;
  82. margin-right: 10px;
  83. background: url(../img/zuoxiIcon.png) no-repeat;
  84. }
  85. .hc {
  86. background-position: 0 0 !important;
  87. }
  88. .ml {
  89. background-position: 0 -24px !important;
  90. }
  91. .kx {
  92. background-position: 0 -68px !important;
  93. }
  94. .zl {
  95. background-position: 0 -93px !important;
  96. }
  97. .qc {
  98. background-position: 0 -116px !important;
  99. }
  100. .lx {
  101. background-position: 0 -138px !important;
  102. }
  103. .hh {
  104. background-position: 0 -46px !important;
  105. }
  106. .th{
  107. background: url(../img/thz.png) no-repeat!important; }
  108. /*坐席监控*/
  109. .bg_person {
  110. background: url(../img/bg-person.png)no-repeat;
  111. width: 65px;
  112. height: 65px;
  113. text-align: -webkit-center;
  114. background-position: center center;
  115. margin: 0 auto;
  116. }
  117. .zx_people {
  118. padding: 0;
  119. }
  120. .zx_content ul:after {
  121. content: "";
  122. display: block;
  123. clear: both;
  124. }
  125. .people_list p {
  126. margin-bottom: 5px !important;
  127. }
  128. .zx_content ul {
  129. height: 800px;
  130. overflow: auto;
  131. }
  132. .zx_content ul li {
  133. width: 14%;
  134. text-align: center;
  135. float: left;
  136. cursor: pointer;
  137. }
  138. .zx_content ul li > div {
  139. width: 100%;
  140. position: relative;
  141. }
  142. .zx_content i {
  143. display: block;
  144. height: 22px;
  145. width: 20px;
  146. background: url(../img/zuoxiIcon.png) no-repeat;
  147. position:relative;
  148. right: -25px;
  149. top: 25px;
  150. }
  151. /*坐席状态*/
  152. .ztsm {
  153. width: 100%;
  154. overflow: hidden;
  155. padding-left: 0px;
  156. padding-top: 20px;
  157. }
  158. .ztsm b {
  159. padding: 3px 15px;
  160. border-radius: 10px;
  161. color: #FFFFFF;
  162. }
  163. .ztsm2 ul li {
  164. width: 33%;
  165. font-size: 14px;
  166. float: left;
  167. margin-bottom: 25px;
  168. text-align: center;
  169. cursor: pointer;
  170. }
  171. .zx {
  172. /*background: #989898;*/
  173. background: #61b960;
  174. }
  175. .jt {
  176. background: #5ed7b7;
  177. }
  178. .dj {
  179. background: #bed75b;
  180. }
  181. .qca {
  182. background: #d75e7c;
  183. }
  184. .lj {
  185. background: #5daed8;
  186. }
  187. .qc {
  188. background: #d8988f;
  189. }
  190. .kqc {
  191. background: #44af3c;
  192. }
  193. .jqc {
  194. background: #d91e06;
  195. }
  196. .dis {
  197. background: #989898;
  198. }
  199. /*坐席弹屏*/
  200. .zx_photo {
  201. padding: 10px;
  202. }
  203. .zx_photo p {
  204. text-align: center;
  205. }
  206. .zx-box_ul > ul {
  207. padding-left: 0px;
  208. }
  209. .zx-box_ul > ul > li {
  210. width: 33% !important;
  211. padding: 22px 13px;
  212. text-align: -webkit-center;
  213. font-size: 15px;
  214. cursor: pointer;
  215. }
  216. .zx-box_ul > ul > li b {
  217. padding: 7px 15px;
  218. border-radius: 10px;
  219. color: #FFFFFF;
  220. }
  221. .zxtp {
  222. position: absolute;
  223. display: none;
  224. }
  225. .shows {
  226. display: block;
  227. }
  228. .hides {
  229. display: block;
  230. }
  231. </style>
  232. </head>
  233. <body>
  234. <div class="wrapper wrapper-content animated fadeInRight">
  235. <div class="daoHang clearfix">
  236. <div class="dhLeft">
  237. <sapn><i class="syIcon"></i>位置:<a href="javaScript:;" id="ReIndex">首页</a>&gt;<a href="javaScript:;">话务管理</a>&gt;<a href="" style="color: #000;">坐席管理</a></sapn>
  238. </div>
  239. <div class="dhRight">
  240. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  241. </div>
  242. </div>
  243. <div class="row" style="margin-top: 20px;">
  244. <!--左边-->
  245. <div class="col-sm-9">
  246. <div class="zx_top">
  247. <span class="zx-title">坐席监控系统</span>
  248. <ul class="fenxian">
  249. <li class="left_red"></li>
  250. <li class="rg_green"></li>
  251. </ul>
  252. </div>
  253. <div class="zx_content">
  254. <ul class="zx_people"></ul>
  255. </div>
  256. </div>
  257. <!--右边-->
  258. <div class="col-sm-3">
  259. <div class="zx_top">
  260. <span class="zx-title">状态说明</span>
  261. <ul class="m-b fenxian" style="width:104px;">
  262. <li class="left_red"></li>
  263. <li class="rg_green"></li>
  264. </ul>
  265. <div class="zx-box">
  266. <div class="ztsm2 w_3">
  267. <ul class="ztsm">
  268. <li><b class="zx">置闲</b></li>
  269. <li><b class="jt">监听</b></li>
  270. <li><b class="dj">代接</b></li>
  271. <li><b class="qca">强插</b></li>
  272. <li><b class="lj">拦截</b></li>
  273. <li><b class="qc">强拆</b></li>
  274. <li style="width: 50%;"><b class="kqc">开始监测</b></li>
  275. <li style="width: 50%;"><b class="jqc dis">停止监测</b></li>
  276. </ul>
  277. </div>
  278. </div>
  279. </div>
  280. <div class="zx_top">
  281. <span class="zx-title">实时统计</span>
  282. <ul class="m-b fenxian" style="width:104px;">
  283. <li class="left_red"></li>
  284. <li class="rg_green"></li>
  285. </ul>
  286. <div class="zx-box">
  287. <div class="zt-content w_5">
  288. <ul class="tjcount">
  289. <li>登录坐席:<b>0</b></li>
  290. <li>离线人数:<b>0</b></li>
  291. <li>空闲人数:<b>0</b></li>
  292. <li>通话人数:<b>0</b></li>
  293. <li>系统呼入:<b>0</b></li>
  294. <li>置忙坐席:<b>0</b></li>
  295. <!--<li>签出坐席:<b>100</b></li>-->
  296. <li>全部坐席:<b>0</b></li>
  297. </ul>
  298. </div>
  299. </div>
  300. </div>
  301. <div class="zx_top">
  302. <span class="zx-title">状态说明</span>
  303. <ul class="m-b fenxian" style="width:104px;">
  304. <li class="left_red"></li>
  305. <li class="rg_green"></li>
  306. </ul>
  307. <div class="zx-box">
  308. <div class="zt-content w_5">
  309. <ul>
  310. <li><i class="hc"></i>呼出</li>
  311. <li><i class="ml"></i>忙绿</li>
  312. <li><i class="kx"></i>空闲</li>
  313. <li><i class="zl"></i>振铃</li>
  314. <!--<li><i class="qc"></i>&nbsp;签出</li>-->
  315. <li><i class="lx"></i>离线</li>
  316. <li><i class="hh"></i>话后处理</li>
  317. <li><i class="th"></i>通话中</li>
  318. </ul>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. <!--坐席弹屏-->
  326. <div class="zxT zxtp">
  327. <div class="zx-box" style="width: 400px;">
  328. <div class="zx_photo row zx_content">
  329. <div style="width: 400px;">
  330. <div class="bg_person"> <i class="lx"></i></div>
  331. <p>
  332. <span>工号:</span>
  333. <span class="g_nums"></span>
  334. </p>
  335. <p>
  336. <span>姓名:</span>
  337. <span class="g_names"></span>
  338. </p>
  339. </div>
  340. </div>
  341. <div class="zx-box_ul row">
  342. <ul>
  343. <li><b class="zx" item="ForceAgentState">置闲</b></li>
  344. <li><b class="jt" item="Listen">监听</b></li>
  345. <li><b class="dj" item="Instead">代接</b></li>
  346. <li><b class="qca" item="Insert">强插</b></li>
  347. <li><b class="lj" item="Intercept">拦截</b></li>
  348. <li><b class="qc" item="Break">强拆</b></li>
  349. </ul>
  350. </div>
  351. </div>
  352. </div>
  353. <script>
  354. var user;
  355. $(document).ready(function () {
  356. //获取坐席列表
  357. $.getJSON(huayi.config.callcenter_url+'SeatMonitoring/getlist', { "token": $.cookie("token") }, function (result) {
  358. if (result.state.toLowerCase() == "success") {
  359. $(".zx_people").empty();
  360. user = result.data;
  361. $(".tjcount li").eq(6).find("b").text(user.length);
  362. $(user).each(function (i, n) {
  363. var html = '<li class="people_list ' + n.F_WorkNumber + '">'
  364. + '<div>'
  365. + ' <div class="bg_person">'
  366. + ' <i class="lx" zx_item="0" xl_item="0"></i>'
  367. + ' </div>'
  368. + ' <p>'
  369. + ' <span>工号:</span>'
  370. + ' <span class="g-num">' + n.F_WorkNumber + '</span>'
  371. + ' </p>'
  372. + ' <p>'
  373. + ' <span>&nbsp;&nbsp;姓名:</span>'
  374. + ' <span class="g-name">' + n.F_UserName + '</span>'
  375. + ' </p>'
  376. + '</div>'
  377. + '</li>';
  378. $(html).appendTo($(".zx_people")).click(function (event) {
  379. event.stopPropagation();
  380. if (top.obj.AgentID != $(this).find(".g-num").text()) {
  381. $(".zxtp .g_nums").text($(this).find(".g-num").text());
  382. $(".zxtp .g_names").text($(this).find(".g-name").text());
  383. $(".zxtp i").removeClass().addClass($(this).find("i").attr("class"));
  384. //if (!$(this).find("i").hasClass("lx")) {
  385. // Center($('.zxtp'));
  386. //}
  387. Center($('.zxtp'));
  388. UpdateSelState($(this).find("i").attr("zx_item"), $(this).find("i").attr("xl_item"));
  389. }
  390. else {
  391. layer.confirm('不能操作自己的坐席!', {
  392. btn: ['确定']
  393. });
  394. }
  395. })
  396. })
  397. }
  398. })
  399. $(".wrapper").click(function () {
  400. if (!$('.zxtp').is(":hidden")) {
  401. $('.zxtp').hide();
  402. }
  403. })
  404. //开始监测
  405. $(".kqc").click(function () {
  406. if (!$(this).hasClass("dis")) {
  407. $(user).each(function (i, n) {
  408. top.obj.Type = "SubScribe";
  409. top.obj.SubParmer = n.F_WorkNumber;
  410. top.obj.SubType = "0";//根据工号订阅坐席状态
  411. top.Send();
  412. top.obj.SubType = "1";//根据工号订阅线路状态
  413. top.Send();
  414. })
  415. //top.obj.Type = "SubScribe";
  416. //top.obj.SubParmer = "8003";
  417. //top.obj.SubType = "0";//根据工号订阅坐席状态
  418. //top.Send();
  419. //top.obj.SubType = "1";//根据工号订阅线路状态
  420. //top.Send();
  421. }
  422. })
  423. //停止监测
  424. $(".jqc").click(function () {
  425. if (!$(this).hasClass("dis")) {
  426. //$(user).each(function (i, n) {
  427. // top.obj.Type = "SubScribeCancel";
  428. // top.obj.SubParmer = n.F_WorkNumber;
  429. // top.obj.SubType = "0";//根据工号取消订阅坐席状态
  430. // top.Send();
  431. // top.obj.SubType = "1";//根据工号取消订阅线路状态
  432. // top.Send();
  433. //})
  434. top.obj.Type = "SubScribeCancel";
  435. top.obj.SubParmer = "-1";
  436. top.obj.SubType = "0";//根据工号取消订阅坐席状态
  437. top.Send();
  438. top.obj.SubType = "1";//根据工号取消订阅线路状态
  439. top.Send();
  440. }
  441. })
  442. //班长操作坐席
  443. $(".zxtp b").click(function () {
  444. if (!$(this).hasClass("dis")) {
  445. var wn = $(".zxtp .g_nums").text();
  446. var type = $(this).attr("item");
  447. top.obj.Type = type;
  448. top.obj.TargetAgentID = wn;
  449. top.Send();
  450. }
  451. })
  452. })
  453. //计算数量
  454. var tj;
  455. function tjcount() {
  456. tj = { hr: 0, tx: 0, kx: 0, lx: 0, zm: 0, dl: 0};
  457. $(".zx_people i").each(function () {
  458. var zx = $(this).attr("zx_item");
  459. var xl = $(this).attr("xl_item");
  460. switch (zx) {
  461. case "0": tj.lx = tj.lx + 1; break;//离线
  462. case "5": tj.zm = tj.zm + 1; break;//小休
  463. }
  464. switch (xl) {
  465. case "5": tj.hr = tj.hr + 1; break;//来电振铃
  466. case "6": tj.tx = tj.tx + 1; break;//通话中
  467. }
  468. if (zx == '2' && xl == '1') { tj.kx = tj.kx + 1; }//空闲
  469. if (zx != '0' && zx != '7' && xl != '0' && xl != '9') {
  470. tj.dl = tj.dl + 1;
  471. }
  472. })
  473. $(".tjcount li").eq(0).find("b").text(tj.dl);
  474. $(".tjcount li").eq(1).find("b").text(tj.lx);
  475. $(".tjcount li").eq(2).find("b").text(tj.kx);
  476. $(".tjcount li").eq(3).find("b").text(tj.tx);
  477. $(".tjcount li").eq(4).find("b").text(tj.hr);
  478. $(".tjcount li").eq(5).find("b").text(tj.zm);
  479. }
  480. /*居中*/
  481. function Center(obj) {
  482. var screenWidth = $(window).width(), screenHeight = $(window).height(); //当前浏览器窗口的 宽高
  483. var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
  484. var objLeft = (screenWidth - obj.width()) / 2;
  485. var objTop = (screenHeight - obj.height()) / 2 + scrolltop;
  486. obj.css({ left: objLeft + 'px', top: objTop + 'px' });
  487. obj.show();
  488. }
  489. //开始监测成功后
  490. function Start() {
  491. $(".kqc").addClass("dis");
  492. $(".jqc").removeClass("dis");
  493. }
  494. //停止监测成功后
  495. function Stop() {
  496. $(".jqc").addClass("dis");
  497. $(".kqc").removeClass("dis");
  498. $(".zxtp i").removeClass().addClass("lx");
  499. $(".zx_people i").removeClass().addClass("lx").attr("zx_item", "0").attr("xl_item", "0");
  500. }
  501. //坐席状态
  502. function UpdateAgentState(WorkNumber, State) {
  503. var sts = "";
  504. switch (State) {
  505. case "0": sts = "lx"; break;//离线
  506. case "1": break;//登录中
  507. case "2": sts = "kx"; break;//空闲
  508. case "3": sts = "th"; break;//通话中
  509. case "4": sts = "hh"; break;//话后处理中
  510. case "5": sts = "ml"; break;//小休
  511. case "6": sts = "zl"; break;//被请求
  512. case "7": sts = "lx"; break;//注销
  513. }
  514. var ele = $("." + WorkNumber).find("i");
  515. if (sts) {
  516. ele.removeClass().addClass(sts);
  517. }
  518. ele.attr("zx_item", State);
  519. if ($(".zxtp .g_nums").text() == WorkNumber) {
  520. if (sts) {
  521. $(".zxtp i").removeClass().addClass(sts);
  522. }
  523. UpdateSelState(State, ele.attr("xl_item"))
  524. }
  525. tjcount();
  526. }
  527. //线路状态
  528. function UpdateLineState(WorkNumber, State) {
  529. var sts = "";
  530. switch (State) {
  531. case "0": sts = "lx"; break;//分机不可用
  532. case "1": sts = "kx"; break;//空闲
  533. case "2": sts = "ml"; break;//摘机等待拨号
  534. case "3": sts = "ml"; break;//正在拨号
  535. case "4": sts = "hc"; break;//呼出振铃
  536. case "5": sts = "zl"; break;//来电振铃
  537. case "6": sts = "th"; break;//通话中
  538. case "7": sts = "ml"; break;//播放忙音中
  539. case "8": sts = "th"; break;//通话保持中
  540. case "9": break;//话机移除
  541. case "10": break;//保持/空闲
  542. case "11": break;//保持/摘机等待拨号
  543. case "12": break;//保持/正在拨号
  544. case "13": break;//保持/呼出振铃
  545. case "14": break;//保持/通话中
  546. }
  547. var ele = $("." + WorkNumber).find("i");
  548. if (sts) {
  549. ele.removeClass().addClass(sts);
  550. }
  551. ele.attr("xl_item", State);
  552. if ($(".zxtp .g_nums").text() == WorkNumber) {
  553. if (sts) {
  554. $(".zxtp i").removeClass().addClass(sts);
  555. }
  556. UpdateSelState(ele.attr("zx_item"), State)
  557. }
  558. tjcount();
  559. }
  560. //更新选中坐席的可操作
  561. function UpdateSelState(zxState, xlState) {
  562. $(".zxtp b").addClass("dis");
  563. if (zxState == '5' && xlState == '1') {
  564. $(".zxtp .zx").removeClass("dis");
  565. }
  566. if (zxState == '3' && xlState == '6') {
  567. $(".zxtp .jt").removeClass("dis");
  568. $(".zxtp .qca").removeClass("dis");
  569. $(".zxtp .qc").removeClass("dis");
  570. $(".zxtp .lj").removeClass("dis");
  571. }
  572. if (zxState == '2' && xlState == '5') {
  573. $(".zxtp .dj").removeClass("dis");
  574. }
  575. }
  576. // //浏览器窗口大小改变时
  577. // $(window).resize(function() {
  578. // screenWidth = $(window).width();
  579. // screenHeight = $(window).height();
  580. // scrolltop = $(document).scrollTop();
  581. // objLeft = (screenWidth - obj.width())/2 ;
  582. // objTop = (screenHeight - obj.height())/2 + scrolltop;
  583. // obj.css({left: objLeft + 'px', top: objTop + 'px'});
  584. // obj.fadeToggle();
  585. // });
  586. // //浏览器有滚动条时的操作、
  587. // $(window).scroll(function() {
  588. // screenWidth = $(window).width();
  589. // screenHeight = $(window).height();
  590. // scrolltop = $(document).scrollTop();
  591. // objLeft = (screenWidth - obj.width())/2 ;
  592. // objTop = (screenHeight - obj.height())/2 + scrolltop;
  593. // obj.css({left: objLeft + 'px', top: objTop + 'px'});
  594. // obj.fadeToggle();
  595. // });
  596. //# sourceURL=zx.js;
  597. </script>
  598. </body>
  599. </html>