Pārlūkot izejas kodu

暂存-事件删除-未做完

seimin 3 gadi atpakaļ
vecāks
revīzija
535a994701
1 mainītis faili ar 37 papildinājumiem un 0 dzēšanām
  1. 37 0
      assets/js/controllers/incident/incidentCtrl.js

+ 37 - 0
assets/js/controllers/incident/incidentCtrl.js

@@ -2298,6 +2298,34 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2298 2298
             }
2299 2299
         });
2300 2300
     }
2301
+    // 删除事件
2302
+    $scope.delSj = function(model){
2303
+        console.log(model);
2304
+        SweetAlert.swal({
2305
+            title: "确认删除?",
2306
+            text: "删除的数据不可恢复,请确认继续操作!",
2307
+            type: "warning",
2308
+            showCancelButton: true,
2309
+            confirmButtonColor: "#DD6B55",
2310
+            confirmButtonText: "继续删除",
2311
+            cancelButtonText: "取消操作",
2312
+            closeOnConfirm: false,
2313
+            closeOnCancel: false
2314
+        }, function (isConfirm) {
2315
+            if (isConfirm) {
2316
+                api_bpm_schedule.remove([event.id]).then(function (response) {
2317
+                    if (response.status == 200) {
2318
+                        $scope.events.splice(event.id, 1); //有修改的一行
2319
+                        SweetAlert.swal("操作成功!", "数据已经被删除.", "success");
2320
+                    } else {
2321
+                        SweetAlert.swal("操作失败!", "数据暂时无法被删除,请稍候重试", "error");
2322
+                    }
2323
+                });
2324
+            } else {
2325
+                SweetAlert.swal("操作取消", "数据安全", "error");
2326
+            }
2327
+        });
2328
+    }
2301 2329
     // 新增处理日志弹窗baba
2302 2330
     $scope.toHandlerLog = function (model) {
2303 2331
         console.log(model)
@@ -2839,6 +2867,7 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
2839 2867
     $scope.dayin = false;
2840 2868
     $scope.huifang = false;
2841 2869
     $scope.assign = false;
2870
+    $scope.delFlag = false;
2842 2871
     if(loginUser.role.length){
2843 2872
         $scope.assign = loginUser.role.some(function(v){
2844 2873
             return v.rolecode === "incident-category-manager"||v.rolecode === 'incident manager';
@@ -2857,6 +2886,9 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
2857 2886
         if (loginUser.menu[i].link == "shijianliebiao_huifang") {
2858 2887
             $scope.huifang = true
2859 2888
         }
2889
+        if (loginUser.menu[i].link == "shijianliebiao_del") {
2890
+            $scope.delFlag = true
2891
+        }
2860 2892
     }
2861 2893
     $scope.up = true;
2862 2894
     $scope.fuwutaiRenYuan = false;//服务台人员
@@ -2986,6 +3018,10 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
2986 3018
         $scope.colobject.grid.appScope.toAssign($scope.item);
2987 3019
         // $scope.doEdit($scope.item.id);
2988 3020
     }
3021
+    // 删除事件
3022
+    $scope.delSj = function () {
3023
+        $scope.colobject.grid.appScope.delSj($scope.item);
3024
+    }
2989 3025
     // 新增处理日志
2990 3026
     $scope.toHandlerLog = function () { //print
2991 3027
         $scope.colobject.grid.appScope.toHandlerLog($scope.item);
@@ -3074,6 +3110,7 @@ app.directive('incidentoperator', function () {
3074 3110
             // '<a ng-click="rotate()" ng-show="{{item.state.id==4}}" class="rotate" >转派</a>' +
3075 3111
             '<a ng-click="toAssign()" ng-show="{{(item.state.id==1543||item.state.id==1544)&&assign&&item.assignee}}" class="assign" >指派</a>' +
3076 3112
             '<a ng-click="toHandlerLog()" ng-show="{{item.state.id==1544}}" class="assign" >新增处理日志</a>' +
3113
+            '<a ng-click="delSj()" ng-show="{{delFlag}}" class="assign" >删除</a>' +
3077 3114
             // '<a ng-click="upgrade()" ng-show="{{up&&item.state.id==4&&item.currentRole!=' + "'incident manager'" + '}}" class="upgrade" >升级</a>' +
3078 3115
             // '<a ng-click="problem()" ng-show="{{item.state.id==5&&item.currentRole!=' + "'incident manager'" + '}}" class="upgrade" >问题升级</a>' +
3079 3116
             // '<a ng-click="configuration()"  ng-show="{{item.state.id==5}}"  class="bianjifont">变更升级</a>' +