Commit 6b01a186 authored by 杨帆's avatar 杨帆
Browse files

Dev yf'

parent 328cc75e
Loading
Loading
Loading
Loading
+48 −22
Original line number Original line Diff line number Diff line
@@ -360,7 +360,6 @@
          @cancel="showTrouble = false"
          @cancel="showTrouble = false"
        />
        />
      </van-popup>
      </van-popup>

      <van-popup v-model="showSource" position="bottom">
      <van-popup v-model="showSource" position="bottom">
        <van-picker
        <van-picker
          show-toolbar
          show-toolbar
@@ -370,7 +369,18 @@
          @cancel="showSource = false"
          @cancel="showSource = false"
        />
        />
      </van-popup>
      </van-popup>

      <!-- 楼层弹出层 -->
      <van-popup
        v-model="ShowfloorList"
        position="bottom"
        :style="{ height: '100%' }"
      >
        <selectFloor
          :listdata="floorSource"
          @closeSlect="closeSlectfloor"
          @saveSlect="saveSlectfloor"
        ></selectFloor>
      </van-popup>
      <!-- 风险源弹出层 -->
      <!-- 风险源弹出层 -->
      <van-popup
      <van-popup
        v-model="ShowSelectList"
        v-model="ShowSelectList"
@@ -487,6 +497,7 @@
<script>
<script>
import LHeader from "@/components/header.vue";
import LHeader from "@/components/header.vue";
import SelectList from "@/components/selectList.vue";
import SelectList from "@/components/selectList.vue";
import selectFloor from "@/components/selectFloor.vue";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue";
// import selectPeople from "@/views/riskTask/selectPeople/index.vue";
import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
import { getUserInfo, getLocalUserInfo } from "@/utils/userInfo";
import { getFun, postFun } from "@/service/table.js";
import { getFun, postFun } from "@/service/table.js";
@@ -503,6 +514,7 @@ export default {
  name: "addPresent",
  name: "addPresent",
  components: {
  components: {
    LHeader,
    LHeader,
    selectFloor,
    SelectList
    SelectList
  },
  },
  activated() {},
  activated() {},
@@ -521,6 +533,8 @@ export default {
  },
  },
  data() {
  data() {
    return {
    return {
      ShowfloorList: false,
      floorSource: [],
      ShowAccidentList: false,
      ShowAccidentList: false,
      ShowSelectList: false,
      ShowSelectList: false,
      columnsAccident: [],
      columnsAccident: [],
@@ -591,7 +605,15 @@ export default {
  },
  },
  created() {
  created() {
    var userInfo = getUserInfo();
    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.planId = this.$route.params.planId;
    this.form.floorId = this.$route.params.floorId;
    this.form.floorId = this.$route.params.floorId;
    this.form.roomId = this.$route.params.roomId;
    this.form.roomId = this.$route.params.roomId;
@@ -604,14 +626,24 @@ export default {
    this.form.projectId = "测试项目";
    this.form.projectId = "测试项目";
  },
  },
  mounted() {
  mounted() {
    if (sessionStorage.getItem("presentForm") != "") {
    this.getFloor();
      this.form = JSON.parse(sessionStorage.getItem("presentForm"));
      this.form.level = sessionStorage.getItem("level");
    }
    this.getFXYS();
    this.getFXYS();
    this.getZSGLX();
    this.getZSGLX();
  },
  },
  methods: {
  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() {
    getFXYS() {
      getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
      getFun(`/risk/plan/dict/data/list?dictType=risk_plan_factor`)
        .then(res => {
        .then(res => {
@@ -631,22 +663,8 @@ export default {
        });
        });
    },
    },
    seletFloor(name) {
    seletFloor(name) {
      this.$toast.loading({
      this.ShowfloorList = true;
        message: "加载中...",
        forbidClick: true,
        loadingType: "spinner",
        duration: 0
      });
      this.userPrefix = name;
      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) {
    seletRoom(name) {
      this.$toast.loading({
      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() {
    closeSlect() {
      this.ShowSelectList = false;
      this.ShowSelectList = false;
    },
    },