zhengbingbing 7 anni fa
parent
commit
e007e86845
2 ha cambiato i file con 50 aggiunte e 27 eliminazioni
  1. 2 2
      CallCenterWeb.UI/index.html
  2. 48 25
      CallCenterWeb.UI/js/newtx.js

+ 2 - 2
CallCenterWeb.UI/index.html

1465
 				callid: $('#callId').val(),
1465
 				callid: $('#callId').val(),
1466
 				"token": $.cookie("token")
1466
 				"token": $.cookie("token")
1467
 			}, function(res) {
1467
 			}, function(res) {
1468
-				if(res.state.toLowerCase() == "success") {
1468
+				//if(res.state.toLowerCase() == "success") {
1469
 					//											console.log('挂机成功' );
1469
 					//											console.log('挂机成功' );
1470
-				}
1470
+				//}
1471
 			});
1471
 			});
1472
 			$('#callId').val('');
1472
 			$('#callId').val('');
1473
 			$("#callNumber").val('');
1473
 			$("#callNumber").val('');

+ 48 - 25
CallCenterWeb.UI/js/newtx.js

66
 						AgentFree();
66
 						AgentFree();
67
 						break; //置闲
67
 						break; //置闲
68
 					case "MakeCall":
68
 					case "MakeCall":
69
-						//otype 1外呼 2转移 3多方通话
69
+					    //otype 1外呼 2转移 3多方通话
70
+					    AgentBusy();
71
+					    becallout = true;
72
+					    becallcome = false;
70
 						$(".hidCallID").val("");
73
 						$(".hidCallID").val("");
71
 						$("#hidwhtype").val(fun);
74
 						$("#hidwhtype").val(fun);
72
 						$("#hfOtype").val(1);
75
 						$("#hfOtype").val(1);
803
 										extnumber:extnumber,
806
 										extnumber:extnumber,
804
 										timeno:timeno,
807
 										timeno:timeno,
805
 										"token": $.cookie("token")
808
 										"token": $.cookie("token")
806
-									},function(res){
807
-										if(res.state== "success") {
808
-											$('#callId').val(res.data.CallId);
809
+									}, function (res) {
810
+									    res = JSON.parse(res);
811
+									    if (res.state == "success") {
812
+									        document.getElementById("callId").value = res.data.CallId;
813
+											//$('#callId').val(res.data.CallId);
809
 											$('#BusinessType').val(res.data.BusinessType);
814
 											$('#BusinessType').val(res.data.BusinessType);
810
-											callId=res.data.CallId;
815
+											callId = res.data.CallId;
816
+											console.log(res.data.CallId);
817
+											updateZL(res.data.CallId);
818
+											Form_callCommingCaller(telphone, res.data.CallId, res.data.BusinessType);
811
 										}
819
 										}
812
 									});
820
 									});
813
-									//更新振铃事件
814
-									$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateZL',{
815
-										callid:$('#callId').val(),
816
-										userid:userid,
817
-										usercode:usercode,
818
-										username:username,
819
-										extnumber:extnumber,
820
-										timeno:timeno,
821
-										"token": $.cookie("token")
822
-									},function(res){
823
-//										if(res.state.toLowerCase() == "success") {
824
-//										}
825
-									});
826
-								
827
-								Form_callCommingCaller(telphone, $('#callId').val(),$('#BusinessType').val());
821
+									console.log($('#callId').val());
822
+								    //Form_callCommingCaller(telphone, $('#callId').val(),$('#BusinessType').val());
828
 							}
823
 							}
829
 							becallout = false;
824
 							becallout = false;
830
 							becallcome = true;
825
 							becallcome = true;
