seimin 2 anni fa
parent
commit
0b6d34d42f

+ 32 - 3
assets/js/controllers/inspect/inspectionScopeCtrl.js

@@ -52,6 +52,13 @@ app.controller("inspectionScope", [
52 52
           $scope.stateModel = res.data;
53 53
           console.log($scope.stateModel);
54 54
           $scope.modelName = $scope.stateModel.modelName || $scope.stateModel.title;
55
+          $scope.everyDay = {
56
+            time: $scope.stateModel.dayMsgTime?new Date($scope.stateModel.dayMsgTime):new Date(),
57
+            everyDayNotices: [
58
+              {id:0 ,name:'线上', checked:$scope.stateModel.dayMsgOnline == 1},
59
+              {id:1 ,name:'线下', checked:$scope.stateModel.dayMsgOffline == 1}
60
+            ]
61
+          }
55 62
           if ($scope.stateModel.model != 1) {
56 63
             $scope.stateModel.model = 0;
57 64
           }
@@ -587,7 +594,6 @@ app.controller("inspectionScope", [
587 594
     // 保存设置 liaomingming
588 595
     $scope.submit1change = function () {
589 596
       console.log($scope.everyDay);
590
-      debugger;
591 597
       console.log($scope.notice);
592 598
       console.log($scope.copyInspection.tree);
593 599
       console.log($scope.stateModel);
@@ -642,7 +648,6 @@ app.controller("inspectionScope", [
642 648
       console.log(arr);
643 649
       // return;
644 650
       api_simple.addListData("inspectionBind", arr).then(function (response) {
645
-        $rootScope.isMask = false;
646 651
         if (response) {
647 652
           if (response.status == 200) {
648 653
             var filedata = {
@@ -664,10 +669,17 @@ app.controller("inspectionScope", [
664 669
             }else{
665 670
               delete filedata.inspection.msgUsers;
666 671
             }
672
+            var dayMsgOnline = $scope.everyDay.everyDayNotices.find(v => v.id === 0).checked;//线上
673
+            var dayMsgOffline = $scope.everyDay.everyDayNotices.find(v => v.id === 1).checked;//线下
674
+            var dayMsgTime = $scope.everyDay.time;
675
+            filedata.inspection.dayMsgOnline = dayMsgOnline ? 1: 0;
676
+            filedata.inspection.dayMsgOffline = dayMsgOffline ? 1: 0;
677
+            filedata.inspection.dayMsgTime = dayMsgTime ? (new Date(dayMsgTime).getTime()): (new Date().getTime());
667 678
             // 修改巡检计划 baba
668 679
             api_bpm_data
669 680
               .addData("inspection", filedata)
670 681
               .then(function (response) {
682
+                $rootScope.isMask = false;
671 683
                 if (response) {
672 684
                   if (response.status == 200) {
673 685
                     SweetAlert.swal(
@@ -677,7 +689,15 @@ app.controller("inspectionScope", [
677 689
                       },
678 690
                       function () {
679 691
                         if(flag){
680
-                          window.history.back();
692
+                          $state.go('app.inspection.editor', {
693
+                              formKey: 'inspectionform',
694
+                              service: 'api_bpm_data',
695
+                              model: JSON.stringify({
696
+                                model: {
697
+                                    inspection: filedata.inspection
698
+                                }
699
+                              })
700
+                          });
681 701
                         }else{
682 702
                           $scope.selectedchangecategory.value = {};
683 703
                           $scope.copyInspection.tree = [];
@@ -698,11 +718,14 @@ app.controller("inspectionScope", [
698 718
                 }
699 719
               });
700 720
           } else {
721
+            $rootScope.isMask = false;
701 722
             SweetAlert.swal({
702 723
               title: "保存失败!",
703 724
               type: "error",
704 725
             });
705 726
           }
727
+        }else{
728
+          $rootScope.isMask = false;
706 729
         }
707 730
       });
708 731
     };
@@ -792,6 +815,12 @@ app.controller("inspectionScope", [
792 815
             }else{
793 816
               delete filedata.inspection.msgUsers;
794 817
             }
818
+            var dayMsgOnline = $scope.everyDay.everyDayNotices.find(v => v.id === 0).checked;//线上
819
+            var dayMsgOffline = $scope.everyDay.everyDayNotices.find(v => v.id === 1).checked;//线下
820
+            var dayMsgTime = $scope.everyDay.time;
821
+            filedata.inspection.dayMsgOnline = dayMsgOnline ? 1: 0;
822
+            filedata.inspection.dayMsgOffline = dayMsgOffline ? 1: 0;
823
+            filedata.inspection.dayMsgTime = dayMsgTime ? (new Date(dayMsgTime).getTime()): (new Date().getTime());
795 824
             // 修改巡检计划 baba
796 825
             api_bpm_data
797 826
               .addData("inspection", filedata)

+ 4 - 0
assets/js/controllers/performance/scoreConfigurationPerformanceCtrl.js

@@ -241,7 +241,9 @@ app.controller('scoreConfigurationPerformanceCtrl', ["$rootScope", "$scope", "$s
241 241
                 removeRules: 1
242 242
             }
243 243
             if (result) {
244
+                $rootScope.isMask = true;
244 245
                 api_bpm_data.setScoreRule(postData).then(function (response) {
246
+                    $rootScope.isMask = false;
245 247
                     if(response.status == 200){
246 248
                         var postData = {
247 249
                             ids: result.selectedItems.map(v => v.id).toString(),
@@ -357,7 +359,9 @@ app.controller('scoreConfigurationPerformanceCtrl', ["$rootScope", "$scope", "$s
357 359
                 removeRules: 1
358 360
             }
359 361
             if (result) {
362
+                $rootScope.isMask = true;
360 363
                 api_bpm_data.setScoreRule(postData).then(function (response) {
364
+                    $rootScope.isMask = false;
361 365
                     if(response.status == 200){
362 366
                         var postData = {
363 367
                             ids: result.selectedItems.map(v => v.id).toString(),

+ 1 - 1
assets/js/controllers/performance/servicePerformanceCtrl.js

@@ -74,7 +74,7 @@ app.controller("servicePerformanceCtrl", [
74 74
           if (response) {
75 75
             if ((response.status = 200)) {
76 76
               $scope.isMaskground = false;
77
-              $scope.charginrow = response.data;
77
+              $scope.charginrow = response.data.sort((a, b) => b.total - a.total);
78 78
               // 图表
79 79
               barechart6(response.data);
80 80
               barechart7(response.data);