Browse Source

指派人或组

seimin 1 year ago
parent
commit
a812469f80

+ 167 - 31
assets/js/controllers/incident/incidentCtrl.js

@@ -828,7 +828,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
828 828
         //             api_bpm_data.fetchDataList('incidentcategory',postData).then(function(data){
829 829
         //                 console.log(data)
830 830
         //                     var myData = Restangular.stripRestangular(data);
831
-        //                     $scope.propTypeOptions = myData[2].form.fields;   
831
+        //                     $scope.propTypeOptions = myData[2].form.fields;
832 832
         //                     // console.log($scope.propTypeOptions)
833 833
         //             });
834 834
         //         }
@@ -865,7 +865,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
865 865
         if (JSON.parse(sessionStorage.getItem("searchincident")).incident) {
866 866
             $scope.searchkeys = JSON.parse(sessionStorage.getItem("searchincident")).incident;
867 867
         }
868
-        
868
+
869 869
         if ($scope.searchkeys.acceptDate) {
870 870
             $scope.searchkeys.acceptDate = new Date($scope.searchkeys.acceptDate);
871 871
         }
@@ -923,7 +923,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
923 923
             item.statusId = undefined;
924 924
         }
925 925
         console.log(item)
926
-        
926
+
927 927
         var fildata = {};
928 928
         if (sessionStorage.searchincident) {
929 929
             fildata = JSON.parse(sessionStorage.getItem("searchincident"));
@@ -948,7 +948,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
948 948
         //     angular.extend(fildata, { 'idx': 0, 'sum': $scope.gridOptions.paginationPageSize })
949 949
         //     angular.extend(fildata.incident, { 'acceptDate': moment(parameters.paramDateFrom).format('YYYY-MM-DD 00:00:00'), 'acceptDateEnd': moment(parameters.paramDateTo).format('YYYY-MM-DD 23:59:59') })
950 950
         // }
951
-        
951
+
952 952
         var transitiondata = angular.copy(item);
953 953
         angular.extend(fildata.incident, transitiondata)
954 954
         sessionStorage['searchincident'] = JSON.stringify(fildata);
@@ -956,7 +956,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
956 956
         fildata.assignee = loginUser.id;
957 957
         // seimin
958 958
         if($scope.searchstate === 'all_del'){
959
-            fildata.searchType = 'all'; 
959
+            fildata.searchType = 'all';
960 960
         }else{
961 961
             fildata.searchType = $scope.searchstate;
962 962
         }
@@ -1011,7 +1011,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1011 1011
                 $scope.requester = data.list
1012 1012
             });
1013 1013
         }
1014
-        
1014
+
1015 1015
     }
1016 1016
     getRequester();
1017 1017
 
@@ -1313,7 +1313,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1313 1313
                 filtersData.assignee = loginUser.id;
1314 1314
                 $scope.refreshData('expand-right', filtersData);
1315 1315
             }
1316
-            // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});                                            
1316
+            // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});
1317 1317
         });
1318 1318
 
1319 1319
         // gridApi.selection.on.rowSelectionChanged($scope, function(data) {
@@ -1529,7 +1529,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1529 1529
                 // {name:"处理结果",value:data.handleResult}];
1530 1530
                 // {name:"用户评价",value:''},
1531 1531
                 // {name:"满意度",value:''},
1532
-                // {name:"用户签字",value:''}];                                                                         
1532
+                // {name:"用户签字",value:''}];
1533 1533
                 $scope.cancel = function () {
1534 1534
                     $modalInstance.dismiss('cancel');
1535 1535
                 };
@@ -1713,7 +1713,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1713 1713
                         filtersData.idx = newPage - 1;
1714 1714
                         filtersData.sum = pageSize;
1715 1715
                         $scope.loadData(filtersData);
1716
-                        // $scope.loadData({"idx":newPage-1,"sum":pageSize});                                            
1716
+                        // $scope.loadData({"idx":newPage-1,"sum":pageSize});
1717 1717
                     });
