Loading src/views/riskProject/add/addPresent.vue +26 −20 Original line number Diff line number Diff line Loading @@ -497,6 +497,7 @@ <script> import LHeader from "@/components/header.vue"; import SelectList from "@/components/selectList.vue"; import selectFloor from "@/components/selectFloor.vue"; // import selectPeople from "@/views/riskTask/selectPeople/index.vue"; import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo"; import { getFun, postFun } from "@/service/table.js"; Loading @@ -513,6 +514,7 @@ export default { name: "addPresent", components: { LHeader, selectFloor, SelectList }, activated() {}, Loading Loading @@ -603,7 +605,15 @@ export default { }, created() { var userInfo = getUserInfo(); this.form.buildingIds = this.$route.params.id; this.form.buildingIds = this.$route.params.buildingId || sessionStorage.getItem("buildingId"); this.form.planId = this.$route.params.planId || sessionStorage.getItem("planId"); this.form.buildingName = this.$route.params.buildingName || sessionStorage.getItem("buildingName"); this.form.userId = userInfo.userId; this.form.userName = userInfo.userName; this.form.deptName = userInfo.dept.deptName; this.form.planId = this.$route.params.planId; this.form.floorId = this.$route.params.floorId; this.form.roomId = this.$route.params.roomId; Loading @@ -616,14 +626,24 @@ export default { this.form.projectId = "测试项目"; }, mounted() { if (sessionStorage.getItem("presentForm") != "") { this.form = JSON.parse(sessionStorage.getItem("presentForm")); this.form.level = sessionStorage.getItem("level"); } this.getFloor(); this.getFXYS(); this.getZSGLX(); }, methods: { getFloor() { getFun(`/risk/plan/floor/list/${this.form.buildingIds}`) .then(res => { // this.$toast.clear(); // this.showSource = true; let newArr = this.renameKeyInTree(res.data, "name", "text"); this.floorSource = newArr; }) .catch(() => { this.$toast.fail("加载失败,请稍后再试"); }); }, getFXYS() { getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`) .then(res => { Loading @@ -643,22 +663,8 @@ export default { }); }, seletFloor(name) { this.$toast.loading({ message: "加载中...", forbidClick: true, loadingType: "spinner", duration: 0 }); this.ShowfloorList = true; this.userPrefix = name; getFun(`/risk/plan/floor/list/${this.form.buildingIds}`) .then(res => { this.$toast.clear(); this.showSource = true; this.columnsSource = res.data; }) .catch(() => { this.$toast.fail("加载失败,请稍后再试"); }); }, seletRoom(name) { this.$toast.loading({ Loading Loading
src/views/riskProject/add/addPresent.vue +26 −20 Original line number Diff line number Diff line Loading @@ -497,6 +497,7 @@ <script> import LHeader from "@/components/header.vue"; import SelectList from "@/components/selectList.vue"; import selectFloor from "@/components/selectFloor.vue"; // import selectPeople from "@/views/riskTask/selectPeople/index.vue"; import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo"; import { getFun, postFun } from "@/service/table.js"; Loading @@ -513,6 +514,7 @@ export default { name: "addPresent", components: { LHeader, selectFloor, SelectList }, activated() {}, Loading Loading @@ -603,7 +605,15 @@ export default { }, created() { var userInfo = getUserInfo(); this.form.buildingIds = this.$route.params.id; this.form.buildingIds = this.$route.params.buildingId || sessionStorage.getItem("buildingId"); this.form.planId = this.$route.params.planId || sessionStorage.getItem("planId"); this.form.buildingName = this.$route.params.buildingName || sessionStorage.getItem("buildingName"); this.form.userId = userInfo.userId; this.form.userName = userInfo.userName; this.form.deptName = userInfo.dept.deptName; this.form.planId = this.$route.params.planId; this.form.floorId = this.$route.params.floorId; this.form.roomId = this.$route.params.roomId; Loading @@ -616,14 +626,24 @@ export default { this.form.projectId = "测试项目"; }, mounted() { if (sessionStorage.getItem("presentForm") != "") { this.form = JSON.parse(sessionStorage.getItem("presentForm")); this.form.level = sessionStorage.getItem("level"); } this.getFloor(); this.getFXYS(); this.getZSGLX(); }, methods: { getFloor() { getFun(`/risk/plan/floor/list/${this.form.buildingIds}`) .then(res => { // this.$toast.clear(); // this.showSource = true; let newArr = this.renameKeyInTree(res.data, "name", "text"); this.floorSource = newArr; }) .catch(() => { this.$toast.fail("加载失败,请稍后再试"); }); }, getFXYS() { getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`) .then(res => { Loading @@ -643,22 +663,8 @@ export default { }); }, seletFloor(name) { this.$toast.loading({ message: "加载中...", forbidClick: true, loadingType: "spinner", duration: 0 }); this.ShowfloorList = true; this.userPrefix = name; getFun(`/risk/plan/floor/list/${this.form.buildingIds}`) .then(res => { this.$toast.clear(); this.showSource = true; this.columnsSource = res.data; }) .catch(() => { this.$toast.fail("加载失败,请稍后再试"); }); }, seletRoom(name) { this.$toast.loading({ Loading