Procházet zdrojové kódy

大屏坐席监控,工单导出PDF

miaofuhao %!s(int64=5) %!d(string=před) roky
rodič
revize
350347cc9c

+ 4 - 1
WebChart/TelephoneDetails.html

@@ -838,7 +838,10 @@
838 838
 		</div>
839 839
 		</div>
840 840
 		<script src="js/TelephoneDetails.js"></script>
841
-		<script src="js/setItervalTime.js"></script>
841
+		<script>
842
+			setInterval(Ajax, huayi.config.indextime)
843
+		</script>
844
+		<!--<script src="js/setItervalTime.js"></script>-->
842 845
 	</body>
843 846
 
844 847
 </html>

+ 264 - 515
WebChart/js/TelephoneDetails.js

@@ -12,392 +12,227 @@
12 12
 	var cls = 0;
13 13
 	var lasttime = new Date().getTime();
14 14
 	var cons;
15
-	var person='';
16
-	if (areaOneVal) {
15
+	var person = '';
16
+	if(areaOneVal) {
17 17
 		var areaOneVal = helper.cookies.get("areaOneVal");
18
-		
19
-	} else{
20
-		var areaOneVal="sqs12345"
21
-		
18
+	} else {
19
+		var areaOneVal = "sqs12345"
22 20
 	}
23 21
 	//创建scoket连接
24 22
 	function createWebSocket() {
25
-	    try {
26
-	       
27
-	        Connect();
28
-	    } catch (e) {
29
-	        reconnect();
30
-	    }
23
+		try {
24
+
25
+			Connect();
26
+		} catch(e) {
27
+			reconnect();
28
+		}
31 29
 	}
32 30
 	//连接
33 31
 	function Connect() {
34 32
 		// debugger
35
-	    ws = new WebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
36
-	    ws.onopen = function () {
37
-	        console.log(new Date() + "    " + "建立连接");
38
-	        //心跳检测重置
39
-	        heartCheck.reset().start();
40
-	        cls = 0;
41
-	        // $(".Login").addClass("active");
42
-	        lasttime = new Date().getTime();
43
-			
44
-	     join()
45
-		 SayBusy()
46
-	        //自动签入
47
-	        // if ($.cookie("socket_state") != null) {
48
-	            // SetLogin($.cookie("socket_state"));
49
-	        // }
50
-	        //$(".hwzt").text('连接成功!');
51
-	    };
52
-	    //接收到消息的回调方法
53
-	    ws.onmessage = function (evt) {
54
-	        //如果获取到消息,心跳检测重置
55
-	        //拿到任何消息都说明当前连接是正常的
56
-	        heartCheck.reset().start();
57
-	        var myDate = new Date();
58
-	        console.log(myDate + "  receive  " + evt.data);
59
-	        var data = JSON.parse(evt.data)[0];
60
-	        if (data) {
61
-	            var rlt = data.Result;
62
-				  var type = data.Type;
63
-	            if (rlt == true) {
64
-	              
65
-	                switch (type.toLowerCase()) {
66
-	                    //case "heart": HeartBack(); break;//心跳
67
-	                    case "login":
68
-	                        LoginBack();
69
-	                        break; //签入
70
-	                  // case "logout":
71
-	                  //     LogoutBack();
72
-	                  //     break; //签出
73
-	                  // case "dropcall":
74
-	                  //     DropCallBack();
75
-	                  //     break; //挂断
76
-	                  case "makecall":
77
-	                      MakeCallBack();
78
-	                      break; //外呼
79
-	                  case "setstate":
80
-	                      SetState(data);
81
-	                      break; //置忙置闲
82
-	                      //case "saybusy": SayBusyBack(data); break;
83
-	                      //case "sayfree": SayFreeBack(data); break;
84
-	                  case "meeting":
85
-	                      MeetingBack();
86
-	                      break; //多方通话
87
-	                  case "transfer":
88
-	                      TransferBack();
89
-	                      break; //转移
90
-	                  case "hold":
91
-	                      HoldBack();
92
-	                      break; //保持
93
-	                  case "retrieve":
94
-	                      RetrieveBack();
95
-	                      break; //接回
96
-	                  // case "incoming":
97
-	                  //     IncomingBack(data);
98
-	                  //     break; //来电
99
-	                  case "subscribe":
100
-	                      SubScribeBack();
101
-	                      break; //监测
102
-	                  case "subscribecancel":
103
-	                      SubScribeCancelBack();
104
-	                      break; //停止监测
105
-	                  case "agentstate":
106
-	                      AgentStateBack(data);
107
-	                      break; //坐席状态
108
-	                  case "linestate":
109
-	                      LineStateBack(data);
110
-	                      break; //线路状态
111
-	                  case "motorsetstate":
112
-	                      SayFreeBack();
113
-	                      break; //班长置闲
114
-	                  // case "linestateagent":
115
-	                  //     LineStateAgentBack(data);
116
-	                  //     break; //线路状态通知
117
-	                  case "agentstateagent":
118
-	                      AgentStateAgentBack(data);
119
-	                      break; //坐席状态通知
120
-	                  //case "callid":
121
-	                  //    CallIDBack(data);
122
-	                  //    break; //获取callid
123
-	                  //case "recordpath":
124
-	                  //    RecordPathBack(data);
125
-	                  //    break; //录音返回
126
-	                  case "getagentlist":
127
-	                      GetAgentListBack(data);
128
-	                      break;//在线坐席信息
129
-	                  case "confirmtransfer":
130
-	                      ConfirmTransfer(data);
131
-	                      break;//确认转移 取消转移
132
-	                  case "consult":
133
-	                      ConsultationCall();
134
-	                      break;//协商呼叫
135
-	                
136
-	                }
137
-	            } else {
138
-	                if (rlt == false) {
139
-	                    //layer.confirm('操作失败!', {
140
-	                    //    btn: ['确定'] 
141
-	                    //});
142
-	                    $(".hwzt").text('操作失败!');
143
-	                } else {
144
-	                    $(".hwzt").text(rlt);
145
-	                    //layer.confirm(rlt, {
146
-	                    //    btn: ['确定']
147
-	                    //});
148
-						  if(type.toLowerCase()=='waitcount') {
149
-							   backstageQueue(data);
150
-							  }
151
-	                }
152
-	            }
153
-	        }
154
-	    };
155
-	    
156
-	    //连接关闭的回调方法
157
-	    ws.onclose = function (evt) {
158
-	        if (cls == 0) {
159
-	            cls = 1;
160
-	            //console.log("连接关闭!");
161
-	            //layer.confirm('连接关闭!', {
162
-	            //    btn: ['确定']
163
-	            //});
164
-	            $(".hwzt").text('连接关闭!');
165
-	            $("#top-search li i").removeClass("active");
166
-	            reconnect();
167
-	        }
168
-	    };
169
-	    //连接发生错误的回调方法
170
-	    ws.onerror = function (evt) {
171
-	        //产生异常
172
-	        $(".hwzt").text('连接出现异常!');
173
-	        console.log(ws);
174
-	        if (ws == null || ws.readyState != ws.OPEN) {
175
-	            console.log(new Date() + "开始重连");
176
-	            reconnect();
177
-	        }
178
-	
179
-	    };
33
+		ws = new WebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
34
+		ws.onopen = function() {
35
+			console.log(new Date() + "    " + "建立连接");
36
+			cls = 0;
37
+			lasttime = new Date().getTime();
38
+			join()
39
+			SayBusy()
40
+
41
+		};
42
+		//接收到消息的回调方法
43
+		ws.onmessage = function(evt) {
44
+			//如果获取到消息,心跳检测重置
45
+			//拿到任何消息都说明当前连接是正常的
46
+			//heartCheck.reset().start();
47
+			var myDate = new Date();
48
+			console.log(myDate + "  receive  " + evt.data);
49
+			var data = JSON.parse(evt.data)[0];
50
+			if(data) {
51
+				var rlt = data.Result;
52
+				var type = data.Type;
53
+				if(rlt == true) {
54
+					switch(type.toLowerCase()) {
55
+						//case "heart": HeartBack(); break;//心跳
56
+						case "login":
57
+							LoginBack();
58
+							break; //签入
59
+						case "subscribecancel":
60
+							SubScribeCancelBack();
61
+							break; //停止监测
62
+						case "agentstate":
63
+							AgentStateBack(data);
64
+							break; //坐席状态
65
+					}
66
+				} else {
67
+					if(rlt == false) {
68
+						$(".hwzt").text('操作失败!');
69
+					} else {
70
+						$(".hwzt").text(rlt);
71
+						if(type.toLowerCase() == 'waitcount') {
72
+							backstageQueue(data);
73
+						}
74
+					}
75
+				}
76
+			}
77
+		};
78
+
79
+		//连接关闭的回调方法
80
+		ws.onclose = function(evt) {
81
+			if(cls == 0) {
82
+				cls = 1;
83
+				$(".hwzt").text('连接关闭!');
84
+				$("#top-search li i").removeClass("active");
85
+				reconnect();
86
+			}
87
+		};
88
+		//连接发生错误的回调方法
89
+		ws.onerror = function(evt) {
90
+			//产生异常
91
+			$(".hwzt").text('连接出现异常!');
92
+			console.log(ws);
93
+			if(ws == null || ws.readyState != ws.OPEN) {
94
+				console.log(new Date() + "开始重连");
95
+				reconnect();
96
+			}
97
+
98
+		};
180 99
 	}
181 100
 	//重连
182 101
 	function reconnect() {
183
-		
184
-	    if (lockReconnect) return;
185
-	    lockReconnect = true;
186
-	    //没连接上会一直重连,设置延迟避免请求过多
187
-	    setTimeout(function () {
188
-	        console.log(new Date() + "    " + "重连中……");
189
-	        createWebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
190
-	        lockReconnect = false;
102
+
103
+		if(lockReconnect) return;
104
+		lockReconnect = true;
105
+		//没连接上会一直重连,设置延迟避免请求过多
106
+		setTimeout(function() {
107
+			console.log(new Date() + "    " + "重连中……");
108
+			createWebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
109
+			lockReconnect = false;
191 110
 			SayBusy()
192
-	    }, 2000);
111
+		}, 2000);
193 112
 	}
194
-	
113
+
195 114
 	//发送
196 115
 	function Send() {
197
-	    if (ws.readyState != ws.OPEN) {
198
-	        reconnect();
199
-	    }
200
-	    if (ws.readyState == ws.OPEN) {
201
-	        console.log(new Date() + "  send  " + JSON.stringify(obj));
202
-	        ws.send(JSON.stringify(obj));
203
-	    }
116
+		if(ws.readyState != ws.OPEN) {
117
+			//reconnect();
118
+		}
119
+		if(ws.readyState == ws.OPEN) {
120
+			console.log(new Date() + "  send  " + JSON.stringify(obj));
121
+			ws.send(JSON.stringify(obj));
122
+		}
204 123
 	}
205 124
 	//心跳检测
206 125
 	var heartCheck = {
207
-	    timeout: 25000, //25秒
208
-	    timeoutObj: null,
209
-	    serverTimeoutObj: null,
210
-	    reset: function () {
211
-	        clearTimeout(this.timeoutObj);
212
-	        clearTimeout(this.serverTimeoutObj);
213
-	        return this;
214
-	    },
215
-	    start: function () {
216
-	        var self = this;
217
-	        this.timeoutObj = setTimeout(function () {
218
-	            //这里发送一个心跳,后端收到后,返回一个心跳消息,
219
-	            //onmessage拿到返回的心跳就说明连接正常
220
-	            obj.Type = "Heart";
221
-	            Send();
222
-	            self.serverTimeoutObj = setTimeout(function () { //如果超过一定时间还没重置,说明后端主动断开了
223
-	                ws.close(); //如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
224
-	            }, self.timeout)
225
-	        }, this.timeout)
226
-	    }
126
+		timeout: 25000, //25秒
127
+		timeoutObj: null,
128
+		serverTimeoutObj: null,
129
+		reset: function() {
130
+			clearTimeout(this.timeoutObj);
131
+			clearTimeout(this.serverTimeoutObj);
132
+			return this;
133
+		},
134
+		start: function() {
135
+			var self = this;
136
+			this.timeoutObj = setTimeout(function() {
137
+				//这里发送一个心跳,后端收到后,返回一个心跳消息,
138
+				//onmessage拿到返回的心跳就说明连接正常
139
+				obj.Type = "Heart";
140
+				Send();
141
+				self.serverTimeoutObj = setTimeout(function() { //如果超过一定时间还没重置,说明后端主动断开了
142
+					ws.close(); //如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
143
+				}, self.timeout)
144
+			}, this.timeout)
145
+		}
227 146
 	}
228 147
 	// 签入
229 148
 	function SayBusy() {
230 149
 		obj.Type = "SayBusy";
231 150
 		Send();
232
-		console.log('置忙')
233 151
 	}
234
-	
235 152
 	//签入
236 153
 	function LoginBack() {
237
-	    
238
-	  obj.Type = "SayBusy";
239
-	  Send();
240
-	  console.log('置忙')
154
+		obj.Type = "SayBusy";
155
+		Send();
241 156
 	}
242 157
 	// 点击签入
243
-	function join(){
244
-	            obj.Type ='Login',
245
-		        obj.AgentID='9898',
246
-		        obj.AgentExten='1014',
247
-		        obj.AgentType='0',
248
-				obj.AgentGroup='364'
249
-		       
250
-		      
251
-			  // console.log(scoketDatas)
252
-		      Send()
253
-	}
254
-	//监测
255
-	function SubScribeBack() {
256
-	    var obj = $("iframe:visible")
257
-	    if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
258
-	        window.frames[obj.attr("name")].Start();
259
-	    }
260
-	    if (obj.attr("data-id") == "./TelCall/zxKong.html") {
261
-	        window.frames[obj.attr("name")].Start();
262
-	    }
158
+	function join() {
159
+		obj.Type = 'Login',
160
+		obj.AgentID = '9898',
161
+		obj.AgentExten = '1015',
162
+		obj.AgentType = '0',
163
+		obj.AgentGroup = '364'
164
+		Send()
263 165
 	}
264 166
 	//取消监测
265 167
 	function SubScribeCancelBack() {
266
-	    // var obj = $("iframe:visible")
267
-	    // if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
268
-	    //     window.frames[obj.attr("name")].Stop();
269
-	    // }
270
-	    // if (obj.attr("data-id") == "./TelCall/zxKong.html") {
271
-	    //     window.frames[obj.attr("name")].Stop();
272
-	    // }
273 168
 		$('.yuan_one').addClass("lx")
274 169
 		$('.yuan_two').addClass("lx")
275 170
 	}
276
-	//班长监测返回状态
277 171
 	//坐席状态
278
-	
279 172
 	function AgentStateBack(data) {
280
-		$('.yuan_one').removeClass("lx")
281
-		$('.yuan_two').removeClass("lx")
282
-		$(cons).each(function (i, n) {
283
-			if(n.F_UserCode==data.AgentID){
284
-				if(data.State=='0'){
173
+		
174
+		$(cons).each(function(i, n) {
175
+			if(n.F_UserCode == data.AgentID) {
176
+				
177
+				$('.yuan_one').eq(i).removeClass("lx")
178
+				$('.yuan_two').eq(i).removeClass("lx")
179
+				
180
+				$('.yuan_one').eq(i).removeClass("kx")
181
+				$('.yuan_two').eq(i).removeClass("kx")
182
+				
183
+				$('.yuan_one').eq(i).removeClass("hc")
184
+				$('.yuan_two').eq(i).removeClass("hc")
185
+				
186
+				$('.yuan_one').eq(i).removeClass("hh")
187
+				$('.yuan_two').eq(i).removeClass("hh")
188
+				
189
+				$('.yuan_one').eq(i).removeClass("ml")
190
+				$('.yuan_two').eq(i).removeClass("ml")
191
+				
192
+				$('.yuan_one').eq(i).removeClass("zl")
193
+				$('.yuan_two').eq(i).removeClass("zl")
194
+				
195
+				if(data.State == '0') {
285 196
 					$('.yuan_one').eq(i).addClass("lx")
286 197
 					$('.yuan_two').eq(i).addClass("lx")
287
-				}else if(data.State=='2'){
198
+				} else if(data.State == '2') {
288 199
 					$('.yuan_one').eq(i).addClass("kx")
289 200
 					$('.yuan_two').eq(i).addClass("kx")
290
-				}else if(data.State=='3'){
201
+				} else if(data.State == '3') {
291 202
 					$('.yuan_one').eq(i).addClass("hc")
292 203
 					$('.yuan_two').eq(i).addClass("hc")
293
-				}else if(data.State=='4'){
204
+				} else if(data.State == '4') {
294 205
 					$('.yuan_one').eq(i).addClass("hh")
295 206
 					$('.yuan_two').eq(i).addClass("hh")
296
-				}else if(data.State=='5'){
207
+				} else if(data.State == '5') {
297 208
 					$('.yuan_one').eq(i).addClass("ml")
298 209
 					$('.yuan_two').eq(i).addClass("ml")
299
-				}else if(data.State=='6'){
210
+				} else if(data.State == '6') {
300 211
 					$('.yuan_one').eq(i).addClass("zl")
301 212
 					$('.yuan_two').eq(i).addClass("zl")
302 213
 				}
303
-				
304 214
 			}
305
-			})
306
-	    // var obj = $("iframe:visible")
307
-	    // if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
308
-	    //     window.frames[obj.attr("name")].UpdateAgentState(data.AgentID, data.State);
309
-	    // }
310
-	    // if (obj.attr("data-id") == "./TelCall/zxKong.html") {
311
-	    //     window.frames[obj.attr("name")].UpdateAgentState(data.AgentID, data.State);
312
-	    // }
313
-	}
314
-	//线路状态
315
-	function LineStateBack(data) {
316
-	    var obj = $("iframe:visible")
317
-	    if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
318
-	        window.frames[obj.attr("name")].UpdateLineState(data.AgentID, data.State);
319
-	    }
320
-	    if (obj.attr("data-id") == "./TelCall/zxKong.html") {
321
-	        window.frames[obj.attr("name")].UpdateLineState(data.AgentID, data.State);
322
-	    }
215
+		})
216
+
323 217
 	}
218
+
324 219
 	//后台排队
325 220
 	function backstageQueue(data) {
326
-		
327
-		person=data.WaitCount
221
+		person = data.WaitCount
328 222
 		console.log(person)
329
-	    // if (obj.attr("data-id") == "./widgets.html") {
330
-	    //     window.frames[obj.attr("name")].realTimeMonitorQueue(data.WaitCount);
331
-	    // }
332
-	}
333
-	//坐席状态通知
334
-	function AgentStateAgentBack(data) {
335
-	    var strr = '';
336
-	    console.log('坐席状态'+ data.State );
337
-	    switch (data.State+"") {
338
-	        case "0":
339
-	            strr = "离线";
340
-	            $(".zxzt").removeClass("br").removeClass("bl").removeClass("by");
341
-	            break; //离线
342
-	        case "1":
343
-	            break; //登录中
344
-	        case "2":
345
-	            strr = "空闲";
346
-	            $(".zxzt").removeClass("br").removeClass("by").addClass("bl");
347
-	            break; //空闲
348
-	        case "3":
349
-	            strr = "通话中";
350
-	            $(".zxzt").removeClass("bl").removeClass("by").addClass("br");
351
-	            break; //通话中
352
-	        case "4":
353
-	            strr = "话后处理中";
354
-	            $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
355
-	            break; //话后处理中
356
-	        case "5":
357
-	            strr = "忙碌";
358
-	            $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
359
-	            break; //小休
360
-	        case "6":
361
-	            strr = "振铃";
362
-	            break; //被请求
363
-	        case "7":
364
-	            strr = "注销";
365
-	            $(".zxzt").removeClass("br").removeClass("bl").removeClass("by");
366
-	            break; //注销
367
-	    }
368
-	
369
-	    $(".hxzt").text(strr);
370
-	}
371
-	
372
-	//置忙 置闲
373
-	function SetState(obj) {
374
-	    if (obj.State == '5') {
375
-	        $(".SayBusy").removeClass("active");
376
-	        $(".SayFree").addClass("active");
377
-	        $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
378
-	        $(".hwzt").text('忙碌');
379
-	        $("#isml").val(1);
380
-	        // SetStateCookie(1);
381
-	    }
382
-	    if (obj.State == '2') {
383
-	    	$(".SayBusy").addClass("active");
384
-	        $(".SayFree").removeClass("active");
385
-	        $(".zxzt").removeClass("br").removeClass("by").addClass("bl");
386
-	        $(".hwzt").text('空闲');
387
-	        $("#isml").val(0);
388
-	        // SetStateCookie(0);
389
-	    }
390 223
 	}
224
+
391 225
 	$(function() {
392 226
 		createWebSocket()
393
-		 SayBusy()
227
+		SayBusy()
228
+		partOne($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1], areaOneVal);
394 229
 		laydate.render({
395 230
 			elem: '#time1',
396 231
 			range: '~',
397 232
 			theme: '#114a97',
398 233
 			done: function(value, date) {
399
-				var areaOneVal=$(".areaOne").val();
400
-				partOne(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],areaOneVal);
234
+				var areaOneVal = $(".areaOne").val();
235
+				partOne(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1], areaOneVal);
401 236
 			}
402 237
 
403 238
 		});
@@ -405,168 +240,80 @@
405 240
 			elem: '#time2',
406 241
 			theme: '#114a97',
407 242
 			done: function(value, date) {
408
-				var areaOneVal=$(".areaOne").val();
409
-				partTwo(value,areaOneVal)
243
+				var areaOneVal = $(".areaOne").val();
244
+				partTwo(value, areaOneVal)
410 245
 			}
411 246
 		});
412 247
 		laydate.render({
413 248
 			elem: '#time3',
414 249
 			theme: '#114a97',
415 250
 			done: function(value, date) {
416
-				var areaOneVal=$(".areaOne").val();
417
-				partThree(value,areaOneVal)
251
+				var areaOneVal = $(".areaOne").val();
252
+				partThree(value, areaOneVal)
418 253
 			}
419 254
 		});
420 255
 		Ajax();
421 256
 		$(".areaOne").change(function() {
422
-	      	var areaOneVal=$(this).val();
423
-      		var areaOneText=$(".areaOne").find("option:selected").text();
424
-      		helper.cookies.set("areaOneVal", areaOneVal, 7);
425
-      		helper.cookies.set("areaOneText", areaOneText, 7);
426
-	      	partOne($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],areaOneVal);
427
-			partTwo($('#time2').val(),areaOneVal);
428
-			partThree( $('#time3').val(),areaOneVal);
429
-	//  	Ajax()
257
+			var areaOneVal = $(this).val();
258
+			var areaOneText = $(".areaOne").find("option:selected").text();
259
+			helper.cookies.set("areaOneVal", areaOneVal, 7);
260
+			helper.cookies.set("areaOneText", areaOneText, 7);
261
+			partOne($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1], areaOneVal);
262
+			partTwo($('#time2').val(), areaOneVal);
263
+			partThree($('#time3').val(), areaOneVal);
264
+			//  	Ajax()
430 265
 		});