831
 						} else if(status == 1) {
826
 						} else if(status == 1) {
832
-							
827
+						    console.log($('#callId').val());
833
 							//更新摘机事件
828
 							//更新摘机事件
834
 									$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateZJ',{
829
 									$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateZJ',{
835
 										callid:$('#callId').val(),
830
 										callid:$('#callId').val(),
836
 										timeno:timeno,
831
 										timeno:timeno,
837
 										"token": $.cookie("token")
832
 										"token": $.cookie("token")
838
-									},function(res){
833
+									}, function (res) {
834
+									    console.log("CallInScreen/UpdateZJ");
835
+									    console.log(res);
839
 //										if(res.state.toLowerCase() == "success") {
836
 //										if(res.state.toLowerCase() == "success") {
840
 //											$('#callId').val(res.data.CallId);
837
 //											$('#callId').val(res.data.CallId);
841
 //										}
838
 //										}
844
 							Form_setWinfromenble("True", "false", "false", "false", "True", "True", "True", "false", "false", "false");
841
 							Form_setWinfromenble("True", "false", "false", "false", "True", "True", "True", "false", "false", "false");
845
 							setAgentStatus("忙");
842
 							setAgentStatus("忙");
846
 
843
 
847
-						} else if(status == 2) {
844
+						} else if (status == 2) {
845
+						    console.log("CallInScreen/UpdateGJ");
848
 							//更新挂机事件
846
 							//更新挂机事件
849
 							$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateGJ',{
847
 							$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateGJ',{
850
 								callid:$('#callId').val(),
848
 								callid:$('#callId').val(),
851
 								timeno:timeno,
849
 								timeno:timeno,
852
 								"token": $.cookie("token")
850
 								"token": $.cookie("token")
853
 							},function(res){
851
 							},function(res){
854
-							
852
+							    console.log(res);
855
 							});
853
 							});
856
 							Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "false");
854
 							Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "false");
857
 							setAgentStatus("空闲");
855
 							setAgentStatus("空闲");
865
 //					}
863
 //					}
866
 					console.log("话机状态:" + status);
864
 					console.log("话机状态:" + status);
867
 				}
865
 				}
866
+                //更新振铃事件
867
+				function updateZL(callids){
868
+				   
869
+				    $.get(huayi.config.callcenter_url + 'CallInScreen/UpdateZL', {
870
+				        callid: callids,
871
+				        //userid:userid,
872
+				        //usercode:usercode,
873
+				        //username:username,
874
+				        //extnumber:extnumber,
875
+				        //timeno:timeno,
876
+				        "token": $.cookie("token")
877
+				    }, function (res) {
878
+				        console.log("CallInScreen/UpdateZL");
879
+				        console.log(res);
880
+				        //										if(res.state.toLowerCase() == "success") {
881
+				        //										}
882
+				    });
883
+
884
+				}
868
 				//来电弹屏事件
885
 				//来电弹屏事件
869
 				function Form_callCommingCaller(callerNum, callid, calledType) {
886
 				function Form_callCommingCaller(callerNum, callid, calledType) {
887
+				    console.log('callid' + callid + 'calledType' + calledType);
870
 					becallout = false;
888
 					becallout = false;
871
 					becallcome = true;
889
 					becallcome = true;
872
 					var p = '<a href="javascript:;" class="active J_menuTab" data-id="./callScreen/callScreen.html?Number=' + callerNum + '&CallID=' + callid + '&callType='+ calledType +'">来电弹屏' + callerNum + ' <i class="fa fa-times-circle"></i></a>';
890
 					var p = '<a href="javascript:;" class="active J_menuTab" data-id="./callScreen/callScreen.html?Number=' + callerNum + '&CallID=' + callid + '&callType='+ calledType +'">来电弹屏' + callerNum + ' <i class="fa fa-times-circle"></i></a>';
882
 				}
900
 				}
883
 				//录音成功
901
 				//录音成功
884
 				function Form_callComming(callerNum, parth) {
902
 				function Form_callComming(callerNum, parth) {
903
+				    console.log('CallInScreen/UpdateLY');
904
+				    console.log(parth);
905
+				    console.log(callerNum);
906
+				    console.log($('#callId').val());
885
 					var timeno = new Date().getTime();
907
 					var timeno = new Date().getTime();
886
 					$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateLY',{
908
 					$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateLY',{
887
 						callid:$('#callId').val(),
909
 						callid:$('#callId').val(),
888
 						path:parth,
910
 						path:parth,
889
 						timeno:timeno,
911
 						timeno:timeno,
890
 						"token": $.cookie("token")
912
 						"token": $.cookie("token")
891
-					},function(res){
913
+					}, function (res) {
914
+					    console.log(res);
892
 //						if(res.state.toLowerCase() == "success") {
915
 //						if(res.state.toLowerCase() == "success") {
893
 //						}
916
 //						}
894
 					});
917
 					});