seimin 2 年之前
父節點
當前提交
4c550213af
共有 1 個文件被更改,包括 11 次插入8 次删除
  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 551
       $scope.stateModel.modelName = $scope.modelName;
552 552
       $scope.stateModel.typeIds = arr.map((v) => v.id).toString();
553 553
       arr = arr.map((v) => ({
554
-        inspection: $scope.stateModel,
554
+        inspection: $scope.stateModel.id,
555 555
         inspectionType: v.id,
556
+        inspectionTypeName: v.name,
556 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 564
       if (arr.length === 0) {
562
-        arr.push({ inspection: $scope.stateModel });
565
+        arr.push({ inspection: $scope.stateModel.id });
563 566
       }
564 567
       console.log(arr);
565 568
       // return;
@@ -720,7 +723,7 @@ app.directive("zTree", function () {
720 723
               .fetchDataList("inspectionBind", {
721 724
                 idx: 0,
722 725
                 sum: 1000,
723
-                inspectionBind: { inspection: { id: $scope.stateModel.id } },
726
+                inspectionBind: { inspection: $scope.stateModel.id },
724 727
               })
725 728
               .then(function (response) {
726 729
                 $.fn.zTree.destroy("z-tree");
@@ -856,7 +859,7 @@ app.directive("zTree", function () {
856 859
             .fetchDataList("inspectionBind", {
857 860
               idx: 0,
858 861
               sum: 1000,
859
-              inspectionBind: { inspection: { id: $scope.stateModel.id } },
862
+              inspectionBind: { inspection: $scope.stateModel.id },
860 863
             })
861 864
             .then(function (response) {
862 865
               var result = response.list || [];
@@ -881,8 +884,8 @@ app.directive("zTree", function () {
881 884
           result = result.map((v) => ({
882 885
             id: v.inspectionType,
883 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 889
             parent: v.parent ? { id: v.parent.inspectionType } : undefined,
887 890
             pId: v.parent ? v.parent.inspectionType : 0,
888 891
           }));