Commit d85fa855 authored by 杨帆's avatar 杨帆

Merge branch 'dev-yf'' into 'develop'

Dev yf'

See merge request !17
parents 328cc75e 6b01a186
......@@ -360,7 +360,6 @@
@cancel="showTrouble = false"
/>
</van-popup>
<van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
......@@ -370,7 +369,18 @@
@cancel="showSource = false"
/>
</van-popup>
<!-- 楼层弹出层 -->
<van-popup
v-model="ShowfloorList"
position="bottom"
:style="{ height: '100%' }"
>
<selectFloor
:listdata="floorSource"
@closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"
></selectFloor>
</van-popup>
<!-- 风险源弹出层 -->
<van-popup
v-model="ShowSelectList"
......@@ -487,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";
......@@ -503,6 +514,7 @@ export default {
name: "addPresent",
components: {
LHeader,
selectFloor,
SelectList
},
activated() {},
......@@ -521,6 +533,8 @@ export default {
},
data() {
return {
ShowfloorList: false,
floorSource: [],
ShowAccidentList: false,
ShowSelectList: false,
columnsAccident: [],
......@@ -591,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;
......@@ -604,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 => {
......@@ -631,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({
......@@ -703,6 +721,14 @@ export default {
}
});
},
closeSlectfloor() {
this.ShowfloorList = false;
},
saveSlectfloor(data) {
this.form.floorId = data.id;
this.form.floorName = data.text;
this.ShowfloorList = false;
},
closeSlect() {
this.ShowSelectList = false;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment