seimin преди 11 месеца
родител
ревизия
2f957a1669
променени са 1 файла, в които са добавени 8 реда и са изтрити 51 реда
  1. 8 51
      assets/js/controllers/businessConfiguration/faultConsumablesCtrl.js

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

@@ -338,6 +338,7 @@ app.controller("faultConsumablesCtrl", [
338 338
                       SweetAlert.swal(
339 339
                         {
340 340
                           title: "修改失败!",
341
+                          text: response.msg,
341 342
                           type: "error",
342 343
                         },
343 344
                         function () {
@@ -422,7 +423,7 @@ app.controller("faultConsumablesCtrl", [
422 423
     $scope.addData = function () {
423 424
       var modalInstance = $modal.open({
424 425
         templateUrl: "assets/views/system/tpl/faultConsumableschange.html",
425
-        controller: function ($rootScope, $scope, $modalInstance, api_user_data,api_bpm_data) {
426
+        controller: function ($rootScope, $scope, scope, $modalInstance, api_user_data,api_bpm_data) {
426 427
           $scope.deptdata = {
427 428
             consumableIds: [],
428 429
             category: "",
@@ -553,7 +554,7 @@ app.controller("faultConsumablesCtrl", [
553 554
                             type: "success",
554 555
                           },
555 556
                           function () {
556
-                            $scope.refreshData("expand-right", $scope.fileData);
557
+                            scope.refreshData("expand-right", scope.fileData);
557 558
                           }
558 559
                         );
559 560
                       } else {
@@ -589,56 +590,12 @@ app.controller("faultConsumablesCtrl", [
589 590
             }
590 591
           };
591 592
         },
593
+        resolve: {
594
+          scope: function(){
595
+            return $scope;
596
+          }
597
+        },
592 598
       });
593
-      // modalInstance.result.then(function (selectedItem) {
594
-      //   if (selectedItem.consumableIds && selectedItem.category) {
595
-      //     var fildata = {
596
-      //       incidentCategoryConsumable: {
597
-      //         consumableIds: selectedItem.consumableIds.map(v => v.id).toString(),
598
-      //         category: selectedItem.category,
599
-      //       },
600
-      //     };
601
-      //     // 当前所属院区或责任科室
602
-      //     if($rootScope.user.duty){
603
-      //       fildata.incidentCategoryConsumable.duty = $rootScope.user.duty.id;
604
-      //     }else if($rootScope.user.branch){
605
-      //       fildata.incidentCategoryConsumable.branch = $rootScope.user.branch.id;
606
-      //     }
607
-      //     api_user_data
608
-      //       .addData("incidentCategoryConsumable", fildata)
609
-      //       .then(function (response) {
610
-      //         if (response) {
611
-      //           if (response.status == 200) {
612
-      //             SweetAlert.swal(
613
-      //               {
614
-      //                 title: "新增成功!",
615
-      //                 type: "success",
616
-      //               },
617
-      //               function () {
618
-      //                 $scope.refreshData("expand-right", $scope.fileData);
619
-      //               }
620
-      //             );
621
-      //           } else {
622
-      //             SweetAlert.swal({
623
-      //               title: "新增失败!",
624
-      //               text: response.msg,
625
-      //               type: "error",
626
-      //             });
627
-      //           }
628
-      //         }
629
-      //       });
630
-      //   } else {
631
-      //     SweetAlert.swal(
632
-      //       {
633
-      //         title: "新增失败!",
634
-      //         text: "请填写必填项!",
635
-      //         type: "error",
636
-      //         confirmButtonColor: "#DD6B55",
637
-      //       },
638
-      //       function () {}
639
-      //     );
640
-      //   }
641
-      // });
642 599
     };
643 600
 
644 601
     $scope.removeData = function () {