Browse Source

呼叫中心手动加状态

seimin 3 years ago
parent
commit
001bb3c7cf

+ 12 - 12
assets/js/controllers/customform/customformCtrl.js

@@ -14997,19 +14997,19 @@ appFormly.config(function config(formlyConfigProvider) {
14997
       "SweetAlert",
14997
       "SweetAlert",
14998
       function ($scope, $rootScope, api_text, SweetAlert) {
14998
       function ($scope, $rootScope, api_text, SweetAlert) {
14999
         $scope.dialout = function (teleno) {
14999
         $scope.dialout = function (teleno) {
15000
-          var gid = "@0";
15001
-          var telephone = "9" + teleno;
15000
+          // var gid = "@0";
15001
+          // var telephone = "9" + teleno;
15002
           $rootScope.callout = 2;
15002
           $rootScope.callout = 2;
15003
-          var agcount = tlwsa.tlaGetagentcount();
15004
-          var agcountFlag = false;
15005
-          console.log(teleno)
15006
-          // 查询当前话机是否签入
15007
-          for (var i = 0; i < agcount; i++) {
15008
-            if (tlwsa.tlaGetagentwid(i) == $rootScope.phoneNumber) {
15009
-              agcountFlag = true;
15010
-            }
15011
-          }
15012
-          if (agcountFlag) {
15003
+          // var agcount = tlwsa.tlaGetagentcount();
15004
+          // var agcountFlag = false;
15005
+          // console.log(teleno)
15006
+          // // 查询当前话机是否签入
15007
+          // for (var i = 0; i < agcount; i++) {
15008
+          //   if (tlwsa.tlaGetagentwid(i) == $rootScope.phoneNumber) {
15009
+          //     agcountFlag = true;
15010
+          //   }
15011
+          // }
15012
+          if (localStorage.getItem('phoneNumber')) {
15013
             var caller = localStorage.getItem('phoneNumber');//呼叫人
15013
             var caller = localStorage.getItem('phoneNumber');//呼叫人
15014
             console.log(sessionStorage.getItem('phones'))
15014
             console.log(sessionStorage.getItem('phones'))
15015
             var phones = JSON.parse(sessionStorage.getItem('phones'));
15015
             var phones = JSON.parse(sessionStorage.getItem('phones'));

+ 14 - 15
assets/js/controllers/desk/calllogCtrl.js

@@ -136,11 +136,10 @@ app.controller('calllogCtrl', ["$scope", "i18nService", "$rootScope", "$state",
136
         }
136
         }
137
     }
137
     }
138
     $scope.isHuibo=function(data){
138
     $scope.isHuibo=function(data){
139
-        if(data.callerIdNumber != $rootScope.phoneNumber){
140
-            return true
141
-        }else{
142
-            return false
143
-        }
139
+        var phones = JSON.parse(sessionStorage.getItem('phones'));
140
+        console.log(phones,data.callerIdNumber)
141
+        var isHuajihao = phones.length?phones.some(v=>v == data.callerIdNumber):false;
142
+        return !isHuajihao;
144
     }
143
     }
145
     $scope.chuli=false;
144
     $scope.chuli=false;
146
     for(var i=0;i<loginUser.menu.length;i++){
145
     for(var i=0;i<loginUser.menu.length;i++){
@@ -342,16 +341,16 @@ app.controller('calllogCtrl', ["$scope", "i18nService", "$rootScope", "$state",
342
         //     });
341
         //     });
343
         // }
342
         // }
344
         // $rootScope.dial(data.callerIdNumber)
343
         // $rootScope.dial(data.callerIdNumber)
345
-        var agcount = tlwsa.tlaGetagentcount();
346
-          var agcountFlag = false;
347
-          console.log(data.callerIdNumber)
348
-          // 查询当前话机是否签入
349
-          for (var i = 0; i < agcount; i++) {
350
-            if (tlwsa.tlaGetagentwid(i) == $rootScope.phoneNumber) {
351
-              agcountFlag = true;
352
-            }
353
-          }
354
-          if (agcountFlag) {
344
+        // var agcount = tlwsa.tlaGetagentcount();
345
+        //   var agcountFlag = false;
346
+        //   console.log(data.callerIdNumber)
347
+        //   // 查询当前话机是否签入
348
+        //   for (var i = 0; i < agcount; i++) {
349
+        //     if (tlwsa.tlaGetagentwid(i) == $rootScope.phoneNumber) {
350
+        //       agcountFlag = true;
351
+        //     }
352
+        //   }
353
+          if (localStorage.getItem('phoneNumber')) {
355
             var caller = localStorage.getItem('phoneNumber');//呼叫人
354
             var caller = localStorage.getItem('phoneNumber');//呼叫人
356
             console.log(sessionStorage.getItem('phones'))
355
             console.log(sessionStorage.getItem('phones'))
357
             var phones = JSON.parse(sessionStorage.getItem('phones'));
356
             var phones = JSON.parse(sessionStorage.getItem('phones'));

+ 78 - 52
assets/js/controllers/desk/recordCtrl.js

@@ -320,43 +320,44 @@ app.controller('recordCtrl', ["$scope", "i18nService", "$rootScope", "$state", "
320
             backdrop: "static",
320
             backdrop: "static",
321
             templateUrl: 'assets/views/incident/tpl/audio.html',
321
             templateUrl: 'assets/views/incident/tpl/audio.html',
322
             controller: function($rootScope, $scope, $modalInstance, $sce, $http, api_playservice) {
322
             controller: function($rootScope, $scope, $modalInstance, $sce, $http, api_playservice) {
323
-                $rootScope.setbusy();
324
-                $scope.datasurl = "";
325
-                $http({
326
-                    url: callIp + "/recording/recording?recordId=" + data.id,
327
-                    method: 'GET',
328
-                    headers: {},
329
-                }).success(function(data, status, headers, config) {
330
-                    $scope.data = {
331
-                        "name": "视频",
332
-                        "url": $sce.trustAsResourceUrl("http://" + data.rrpath)
333
-                    };
334
-                    $scope.datasurl = data.rrpath;
335
-                }).error(function(data, status, headers, config) {});
336
-                $scope.download = function(contentId, filename) {
337
-                    $http({
338
-                        url: "http://" + $scope.datasurl,
339
-                        method: 'GET',
340
-                        headers: {
341
-                            'Content-type': 'application/octet-stream',
342
-                        },
343
-                        responseType: 'arraybuffer'
344
-                    }).success(function(data, status, headers, config) {
345
-                        var file = new Blob([data], {
346
-                            type: 'application/octet-stream'
347
-                        });
348
-                        //trick to download store a file having its URL
349
-                        var fileURL = URL.createObjectURL(file);
350
-                        var a = document.createElement('a');
351
-                        a.href = fileURL;
352
-                        a.target = '_blank';
353
-                        a.download = filename;
354
-                        document.body.appendChild(a);
355
-                        a.click();
356
-                    }).error(function(data, status, headers, config) {
357
-                        // console.log(data);
358
-                    });
359
-                }
323
+                $scope.audioUrl=$sce.trustAsResourceUrl(callIp+data.recFileName);
324
+                // $rootScope.setbusy();
325
+                // $scope.datasurl = "";
326
+                // $http({
327
+                //     url: callIp + "/recording/recording?recordId=" + data.id,
328
+                //     method: 'GET',
329
+                //     headers: {},
330
+                // }).success(function(data, status, headers, config) {
331
+                //     $scope.data = {
332
+                //         "name": "视频",
333
+                //         "url": $sce.trustAsResourceUrl("http://" + data.rrpath)
334
+                //     };
335
+                //     $scope.datasurl = data.rrpath;
336
+                // }).error(function(data, status, headers, config) {});
337
+                // $scope.download = function(contentId, filename) {
338
+                //     $http({
339
+                //         url: "http://" + $scope.datasurl,
340
+                //         method: 'GET',
341
+                //         headers: {
342
+                //             'Content-type': 'application/octet-stream',
343
+                //         },
344
+                //         responseType: 'arraybuffer'
345
+                //     }).success(function(data, status, headers, config) {
346
+                //         var file = new Blob([data], {
347
+                //             type: 'application/octet-stream'
348
+                //         });
349
+                //         //trick to download store a file having its URL
350
+                //         var fileURL = URL.createObjectURL(file);
351
+                //         var a = document.createElement('a');
352
+                //         a.href = fileURL;
353
+                //         a.target = '_blank';
354
+                //         a.download = filename;
355
+                //         document.body.appendChild(a);
356
+                //         a.click();
357
+                //     }).error(function(data, status, headers, config) {
358
+                //         // console.log(data);
359
+                //     });
360
+                // }
360
                 $scope.cancel = function() {
361
                 $scope.cancel = function() {
361
                     $modalInstance.dismiss('cancel');
362
                     $modalInstance.dismiss('cancel');
362
                 };
363
                 };
@@ -373,23 +374,42 @@ app.controller('recordCtrl', ["$scope", "i18nService", "$rootScope", "$state", "
373
     };
374
     };
374
     /*--------- call --------- */
375
     /*--------- call --------- */
375
     $scope.recordcallid = function(data) {
376
     $scope.recordcallid = function(data) {
376
-        var telephone = '9' + data.ano;
377
+        // var telephone = '9' + data.ano;
377
         $rootScope.callout = 2;
378
         $rootScope.callout = 2;
378
-        if ($rootScope.takes) {
379
-            api_text.dialout($rootScope.takes, "@0", telephone).then(function(data) {
380
-                if (data.errno == 0) {
381
-                    $rootScope.status = 6;
382
-                    $scope.oldRecord(data);
383
-                }
384
-            })
385
-        } else {
379
+        // if ($rootScope.takes) {
380
+        //     api_text.dialout($rootScope.takes, "@0", telephone).then(function(data) {
381
+        //         if (data.errno == 0) {
382
+        //             $rootScope.status = 6;
383
+        //             $scope.oldRecord(data);
384
+        //         }
385
+        //     })
386
+        // } else {
387
+        //     SweetAlert.swal({
388
+        //         title: "呼叫失败",
389
+        //         text: "请先签入呼叫中心!",
390
+        //         type: "error",
391
+        //         confirmButtonColor: "#DD6B55"
392
+        //     });
393
+        // }
394
+        if (localStorage.getItem('phoneNumber')) {
395
+            var caller = localStorage.getItem('phoneNumber');//呼叫人
396
+            console.log(sessionStorage.getItem('phones'))
397
+            var phones = JSON.parse(sessionStorage.getItem('phones'));
398
+            var isHuajihao = phones.length?phones.some(v=>v == data.ano):false;
399
+            console.log(isHuajihao)
400
+            if(isHuajihao){
401
+              tlwsa.tlaCallagc(data.ano);//呼叫坐席
402
+            }else{
403
+              tlwsa.tlaCallout(data.ano, caller, 0);//呼叫外线
404
+            }
405
+          } else {
386
             SweetAlert.swal({
406
             SweetAlert.swal({
387
-                title: "呼叫失败",
388
-                text: "请先签入呼叫中心!",
389
-                type: "error",
390
-                confirmButtonColor: "#DD6B55"
407
+              title: "呼叫失败",
408
+              text: "请先签入呼叫中心!",
409
+              type: "error",
410
+              confirmButtonColor: "#DD6B55",
391
             });
411
             });
392
-        }
412
+          }
393
     };
413
     };
394
     /*--------- old record --------- */
414
     /*--------- old record --------- */
395
     $scope.oldRecord = function(data) {
415
     $scope.oldRecord = function(data) {
@@ -585,6 +605,12 @@ app.controller('Recordoperator', ['$rootScope', '$http', '$scope', '$modal', fun
585
     // } else {
605
     // } else {
586
     //     $scope.isvalid = false;
606
     //     $scope.isvalid = false;
587
     // }
607
     // }
608
+    $scope.isHuibo = (function(){
609
+        var phones = JSON.parse(sessionStorage.getItem('phones'));
610
+        console.log(phones,$scope.item.ano)
611
+        var isHuajihao = phones.length?phones.some(v=>v == $scope.item.ano):false;
612
+        return !isHuajihao;
613
+    })()
588
     $scope.weishouli=false;
614
     $scope.weishouli=false;
589
     $scope.yishouli=false;
615
     $scope.yishouli=false;
590
     $scope.bushouli=false;
616
     $scope.bushouli=false;
@@ -639,7 +665,7 @@ app.directive('recordoperator', function() {
639
             // '<a ng-click="record()"  ng-show="{{isvalid}}&&{{handle}}" class="luyinfont">有效</a>' +
665
             // '<a ng-click="record()"  ng-show="{{isvalid}}&&{{handle}}" class="luyinfont">有效</a>' +
640
             // '<a ng-click="record()"  ng-show="{{novalid}}&&{{handle}}" class="luyinfont">无效</a>' +
666
             // '<a ng-click="record()"  ng-show="{{novalid}}&&{{handle}}" class="luyinfont">无效</a>' +
641
             '<a ng-click="recordcall()" ng-show="(weishouli||yishouli)&&chuli" class="bianjifont">回放</a>' +
667
             '<a ng-click="recordcall()" ng-show="(weishouli||yishouli)&&chuli" class="bianjifont">回放</a>' +
642
-            '<a ng-click="recordcallid()" ng-show="(weishouli||yishouli)&&chuli" class="bianjifont">回拨</a>' +
668
+            '<a ng-click="recordcallid()" ng-show="(weishouli||yishouli)&&chuli&&isHuibo" class="bianjifont">回拨</a>' +
643
             '<a ng-click="toIncident()"  ng-show="yishouli" class="bianjifont">查看事件</a>' +
669
             '<a ng-click="toIncident()"  ng-show="yishouli" class="bianjifont">查看事件</a>' +
644
             '</div>'
670
             '</div>'
645
     };
671
     };

+ 138 - 98
assets/js/controllers/mainCtrl.js

@@ -49,20 +49,30 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
49
       console.log(event, toState, toParams, fromState, fromParams, 'cao')
49
       console.log(event, toState, toParams, fromState, fromParams, 'cao')
50
       if ((toState.name == 'app.incident.chart' || toState.name == 'app.incident.editor') &&
50
       if ((toState.name == 'app.incident.chart' || toState.name == 'app.incident.editor') &&
51
         fromState.name) {
51
         fromState.name) {
52
-        $rootScope.phoneNumber = localStorage.getItem('phoneNumber');
53
-        //进入页面强制示忙
54
-        if (tlwsa) {
55
-          tlwsa.tlaForceacw($rootScope.phoneNumber);
52
+        console.log($rootScope.jry_state);
53
+        $scope.isShixian = false;
54
+        if($rootScope.jry_state == 'shixian'){
55
+          $rootScope.phoneNumber = localStorage.getItem('phoneNumber');
56
+          //进入页面强制示忙
57
+          if (tlwsa) {
58
+            // tlwsa.tlaForceacw($rootScope.phoneNumber);
59
+            setTimeout(()=>{
60
+              tlwsa.tlaAcw();
61
+            },0)
62
+          }
56
         }
63
         }
57
       }
64
       }
58
       if ((fromState.name == 'app.incident.chart' || fromState.name == 'app.incident.editor') &&
65
       if ((fromState.name == 'app.incident.chart' || fromState.name == 'app.incident.editor') &&
59
         toState.name != 'app.incident.chart' && toState.name != 'app.incident.editor'
66
         toState.name != 'app.incident.chart' && toState.name != 'app.incident.editor'
60
       ) {
67
       ) {
61
-        $rootScope.phoneNumber = localStorage.getItem('phoneNumber');
68
+        console.log($rootScope.jry_state);
69
+        // $rootScope.phoneNumber = localStorage.getItem('phoneNumber');
62
         //进入页面强制示闲
70
         //进入页面强制示闲
63
-        if (tlwsa) {
64
-          tlwsa.tlaForcewca($rootScope.phoneNumber);
65
-        }
71
+        $scope.isShixian = true;
72
+        // if (tlwsa) {
73
+        //   // tlwsa.tlaForcewca($rootScope.phoneNumber);
74
+        //   tlwsa.tlaWca();
75
+        // }
66
       }
76
       }
67
       if (isEmpty($auth.retrieveData('auth_headers'))) {
77
       if (isEmpty($auth.retrieveData('auth_headers'))) {
68
         // if (toState.name != "login.signin" && toState.name != "echart") {
78
         // if (toState.name != "login.signin" && toState.name != "echart") {
@@ -1292,21 +1302,39 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1292
         $rootScope.jry_extnNumberObj.jry_extnNumber = angular.copy(res[0]);//绑定分机对象
1302
         $rootScope.jry_extnNumberObj.jry_extnNumber = angular.copy(res[0]);//绑定分机对象
1293
         $rootScope.jry_extnNumberObj.tel1 = angular.copy(res[0]);//目的号码对象
1303
         $rootScope.jry_extnNumberObj.tel1 = angular.copy(res[0]);//目的号码对象
1294
         $rootScope.jry_extnNumberObj.tel2 = angular.copy(res[0]);//转接坐席对象
1304
         $rootScope.jry_extnNumberObj.tel2 = angular.copy(res[0]);//转接坐席对象
1305
+        $rootScope.preState = '';//最近一次示忙还是示闲的状态
1295
         //连接
1306
         //连接
1296
         tlwsa.tlaOpen(websocket_url);
1307
         tlwsa.tlaOpen(websocket_url);
1297
-        // 获取状态
1298
-        $scope.getState = function () {
1308
+        // 强制示忙
1309
+        $scope.qShimang = function(state){
1299
           if (location.href.includes('app/incident/editor') || location.href.includes('app/incident/chart')) {
1310
           if (location.href.includes('app/incident/editor') || location.href.includes('app/incident/chart')) {
1300
             //进入页面,强制示忙
1311
             //进入页面,强制示忙
1301
-            tlwsa.tlaForceacw($rootScope.phoneNumber);
1312
+            // tlwsa.tlaForceacw($rootScope.phoneNumber);
1313
+            setTimeout(()=>{
1314
+              tlwsa.tlaAcw();
1315
+            },0)
1316
+          }else{
1317
+            $scope.getState(state);
1302
           }
1318
           }
1303
-          var agcount = tlwsa.tlaGetagentcount();
1304
-          var flag = true;
1305
-          for (var i = 0; i < agcount; i++) {
1306
-            if (tlwsa.tlaGetagentwid(i) == $rootScope.phoneNumber) {
1307
-              flag = false;
1308
-              var state = Number(tlwsa.tlaGetagentstate(i));
1309
-              console.log(state);
1319
+        }
1320
+        // 获取状态
1321
+        $scope.getState = function (state) {
1322
+          // if (location.href.includes('app/incident/editor') || location.href.includes('app/incident/chart')) {
1323
+          //   if(state != 2&&state != 0){
1324
+          //     //进入页面,强制示忙
1325
+          //     // tlwsa.tlaForceacw($rootScope.phoneNumber);
1326
+          //     setTimeout(()=>{
1327
+          //       tlwsa.tlaAcw();
1328
+          //     },3000)
1329
+          //   }
1330
+          // }
1331
+          // var agcount = tlwsa.tlaGetagentcount();
1332
+          // var flag = true;
1333
+          // for (var i = 0; i < agcount; i++) {
1334
+            // if (tlwsa.tlaGetagentwid(i) == $rootScope.phoneNumber) {
1335
+              // flag = false;
1336
+              // var state = Number(tlwsa.tlaGetagentstate(i));
1337
+              // console.log(state);
1310
               switch (state) {
1338
               switch (state) {
1311
                 case 0:
1339
                 case 0:
1312
                   $rootScope.jry_state = 'weiqianru';
1340
                   $rootScope.jry_state = 'weiqianru';
@@ -1330,25 +1358,26 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1330
                   $rootScope.jry_state = 'zhengzaizhuanyi';
1358
                   $rootScope.jry_state = 'zhengzaizhuanyi';
1331
                   break;
1359
                   break;
1332
               }
1360
               }
1333
-            }
1334
-            console.log('agnet No. ' + i + ' workid is ' + tlwsa.tlaGetagentwid(i) + ' state is ' + tlwsa.tlaGetagentstate(i) + '  ' + getStateInfo(tlwsa.tlaGetagentstate(i)))
1335
-          }
1336
-          if (flag) {
1337
-            $rootScope.jry_state = 'weiqianru';
1338
-          }
1361
+            // }
1362
+            // console.log('agnet No. ' + i + ' workid is ' + tlwsa.tlaGetagentwid(i) + ' state is ' + tlwsa.tlaGetagentstate(i) + '  ' + getStateInfo(tlwsa.tlaGetagentstate(i)))
1363
+          // }
1364
+          // if (flag) {
1365
+          //   $rootScope.jry_state = 'weiqianru';
1366
+          // }
1339
         }
1367
         }
1340
         // 状态回调函数
1368
         // 状态回调函数
1341
-        TLWSA.onStatechange = onstatechange;
1342
-        function onstatechange() {
1343
-          console.log('事件:状态变化----------------------------------------------------');
1344
-          $scope.getState();
1345
-        }
1369
+        // TLWSA.onStatechange = onstatechange;
1370
+        // function onstatechange() {
1371
+        //   console.log('事件:状态变化----------------------------------------------------');
1372
+        //   $scope.getState();
1373
+        // }
1346
         //连接呼叫中心回调函数
1374
         //连接呼叫中心回调函数
1347
         TLWSA.onOpenreturn = onopenreturn;
1375
         TLWSA.onOpenreturn = onopenreturn;
1348
         function onopenreturn(err) {
1376
         function onopenreturn(err) {
1349
           err = Number(err);
1377
           err = Number(err);
1350
           if (!err) {
1378
           if (!err) {
1351
             console.log('呼叫中心连接成功-----seimin');
1379
             console.log('呼叫中心连接成功-----seimin');
1380
+            $scope.getState(0);
1352
             $.toaster({
1381
             $.toaster({
1353
               priority: 'info',
1382
               priority: 'info',
1354
               title: '操作',
1383
               title: '操作',
@@ -1361,13 +1390,13 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1361
             }
1390
             }
1362
           } else {
1391
           } else {
1363
             console.log('呼叫中心连接失败-----seimin');
1392
             console.log('呼叫中心连接失败-----seimin');
1393
+            $scope.getState(0);
1364
             $.toaster({
1394
             $.toaster({
1365
               priority: 'info',
1395
               priority: 'info',
1366
               title: '操作',
1396
               title: '操作',
1367
               message: '呼叫中心连接失败'
1397
               message: '呼叫中心连接失败'
1368
             });
1398
             });
1369
           }
1399
           }
1370
-
1371
         }
1400
         }
1372
         //绑定分机回调函数
1401
         //绑定分机回调函数
1373
         TLWSA.onSetphonenumberreturn = onsetphonenumberreturn;
1402
         TLWSA.onSetphonenumberreturn = onsetphonenumberreturn;
@@ -1380,14 +1409,11 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1380
               title: '操作',
1409
               title: '操作',
1381
               message: '绑定分机成功'
1410
               message: '绑定分机成功'
1382
             });
1411
             });
1383
-            // $rootScope.jry_state = 'shixian';
1384
             localStorage.setItem('phoneNumber', $rootScope.phoneNumber);
1412
             localStorage.setItem('phoneNumber', $rootScope.phoneNumber);
1385
-            if (location.href.includes('app/incident/editor') || location.href.includes('app/incident/chart')) {
1386
-              //进入页面,强制示忙
1387
-              tlwsa.tlaForceacw($rootScope.phoneNumber);
1388
-            }
1413
+            $scope.qShimang(1);
1389
           } else {
1414
           } else {
1390
             console.log('绑定分机失败-----seimin');
1415
             console.log('绑定分机失败-----seimin');
1416
+            $scope.getState(0);
1391
             $.toaster({
1417
             $.toaster({
1392
               priority: 'info',
1418
               priority: 'info',
1393
               title: '操作',
1419
               title: '操作',
@@ -1396,52 +1422,52 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1396
           }
1422
           }
1397
         }
1423
         }
1398
         //强制示忙回调函数
1424
         //强制示忙回调函数
1399
-        TLWSA.onAcw = onacw;
1400
-        function onacw(err) {
1401
-          err = Number(err);
1402
-          if (!err) {
1403
-            // $rootScope.jry_state = 'shimang';
1404
-            console.log('强制示忙成功-----seimin');
1405
-            $.toaster({
1406
-              priority: 'info',
1407
-              title: '操作',
1408
-              message: '示忙成功'
1409
-            });
1410
-          } else {
1411
-            console.log('强制示忙失败-----seimin');
1412
-            $.toaster({
1413
-              priority: 'info',
1414
-              title: '操作',
1415
-              message: '示忙失败'
1416
-            });
1417
-          }
1418
-        }
1419
-        //强制示闲回调函数
1420
-        TLWSA.onWca = onwca;
1421
-        function onwca(err) {
1422
-          console.log(err)
1423
-          err = Number(err);
1424
-          if (!err) {
1425
-            // $rootScope.jry_state = 'shixian';
1426
-            console.log('强制示闲成功-----seimin');
1427
-            $.toaster({
1428
-              priority: 'info',
1429
-              title: '操作',
1430
-              message: '示闲成功'
1431
-            });
1432
-          } else {
1433
-            console.log('强制示闲失败-----seimin');
1434
-            $.toaster({
1435
-              priority: 'info',
1436
-              title: '操作',
1437
-              message: '示闲失败'
1438
-            });
1439
-          }
1440
-        }
1425
+        // TLWSA.onAcw = onacw;
1426
+        // function onacw(err) {
1427
+        //   err = Number(err);
1428
+        //   if (!err) {
1429
+        //     console.log('强制示忙成功-----seimin');
1430
+        //     $scope.getState(2);
1431
+        //     $.toaster({
1432
+        //       priority: 'info',
1433
+        //       title: '操作',
1434
+        //       message: '示忙成功'
1435
+        //     });
1436
+        //   } else {
1437
+        //     console.log('强制示忙失败-----seimin');
1438
+        //     $.toaster({
1439
+        //       priority: 'info',
1440
+        //       title: '操作',
1441
+        //       message: '示忙失败'
1442
+        //     });
1443
+        //   }
1444
+        // }
1445
+        // //强制示闲回调函数
1446
+        // TLWSA.onWca = onwca;
1447
+        // function onwca(err) {
1448
+        //   console.log(err)
1449
+        //   err = Number(err);
1450
+        //   if (!err) {
1451
+        //     console.log('强制示闲成功-----seimin');
1452
+        //     $scope.getState(1);
1453
+        //     $.toaster({
1454
+        //       priority: 'info',
1455
+        //       title: '操作',
1456
+        //       message: '示闲成功'
1457
+        //     });
1458
+        //   } else {
1459
+        //     console.log('强制示闲失败-----seimin');
1460
+        //     $.toaster({
1461
+        //       priority: 'info',
1462
+        //       title: '操作',
1463
+        //       message: '示闲失败'
1464
+        //     });
1465
+        //   }
1466
+        // }
1441
         //与服务器网络连接中断回调函数
1467
         //与服务器网络连接中断回调函数
1442
         TLWSA.onClosed = onclosed;
1468
         TLWSA.onClosed = onclosed;
1443
         function onclosed() {
1469
         function onclosed() {
1444
-          $rootScope.jry_state = 'weiqianru';
1470
+          $scope.getState(0);
1445
           console.log('与服务器网络连接中断-----seimin');
1471
           console.log('与服务器网络连接中断-----seimin');
1446
           $.toaster({
1472
           $.toaster({
1447
             priority: 'info',
1473
             priority: 'info',
@@ -1484,7 +1510,7 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1484
               message: '签入失败'
1510
               message: '签入失败'
1485
             });
1511
             });
1486
           }
1512
           }
1487
-          tlwsa.tlaSubscribestateinfo(2);
1513
+          // tlwsa.tlaSubscribestateinfo(2);
1488
         }
1514
         }
1489
         // 强制签出回调函数
1515
         // 强制签出回调函数
1490
         TLWSA.onKillreturn = onkillreturn;
1516
         TLWSA.onKillreturn = onkillreturn;
@@ -1492,6 +1518,7 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1492
           err = Number(err);
1518
           err = Number(err);
1493
           if (!err) {
1519
           if (!err) {
1494
             console.log('强制签出成功-----seimin');
1520
             console.log('强制签出成功-----seimin');
1521
+            $scope.getState(0);
1495
             // $.toaster({
1522
             // $.toaster({
1496
             //   priority: 'info',
1523
             //   priority: 'info',
1497
             //   title: '操作',
1524
             //   title: '操作',
@@ -1518,12 +1545,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1518
           err = Number(err);
1545
           err = Number(err);
1519
           if (!err) {
1546
           if (!err) {
1520
             console.log('签出成功-----seimin');
1547
             console.log('签出成功-----seimin');
1548
+            $scope.getState(0);
1521
             $.toaster({
1549
             $.toaster({
1522
               priority: 'info',
1550
               priority: 'info',
1523
               title: '操作',
1551
               title: '操作',
1524
               message: '签出成功'
1552
               message: '签出成功'
1525
             });
1553
             });
1526
-            // $rootScope.jry_state = 'weiqianru';
1527
             localStorage.removeItem('phoneNumber');
1554
             localStorage.removeItem('phoneNumber');
1528
           } else {
1555
           } else {
1529
             console.log('签出失败-----seimin');
1556
             console.log('签出失败-----seimin');
@@ -1540,19 +1567,25 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1540
           err = Number(err);
1567
           err = Number(err);
1541
           if (!err) {
1568
           if (!err) {
1542
             console.log('示忙成功-----seimin');
1569
             console.log('示忙成功-----seimin');
1570
+            if (location.href.includes('app/incident/editor') || location.href.includes('app/incident/chart')) {
1571
+              $scope.isShixian = false;
1572
+            }else{
1573
+              $scope.isShixian = true;
1574
+            }
1575
+            $scope.getState(2);
1576
+            $rootScope.preState = 2;
1543
             $.toaster({
1577
             $.toaster({
1544
               priority: 'info',
1578
               priority: 'info',
1545
               title: '操作',
1579
               title: '操作',
1546
               message: '示忙成功'
1580
               message: '示忙成功'
1547
             });
1581
             });
1548
-            // $rootScope.jry_state = 'shimang';
1549
           } else {
1582
           } else {
1550
             console.log('示忙失败-----seimin');
1583
             console.log('示忙失败-----seimin');
1551
-            $.toaster({
1552
-              priority: 'info',
1553
-              title: '操作',
1554
-              message: '示忙失败'
1555
-            });
1584
+            // $.toaster({
1585
+            //   priority: 'info',
1586
+            //   title: '操作',
1587
+            //   message: '示忙失败'
1588
+            // });
1556
           }
1589
           }
1557
         }
1590
         }
1558
         //示闲回调函数
1591
         //示闲回调函数
@@ -1561,12 +1594,13 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1561
           err = Number(err);
1594
           err = Number(err);
1562
           if (!err) {
1595
           if (!err) {
1563
             console.log('示闲成功-----seimin');
1596
             console.log('示闲成功-----seimin');
1597
+            $scope.getState(1);
1598
+            $rootScope.preState = 1;
1564
             $.toaster({
1599
             $.toaster({
1565
               priority: 'info',
1600
               priority: 'info',
1566
               title: '操作',
1601
               title: '操作',
1567
               message: '示闲成功'
1602
               message: '示闲成功'
1568
             });
1603
             });
1569
-            // $rootScope.jry_state = 'shixian';
1570
           } else {
1604
           } else {
1571
             console.log('示闲失败-----seimin');
1605
             console.log('示闲失败-----seimin');
1572
             $.toaster({
1606
             $.toaster({
@@ -1582,12 +1616,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1582
           err = Number(err);
1616
           err = Number(err);
1583
           if (!err) {
1617
           if (!err) {
1584
             console.log('呼叫成功,请摘机-----seimin');
1618
             console.log('呼叫成功,请摘机-----seimin');
1619
+            $scope.getState(6);
1585
             $.toaster({
1620
             $.toaster({
1586
               priority: 'info',
1621
               priority: 'info',
1587
               title: '操作',
1622
               title: '操作',
1588
               message: '呼叫成功,请摘机'
1623
               message: '呼叫成功,请摘机'
1589
             });
1624
             });
1590
-            // $rootScope.jry_state = 'tonghuazhong';
1591
           } else {
1625
           } else {
1592
             console.log('呼叫失败-----seimin');
1626
             console.log('呼叫失败-----seimin');
1593
             $.toaster({
1627
             $.toaster({
@@ -1605,20 +1639,20 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1605
           var err = Number(jso.err);
1639
           var err = Number(jso.err);
1606
           if (!err) {
1640
           if (!err) {
1607
             console.log('呼叫被接听成功-----seimin');
1641
             console.log('呼叫被接听成功-----seimin');
1642
+            $scope.getState(5);
1608
             $.toaster({
1643
             $.toaster({
1609
               priority: 'info',
1644
               priority: 'info',
1610
               title: '操作',
1645
               title: '操作',
1611
               message: '呼叫被接听成功'
1646
               message: '呼叫被接听成功'
1612
             });
1647
             });
1613
-            // $rootScope.jry_state = 'tonghuazhong';
1614
           } else {
1648
           } else {
1615
             console.log('呼叫被接听失败-----seimin');
1649
             console.log('呼叫被接听失败-----seimin');
1650
+            $scope.qShimang(1);
1616
             $.toaster({
1651
             $.toaster({
1617
               priority: 'info',
1652
               priority: 'info',
1618
               title: '操作',
1653
               title: '操作',
1619
               message: '呼叫被接听失败'
1654
               message: '呼叫被接听失败'
1620
             });
1655
             });
1621
-            // $rootScope.jry_state = 'shixian';
1622
           }
1656
           }
1623
         }
1657
         }
1624
         //挂断回调函数
1658
         //挂断回调函数
@@ -1627,12 +1661,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1627
           console.log(jso);//lmm
1661
           console.log(jso);//lmm
1628
           if (jso) {
1662
           if (jso) {
1629
             console.log('挂断成功-----seimin');
1663
             console.log('挂断成功-----seimin');
1664
+            $scope.qShimang($rootScope.preState);
1630
             $.toaster({
1665
             $.toaster({
1631
               priority: 'info',
1666
               priority: 'info',
1632
               title: '操作',
1667
               title: '操作',
1633
               message: '挂断成功'
1668
               message: '挂断成功'
1634
             });
1669
             });
1635
-            // $rootScope.jry_state = 'shixian';
1636
           } else {
1670
           } else {
1637
             console.log('挂断失败-----seimin');
1671
             console.log('挂断失败-----seimin');
1638
             $.toaster({
1672
             $.toaster({
@@ -1650,12 +1684,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1650
           $rootScope.sockid = jso.crs;//来电的话机id
1684
           $rootScope.sockid = jso.crs;//来电的话机id
1651
           if (jso) {
1685
           if (jso) {
1652
             console.log('呼入坐席成功,请摘机-----seimin');
1686
             console.log('呼入坐席成功,请摘机-----seimin');
1687
+            $scope.getState(3);
1653
             $.toaster({
1688
             $.toaster({
1654
               priority: 'info',
1689
               priority: 'info',
1655
               title: '操作',
1690
               title: '操作',
1656
               message: '呼入坐席成功,请摘机'
1691
               message: '呼入坐席成功,请摘机'
1657
             });
1692
             });
1658
-            // $rootScope.jry_state = 'laidian';
1659
             console.log('来电了!电话号码是【' + $rootScope.callInPhoneNumber + '】');
1693
             console.log('来电了!电话号码是【' + $rootScope.callInPhoneNumber + '】');
1660
           } else {
1694
           } else {
1661
             console.log('呼入坐席失败-----seimin');
1695
             console.log('呼入坐席失败-----seimin');
@@ -1672,13 +1706,19 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1672
           err = Number(err);
1706
           err = Number(err);
1673
           if (!err) {
1707
           if (!err) {
1674
             console.log('呼入摘机应答成功-----seimin');
1708
             console.log('呼入摘机应答成功-----seimin');
1709
+            $scope.getState(5);
1675
             $.toaster({
1710
             $.toaster({
1676
               priority: 'info',
1711
               priority: 'info',
1677
               title: '操作',
1712
               title: '操作',
1678
               message: '呼入摘机应答成功'
1713
               message: '呼入摘机应答成功'
1679
             });
1714
             });
1680
-            // $rootScope.jry_state = 'tonghuazhong';
1681
-            //根据电话号码反查报修人
1715
+            //根据电话号码反查报修人,如果是坐席号码,则不用
1716
+            console.log(sessionStorage.getItem('phones'));
1717
+            var phones = JSON.parse(sessionStorage.getItem('phones'));
1718
+            var isHuajihao = phones.length?phones.some(v=>v == teleno):false;
1719
+            if(isHuajihao){
1720
+              return;
1721
+            }
1682
             var postData = { "idx": 0, "sum": 10, "requester": { hjzxPhone: $rootScope.callInPhoneNumber } };
1722
             var postData = { "idx": 0, "sum": 10, "requester": { hjzxPhone: $rootScope.callInPhoneNumber } };
1683
             api_user_data.fetchDataList('requester', postData).then(function (result) {
1723
             api_user_data.fetchDataList('requester', postData).then(function (result) {
1684
               if (result.status == 200) {
1724
               if (result.status == 200) {
@@ -1768,12 +1808,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1768
           err = Number(err);
1808
           err = Number(err);
1769
           if (!err) {
1809
           if (!err) {
1770
             console.log('呼入未摘机应答成功-----seimin');
1810
             console.log('呼入未摘机应答成功-----seimin');
1811
+            $scope.getState(1);
1771
             $.toaster({
1812
             $.toaster({
1772
               priority: 'info',
1813
               priority: 'info',
1773
               title: '操作',
1814
               title: '操作',
1774
               message: '呼入未摘机应答成功'
1815
               message: '呼入未摘机应答成功'
1775
             });
1816
             });
1776
-            // $rootScope.jry_state = 'shixian';
1777
           } else {
1817
           } else {
1778
             console.log('呼入未摘机应答失败-----seimin');
1818
             console.log('呼入未摘机应答失败-----seimin');
1779
             $.toaster({
1819
             $.toaster({
@@ -1789,12 +1829,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1789
           err = Number(err);
1829
           err = Number(err);
1790
           if (!err) {
1830
           if (!err) {
1791
             console.log('转接坐席开始成功-----seimin');
1831
             console.log('转接坐席开始成功-----seimin');
1832
+            $scope.getState(7);
1792
             $.toaster({
1833
             $.toaster({
1793
               priority: 'info',
1834
               priority: 'info',
1794
               title: '操作',
1835
               title: '操作',
1795
               message: '转接坐席开始成功'
1836
               message: '转接坐席开始成功'
1796
             });
1837
             });
1797
-            // $rootScope.jry_state = 'tonghuazhong';
1798
           } else {
1838
           } else {
1799
             console.log('转接坐席开始失败-----seimin');
1839
             console.log('转接坐席开始失败-----seimin');
1800
             $.toaster({
1840
             $.toaster({
@@ -1810,12 +1850,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1810
           err = Number(err);
1850
           err = Number(err);
1811
           if (!err) {
1851
           if (!err) {
1812
             console.log('转接坐席结果成功-----seimin');
1852
             console.log('转接坐席结果成功-----seimin');
1853
+            $scope.getState(1);
1813
             $.toaster({
1854
             $.toaster({
1814
               priority: 'info',
1855
               priority: 'info',
1815
               title: '操作',
1856
               title: '操作',
1816
               message: '转接坐席结果成功'
1857
               message: '转接坐席结果成功'
1817
             });
1858
             });
1818
-            // $rootScope.jry_state = 'shixian';
1819
           } else {
1859
           } else {
1820
             console.log('转接坐席结果失败-----seimin');
1860
             console.log('转接坐席结果失败-----seimin');
1821
             $.toaster({
1861
             $.toaster({
@@ -1854,7 +1894,7 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1854
         }
1894
         }
1855
       })
1895
       })
1856
     }
1896
     }
1857
-    $rootScope.jry_state = "weiqianru";
1897
+    $rootScope.jry_state = 'weiqianru';
1858
     window.addEventListener('load', function () {
1898
     window.addEventListener('load', function () {
1859
       if ($rootScope.isFuwutai) {
1899
       if ($rootScope.isFuwutai) {
1860
         $rootScope.getExtnDirect();//seiminHj----1
1900
         $rootScope.getExtnDirect();//seiminHj----1

+ 1 - 1
assets/views/partials/off-sidebar2.html

@@ -8,7 +8,7 @@
8
       <div class="users-list fontsizes-14">
8
       <div class="users-list fontsizes-14">
9
         <div style="padding: 0 15px;" class="col-xs-12" ng-if="jry_state!='weiqianru'&&jry_state!='laidian'&&jry_state!='tonghuazhong'">
9
         <div style="padding: 0 15px;" class="col-xs-12" ng-if="jry_state!='weiqianru'&&jry_state!='laidian'&&jry_state!='tonghuazhong'">
10
           <input type="button" ng-if="jry_state=='shixian'" style="margin-left: 8px;" value="示忙" ng-click="jry_shimang()" class="jry_btn">
10
           <input type="button" ng-if="jry_state=='shixian'" style="margin-left: 8px;" value="示忙" ng-click="jry_shimang()" class="jry_btn">
11
-          <input type="button" ng-if="jry_state=='shimang'" style="margin-left: 8px;" value="示闲" ng-click="jry_shixian()" class="jry_btn">
11
+          <input type="button" ng-if="jry_state=='shimang'&&isShixian" style="margin-left: 8px;" value="示闲" ng-click="jry_shixian()" class="jry_btn">
12
           <input type="button" style="margin-left:8px;" value="签出" ng-click="jry_qianchu()" class="jry_btn">
12
           <input type="button" style="margin-left:8px;" value="签出" ng-click="jry_qianchu()" class="jry_btn">
13
         </div>
13
         </div>
14
         <div ng-if="jry_state=='weiqianru'" class="row form-group fontcolor-two" style="margin-top:30px" id="updata">
14
         <div ng-if="jry_state=='weiqianru'" class="row form-group fontcolor-two" style="margin-top:30px" id="updata">

+ 2 - 2
assets/views/partials/top-navbar.html

@@ -91,12 +91,12 @@
91
                         class="fontcolor-six fontsizes-14">来电</span> </div>
91
                         class="fontcolor-six fontsizes-14">来电</span> </div>
92
                 <!-- 示忙  -->
92
                 <!-- 示忙  -->
93
                 <div ng-if="jry_state=='shimang'" class="margin-top-15">
93
                 <div ng-if="jry_state=='shimang'" class="margin-top-15">
94
-                    <img src="assets/images/setbusy.gif" ng-click="jry_shixian()" class="image-widthh-34"><span
94
+                    <img src="assets/images/setbusy.gif" class="image-widthh-34"><span
95
                         class="round setbusycolor fontsizes-14">●</span><span
95
                         class="round setbusycolor fontsizes-14">●</span><span
96
                         class="fontcolor-six fontsizes-14">示忙</span> </div>
96
                         class="fontcolor-six fontsizes-14">示忙</span> </div>
97
                 <!-- 示闲  -->
97
                 <!-- 示闲  -->
98
                 <div ng-if="jry_state=='shixian'" class="margin-top-15">
98
                 <div ng-if="jry_state=='shixian'" class="margin-top-15">
99
-                    <img src="assets/images/link.gif" ng-click="jry_shimang()" class="image-widthh-34"><span
99
+                    <img src="assets/images/link.gif" class="image-widthh-34"><span
100
                         class="round linkcolor fontsizes-14">●</span><span class="fontcolor-six fontsizes-14">示闲</span>
100
                         class="round linkcolor fontsizes-14">●</span><span class="fontcolor-six fontsizes-14">示闲</span>
101
                 </div>
101
                 </div>
102
                 <!--通话中  -->
102
                 <!--通话中  -->