431 266
 	})
432 267
 	// 跳轉
433
-	$(".index").click(function(){
434
-		window.open('detail.html','_self')
268
+	$(".index").click(function() {
269
+		window.open('detail.html', '_self')
435 270
 	})
436
-	$(".second").click(function(){
437
-		window.open('second.html','_self')
271
+	$(".second").click(function() {
272
+		window.open('second.html', '_self')
438 273
 	})
439
-	$(".third").click(function(){
440
-		window.open('third.html','_self')
274
+	$(".third").click(function() {
275
+		window.open('third.html', '_self')
441 276
 	})
442
-	$(".fourth").click(function(){
443
-		window.open('fourth.html','_self')
277
+	$(".fourth").click(function() {
278
+		window.open('fourth.html', '_self')
444 279
 	})
445
-	$(".nav_middle").click(function(){
446
-		window.open('index.html','_self')
280
+	$(".nav_middle").click(function() {
281
+		window.open('index.html', '_self')
447 282
 	})
448
-	$("#department").click(function(){
449
-		window.open('receiptDepartment.html','_self')
283
+	$("#department").click(function() {
284
+		window.open('receiptDepartment.html', '_self')
450 285
 	})
451
-	$("#sourceChannel").click(function(){
452
-		window.open('sourceChannel.html','_self')
286
+	$("#sourceChannel").click(function() {
287
+		window.open('sourceChannel.html', '_self')
453 288
 	})
454 289
 	// $("#call").click(function(){
455 290
 	// 	window.open('TelephoneDetails.html','_self')
456 291
 	// })
457
-	$("#complaint").click(function(){
458
-		window.open('complaintsReport.html','_self')
292
+	$("#complaint").click(function() {
293
+		window.open('complaintsReport.html', '_self')
459 294
 	})
460
-		
295
+
461 296
 	//区县筛选
462 297
 	//deprtment();
463 298
 	function deprtment() {
464
-		$.getJSON( huayi.config.callcenter_url +"CountyBranch/GetBranchListS", function(result) {
299
+		$.getJSON(huayi.config.callcenter_url + "CountyBranch/GetBranchListS", function(result) {
465 300
 			if(result.state.toLowerCase() == "success") {
466 301
 				goodslist = result.data;
467
-	//			第五屏
302
+				//			第五屏
468 303
 				$(".areaOne").empty();
469 304
 				$(goodslist).each(function(i, n) {
470
-					$('<option value="' + n.F_Code 
471
-					+ '">' + n.F_Name 
472
-					+ '</option>').appendTo($(".areaOne"));
305
+					$('<option value="' + n.F_Code +
306
+						'">' + n.F_Name +
307
+						'</option>').appendTo($(".areaOne"));
473 308
 				});
474
-				if (areaOneVal) {
309
+				if(areaOneVal) {
475 310
 					$(".areaOne").val(areaOneVal);
476 311
 				}
477 312
 			}
478 313
 		});
479 314
 	}
480
-	// var sitProportion = echarts.init(document.getElementById('sitProportion')); //坐席闲忙比例
481
-	// sitProportion.setOption({
482
-	// 	color: ['#4ab7c7', '#2484d9', '#2e39c1'],
483
-	// 	tooltip: {
484
-	// 		trigger: 'axis',
485
-	// 		axisPointer: {
486
-	// 			type: 'shadow',
487
-	// 			label: {
488
-	// 				show: true,
489
-	// 				backgroundColor: '#333'
490
-	// 			}
491
-	// 		},
492
-	// 		formatter: function(datas) {
493
-	// 			var res = datas[0].name + '<br/>',
494
-	// 				val;
495
-	// 			for(var i = 0, length = datas.length; i < length; i++) {
496
-	// 				val = (datas[i].value) + '%';
497
-	// 				res += datas[i].seriesName + ':' + val + '<br/>';
498
-	// 			}
499
-	// 			return res;
500
-	// 		}
501
-	// 	},
502
-	// 	legend: {
503
-	// 		top: 'top',
504
-	// 		left: '135px',
505
-	// 		data: ['置忙', '通话', '空闲'],
506
-	// 		textStyle: {
507
-	// 			color: '#00e9ff'
508
-	// 		}
509
-	// 	},
510
-	// 	grid: {
511
-	// 		left: '1%',
512
-	// 		right: '3%',
513
-	// 		bottom: '5%',
514
-	// 		containLabel: true
515
-	// 	},
516
-	// 	xAxis: {
517
-	// 		name: '时',
518
-	// 		data: [],
519
-	// 		axisLine: {
520
-	// 			lineStyle: {
521
-	// 				color: '#3061a2'
522
-	// 			}
523
-	// 		},
524
-	// 		axisTick: {
525
-	// 			alignWithLabel: true,
526
-	// 			show: false
527
-	// 		},
528
-	// 		axisLabel: { //横轴字体颜色
529
-	// 			show: true,
530
-	// 			textStyle: {
531
-	// 				color: '#eff0f4'
532
-	// 			}
533
-	// 		}
534
-
535
-	// 	},
536
-	// 	yAxis: {
537
-	// 		name: '(比率)',
538
-	// 		splitLine: {
539
-	// 			show: false
540
-	// 		},
541
-	// 		axisLine: {
542
-	// 			lineStyle: {
543
-	// 				color: '#3061a2'
544
-	// 			}
545
-	// 		},
546
-	// 		axisLabel: { //横轴字体颜色
547
-	// 			show: true,
548
-	// 			textStyle: {
549
-	// 				color: '#eff0f4'
550
-	// 			}
551
-	// 		}
552
-	// 	},
553
-	// 	series: [{
554
-	// 		name: '置忙',
555
-	// 		type: 'bar',
556
-	// 		data: []
557
-	// 	}, {
558
-	// 		name: '通话',
559
-	// 		type: 'bar',
560
-	// 		data: []
561
-	// 	}, {
562
-	// 		name: '空闲',
563
-	// 		type: 'bar',
564
-	// 		data: []
565
-	// 	}]
566
-
567
-	// });
568
-
569
-	function partOne(starts, ends,areaOneVal) {
315
+
316
+	function partOne(starts, ends, areaOneVal) {
570 317
 		$.ajax({
571 318
 			type: "get",
572 319
 			url: huayi.config.callcenter_url + "SeatMonitoring/getlist",
@@ -580,67 +327,68 @@
580 327
 			success: function(data) {
581 328
 				if(data.state.toLowerCase() == 'success') {
582 329
 					// 	   			layer.close(index);
583
-					 cons = data.data;
330
+					cons = data.data;
584 331
 					$(".users").html('')
585
-						$(cons).each(function(i, n) {
586
-						var str=' <li class="touxiang"><ol class="tx"><li class="person"><span class="yuan_one "></span><span class="yuan_two"></span></li><li class="userid">'+n.F_UserCode+'</li></ol></li>';
587
-						    var a=$(str)
588
-						    a.appendTo($(".users"))
589
-								   })
590
-									  
591
-					}
332
+					$(cons).each(function(i, n) {
333
+						var str = ' <li class="touxiang"><ol class="tx"><li class="person"><span class="yuan_one ">' +
334
+							'</span><span class="yuan_two"></span></li><li class="userid">' +
335
+							n.F_UserCode + '</li></ol></li>';
336
+						var a = $(str)
337
+						a.appendTo($(".users"))
338
+					})
592 339
 
593 340
 				}
594
-			
341
+
342
+			}
343
+
595 344
 		});
596 345
 	}
597 346
 	// 开始检测
598
- $(".kqc").click(function () {
599
-                // if (!$(this).hasClass("dis")) {
600
-               $('.kqc').addClass('kqc_active')
601
-			    $('.jqc').removeClass('dis')
602
-                    $(cons).each(function (i, n) {
603
-                       obj.Type = "SubScribe";
604
-                       obj.SubParmer = n.F_WorkNumber * 1;
605
-
606
-                       obj.SubType = "0";//根据工号订阅坐席状态
607
-                       Send();
608
-                       obj.SubType = "1";//根据工号订阅线路状态
609
-                       Send();
610
-                    })
611
-                    //top.obj.Type = "SubScribe";
612
-                    //top.obj.SubParmer = "8003";
613
-
614
-                    //top.obj.SubType = "0";//根据工号订阅坐席状态
615
-                    //top.Send();
616
-                    //top.obj.SubType = "1";//根据工号订阅线路状态
617
-                    //top.Send();
618
-                // }
619
-            })
620
-			
621
-			
622
-			//停止监测
623
-			$(".jqc").click(function () {
624
-				$('.kqc').removeClass('kqc_active')
625
-				 $('.jqc').addClass('dis')
626
-			        //$(user).each(function (i, n) {
627
-			        //   obj.Type = "SubScribeCancel";
628
-			        //   obj.SubParmer = n.F_WorkNumber;
629
-			
630
-			        //   obj.SubType = "0";//根据工号取消订阅坐席状态
631
-			        //   Send();
632
-			        //   obj.SubType = "1";//根据工号取消订阅线路状态
633
-			        //   Send();
634
-			        //})
635
-			       obj.Type = "SubScribeCancel";
636
-			       obj.SubParmer = "-1";
637
-			
638
-			       obj.SubType = "0";//根据工号取消订阅坐席状态
639
-			       Send();
640
-			       obj.SubType = "1";//根据工号取消订阅线路状态
641
-			       Send();
642
-			    
643
-			})
347
+	$(".kqc").click(function() {
348
+		// if (!$(this).hasClass("dis")) {
349
+		$('.kqc').addClass('kqc_active')
350
+		$('.jqc').removeClass('dis')
351
+		$(cons).each(function(i, n) {
352
+			obj.Type = "SubScribe";
353
+			obj.SubParmer = n.F_WorkNumber * 1;
354
+
355
+			obj.SubType = "0"; //根据工号订阅坐席状态
356
+			Send();
357
+			obj.SubType = "1"; //根据工号订阅线路状态
358
+			Send();
359
+		})
360
+		//top.obj.Type = "SubScribe";
361
+		//top.obj.SubParmer = "8003";
362
+
363
+		//top.obj.SubType = "0";//根据工号订阅坐席状态
364
+		//top.Send();
365
+		//top.obj.SubType = "1";//根据工号订阅线路状态
366
+		//top.Send();
367
+		// }
368
+	})
369
+
370
+	//停止监测
371
+	$(".jqc").click(function() {
372
+		$('.kqc').removeClass('kqc_active')
373
+		$('.jqc').addClass('dis')
374
+		//$(user).each(function (i, n) {
375
+		//   obj.Type = "SubScribeCancel";
376
+		//   obj.SubParmer = n.F_WorkNumber;
377
+
378
+		//   obj.SubType = "0";//根据工号取消订阅坐席状态
379
+		//   Send();
380
+		//   obj.SubType = "1";//根据工号取消订阅线路状态
381
+		//   Send();
382
+		//})
383
+		obj.Type = "SubScribeCancel";
384
+		obj.SubParmer = "-1";
385
+
386
+		obj.SubType = "0"; //根据工号取消订阅坐席状态
387
+		Send();
388
+		obj.SubType = "1"; //根据工号取消订阅线路状态
389
+		Send();
390
+
391
+	})
644 392
 	//part 2
645 393
 	var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
646 394
 	phoneTimeCount.setOption({
@@ -709,7 +457,7 @@
709 457
 		series: []
710 458
 	});
711 459
 
712
-	function partTwo(dates,areaOneVal) {
460
+	function partTwo(dates, areaOneVal) {
713 461
 		//		var index = layer.load(1, {
714 462
 		//			shade: [0.5, '#030303'] //0.1透明度的白色背景
715 463
 		//		});
@@ -720,7 +468,7 @@
720 468
 			dataType: "json",
721 469
 			data: {
722 470
 				date: dates,
723
-				branchcode:areaOneVal
471
+				branchcode: areaOneVal
724 472
 			},
725 473
 			success: function(data) {
726 474
 				if(data.state.toLowerCase() == "success") {
@@ -778,6 +526,7 @@
778 526
 
779 527
 	//part3
780 528
 	var todyPhoneCount = echarts.init(document.getElementById('todyPhoneCount'));
529
+
781 530
 	todyPhoneCount.setOption({
782 531
 		tooltip: {
783 532
 			trigger: 'axis',
@@ -791,7 +540,7 @@
791 540
 		},
792 541
 		xAxis: {
793 542
 			name: '类型',
794
-			data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)","排队人数"],
543
+			data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)", "排队人数"],
795 544
 			axisLine: {
796 545
 				lineStyle: {
797 546
 					color: '#3061a2'
@@ -835,7 +584,7 @@
835 584
 					color: function(params) {
836 585
 						// build a color map as your need.
837 586
 						var colorList = [
838
-							'#368cab', '#54b793', '#4b6ab0', '#2531a9','#a93d19'
587
+							'#368cab', '#54b793', '#4b6ab0', '#2531a9', '#a93d19'
839 588
 						];
840 589
 						return colorList[params.dataIndex]
841 590
 					}
@@ -856,7 +605,7 @@
856 605
 
857 606
 	});
858 607
 
859
-	function partThree(dates,areaOneVal) {
608
+	function partThree(dates, areaOneVal) {
860 609
 		$.ajax({
861 610
 			type: "get",
862 611
 			url: huayi.config.callcenter_url + "info/GetTelCountByDate",
@@ -864,17 +613,17 @@
864 613
 			dataType: "json",
865 614
 			data: {
866 615
 				date: dates,
867
-				branchcode:areaOneVal
616
+				branchcode: areaOneVal
868 617
 			},
869 618
 			success: function(data) {
870 619
 				if(data.state.toLowerCase() == "success") {
871 620
 					//					layer.close(index);
872 621
 					var con = data.data;
873
-					con.person=person
622
+					
874 623
 					console.log(con)
875 624
 					todyPhoneCount.setOption({
876 625
 						series: [{
877
-							data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes,con.person]
626
+							data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes, person]
878 627
 						}]
879 628
 
880 629
 					})
@@ -889,7 +638,7 @@
889 638
 	function Ajax() {
890 639
 		var areaOneVal = helper.cookies.get("areaOneVal");
891 640
 		var areaOneText = helper.cookies.get("areaOneText");
892
-		partOne($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],areaOneVal);
893
-		partTwo($('#time2').val(),areaOneVal)
894
-		partThree($('#time3').val(),areaOneVal);
641
+		//partOne($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],areaOneVal);
642
+		partTwo($('#time2').val(), areaOneVal)
643
+		partThree($('#time3').val(), areaOneVal);
895 644
 	}

+ 23 - 226
WebChart/js/index.js

@@ -23,9 +23,9 @@ WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
23 23
 	
24 24
 // }
25 25
 //创建scoket连接
26
+	createWebSocket()
26 27
 	function createWebSocket() {
27 28
 	    try {
28
-	       
29 29
 	        Connect();
30 30
 	    } catch (e) {
31 31
 	        reconnect();
@@ -33,23 +33,17 @@ WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
33 33
 	}
34 34
 	//连接
35 35
 	function Connect() {
36
-		// debugger
37 36
 	    ws = new WebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
38 37
 	    ws.onopen = function () {
39 38
 	        console.log(new Date() + "    " + "建立连接");
40 39
 	        //心跳检测重置
41 40
 	        heartCheck.reset().start();
42 41
 	        cls = 0;
43
-	        // $(".Login").addClass("active");
44 42
 	        lasttime = new Date().getTime();
45 43
 			
46
-	     join()
47
-		 SayBusy()
48
-	        //自动签入
49
-	        // if ($.cookie("socket_state") != null) {
50
-	            // SetLogin($.cookie("socket_state"));
51
-	        // }
52
-	        //$(".hwzt").text('连接成功!');
44
+	     	join()
45
+		 	SayBusy()
46
+	        
53 47
 	    };
54 48
 	    //接收到消息的回调方法
55 49
 	    ws.onmessage = function (evt) {
@@ -63,93 +57,23 @@ WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
63 57
 	            var rlt = data.Result;
64 58
 				  var type = data.Type;
65 59
 	            if (rlt == true) {
66
-	              
60
+	            	
67 61
 	                switch (type.toLowerCase()) {
68
-	                    //case "heart": HeartBack(); break;//心跳
69 62
 	                    case "login":
70 63
 	                        LoginBack();
71 64
 	                        break; //签入
72
-	                  // case "logout":
73
-	                  //     LogoutBack();
74
-	                  //     break; //签出
75
-	                  // case "dropcall":
76
-	                  //     DropCallBack();
77
-	                  //     break; //挂断
78
-	                  case "makecall":
79
-	                      MakeCallBack();
80
-	                      break; //外呼
81
-	                  case "setstate":
82
-	                      SetState(data);
83
-	                      break; //置忙置闲
84
-	                      //case "saybusy": SayBusyBack(data); break;
85
-	                      //case "sayfree": SayFreeBack(data); break;
86
-	                  case "meeting":
87
-	                      MeetingBack();
88
-	                      break; //多方通话
89
-	                  case "transfer":
90
-	                      TransferBack();
91
-	                      break; //转移
92
-	                  case "hold":
93
-	                      HoldBack();
94
-	                      break; //保持
95
-	                  case "retrieve":
96
-	                      RetrieveBack();
97
-	                      break; //接回
98
-	                  // case "incoming":
99
-	                  //     IncomingBack(data);
100
-	                  //     break; //来电
101
-	                  case "subscribe":
102
-	                      SubScribeBack();
103
-	                      break; //监测
104
-	                  case "subscribecancel":
105
-	                      SubScribeCancelBack();
106
-	                      break; //停止监测
107
-	                  case "agentstate":
108
-	                      AgentStateBack(data);
109
-	                      break; //坐席状态
110
-	                  case "linestate":
111
-	                      LineStateBack(data);
112
-	                      break; //线路状态
113
-	                  case "motorsetstate":
114
-	                      SayFreeBack();
115
-	                      break; //班长置闲
116
-	                  // case "linestateagent":
117
-	                  //     LineStateAgentBack(data);
118
-	                  //     break; //线路状态通知
119
-	                  case "agentstateagent":
120
-	                      AgentStateAgentBack(data);
121
-	                      break; //坐席状态通知
122
-	                  //case "callid":
123
-	                  //    CallIDBack(data);
124
-	                  //    break; //获取callid
125
-	                  //case "recordpath":
126
-	                  //    RecordPathBack(data);
127
-	                  //    break; //录音返回
128
-	                  case "getagentlist":
129
-	                      GetAgentListBack(data);
130
-	                      break;//在线坐席信息
131
-	                  case "confirmtransfer":
132
-	                      ConfirmTransfer(data);
133
-	                      break;//确认转移 取消转移
134
-	                  case "consult":
135
-	                      ConsultationCall();
136
-	                      break;//协商呼叫
137
-	                
138 65
 	                }
66
+	                
139 67
 	            } else {
140 68
 	                if (rlt == false) {
141
-	                    //layer.confirm('操作失败!', {
142
-	                    //    btn: ['确定'] 
143
-	                    //});
69
+	                    
144 70
 	                    $(".hwzt").text('操作失败!');
71
+	                    
145 72
 	                } else {
146 73
 	                    $(".hwzt").text(rlt);
147
-	                    //layer.confirm(rlt, {
148
-	                    //    btn: ['确定']
149
-	                    //});
150
-						  if(type.toLowerCase()=='waitcount') {
151
-							   backstageQueue(data);
152
-							  }
74
+						if(type.toLowerCase()=='waitcount') {
75
+							backstageQueue(data);
76
+						}
153 77
 	                }
154 78
 	            }
155 79
 	        }
@@ -159,10 +83,6 @@ WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
159 83
 	    ws.onclose = function (evt) {
160 84
 	        if (cls == 0) {
161 85
 	            cls = 1;
162
-	            //console.log("连接关闭!");
163
-	            //layer.confirm('连接关闭!', {
164
-	            //    btn: ['确定']
165
-	            //});
166 86
 	            $(".hwzt").text('连接关闭!');
167 87
 	            $("#top-search li i").removeClass("active");
168 88
 	            reconnect();
@@ -236,22 +156,19 @@ WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
236 156
 	
237 157
 	//签入
238 158
 	function LoginBack() {
239
-	    
240 159
 	  obj.Type = "SayBusy";
241 160
 	  Send();
242 161
 	  console.log('置忙')
243 162
 	}
244 163
 	// 点击签入
245 164
 	function join(){
246
-	            obj.Type ='Login',
247
-		        obj.AgentID='9898',
248
-		        obj.AgentExten='1015',
249
-		        obj.AgentType='0',
250
-				obj.AgentGroup='364'
251
-		       
252
-		      
253
-			  // console.log(scoketDatas)
254
-		      Send()
165
+        obj.Type ='Login',
166
+        obj.AgentID='9898',
167
+        obj.AgentExten='1015',
168
+        obj.AgentType='0',
169
+		obj.AgentGroup='364'
170
+	  	// console.log(scoketDatas)
171
+      	Send()
255 172
 	}
256 173
 	//监测
257 174
 	function SubScribeBack() {
@@ -265,141 +182,23 @@ WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
265 182
 	}
266 183
 	//取消监测
267 184
 	function SubScribeCancelBack() {
268
-	    // var obj = $("iframe:visible")
269
-	    // if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
270
-	    //     window.frames[obj.attr("name")].Stop();
271
-	    // }
272
-	    // if (obj.attr("data-id") == "./TelCall/zxKong.html") {
273
-	    //     window.frames[obj.attr("name")].Stop();
274
-	    // }
275 185
 		$('.yuan_one').addClass("lx")
276 186
 		$('.yuan_two').addClass("lx")
277 187
 	}
278
-	//班长监测返回状态
279
-	//坐席状态
280 188
 	
281
-	function AgentStateBack(data) {
282
-		$('.yuan_one').removeClass("lx")
283
-		$('.yuan_two').removeClass("lx")
284
-		$(cons).each(function (i, n) {
285
-			if(n.F_UserCode==data.AgentID){
286
-				if(data.State=='0'){
287
-					$('.yuan_one').eq(i).addClass("lx")
288
-					$('.yuan_two').eq(i).addClass("lx")
289
-				}else if(data.State=='2'){
290
-					$('.yuan_one').eq(i).addClass("kx")
291
-					$('.yuan_two').eq(i).addClass("kx")
292
-				}else if(data.State=='3'){
293
-					$('.yuan_one').eq(i).addClass("hc")
294
-					$('.yuan_two').eq(i).addClass("hc")
295
-				}else if(data.State=='4'){
296
-					$('.yuan_one').eq(i).addClass("hh")
297
-					$('.yuan_two').eq(i).addClass("hh")
298
-				}else if(data.State=='5'){
299
-					$('.yuan_one').eq(i).addClass("ml")
300
-					$('.yuan_two').eq(i).addClass("ml")
301
-				}else if(data.State=='6'){
302
-					$('.yuan_one').eq(i).addClass("zl")
303
-					$('.yuan_two').eq(i).addClass("zl")
304
-				}
305
-				
306
-			}
307
-			})
308
-	    // var obj = $("iframe:visible")
309
-	    // if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
310
-	    //     window.frames[obj.attr("name")].UpdateAgentState(data.AgentID, data.State);
311
-	    // }
312
-	    // if (obj.attr("data-id") == "./TelCall/zxKong.html") {
313
-	    //     window.frames[obj.attr("name")].UpdateAgentState(data.AgentID, data.State);
314
-	    // }
315
-	}
316
-	//线路状态
317
-	function LineStateBack(data) {
318
-	    var obj = $("iframe:visible")
319
-	    if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
320
-	        window.frames[obj.attr("name")].UpdateLineState(data.AgentID, data.State);
321
-	    }
322
-	    if (obj.attr("data-id") == "./TelCall/zxKong.html") {
323
-	        window.frames[obj.attr("name")].UpdateLineState(data.AgentID, data.State);
324
-	    }
325
-	}
326 189
 	//后台排队
327 190
 	function backstageQueue(data) {
328
-		
329 191
 		person=data.WaitCount
330 192
 		console.log(person)
331
-	    // if (obj.attr("data-id") == "./widgets.html") {
332
-	    //     window.frames[obj.attr("name")].realTimeMonitorQueue(data.WaitCount);
333
-	    // }
334
-	}
335
-	//坐席状态通知
336
-	function AgentStateAgentBack(data) {
337
-	    var strr = '';
338
-	    console.log('坐席状态'+ data.State );
339
-	    switch (data.State+"") {
340
-	        case "0":
341
-	            strr = "离线";
342
-	            $(".zxzt").removeClass("br").removeClass("bl").removeClass("by");
343
-	            break; //离线
344
-	        case "1":
345
-	            break; //登录中
346
-	        case "2":
347
-	            strr = "空闲";
348
-	            $(".zxzt").removeClass("br").removeClass("by").addClass("bl");
349
-	            break; //空闲
350
-	        case "3":
351
-	            strr = "通话中";
352
-	            $(".zxzt").removeClass("bl").removeClass("by").addClass("br");
353
-	            break; //通话中
354
-	        case "4":
355
-	            strr = "话后处理中";
356
-	            $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
357
-	            break; //话后处理中
358
-	        case "5":
359
-	            strr = "忙碌";
360
-	            $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
361
-	            break; //小休
362
-	        case "6":
363
-	            strr = "振铃";
364
-	            break; //被请求
365
-	        case "7":
366
-	            strr = "注销";
367
-	            $(".zxzt").removeClass("br").removeClass("bl").removeClass("by");
368
-	            break; //注销
369
-	    }
370
-	
371
-	    $(".hxzt").text(strr);
372
-	}
373
-	
374
-	//置忙 置闲
375
-	function SetState(obj) {
376
-	    if (obj.State == '5') {
377
-	        $(".SayBusy").removeClass("active");
378
-	        $(".SayFree").addClass("active");
379
-	        $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
380
-	        $(".hwzt").text('忙碌');
381
-	        $("#isml").val(1);
382
-	        // SetStateCookie(1);
383
-	    }
384
-	    if (obj.State == '2') {
385
-	    	$(".SayBusy").addClass("active");
386
-	        $(".SayFree").removeClass("active");
387
-	        $(".zxzt").removeClass("br").removeClass("by").addClass("bl");
388
-	        $(".hwzt").text('空闲');
389
-	        $("#isml").val(0);
390
-	        // SetStateCookie(0);
391
-	    }
392 193
 	}
194
+
195
+
393 196
 $(function() {
394
-	createWebSocket()
395
-	 SayBusy()
197
+	
396 198
 	loginTimeLimit(); //登录
397 199
 
398 200
 	var mySwiper = new Swiper('.swiper-container', {
399
-//		loop: true,
400
-//		autoplay: {
401
-//			delay: 60000,
402
-//		},
201
+
403 202
 		pagination: { /* 分页器*/
404 203
 			el: '.swiper-pagination',
405 204
 			clickable: true,
@@ -408,8 +207,7 @@ $(function() {
408 207
 			nextEl: '.swiper-button-next',
409 208
 			prevEl: '.swiper-button-prev',
410 209
 		},
411
-		//				followFinger : false,
412
-		//				speed:800,
210
+
413 211
 		on: {
414 212
 			init: function() {
415 213
 				swiperAnimateCache(this); //隐藏动画元素 
@@ -1244,7 +1042,6 @@ function partTwo(starts, ends, areaOneVal) {
1244 1042
 			},
1245 1043
 			success: function(data) {
1246 1044
 				if(data.state.toLowerCase() == "success") {
1247
-					//					layer.close(index);
1248 1045
 					var con = data.data;
1249 1046
 					con.person=person
1250 1047
 					todyPhoneCount.setOption({

+ 88 - 31
WebUI/CallCenterWeb.UI/CommonHtml/PrintPreview-1.html

@@ -20,15 +20,17 @@
20 20
 				box-shadow: 1px 1px 9px 2px #D2D2D2;
21 21
 				background-color: #fff;
22 22
 				padding: 30px 60px 80px 60px;
23
+				font-size: 16px;
23 24
 			}
24 25
 			
25 26
 			.yzimg {
26 27
 				position: absolute;
27 28
 				right: 10%;
28
-				top:43%;
29
-                width: 109px;
30
-                height: 109px;
31
-                z-index: 99;		
29
+				top:20%;
30
+				    width: 260px;
31
+				    height: 260px;
32
+					z-index: 99;
33
+					
32 34
 			}
33 35
 
34 36
 			.alignC {
@@ -70,7 +72,7 @@
70 72
 				margin: 0 auto;
71 73
 				width: 100%;
72 74
 				border-collapse: collapse;
73
-				font-size: 13pt;
75
+				font-size: 16pt;
74 76
 				font-family: "仿宋";
75 77
 			}
76 78
 			
@@ -96,9 +98,9 @@
96 98
 				word-break: break-all;
97 99
 			}
98 100
 			/*		.mmdj,.lxr,.cbyj,.ldps,.bljg{
99
-			    width: 539px;
100
-			    display: inline-block;
101
-		    } */
101
+			width: 539px;
102
+			display: inline-block;
103
+		} */
102 104
 			
103 105
 			.jbyj {
104 106
 				width: 558px;
@@ -141,7 +143,7 @@
141 143
 			.headerAlign h2 {
142 144
 				font-family: "宋体" !important;
143 145
 				font-weight: bold !important;
144
-				font-size: 30pt !important;
146
+				font-size: 22pt !important;
145 147
 				letter-spacing: -1px !important;
146 148
 			}
147 149
 			
@@ -152,7 +154,7 @@
152 154
 				height: 200px!important;
153 155
 			}
154 156
 			.zhaiyao{
155
-				height: 260px!important;
157
+				height: 250px!important;
156 158
 			}
157 159
 			.headerAlign h3 div:nth-of-type(1) {
158 160
 				font-size: 14pt !important;
@@ -188,16 +190,13 @@
188 190
 				text-indent: .3em;
189 191
 				padding: 4px;
190 192
 			}
191
-
192
-			.schedulingTitle {
193
-                height: 260px !important;
194
-            }
195
-
193
+			
196 194
 			.printdd {
197 195
 				position: relative;
198 196
 				text-align: justify !important;
199 197
 				padding: 4px 2px 4px 4px !important;
200 198
 			}
199
+			
201 200
 			.printnr,
202 201
 			.printcb,
203 202
 			.printldps,
@@ -210,6 +209,27 @@
210 209
 			@page {
211 210
 				size: A4 portrait;
212 211
 			}
212
+			.printTr1{
213
+				height: 25px !important;
214
+			}
215
+			.printTr2{
216
+				height: 25px !important;
217
+			}
218
+			.printTr3{
219
+				height: 30px !important;
220
+			}
221
+			.printTr4{
222
+				height: 120px !important;
223
+			}
224
+			.printTr5{
225
+				height: 25px !important;
226
+			}
227
+			.printTr6{
228
+				height: 260px !important;
229
+			}
230
+			.printTr7{
231
+				height: 150px !important;
232
+			}
213 233
 		</style>
214 234
 
215 235
 	</head>
@@ -225,7 +245,7 @@
225 245
 			</div>
226 246
 			<table class="alignC" border="1" cellpadding="4" cellspacing="0" bordercolor="#cbcbcb">
227 247
 				<tbody>
228
-					<tr style="min-height: 49px;">
248
+					<tr class="printTr1" style="height: 50px; font-size: 14pt;">
229 249
 						<td style="font-weight: bolder;" rowspan="2" width="100px">事项编号
230 250
 						</td>
231 251
 						<td rowspan="2" width="154px">
@@ -244,7 +264,7 @@
244 264
 						
245 265
 					</tr>
246 266
 				
247
-					<tr style="min-height: 49px;">
267
+					<tr class="printTr2" style="height: 50px;">
248 268
 						<td style="font-weight: bolder;" width="120px">签收时间</td>
249 269
 						<td ><span class="QSHJ"></span></td>
250 270
 						
@@ -261,7 +281,8 @@
261 281
 							<span class="MJ"></span>
262 282
 						</td> -->
263 283
 					</tr>
264
-					<tr style="min-height: 29px;">
284
+					
285
+					<tr class="printTr3" style="height: 60px;">
265 286
 						<td style="font-weight: bolder;">
266 287
 							事项区域
267 288
 						</td>
@@ -269,14 +290,16 @@
269 290
 							<span class="mmdj"></span>
270 291
 						</td>
271 292
 					</tr>
272
-					<tr style="min-height: 120px;">
293
+					
294
+					<tr class="printTr4" style="height: 340px;">
273 295
 						<td width="60px" style="font-weight: bolder;" class="style1 zhaiyao" >内容摘要
274 296
 						</td>
275 297
 						<td class="printnr" colspan="7">
276 298
 							<span class="lxr"></span>
277 299
 						</td>
278 300
 					</tr>
279
-					<tr style="min-height: 20px;">
301
+					
302
+					<tr class="printTr5" style="height: 50px;">
280 303
 						<td style="font-weight: bolder;">
281 304
 							主办单位
282 305
 						</td>
@@ -292,19 +315,19 @@
292 315
 						</td>
293 316
 					</tr>
294 317
 					
295
-					
296
-					<tr style="height: 130px;">
297
-						<td class="schedulingTitle" style="font-weight: bolder;">
318
+					<tr class="printTr6" style="height: 340px;">
319
+						<td style="font-weight: bolder;">
298 320
 							<span>调度意见</span>
299 321
 						</td>
300 322
 						<td class="printdd" colspan="7">
301
-							<img class="img yzimg" src="../img/yinzhang.png">
323
+							<img id="create_image" class="img yzimg" src="../img/yinzhang.png">
302 324
 							
303
-							<span class="jbyj" style="width: 100%;">&nbsp;&nbsp;请于1小时内与来电人取得联系(匿名除外),于5个工作日内将办理情况反馈来电人,并将办理结果报市长便民公开电话受理中心,同时做好匿名来电的信息保密工作。(若超期将进行通报;若无故不回复,将转交市委政府督查局。</span>
325
+							<span class="jbyj" style="width: 100%;">&nbsp;&nbsp;请于1小时内与来电人取得联系(匿名除外),于5个工作日内将办理情况反馈来电人,并将办理结果报市长便民公开电话受理中心,同时做好匿名来电的信息保密工作。(若超期将进行通报;若无故不回复,将转交市委政府督查局。</span>
304 326
 						    <span class="nowtime" style="width:180px;float: right;font-weight: bolder;margin-right: 20px;margin-bottom: 0px;font-size: 18px;"></span>
305 327
 						</td>
306 328
 					</tr>
307
-					<tr style="height: 130px;">
329
+					
330
+					<tr class="printTr7" style="height: 195px;">
308 331
 						<td style="font-weight: bolder;">
309 332
 							<span>承办意见</span>
310 333
 						</td>
@@ -312,7 +335,8 @@
312 335
 							<span class="cbyj"></span>
313 336
 						</td>
314 337
 					</tr>
315
-					<tr style="height: 100px;">
338
+					
339
+					<tr class="printTr7" style="height: 195px;">
316 340
 						<td style="font-weight: bolder;">
317 341
 							<span>领导批示</span>
318 342
 						</td>
@@ -320,7 +344,8 @@
320 344
 							<span class="ldps"></span>
321 345
 						</td>
322 346
 					</tr>
323
-					<tr class="result_td" style="height: 100px;">
347
+					
348
+					<tr class="result_td printTr7" style="height: 195px;">
324 349
 						<td style="font-weight: bolder;">
325 350
 							处理结果
326 351
 						</td>
@@ -330,7 +355,7 @@
330 355
 					</tr>
331 356
 				</tbody>
332 357
 			</table>
333
-			<div id="" style="width: 100%; height: 20px;">
358
+			<div id="" style="width: 100%; height: 40px;">
334 359
 				<div id="" style="float: left;width: 180px;">
335 360
 					<strong>联系电话:</strong><span>(0372)12345</span>
336 361
 				</div>
@@ -344,7 +369,7 @@
344 369
 		<!--endprint1-->
345 370
 
346 371
 		<div class="alignC">
347
-			<input type="button" value="导出Word" class="btn" id="btn-html2canvas" />
372
+			<input type="button" value="导出pdf" class="btn" id="btn-html2canvas" />
348 373
 			<input type="button" value="打印" class="btn" onclick="preview(1)" />
349 374
 		</div>
350 375
 
@@ -439,8 +464,40 @@
439 464
 						}
440 465
 					})
441 466
 				}
467
+				//克隆一个table(因为显示样式与导出样式不一致,所有用此方法解决)
468
+				var cloneDom = $(".dataTables_list").clone(true);
469
+				//排版,不显示在页面上(不能用display:none,会导致无法生成url)
470
+				cloneDom.css({ "position": "absolute", "top": "0px", "z-index": "-1", "width":600 });
471
+				
472
+				//设置id(用于销毁,否则会导致页面重复生成table)
473
+				
474
+				cloneDom.attr("id", "tmp_datatable");
475
+				$("body").append(cloneDom);
476
+				
477
+				//生成图片下载链接
478
+				html2canvas(cloneDom[0]).then(function(canvas)
479
+				{
480
+				  var imgUri = canvas.toDataURL();
481
+				
482
+				  //销毁克隆对象
483
+				  cloneDom.empty();
484
+				
485
+				  $("#tmp_datatable").remove();
486
+				
487
+				  $("#create_image").attr('href', imgUri);
488
+				  $("#create_image").css("display","");
489
+				})
490
+				
442 491
 				$("#btn-html2canvas").on("click", function() {
443
-					$("#main").wordExport();
492
+					
493
+					var pdf = new jsPDF('p', 'mm', 'a4'); 
494
+					var filename = '工单详情'; 
495
+					//$('#ol_article_content').css("padding", "80px 0px")
496
+					pdf.addHTML($('#main'), function(){
497
+							pdf.output("save", filename)
498
+					})
499
+					 
500
+					//$("#main").wordExport();
444 501
 					//				    parent.parent.layer.closeAll();
445 502
 					//					parent.parent.$('#orderlist').bootstrapTable('refresh');
446 503
 					//					parent.parent.layer.msg("操作成功!");