ソースを参照

Merge remote-tracking branch 'origin/v0.1.0' into v0.1.0

jingyuanchao 1 年間 前
コミット
bed8e55def

+ 7 - 0
src/api/system/role.js

@@ -149,3 +149,10 @@ export function getNamesByOrgId(orgId) {
     method: "get",
   });
 }
+
+export function getAllNames() {
+  return request({
+    url: "/system/role/getAllNames",
+    method: "get",
+  });
+}

+ 8 - 9
src/views/safetycheck/task/components/checkRegister.vue

@@ -241,7 +241,7 @@ import dayjs from "dayjs";
 import SelectPoint from "../../ruleManager/dialog.select.point.vue";
 import imgUpload from "@/components/ImageUpload/index.vue";
 import { getLabel } from "@/views/commonOption.js";
-import { getNamesByOrgId } from "@/api/system/role.js";
+import { getNamesByOrgId, getAllNames } from "@/api/system/role.js";
 import orgDropDown from "@/components/orgTree/orgDropDown.vue";
 import { arabicToChinese } from "@/utils/util.js";
 export default {
@@ -284,8 +284,14 @@ export default {
   },
   mounted() {
     this.taskInfo.checkOrgId = this.orgId;
-    this.taskInfo.checkRoleId = this.roleList[0].roleId;
+    //this.taskInfo.checkRoleId = this.roleList[0].roleId;
     this.taskInfo.signImg = this.$route.params.signImg;
+    getAllNames().then((r) => {
+      this.roleOptions = r.data;
+      if (!this.roleOptions.find((op) => op.id == this.taskInfo.checkRoleId)) {
+        this.taskInfo.checkRoleId = null;
+      }
+    });
   },
   methods: {
     dayjs,
@@ -302,13 +308,6 @@ export default {
         return;
       }
       this.$refs["point_baseInfo"].clearValidate(["checkOrgId"]);
-      getNamesByOrgId(node.id).then((r) => {
-        this.roleOptions = r.data;
-        this.prevCheckOrgType = node.type;
-        if (!this.roleOptions.find((op) => op.id == this.taskInfo.checkRoleId)) {
-          this.taskInfo.checkRoleId = null;
-        }
-      });
     },
     onBecheckOrgSelect(node) {
       if (node == null) {