Przeglądaj źródła

颐和话务置忙置闲问题

miaofuhao 4 lat temu
rodzic
commit
22594812f0

+ 17 - 7
CallCenterWeb.UI/ReportForm/callTime.html

@@ -57,7 +57,7 @@
57 57
 					<div class="form-inline th-bar clearfix">
58 58
 						<div class="time-box form-group">
59 59
 							<i class="tub fa fa-calendar"></i>
60
-							<input class="form-control" type="text" id="startTime" placeholder="请选择起止时间" style="width: 228px;">
60
+							<input class="form-control" autocomplete="off" type="text" id="startTime" placeholder="请选择起止时间" style="width: 228px;">
61 61
 						</div>
62 62
 						<div class="form-group tool_bars pull-right">
63 63
 							<button class="btns sear">搜索</button>
@@ -95,16 +95,26 @@
95 95
 			var stime = ''; //开始时间
96 96
 			var tabIndex = 0;
97 97
 			$(document).ready(function() {
98
-
98
+				
99
+//				$("#startTime").val('2021-09-01 00:00:00 ~ 2021-09-11 23:59:59')
100
+				stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
101
+				endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
102
+				
99 103
 				layui.use('laydate', function() {
100 104
 					var laydate = layui.laydate;
101 105
 					//日期
102 106
 					laydate.render({
103
-						elem: '#startTime',
104
-						range: '~',
105
-						//value: stime + ' ~ ' + endtime,
106
-						theme: '#1ab394',
107
-						calendar: 'true'
107
+						elem: "#startTime",
108
+		                theme: "#1ab394",
109
+		                type: "date",
110
+		                calendar: true,
111
+		                range: "~",
112
+		                ready: function (date) {
113
+//				          $(".layui-laydate-footer [lay-type='datetime'].laydate-btns-time").click();
114
+//				          $(".laydate-main-list-1 .layui-laydate-content li ol li:last-child").click();
115
+//				          $(".layui-laydate-footer [lay-type='date'].laydate-btns-time").click();
116
+				        }
117
+						
108 118
 					});
109 119
 				});
110 120
 

+ 2 - 6
CallCenterWeb.UI/js/index.js

@@ -28,10 +28,6 @@ $(document).ready(function () {
28 28
         },
29 29
         function (result) {
30 30
             if (result.state.toLowerCase() == "success") {
31
-                // console.log(result);
32
-                // $.cookie("userType", result.data.usertype, {
33
-                // 	expires: 7
34
-                // });
35 31
 
36 32
                 $.cookie("userRoleId", result.data.role.F_RoleId, {
37 33
                     expires: 7,
@@ -83,8 +79,8 @@ $(document).ready(function () {
83 79
                         Send();
84 80
                         break; //签入
85 81
                     case "MakeCall":
86
-                        obj.Type = "SayFree";
87
-                        Send(); //备注:用户要求外呼立刻置闲
82
+//                      obj.Type = "SayFree";
83
+//                      Send(); //备注:用户要求外呼立刻置闲
88 84
                         $(".hidCallID").val("");
89 85
                         $("#hidwhtype").val(fun);
90 86
                         whtp();

+ 42 - 2
CallCenterWeb.UI/js/main.js

@@ -27,6 +27,10 @@ function Connect() {
27 27
 
28 28
 			cls = 0;
29 29
 			$(".Login").addClass("active");
30
+			
31
+			if ($.cookie("socket_state") != null) {
32
+	            SetLogin($.cookie("socket_state"));
33
+	        }
30 34
 			//自动签入
31 35
 			//lasttime = new Date().getTime();
32 36
 			//obj.Type = "Login";
@@ -205,6 +209,9 @@ function LoginBack() {
205 209
 	$(".zxzt").removeClass("br").addClass("bl");
206 210
 	$(".fwzt").removeClass("br").addClass("bl");
207 211
 	$(".hwzt").text('');
212
+	if($.cookie("socket_state") == null){
213
+    	SetStateCookie(0);
214
+    }
208 215
 }
209 216
 //签出
210 217
 function LogoutBack() {
@@ -213,6 +220,7 @@ function LogoutBack() {
213 220
 	$(".zxzt").removeClass("bl").addClass("br");
214 221
 	$(".fwzt").removeClass("bl").addClass("br");
215 222
 	$(".hwzt").text('');
223
+	SetStateCookie(2);
216 224
 }
217 225
 //来电
218 226
 function IncomingBack(data) {
@@ -260,6 +268,10 @@ function DropCallBack() {
260 268
 	$(".SayBusy").addClass("active");
261 269
 	$(".MakeCall").addClass("active");
262 270
 	var obj = $("iframe:visible")
271
+	console.log($.cookie("socket_state"))
272
+	if($.cookie("socket_state") == 1){
273
+		SayBusy()
274
+	}
263 275
 //  if (obj.attr("data-id") == './callScreen/callScreen.html?tel=' + hidTel + '&CallID=' + hidCallID + '') {
264 276
 //	        window.frames[obj.attr("name")].$(".td-call").hide();
265 277
 //	        window.frames['iframe'+ hidCallID +''].$(".td-call").hide();
@@ -396,6 +408,7 @@ function AgentStateAgentBack(data){
396 408
 		console.log('出错了!')
397 409
 	}
398 410
 }
411
+
399 412
 function toDub(i) {
400 413
 	return i < 10 ? "0" + i : "" + i;
401 414
 }
@@ -407,7 +420,10 @@ function MakeCallBack() {
407 420
 //	alert('1');
408 421
 //	 window.frames[obj.attr("name")].calling();
409 422
 }
410
-
423
+//默认记忆上次是否签入,是否置忙置闲 0表示已签入 空闲,1表示签入置忙,2表示签出 
424
+function SetStateCookie(state) {
425
+    $.cookie("socket_state", state);
426
+}
411 427
 //置忙置闲
412 428
 function SetState(obj) {
413 429
 	if(obj.State == '5') {
@@ -415,15 +431,39 @@ function SetState(obj) {
415 431
 		$(".SayFree").addClass("active");
416 432
 		$(".zxzt").removeClass("bl").addClass("br");
417 433
 		$(".hwzt").text('置忙');
418
-
434
+		SetStateCookie(1);
419 435
 	}
420 436
 	if(obj.State == '2') {
421 437
 		$(".SayBusy").addClass("active");
422 438
 		$(".SayFree").removeClass("active");
423 439
 		$(".zxzt").removeClass("br").addClass("bl");
424 440
 		$(".hwzt").text('空闲');
441
+		SetStateCookie(0);
425 442
 	}
426 443
 }
444
+function SetLogin(state) {
445
+    if (state == 2) { return; }
446
+    if (obj.AgentID) {
447
+    	obj.Type = "Login";
448
+    	Send();
449
+    }
450
+    if (state == 1) {
451
+        setTimeout('SayBusy()', 500);
452
+    }
453
+}
454
+//置忙
455
+function SayBusy() {
456
+    if (obj.AgentID) {
457
+        obj.Type = "SayBusy";
458
+        Send();
459
+    }
460
+}
461
+function SayBusy() {
462
+    if (obj.AgentID) {
463
+        obj.Type = "SayBusy";
464
+        Send();
465
+    }
466
+}
427 467
 //置忙
428 468
 function SayBusyBack() {
429 469
 	$(".SayBusy").removeClass("active");