seimin %!s(int64=2) %!d(string=hai) anos
pai
achega
d96f50c8eb
Modificáronse 1 ficheiros con 24 adicións e 20 borrados
  1. 24 20
      assets/js/controllers/incident/incidentCtrl.js

+ 24 - 20
assets/js/controllers/incident/incidentCtrl.js

@@ -2384,6 +2384,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2384
                 $scope.hdPhone = '';
2384
                 $scope.hdPhone = '';
2385
                 $scope.callId = '';
2385
                 $scope.callId = '';
2386
                 $scope.user = [];
2386
                 $scope.user = [];
2387
+                $scope.telephone = '';
2387
                 $scope.copyTo = function(phone){
2388
                 $scope.copyTo = function(phone){
2388
                     $scope.hdPhone = phone;
2389
                     $scope.hdPhone = phone;
2389
                 }
2390
                 }
@@ -2414,14 +2415,8 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2414
                             $rootScope.isMask = false;
2415
                             $rootScope.isMask = false;
2415
                             if (data.errno == 0) {
2416
                             if (data.errno == 0) {
2416
                                 $rootScope.status = 6;
2417
                                 $rootScope.status = 6;
2417
-                                api_bpm_data.getCallRecordId({ano: data.ano, bno: data.bno, agentId: data.agentID}).then(function(response){
2418
-                                    console.log(response)
2419
-                                    if (response.status == 200) {
2420
-                                        $scope.callId = response.data || undefined;
2421
-                                    } else {
2422
-                                        $scope.callId = undefined;
2423
-                                    }
2424
-                                });
2418
+                                $scope.telephone = telephone;
2419
+                                
2425
                             }else{
2420
                             }else{
2426
                                 $scope.callId = undefined;
2421
                                 $scope.callId = undefined;
2427
                             }
2422
                             }
@@ -2453,23 +2448,32 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2453
                         });
2448
                         });
2454
                         return;
2449
                         return;
2455
                     }
2450
                     }
2456
-                    api_bpm_data.addData('operationLog',{operationLog:{opType:'handlerLog',opValue:$scope.handlerLog,extra1:model.id, extra2: $scope.callId}}).then(function(response){
2451
+                    api_bpm_data.getCallRecordId({ano: localStorage.getItem('hk_phone'), bno: $scope.telephone, agentId: $rootScope.user.id}).then(function(response){
2457
                         console.log(response)
2452
                         console.log(response)
2458
                         if (response.status == 200) {
2453
                         if (response.status == 200) {
2459
-                            Alert.swal({
2460
-                                title: "操作成功!",
2461
-                                confirmButtonColor: "#007AFF",
2462
-                                type: "success"
2463
-                            });
2464
-                            $modalInstance.close('success');
2454
+                            $scope.callId = response.data || undefined;//获取callId
2465
                         } else {
2455
                         } else {
2466
-                            Alert.swal({
2467
-                                title: "操作失败",
2468
-                                text: "操作失败, 请稍后再试!",
2469
-                                type: "error"
2470
-                            });
2456
+                            $scope.callId = undefined;
2471
                         }
2457
                         }
2458
+                        api_bpm_data.addData('operationLog',{operationLog:{opType:'handlerLog',opValue:$scope.handlerLog,extra1:model.id, extra2: $scope.callId}}).then(function(response){
2459
+                            console.log(response)
2460
+                            if (response.status == 200) {
2461
+                                Alert.swal({
2462
+                                    title: "操作成功!",
2463
+                                    confirmButtonColor: "#007AFF",
2464
+                                    type: "success"
2465
+                                });
2466
+                                $modalInstance.close('success');
2467
+                            } else {
2468
+                                Alert.swal({
2469
+                                    title: "操作失败",
2470
+                                    text: "操作失败, 请稍后再试!",
2471
+                                    type: "error"
2472
+                                });
2473
+                            }
2474
+                        });
2472
                     });
2475
                     });
2476
+                    
2473
                 }
2477
                 }
2474
 
2478
 
2475
                 $scope.cancel = function () {
2479
                 $scope.cancel = function () {