seimin 1 ano atrás
pai
commit
fe137ef322

+ 7 - 51
assets/js/controllers/businessConfiguration/faultConsumablesCtrl.js

@@ -416,7 +416,7 @@ app.controller("faultConsumablesCtrl", [
416
     $scope.addData = function () {
416
     $scope.addData = function () {
417
       var modalInstance = $modal.open({
417
       var modalInstance = $modal.open({
418
         templateUrl: "assets/views/system/tpl/faultConsumableschange.html",
418
         templateUrl: "assets/views/system/tpl/faultConsumableschange.html",
419
-        controller: function ($rootScope, $scope, $modalInstance, api_user_data,api_bpm_data) {
419
+        controller: function ($rootScope, $scope, scope, $modalInstance, api_user_data,api_bpm_data) {
420
           $scope.deptdata = {
420
           $scope.deptdata = {
421
             consumableIds: [],
421
             consumableIds: [],
422
             category: "",
422
             category: "",
@@ -540,7 +540,7 @@ app.controller("faultConsumablesCtrl", [
540
                             type: "success",
540
                             type: "success",
541
                           },
541
                           },
542
                           function () {
542
                           function () {
543
-                            $scope.refreshData("expand-right", $scope.fileData);
543
+                            scope.refreshData("expand-right", scope.fileData);
544
                           }
544
                           }
545
                         );
545
                         );
546
                       } else {
546
                       } else {
@@ -576,56 +576,12 @@ app.controller("faultConsumablesCtrl", [
576
             }
576
             }
577
           };
577
           };
578
         },
578
         },
579
+        resolve: {
580
+          scope: function(){
581
+            return $scope;
582
+          }
583
+        },
579
       });
584
       });
580
-      // modalInstance.result.then(function (selectedItem) {
581
-      //   if (selectedItem.consumableIds && selectedItem.category) {
582
-      //     var fildata = {
583
-      //       incidentCategoryConsumable: {
584
-      //         consumableIds: selectedItem.consumableIds.map(v => v.id).toString(),
585
-      //         category: selectedItem.category,
586
-      //       },
587
-      //     };
588
-      //     // 当前所属院区或责任科室
589
-      //     if($rootScope.user.duty){
590
-      //       fildata.incidentCategoryConsumable.duty = $rootScope.user.duty.id;
591
-      //     }else if($rootScope.user.branch){
592
-      //       fildata.incidentCategoryConsumable.branch = $rootScope.user.branch.id;
593
-      //     }
594
-      //     api_user_data
595
-      //       .addData("incidentCategoryConsumable", fildata)
596
-      //       .then(function (response) {
597
-      //         if (response) {
598
-      //           if (response.status == 200) {
599
-      //             SweetAlert.swal(
600
-      //               {
601
-      //                 title: "新增成功!",
602
-      //                 type: "success",
603
-      //               },
604
-      //               function () {
605
-      //                 $scope.refreshData("expand-right", $scope.fileData);
606
-      //               }
607
-      //             );
608
-      //           } else {
609
-      //             SweetAlert.swal({
610
-      //               title: "新增失败!",
611
-      //               text: response.msg,
612
-      //               type: "error",
613
-      //             });
614
-      //           }
615
-      //         }
616
-      //       });
617
-      //   } else {
618
-      //     SweetAlert.swal(
619
-      //       {
620
-      //         title: "新增失败!",
621
-      //         text: "请填写必填项!",
622
-      //         type: "error",
623
-      //         confirmButtonColor: "#DD6B55",
624
-      //       },
625
-      //       function () {}
626
-      //     );
627
-      //   }
628
-      // });
629
     };
585
     };
630
 
586
 
631
     $scope.removeData = function () {
587
     $scope.removeData = function () {