Commit ed5a0820 authored by kaitly205422@163.com's avatar kaitly205422@163.com
Browse files

完成巡查模块

parent 49dc353d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ export default {
    },
    mounted() {
        const formData = this.$store.state.danger;  //这里的数据是从”implement.vue“页面传递过来的
        console.log(formData)
        if (!formData.riskContent) {  //不存在巡查地点返回
            this.$router.go(-1)
        }
@@ -112,6 +113,7 @@ export default {
        const { level, score } = this.$store.state.assessModel.result
        if (level) {
            this.form.assessmentLevel = level;
            this.form.score = score
        }
    },
    methods: {
+64 −7
Original line number Diff line number Diff line
@@ -13,7 +13,13 @@
                            <van-cell-group @click="toDanger(index)" inset v-for="(item, index) in i.messageList"
                                :key="index">
                                <van-row gutter>
                                    <van-col class="con_type">巡查内容</van-col>
                                    <van-col span="20" class="con_type">{{ item.name }}</van-col>
                                    <!-- v-if="item.patrolStatus == 1"  -->
                                    <van-col v-if="item.patrolStatus == 1" style="color:red">
                                        <div class="ribbon">
                                            <div class="ribbon1">异常</div>
                                        </div>
                                    </van-col>
                                </van-row>
                                <van-row gutter>
                                    <van-col class="con_inner" span="5">风险因素:</van-col>
@@ -138,8 +144,9 @@ export default {
    },
    methods: {
        loadingTabs() {
            getFun("/risk/currentRiskPatrolDetail/detailList", { projectId: this.id }).then(res => {
            getFun("/risk/currentRiskPatrolDetail/detailList", { projectId: this.id, patrolId: this.$route.query.patrolId }).then(res => {
                const tabs = new Set(res.rows.map(x => x.type));
                this.lists = res.rows;
                Array.from(tabs).forEach(name => {
                    this.tabs.push({
                        title: name,
@@ -166,7 +173,8 @@ export default {
                factor: item.factor,
                level: item.level,
                type: item.type,
                measuresProject: item.measuresProject
                measuresProject: item.measuresProject,
                buildingId: item.buildId
            })
            sessionStorage.setItem("buildingId", item.buildId); //为评测分数添加
            this.$router.push({
@@ -185,10 +193,14 @@ export default {
                        loadingType: "spinner",
                        duration: 0
                    });
                    // let obj2 = {
                    //     cycle: this.id
                    // };
                    postFun("patrol/running/save?cycle=" + this.id)
                    const list = this.lists.map(x => ({
                        patrolDetailId: x.patrolDetailId,
                        patrolStatus: x.patrolStatus
                    }))
                    postFun("/risk/currentRiskPatrolDetail/updateStatus", {
                        patrolId: this.$route.query.patrolId,
                        list
                    })
                        .then(res => {
                            this.$toast.clear();
                            this.$toast.success({
@@ -310,4 +322,49 @@ export default {
    text-overflow: ellipsis;
    overflow: hidden;
}

.card-wrap {
    text-align: center;
}


.ribbon {
    width: 2rem;
    height: 2rem;
    overflow: hidden;
    position: absolute;
    top: 0rem;
    right: 0;
}

.ribbon1 {
    line-height: 12px;
    transform: rotate(45deg) translate(0.2rem, 0.5rem);
    position: relative;
    padding: 8px 0;
    width: 3rem;
    background: red;
    color: white;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    text-align: center;
}

// .ribbon1:before,
// .ribbon1:after {
//     content: "";
//     border-top: 4px solid #4e7c7d;
//     border-left: 4px solid transparent;
//     border-right: 4px solid transparent;
//     position: absolute;
//     bottom: -4px;
// }

.ribbon1:before {
    left: 0;
}

.ribbon1:after {
    right: 0;
}
</style>
+18 −8
Original line number Diff line number Diff line
@@ -49,37 +49,44 @@ export default {
                {
                    title: "0",
                    imgUrl: require("@/assets/dangerPatrol/day_list.png"),
                    content: "日查清单"
                    content: "日查清单",
                    id: ''
                },
                {
                    title: "1",
                    imgUrl: require("@/assets/dangerPatrol/week_list.png"),
                    content: "周查清单"
                    content: "周查清单",
                    id: ''
                },
                {
                    title: "3",
                    imgUrl: require("@/assets/dangerPatrol/half_month_list.png"),
                    content: "半月查清单"
                    content: "半月查清单",
                    id: ''
                },
                {
                    title: "2",
                    imgUrl: require("@/assets/dangerPatrol/month_list.png"),
                    content: "月查清单"
                    content: "月查清单",
                    id: ''
                },
                {
                    title: "3",
                    imgUrl: require("@/assets/dangerPatrol/quarter_list.png"),
                    content: "季查清单"
                    content: "季查清单",
                    id: ''
                },
                {
                    title: "6",
                    imgUrl: require("@/assets/dangerPatrol/year_list.png"),
                    content: "半年查清单"
                    content: "半年查清单",
                    id: ''
                },
                {
                    title: "4",
                    imgUrl: require("@/assets/dangerPatrol/year_list.png"),
                    content: "年查清单"
                    content: "年查清单",
                    id: ''
                }
            ]
        }
@@ -102,9 +109,11 @@ export default {
            getFun("risk/riskUserPatrol/list", params).then((res) => {
                this.contentLists.forEach((x) => {
                    res.rows.forEach((y) => {
                        console.log(y)
                        if (x.title == y.patrolType) {
                            x.startTime = y.startTime
                            x.validityTime = y.validityTime
                            x.id = y.id;
                            this.contentList.push(x)
                        }
                    })
@@ -124,7 +133,8 @@ export default {
                name: "implement",
                query: {
                    id: this.projectId,
                    content: val.content
                    content: val.content,
                    patrolId: val.id
                }
            });
        },
+11 −11
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ export default {
      patrolTypeList: ['日查', '周查', '月查', '年查'],
      group: [],
      pages: {
        current: 0
        pageNum: 0
      },
      refreshing: false,
      total: 0
@@ -70,31 +70,31 @@ export default {
  },
  methods: {
    onRefresh() {
      this.pages.current = 1;
      this.pages.pageNum = 1;
      this.group = []
      this.getData()
    },
    //上拉页面加载数据
    onLoad() {
      console.log(123);
      if (this.total <= this.group.length) {
        this.finished = true
      if (this.total && this.total <= this.group.length) {
        this.finished = true;
        return;
      }
      this.pages.current += 1;
      setTimeout(() => {
      this.pages.pageNum += 1;
      this.getData();
      }, 1000)
    },
    getData() {
      let userInfoData = JSON.parse(localStorage.getItem('LocalUserInfo'))
      getFun('/risk/riskUserPatrol/list', {
      getFun('/risk/riskUserPatrol/detailList', {
        userId: userInfoData.userId,
        ...this.pages
      }).then(res => {
        this.group = this.group.concat(res.rows);
        this.refreshing = false;
        this.loading = false;
        this.total = !this.total && res.total;
        if (!this.total) {
          this.total = res.total;
        }
      })
    }
  },
+3 −3
Original line number Diff line number Diff line
<template>
    <div>
        <LHeader :text="text"></LHeader>
        <van-form @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit">
        <van-form>
            <div class="title">
                <img src="@/assets/accidentIcon/bookmark.svg" alt="" class="title-img" />
                基本信息
@@ -53,7 +53,7 @@
            </div>
            <van-field label="巡查地点">
                <template #input>
                    <van-field v-model="form.currentailAbnormal.riskLocation" name="abnormalDesc" label="" autosize
                    <van-field readonly v-model="form.currentailAbnormal.riskLocation" name="abnormalDesc" label="" autosize
                        placeholder="请输入" style="padding: 0" />
                </template>
            </van-field>
@@ -66,7 +66,7 @@
                <van-field name="hdPicture1" label="异常照片">
                    <template #input>
                        <div>
                            <img v-for="item in form.currentailAbnormal.abnormalPics" :src="item.filePath"
                            <img style="width: 2rem;" v-for="item in form.currentailAbnormal.files" :src="item.filePath"
                                :key="item.fileId" alt="">
                        </div>
                    </template>
Loading