zhengbingbing преди 7 години
родител
ревизия
e007e86845
променени са 2 файла, в които са добавени 50 реда и са изтрити 27 реда
  1. 2 2
      CallCenterWeb.UI/index.html
  2. 48 25
      CallCenterWeb.UI/js/newtx.js

+ 2 - 2
CallCenterWeb.UI/index.html

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

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

@@ -66,7 +66,10 @@ $(document).ready(function() {
66 66
 						AgentFree();
67 67
 						break; //置闲
68 68
 					case "MakeCall":
69
-						//otype 1外呼 2转移 3多方通话
69
+					    //otype 1外呼 2转移 3多方通话
70
+					    AgentBusy();
71
+					    becallout = true;
72
+					    becallcome = false;
70 73
 						$(".hidCallID").val("");
71 74
 						$("#hidwhtype").val(fun);
72 75
 						$("#hfOtype").val(1);
@@ -803,39 +806,33 @@ $(document).ready(function() {
803 806
 										extnumber:extnumber,
804 807
 										timeno:timeno,
805 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 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 824
 							becallout = false;
830 825
 							becallcome = true;
831 826
 						} else if(status == 1) {
832
-							
827
+						    console.log($('#callId').val());
833 828
 							//更新摘机事件
834 829
 									$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateZJ',{
835 830
 										callid:$('#callId').val(),
836 831
 										timeno:timeno,
837 832
 										"token": $.cookie("token")
838
-									},function(res){
833
+									}, function (res) {
834
+									    console.log("CallInScreen/UpdateZJ");
835
+									    console.log(res);
839 836
 //										if(res.state.toLowerCase() == "success") {
840 837
 //											$('#callId').val(res.data.CallId);
841 838
 //										}
@@ -844,14 +841,15 @@ $(document).ready(function() {
844 841
 							Form_setWinfromenble("True", "false", "false", "false", "True", "True", "True", "false", "false", "false");
845 842
 							setAgentStatus("忙");
846 843
 
847
-						} else if(status == 2) {
844
+						} else if (status == 2) {
845
+						    console.log("CallInScreen/UpdateGJ");
848 846
 							//更新挂机事件
849 847
 							$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateGJ',{
850 848
 								callid:$('#callId').val(),
851 849
 								timeno:timeno,
852 850
 								"token": $.cookie("token")
853 851
 							},function(res){
854
-							
852
+							    console.log(res);
855 853
 							});
856 854
 							Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "false");
857 855
 							setAgentStatus("空闲");
@@ -865,8 +863,28 @@ $(document).ready(function() {
865 863
 //					}
866 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 886
 				function Form_callCommingCaller(callerNum, callid, calledType) {
887
+				    console.log('callid' + callid + 'calledType' + calledType);
870 888
 					becallout = false;
871 889
 					becallcome = true;
872 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,13 +900,18 @@ $(document).ready(function() {
882 900
 				}
883 901
 				//录音成功
884 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 907
 					var timeno = new Date().getTime();
886 908
 					$.get(huayi.config.callcenter_url + 'CallInScreen/UpdateLY',{
887 909
 						callid:$('#callId').val(),
888 910
 						path:parth,
889 911
 						timeno:timeno,
890 912
 						"token": $.cookie("token")
891
-					},function(res){
913
+					}, function (res) {
914
+					    console.log(res);
892 915
 //						if(res.state.toLowerCase() == "success") {
893 916
 //						}
894 917
 					});