济源12345的前端

SeatMonitor.html 23KB

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