seimin 2 years ago
parent
commit
4c550213af
1 changed files with 11 additions and 8 deletions
  1. 11 8
      assets/js/controllers/inspect/inspectionScopeCtrl.js

+ 11 - 8
assets/js/controllers/inspect/inspectionScopeCtrl.js

@@ -551,15 +551,18 @@ app.controller("inspectionScope", [
551
       $scope.stateModel.modelName = $scope.modelName;
551
       $scope.stateModel.modelName = $scope.modelName;
552
       $scope.stateModel.typeIds = arr.map((v) => v.id).toString();
552
       $scope.stateModel.typeIds = arr.map((v) => v.id).toString();
553
       arr = arr.map((v) => ({
553
       arr = arr.map((v) => ({
554
-        inspection: $scope.stateModel,
554
+        inspection: $scope.stateModel.id,
555
         inspectionType: v.id,
555
         inspectionType: v.id,
556
+        inspectionTypeName: v.name,
556
         parent: v.parent,
557
         parent: v.parent,
557
-        user: v.user,
558
-        group: v.group,
558
+        user: v.user?v.user.id:undefined,
559
+        userName: v.user?v.user.name:undefined,
560
+        group: v.group?v.group.id:undefined,
561
+        groupName: v.group?v.group.groupName:undefined,
559
       }));
562
       }));
560
       // 一条都没选择
563
       // 一条都没选择
561
       if (arr.length === 0) {
564
       if (arr.length === 0) {
562
-        arr.push({ inspection: $scope.stateModel });
565
+        arr.push({ inspection: $scope.stateModel.id });
563
       }
566
       }
564
       console.log(arr);
567
       console.log(arr);
565
       // return;
568
       // return;
@@ -720,7 +723,7 @@ app.directive("zTree", function () {
720
               .fetchDataList("inspectionBind", {
723
               .fetchDataList("inspectionBind", {
721
                 idx: 0,
724
                 idx: 0,
722
                 sum: 1000,
725
                 sum: 1000,
723
-                inspectionBind: { inspection: { id: $scope.stateModel.id } },
726
+                inspectionBind: { inspection: $scope.stateModel.id },
724
               })
727
               })
725
               .then(function (response) {
728
               .then(function (response) {
726
                 $.fn.zTree.destroy("z-tree");
729
                 $.fn.zTree.destroy("z-tree");
@@ -856,7 +859,7 @@ app.directive("zTree", function () {
856
             .fetchDataList("inspectionBind", {
859
             .fetchDataList("inspectionBind", {
857
               idx: 0,
860
               idx: 0,
858
               sum: 1000,
861
               sum: 1000,
859
-              inspectionBind: { inspection: { id: $scope.stateModel.id } },
862
+              inspectionBind: { inspection: $scope.stateModel.id },
860
             })
863
             })
861
             .then(function (response) {
864
             .then(function (response) {
862
               var result = response.list || [];
865
               var result = response.list || [];
@@ -881,8 +884,8 @@ app.directive("zTree", function () {
881
           result = result.map((v) => ({
884
           result = result.map((v) => ({
882
             id: v.inspectionType,
885
             id: v.inspectionType,
883
             name: v.inspectionTypeName,
886
             name: v.inspectionTypeName,
884
-            group: v.group,
885
-            user: v.user,
887
+            group: {id:v.group,groupName:v.groupName},
888
+            user: {id:v.user,name:v.userName},
886
             parent: v.parent ? { id: v.parent.inspectionType } : undefined,
889
             parent: v.parent ? { id: v.parent.inspectionType } : undefined,
887
             pId: v.parent ? v.parent.inspectionType : 0,
890
             pId: v.parent ? v.parent.inspectionType : 0,
888
           }));
891
           }));