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

完成巡查模块

parent 49dc353d
......@@ -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: {
......
......@@ -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>
......@@ -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
}
});
},
......
......@@ -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.getData();
}, 1000)
this.pages.pageNum += 1;
this.getData();
},
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;
}
})
}
},
......
<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>
......
......@@ -70,6 +70,9 @@ export default {
if (res.data.level) {
this.result.level = res.data.level;
}
if (res.data.riskColor) {
this.result.riskColor = res.data.riskColor;
}
})
},
resetClose() {
......
......@@ -21,25 +21,15 @@
<van-cell-group inset v-if="finalRiskList.length > 0">
<van-cell value="风险评估管理" />
<van-grid :column-num="4">
<van-grid-item
@click="dangerJump(item.path)"
v-for="item in finalRiskList"
:key="item.key"
:icon="item.imgUrl"
:text="item.text"
/>
<van-grid-item @click="dangerJump(item.path)" v-for="item in finalRiskList" :key="item.key" :icon="item.imgUrl"
:text="item.text" />
</van-grid>
</van-cell-group>
<van-cell-group inset v-if="finalRiskPatrol.length > 0">
<van-cell value="风险巡查管理" />
<van-grid :column-num="4">
<van-grid-item
@click="dangerJump(item.path)"
v-for="item in finalRiskPatrol"
:key="item.key"
:icon="item.imgUrl"
:text="item.text"
/>
<van-grid-item @click="dangerJump(item.path)" v-for="item in finalRiskPatrol" :key="item.key"
:icon="item.imgUrl" :text="item.text" />
</van-grid>
</van-cell-group>
<!-- <van-cell-group inset v-for="(item, index) in riskList" :key="index">
......@@ -164,7 +154,7 @@ export default {
text: "风险台账"
}
],
riskPatrol:[
riskPatrol: [
{
key: "1",
path: "/patrolExecute",
......@@ -218,7 +208,7 @@ export default {
]
};
},
created() {},
created() { },
mounted() {
// this.getMenuList();
this.workBenchList();
......@@ -257,7 +247,6 @@ export default {
this.finalRiskPatrol = [...this.riskPatrol].filter(x =>
[...this.powerObj.风险巡查管理].some(y => `/${y.path}` == x.path)
);
console.log(' this.finalRiskPatrol==>>', this.finalRiskPatrol)
} else {
this.finalRiskPatrol = [];
}
......@@ -266,7 +255,7 @@ export default {
}
});
},
onSearch() {},
onSearch() { },
createdClick() {
this.$router.push("/create-task");
},
......
......@@ -9,11 +9,11 @@ module.exports = {
proxy: {
//配置跨域
"/app-api": {
// target: "http://192.168.4.232:8080/", //这里是后台的地址
target: "http://192.168.4.232:8080/", //这里是后台的地址
// target: "http://localhost:8080/", //这里是后台的地址
// target: 'http://192.168.15.124:8080/', //这里是杨帆的地址
// target: "http://192.168.14.152:8080/", //这里是鲍德的地址
target: "http://192.168.15.230:8080/", //这里是晓静的地址
// target: "http://192.168.15.230:8080/", //这里是晓静的地址
// target: 'http://localhost:8081/', //这里是后台的地址
// target: 'http://127.0.0.1:8080', //这里是后台的地址
ws: true,
......
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