|
@@ -33,4 +33,58 @@ app.controller('wxDetailCtrl', ["$scope", "i18nService", "$rootScope", "$state",
|
33
|
33
|
$scope.closeBigImg=function(){
|
34
|
34
|
$scope.showBigImg=false
|
35
|
35
|
}
|
|
36
|
+ $scope.dialout = function (teleno) {
|
|
37
|
+ // var gid = "@0";
|
|
38
|
+ // var telephone = "9" + teleno;
|
|
39
|
+ $rootScope.callout = 2;
|
|
40
|
+ // var agcount = tlwsa.tlaGetagentcount();
|
|
41
|
+ // var agcountFlag = false;
|
|
42
|
+ // console.log(teleno)
|
|
43
|
+ // // 查询当前话机是否签入
|
|
44
|
+ // for (var i = 0; i < agcount; i++) {
|
|
45
|
+ // if (tlwsa.tlaGetagentwid(i) == $rootScope.phoneNumber) {
|
|
46
|
+ // agcountFlag = true;
|
|
47
|
+ // }
|
|
48
|
+ // }
|
|
49
|
+ if (localStorage.getItem('fenjiNumber')) {
|
|
50
|
+ // var caller = localStorage.getItem('phoneNumber');//呼叫人
|
|
51
|
+ // console.log(sessionStorage.getItem('phones'))
|
|
52
|
+ // var phones = JSON.parse(sessionStorage.getItem('phones'));
|
|
53
|
+ // var isHuajihao = phones.length?phones.some(v=>v == teleno):false;
|
|
54
|
+ // console.log(isHuajihao)
|
|
55
|
+ // if(isHuajihao){
|
|
56
|
+ // tlwsa.tlaCallagc(teleno);
|
|
57
|
+ // }else{
|
|
58
|
+ // tlwsa.tlaCallout(teleno, caller, 0);
|
|
59
|
+ // }
|
|
60
|
+ // var caller = localStorage.getItem('fenjiNumber');//呼叫人
|
|
61
|
+ $rootScope.toggle('off-sidebar');
|
|
62
|
+ // tlwsa.tlaCallout(teleno, caller, 0);
|
|
63
|
+ }else if(localStorage.getItem('hk_phone')){
|
|
64
|
+ var gid = "@0"
|
|
65
|
+ var telephone = '9' + teleno
|
|
66
|
+ $rootScope.callout = 2;
|
|
67
|
+ if ($rootScope.takes) {
|
|
68
|
+ api_text.dialout($rootScope.takes, gid, telephone).then(function (data) {
|
|
69
|
+ if (data.errno == 0) {
|
|
70
|
+ $rootScope.status = 6;
|
|
71
|
+ }
|
|
72
|
+ })
|
|
73
|
+ } else {
|
|
74
|
+ SweetAlert.swal({
|
|
75
|
+ title: "呼叫失败",
|
|
76
|
+ text: "请先签入呼叫中心!",
|
|
77
|
+ type: "error",
|
|
78
|
+ confirmButtonColor: "#DD6B55"
|
|
79
|
+ });
|
|
80
|
+ }
|
|
81
|
+ } else {
|
|
82
|
+ SweetAlert.swal({
|
|
83
|
+ title: "呼叫失败",
|
|
84
|
+ text: "请先签入呼叫中心!",
|
|
85
|
+ type: "error",
|
|
86
|
+ confirmButtonColor: "#DD6B55",
|
|
87
|
+ });
|
|
88
|
+ }
|
|
89
|
+ };
|
36
|
90
|
}]);
|