PingAnYeXianSZCG_Web 前端代码

SeatMonitor.html 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  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 id="ReIndex">首页</a>&gt;<a href="javaScript:;">话务管理</a>&gt;<a href="" style="color: #000;">坐席管理</a></sapn>
  238. </div>
  239. </div>
  240. <div class="row" style="margin-top: 20px;">
  241. <!--左边-->
  242. <div class="col-sm-9">
  243. <div class="zx_top">
  244. <span class="zx-title">坐席监控系统</span>
  245. <ul class="fenxian">
  246. <li class="left_red"></li>
  247. <li class="rg_green"></li>
  248. </ul>
  249. </div>
  250. <div class="zx_content">
  251. <ul class="zx_people"></ul>
  252. </div>
  253. </div>
  254. <!--右边-->
  255. <div class="col-sm-3">
  256. <div class="zx_top">
  257. <span class="zx-title">状态说明</span>
  258. <ul class="m-b fenxian" style="width:104px;">
  259. <li class="left_red"></li>
  260. <li class="rg_green"></li>
  261. </ul>
  262. <div class="zx-box">
  263. <div class="ztsm2 w_3">
  264. <ul class="ztsm">
  265. <li><b class="zx">置闲</b></li>
  266. <li><b class="jt">监听</b></li>
  267. <li><b class="dj">代接</b></li>
  268. <li><b class="qca">强插</b></li>
  269. <li><b class="lj">拦截</b></li>
  270. <li><b class="qc">强拆</b></li>
  271. <li style="width: 50%;"><b class="kqc">开始监测</b></li>
  272. <li style="width: 50%;"><b class="jqc dis">停止监测</b></li>
  273. </ul>
  274. </div>
  275. </div>
  276. </div>
  277. <div class="zx_top">
  278. <span class="zx-title">实时统计</span>
  279. <ul class="m-b fenxian" style="width:104px;">
  280. <li class="left_red"></li>
  281. <li class="rg_green"></li>
  282. </ul>
  283. <div class="zx-box">
  284. <div class="zt-content w_5">
  285. <ul class="tjcount">
  286. <li>登录坐席:<b>0</b></li>
  287. <li>离线人数:<b>0</b></li>
  288. <li>空闲人数:<b>0</b></li>
  289. <li>通话人数:<b>0</b></li>
  290. <li>系统呼入:<b>0</b></li>
  291. <li>置忙坐席:<b>0</b></li>
  292. <!--<li>签出坐席:<b>100</b></li>-->
  293. <li>全部坐席:<b>0</b></li>
  294. </ul>
  295. </div>
  296. </div>
  297. </div>
  298. <div class="zx_top">
  299. <span class="zx-title">状态说明</span>
  300. <ul class="m-b fenxian" style="width:104px;">
  301. <li class="left_red"></li>
  302. <li class="rg_green"></li>
  303. </ul>
  304. <div class="zx-box">
  305. <div class="zt-content w_5">
  306. <ul>
  307. <li><i class="hc"></i>呼出</li>
  308. <li><i class="ml"></i>忙绿</li>
  309. <li><i class="kx"></i>空闲</li>
  310. <li><i class="zl"></i>振铃</li>
  311. <!--<li><i class="qc"></i>&nbsp;签出</li>-->
  312. <li><i class="lx"></i>离线</li>
  313. <li><i class="hh"></i>话后处理</li>
  314. <li><i class="th"></i>通话中</li>
  315. </ul>
  316. </div>
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. <!--坐席弹屏-->
  323. <div class="zxT zxtp">
  324. <div class="zx-box" style="width: 400px;">
  325. <div class="zx_photo row zx_content">
  326. <div style="width: 400px;">
  327. <div class="bg_person"> <i class="lx" ></i></div>
  328. <p>
  329. <span>工号:</span>
  330. <span class="g_nums"></span>
  331. </p>
  332. <p>
  333. <span>姓名:</span>
  334. <span class="g_names"></span>
  335. </p>
  336. </div>
  337. </div>
  338. <div class="zx-box_ul row">
  339. <ul>
  340. <li><b class="zx" item="ForceAgentState">置闲</b></li>
  341. <li><b class="jt" item="Listen">监听</b></li>
  342. <li><b class="dj" item="Instead">代接</b></li>
  343. <li><b class="qca" item="Insert">强插</b></li>
  344. <li><b class="lj" item="Intercept">拦截</b></li>
  345. <li><b class="qc" item="Break">强拆</b></li>
  346. </ul>
  347. </div>
  348. </div>
  349. </div>
  350. <script>
  351. var user;
  352. $(document).ready(function () {
  353. //获取坐席列表
  354. $.getJSON(huayi.config.callcenter_url+'SeatMonitoring/getlist', { "token": $.cookie("token") }, function (result) {
  355. if (result.state.toLowerCase() == "success") {
  356. $(".zx_people").empty();
  357. user = result.data;
  358. $(".tjcount li").eq(6).find("b").text(user.length);
  359. $(user).each(function (i, n) {
  360. var html = '<li class="people_list ' + n.F_WorkNumber + '">'
  361. + '<div>'
  362. + ' <div class="bg_person">'
  363. + ' <i class="lx" zx_item="0" xl_item="0"></i>'
  364. + '</div>'
  365. + ' <p>'
  366. + ' <span>工号:</span>'
  367. + ' <span class="g-num">' + n.F_WorkNumber + '</span>'
  368. + ' </p>'
  369. + ' <p>'
  370. + ' <span>&nbsp;&nbsp;姓名:</span>'
  371. + ' <span class="g-name">' + n.F_UserName + '</span>'
  372. + ' </p>'
  373. + '</div>'
  374. + '</li>';
  375. $(html).appendTo($(".zx_people")).click(function (event) {
  376. event.stopPropagation();
  377. if (top.obj.AgentID != $(this).find(".g-num").text()) {
  378. $(".zxtp .g_nums").text($(this).find(".g-num").text());
  379. $(".zxtp .g_names").text($(this).find(".g-name").text());
  380. $(".zxtp i").removeClass().addClass($(this).find("i").attr("class"));
  381. //if (!$(this).find("i").hasClass("lx")) {
  382. // Center($('.zxtp'));
  383. //}
  384. Center($('.zxtp'));
  385. UpdateSelState($(this).find("i").attr("zx_item"), $(this).find("i").attr("xl_item"));
  386. }
  387. else {
  388. layer.confirm('不能操作自己的坐席!', {
  389. btn: ['确定']
  390. });
  391. }
  392. })
  393. })
  394. }
  395. })
  396. $(".wrapper").click(function () {
  397. if (!$('.zxtp').is(":hidden")) {
  398. $('.zxtp').hide();
  399. }
  400. })
  401. //开始监测
  402. $(".kqc").click(function () {
  403. if (!$(this).hasClass("dis")) {
  404. $(user).each(function (i, n) {
  405. top.obj.Type = "SubScribe";
  406. top.obj.SubParmer = n.F_WorkNumber;
  407. top.obj.SubType = "0";//根据工号订阅坐席状态
  408. top.Send();
  409. top.obj.SubType = "1";//根据工号订阅线路状态
  410. top.Send();
  411. })
  412. //top.obj.Type = "SubScribe";
  413. //top.obj.SubParmer = "8003";
  414. //top.obj.SubType = "0";//根据工号订阅坐席状态
  415. //top.Send();
  416. //top.obj.SubType = "1";//根据工号订阅线路状态
  417. //top.Send();
  418. }
  419. })
  420. //停止监测
  421. $(".jqc").click(function () {
  422. if (!$(this).hasClass("dis")) {
  423. //$(user).each(function (i, n) {
  424. // top.obj.Type = "SubScribeCancel";
  425. // top.obj.SubParmer = n.F_WorkNumber;
  426. // top.obj.SubType = "0";//根据工号取消订阅坐席状态
  427. // top.Send();
  428. // top.obj.SubType = "1";//根据工号取消订阅线路状态
  429. // top.Send();
  430. //})
  431. top.obj.Type = "SubScribeCancel";
  432. top.obj.SubParmer = "-1";
  433. top.obj.SubType = "0";//根据工号取消订阅坐席状态
  434. top.Send();
  435. top.obj.SubType = "1";//根据工号取消订阅线路状态
  436. top.Send();
  437. }
  438. })
  439. //班长操作坐席
  440. $(".zxtp b").click(function () {
  441. if (!$(this).hasClass("dis")) {
  442. var wn = $(".zxtp .g_nums").text();
  443. var type = $(this).attr("item");
  444. top.obj.Type = type;
  445. top.obj.TargetAgentID = wn;
  446. top.Send();
  447. }
  448. })
  449. })
  450. //计算数量
  451. var tj;
  452. function tjcount() {
  453. tj = { hr: 0, tx: 0, kx: 0, lx: 0, zm: 0, dl: 0};
  454. $(".zx_people i").each(function () {
  455. var zx = $(this).attr("zx_item");
  456. var xl = $(this).attr("xl_item");
  457. switch (zx) {
  458. case "0": tj.lx = tj.lx + 1; break;//离线
  459. case "5": tj.zm = tj.zm + 1; break;//小休
  460. }
  461. switch (xl) {
  462. case "5": tj.hr = tj.hr + 1; break;//来电振铃
  463. case "6": tj.tx = tj.tx + 1; break;//通话中
  464. }
  465. if (zx == '2' && xl == '1') { tj.kx = tj.kx + 1; }//空闲
  466. if (zx != '0' && zx != '7' && xl != '0' && xl != '9') {
  467. tj.dl = tj.dl + 1;
  468. }
  469. })
  470. $(".tjcount li").eq(0).find("b").text(tj.dl);
  471. $(".tjcount li").eq(1).find("b").text(tj.lx);
  472. $(".tjcount li").eq(2).find("b").text(tj.kx);
  473. $(".tjcount li").eq(3).find("b").text(tj.tx);
  474. $(".tjcount li").eq(4).find("b").text(tj.hr);
  475. $(".tjcount li").eq(5).find("b").text(tj.zm);
  476. }
  477. /*居中*/
  478. function Center(obj) {
  479. var screenWidth = $(window).width(), screenHeight = $(window).height(); //当前浏览器窗口的 宽高
  480. var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
  481. var objLeft = (screenWidth - obj.width()) / 2;
  482. var objTop = (screenHeight - obj.height()) / 2 + scrolltop;
  483. obj.css({ left: objLeft + 'px', top: objTop + 'px' });
  484. obj.show();
  485. }
  486. //开始监测成功后
  487. function Start() {
  488. $(".kqc").addClass("dis");
  489. $(".jqc").removeClass("dis");
  490. }
  491. //停止监测成功后
  492. function Stop() {
  493. $(".jqc").addClass("dis");
  494. $(".kqc").removeClass("dis");
  495. $(".zxtp i").removeClass().addClass("lx");
  496. $(".zx_people i").removeClass().addClass("lx").attr("zx_item", "0").attr("xl_item", "0");
  497. }
  498. //坐席状态
  499. function UpdateAgentState(WorkNumber, State) {
  500. var sts = "";
  501. switch (State) {
  502. case "0": sts = "lx"; break;//离线
  503. case "1": break;//登录中
  504. case "2": sts = "kx"; break;//空闲
  505. case "3": sts = "th"; break;//通话中
  506. case "4": sts = "hh"; break;//话后处理中
  507. case "5": sts = "ml"; break;//小休
  508. case "6": sts = "zl"; break;//被请求
  509. case "7": sts = "lx"; break;//注销
  510. }
  511. var ele = $("." + WorkNumber).find("i");
  512. if (sts) {
  513. ele.removeClass().addClass(sts);
  514. }
  515. ele.attr("zx_item", State);
  516. if ($(".zxtp .g_nums").text() == WorkNumber) {
  517. if (sts) {
  518. $(".zxtp i").removeClass().addClass(sts);
  519. }
  520. UpdateSelState(State, ele.attr("xl_item"))
  521. }
  522. tjcount();
  523. }
  524. //线路状态
  525. function UpdateLineState(WorkNumber, State) {
  526. var sts = "";
  527. switch (State) {
  528. case "0": sts = "lx"; break;//分机不可用
  529. //case "1": sts = "kx"; break;//空闲
  530. case "2": sts = "ml"; break;//摘机等待拨号
  531. case "3": sts = "ml"; break;//正在拨号
  532. case "4": sts = "hc"; break;//呼出振铃
  533. case "5": sts = "zl"; break;//来电振铃
  534. case "6": sts = "th"; break;//通话中
  535. case "7": sts = "ml"; break;//播放忙音中
  536. case "8": sts = "th"; break;//通话保持中
  537. case "9": break;//话机移除
  538. case "10": break;//保持/空闲
  539. case "11": break;//保持/摘机等待拨号
  540. case "12": break;//保持/正在拨号
  541. case "13": break;//保持/呼出振铃
  542. case "14": break;//保持/通话中
  543. }
  544. var ele = $("." + WorkNumber).find("i");
  545. if (sts) {
  546. ele.removeClass().addClass(sts);
  547. }
  548. ele.attr("xl_item", State);
  549. if ($(".zxtp .g_nums").text() == WorkNumber) {
  550. if (sts) {
  551. $(".zxtp i").removeClass().addClass(sts);
  552. }
  553. UpdateSelState(ele.attr("zx_item"), State)
  554. }
  555. tjcount();
  556. }
  557. //更新选中坐席的可操作
  558. function UpdateSelState(zxState, xlState) {
  559. $(".zxtp b").addClass("dis");
  560. if (zxState == '5' && xlState == '1') {
  561. $(".zxtp .zx").removeClass("dis");
  562. }
  563. if (zxState == '3' && xlState == '6') {
  564. $(".zxtp .jt").removeClass("dis");
  565. $(".zxtp .qca").removeClass("dis");
  566. $(".zxtp .qc").removeClass("dis");
  567. $(".zxtp .lj").removeClass("dis");
  568. }
  569. if (zxState == '2' && xlState == '5') {
  570. $(".zxtp .dj").removeClass("dis");
  571. }
  572. }
  573. // //浏览器窗口大小改变时
  574. // $(window).resize(function() {
  575. // screenWidth = $(window).width();
  576. // screenHeight = $(window).height();
  577. // scrolltop = $(document).scrollTop();
  578. // objLeft = (screenWidth - obj.width())/2 ;
  579. // objTop = (screenHeight - obj.height())/2 + scrolltop;
  580. // obj.css({left: objLeft + 'px', top: objTop + 'px'});
  581. // obj.fadeToggle();
  582. // });
  583. // //浏览器有滚动条时的操作、
  584. // $(window).scroll(function() {
  585. // screenWidth = $(window).width();
  586. // screenHeight = $(window).height();
  587. // scrolltop = $(document).scrollTop();
  588. // objLeft = (screenWidth - obj.width())/2 ;
  589. // objTop = (screenHeight - obj.height())/2 + scrolltop;
  590. // obj.css({left: objLeft + 'px', top: objTop + 'px'});
  591. // obj.fadeToggle();
  592. // });
  593. //# sourceURL=zx.js;
  594. </script>
  595. </body>
  596. </html>