1718 1718
                     gridApi.selection.on.rowSelectionChanged($scope, function (scope) {
1719 1719
                         scope.grid.appScope.selected.items[0] = scope.entity;
@@ -1816,7 +1816,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1816 1816
     // };
1817 1817
 
1818 1818
     /*
1819
-      appScopeProvider: { 
1819
+      appScopeProvider: {
1820 1820
           onDblClick : function(row) {
1821 1821
              var url = '//google.com';
1822 1822
              $window.open(url, "_blank", "height=600,width=800,toolbar=no,location=no,menubar=no,titlebar=no");
@@ -2265,8 +2265,8 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2265 2265
             }
2266 2266
         });
2267 2267
     }
2268
-    // 指派弹窗
2269
-    $scope.toAssign = function (model) {
2268
+    // 指派弹窗
2269
+    $scope.toAssignPerson = function (model) {
2270 2270
         console.log(model)
2271 2271
         var modalInstance = $modal.open({
2272 2272
             templateUrl: 'assets/views/incident/tpl/toAssign.tpl.html',
@@ -2322,7 +2322,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2322 2322
                     $scope.assignGroup = item.id;
2323 2323
                     $scope.getUsers(item.id)
2324 2324
                 }
2325
-                
2325
+
2326 2326
                 $scope.ok = function () {
2327 2327
                     if (!$scope.assignUser){
2328 2328
                         Alert.swal({
@@ -2332,7 +2332,137 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2332 2332
                         });
2333 2333
                         return;
2334 2334
                     }
2335
-                    api_bpm_domain.delegateTask(model.taskId, {assginee:$scope.assignUser}).then(function (response) {
2335
+                    var taskType = undefined;
2336
+                    var handlerIncidentId = undefined;
2337
+                    if(model.state.value == "pending"){
2338
+                        taskType = 'receiveform';
2339
+                    }else if(model.state.value == "handler"){
2340
+                        taskType = 'handlerform';
2341
+                        handlerIncidentId = model.id;
2342
+                    }
2343
+                    api_bpm_domain.delegateTask(model.taskId, {assginee:$scope.assignUser, taskType, handlerIncidentId}).then(function (response) {
2344
+                        console.log(response)
2345
+                        if (response.status == 200) {
2346
+                            Alert.swal({
2347
+                                title: "操作成功!",
2348
+                                confirmButtonColor: "#007AFF",
2349
+                                type: "success"
2350
+                            });
2351
+                            $modalInstance.close('success');
2352
+                        } else {
2353
+                            Alert.swal({
2354
+                                title: "操作失败",
2355
+                                text: "操作失败, 请稍后再试!",
2356
+                                type: "error"
2357
+                            });
2358
+                        }
2359
+                    });
2360
+                }
2361
+
2362
+                $scope.cancel = function () {
2363
+                    $modalInstance.dismiss('cancel');
2364
+                }
2365
+            },
2366
+            size: 'sm',
2367
+            resolve: {
2368
+                api_bpm: function () {
2369
+                    return api_bpm;
2370
+                },
2371
+                modelData: function () {
2372
+                    return model;
2373
+                },
2374
+                currentUserId: function () {
2375
+                    return loginUser.id;
2376
+                },
2377
+                Alert: function () {
2378
+                    return SweetAlert;
2379
+                },
2380
+                api_user_data: function () {
2381
+                    return api_user_data;
2382
+                }
2383
+            }
2384
+        });
2385
+        modalInstance.result.then(function (selectedItem) {
2386
+            if (selectedItem == 'success') {
2387
+                defaultFilterData.assignee = loginUser.id;
2388
+                $scope.refreshData('expand-right', defaultFilterData);
2389
+            }
2390
+        });
2391
+    }
2392
+    // 指派组弹窗
2393
+    $scope.toAssignGroup = function (model) {
2394
+        console.log(model)
2395
+        var modalInstance = $modal.open({
2396
+            templateUrl: 'assets/views/incident/tpl/toAssign.tpl.html',
2397
+            controller: function ($scope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data) {
2398
+                console.log(model,loginUser);
2399
+                $scope.isGroup = true;
2400
+                //获取组下面的用户
2401
+                $scope.getUsers = function(groupId){
2402
+                    $scope.user = [];
2403
+                    var postData = {};
2404
+                    if(groupId){
2405
+                        postData = {
2406
+                            "idx": 0,
2407
+                            "sum": 100,
2408
+                            user: {
2409
+                                groupdata:{id:groupId},
2410
+                                roledata: { rolecode: "first-line support" },
2411
+                                roledata2: { rolecode: "second-line support" },
2412
+                                selectType: "1",
2413
+                                selectDetails:1
2414
+                            }
2415
+                        }
2416
+                    }else{
2417
+                        postData = {
2418
+                            "idx": 0,
2419
+                            "sum": 100,
2420
+                            user: {
2421
+                                roledata: { rolecode: "first-line support" },
2422
+                                roledata2: { rolecode: "second-line support" },
2423
+                                selectType: "1",
2424
+                                selectDetails:1
2425
+                            }
2426
+                        }
2427
+                    }
2428
+                    api_user_data.fetchDataList('user', postData).then(function (data) {
2429
+                        $scope.user = data.list;
2430
+                    })
2431
+                }
2432
+                $scope.assignUser = null;
2433
+                $scope.user = [];
2434
+                $scope.group = [];
2435
+                // $scope.getUsers();
2436
+                api_user_data.fetchDataList('group', {
2437
+                    "idx": 0,
2438
+                    "sum": 100,
2439
+                    group: {'selectType':'nouser'}
2440
+                }).then(function (data) {
2441
+                    $scope.group = data.list;
2442
+                })
2443
+                $scope.onChangeRotateUser = function(item){
2444
+                    $scope.assignUser = item.id;
2445
+                }
2446
+                $scope.onChangeRotateGroup = function(item){
2447
+                    $scope.assignGroup = item.id;
2448
+                    // $scope.getUsers(item.id)
2449
+                }
2450
+
2451
+                $scope.ok = function () {
2452
+                    if (!$scope.assignGroup){
2453
+                        Alert.swal({
2454
+                            title: "操作失败",
2455
+                            text: "请选择转派组信息!",
2456
+                            type: "error"
2457
+                        });
2458
+                        return;
2459
+                    }
2460
+                    var handlerIncidentId = undefined;
2461
+                    if(model.state.value == "pending"){
2462
+                    }else if(model.state.value == "handler"){
2463
+                        handlerIncidentId = model.id;
2464
+                    }
2465
+                    api_bpm_domain.delegateTask(model.taskId, {group:$scope.assignGroup, handlerIncidentId}).then(function (response) {
2336 2466
                         console.log(response)
2337 2467
                         if (response.status == 200) {
2338 2468
                             Alert.swal({
@@ -2409,7 +2539,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2409 2539
             }
2410 2540
         });
2411 2541
     }
2412
-    
2542
+
2413 2543
     // 新增发送短信弹窗
2414 2544
     $scope.toSms = function (model) {
2415 2545
         console.log(model)
@@ -2457,7 +2587,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2457 2587
                 $scope.group = [];
2458 2588
                 $scope.getUsers();
2459 2589
                 $scope.getGroups();
2460
-                
2590
+
2461 2591
                 $scope.ok = function () {
2462 2592
                     if ($scope.userOrGroup == 1 && !$scope.sms.assignUser){
2463 2593
                         Alert.swal({
@@ -2568,7 +2698,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2568 2698
                             if (data.errno == 0) {
2569 2699
                                 $rootScope.status = 6;
2570 2700
                                 $scope.telephone = telephone;
2571
-                                
2701
+
2572 2702
                             }else{
2573 2703
                                 $scope.callId = undefined;
2574 2704
                             }
@@ -2625,7 +2755,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2625 2755
                             }
2626 2756
                         });
2627 2757
                     });
2628
-                    
2758
+
2629 2759
                 }
2630 2760
 
2631 2761
                 $scope.cancel = function () {
@@ -2864,7 +2994,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2864 2994
         //     }
2865 2995
         // }
2866 2996
         // // -----------seimin-------------
2867
-        
2997
+
2868 2998
         // $scope.refreshData('expand-right', defaultFilterData);
2869 2999
         // $interval.cancel($scope.timer);
2870 3000
         // $scope.timer = $interval(function () {
@@ -3015,7 +3145,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
3015 3145
         //$scope.callsPending++;
3016 3146
         $scope.memoryfilterData = filterData;
3017 3147
         $scope.gridOptions['sum'] = filterData.sum;
3018
-        
3148
+
3019 3149
         api_bpm_domain.fetchtask(pdKey, filterData).then(function (data) {
3020 3150
             if (data.data) {
3021 3151
                 // if(filterData.searchType == 'all'){
@@ -3037,7 +3167,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
3037 3167
                 });
3038 3168
             }
3039 3169
             $scope.ldloading[style.replace('-', '_')] = false;
3040
-            
3170
+
3041 3171
         }, function () {
3042 3172
             $scope.ldloading[style.replace('-', '_')] = false;
3043 3173
         });
@@ -3148,7 +3278,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
3148 3278
         // }
3149 3279
         $scope.refreshData('expand-right');
3150 3280
     }
3151
-    
3281
+
3152 3282
     $scope.timer = $interval(function () {
3153 3283
         $scope.jry_refresh()
3154 3284
     }, $rootScope.refreshTime);
@@ -3279,7 +3409,7 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
3279 3409
         } else {
3280 3410
             return false
3281 3411
         }
3282
-        // }   
3412
+        // }
3283 3413
     }
3284 3414
     $scope.coordination = function () {
3285 3415
         $scope.colobject.grid.appScope.coordination($scope.item);
@@ -3322,9 +3452,14 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
3322 3452
         $scope.colobject.grid.appScope.rotate($scope.item);
3323 3453
         // $scope.doEdit($scope.item.id);
3324 3454
     }
3325
-    // 指派
3326
-    $scope.toAssign = function () { //print
3327
-        $scope.colobject.grid.appScope.toAssign($scope.item);
3455
+    // 指派人
3456
+    $scope.toAssignPerson = function () { //print
3457
+        $scope.colobject.grid.appScope.toAssignPerson($scope.item);
3458
+        // $scope.doEdit($scope.item.id);
3459
+    }
3460
+    // 指派组
3461
+    $scope.toAssignGroup = function () { //print
3462
+        $scope.colobject.grid.appScope.toAssignGroup($scope.item);
3328 3463
         // $scope.doEdit($scope.item.id);
3329 3464
     }
3330 3465
     // 删除事件
@@ -3387,16 +3522,16 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
3387 3522
     //       $scope.data={
3388 3523
     //           "name":"视频",
3389 3524
     //           "url":"http://192.168.3.69:8088/recording/recording?callID="+$rootScope.callid
3390
-    //       };  
3525
+    //       };
3391 3526
     //       $scope.data.url = $sce.trustAsResourceUrl($scope.data.url);
3392 3527
 
3393 3528
     //         // $scope.audiourl={url:$sce.trustAsResourceUrl("http://192.168.3.69:8088/recording/recording?callID=218147232")};
3394 3529
 
3395 3530
     //         $scope.cancel = function() {
3396 3531
     //                 $modalInstance.dismiss('cancel');
3397
-    //             };       
3398
-    //             $modalInstance.close();  
3399
-    //       } 
3532
+    //             };
3533
+    //             $modalInstance.close();
3534
+    //       }
3400 3535
     //     });
3401 3536
     // };
3402 3537
 
@@ -3417,7 +3552,8 @@ app.directive('incidentoperator', function () {
3417 3552
             '<a ng-click="handler()" ng-show="{{item.state.id != 1546 &&!item.handlerUser&&item.tiquPower&&qiangdan}}" class="bianjifont" >抢单</a>' +
3418 3553
             // '<a ng-click="visit()"  ng-show="{{item.huifang&&huifang}}"  class="bianjifont">回访</a>' +
3419 3554
             '<a ng-click="changeCenter()"  ng-show="jry_modify(item)"  class="luyinfont">编辑</a>' +
3420
-            '<a ng-click="toAssign()" ng-show="{{(item.state.id==1543||item.state.id==1544)&&assignFlag&&item.assignee}}" class="assign" >指派</a>' +
3555
+            '<a ng-click="toAssignPerson()" ng-show="{{(item.state.id==1543||item.state.id==1544)&&assignFlag}}" class="assign" >指派人</a>' +
3556
+            '<a ng-click="toAssignGroup()" ng-show="{{(item.state.id==1543||item.state.id==1544)&&assignFlag}}" class="assign" >指派组</a>' +
3421 3557
             // '<a ng-click="toHandlerLog()" ng-show="{{item.state.id==1544}}" class="assign" >新增沟通记录</a>' +
3422 3558
             // '<a ng-click="delSj()" ng-show="{{delFlag&&item.state.value!== \'deleted\'}}" class="assign" >删除</a>' +
3423 3559
             // '<a ng-click="print()" ng-show="dayin" class="bianjifont" >打印</a>' +

+ 2 - 2
assets/js/main.js

@@ -31,7 +31,7 @@ if(document.domain === 'itsm.zuel.edu.cn'){
31 31
 // var callIp = "http://192.168.2.63:80/service";
32 32
 //101测试
33 33
 // var serverIp = "http://192.168.3.101/service";
34
-// var reportIp = "http://192.168.3.101/service"; 
34
+// var reportIp = "http://192.168.3.101/service";
35 35
 // var inspectIp = "http://192.168.3.101/service";
36 36
 // var imgBaseUrl = "http://192.168.3.101";//富文本框上传图片路径
37 37
 // var callIp = "http://192.168.3.122:29005";
@@ -700,7 +700,7 @@ app.factory('api_statistic', ['BpmRestangular', function (BpmRestangular) {
700 700
         // exportData: function(reportView, uuid, reportfileName){
701 701
         //     return  reportService.one('query/rest/export/xls/?exportname='+reportfileName+'xls');
702 702
 
703
-        // }   
703
+        // }
704 704
         getTask: function (userid, idx, sum) {
705 705
             return table.customGET('getTask/' + userid + '/' + idx + '/' + sum);
706 706
         },

+ 1 - 1
assets/views/incident/tpl/toAssign.tpl.html

@@ -21,7 +21,7 @@
21 21
             </div>
22 22
         </div>
23 23
     </div>
24
-    <div class="form-group incidentsearch" style="margin:0 auto;width: 300px;">
24
+    <div class="form-group incidentsearch" style="margin:0 auto;width: 300px;" ng-if="!isGroup">
25 25
         <div class=" input-group" style="margin:8px 0 0;">
26 26
             <div class="control-label pull-left margin-top-5 margin-right-5">
27 27
                 <label class="demoincident">指派对象</label>:</div>