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

完成巡查模块

parent 49dc353d
...@@ -102,6 +102,7 @@ export default { ...@@ -102,6 +102,7 @@ export default {
}, },
mounted() { mounted() {
const formData = this.$store.state.danger; //这里的数据是从”implement.vue“页面传递过来的 const formData = this.$store.state.danger; //这里的数据是从”implement.vue“页面传递过来的
console.log(formData)
if (!formData.riskContent) { //不存在巡查地点返回 if (!formData.riskContent) { //不存在巡查地点返回
this.$router.go(-1) this.$router.go(-1)
} }
...@@ -112,6 +113,7 @@ export default { ...@@ -112,6 +113,7 @@ export default {
const { level, score } = this.$store.state.assessModel.result const { level, score } = this.$store.state.assessModel.result
if (level) { if (level) {
this.form.assessmentLevel = level; this.form.assessmentLevel = level;
this.form.score = score
} }
}, },
methods: { methods: {
......
...@@ -13,7 +13,13 @@ ...@@ -13,7 +13,13 @@
<van-cell-group @click="toDanger(index)" inset v-for="(item, index) in i.messageList" <van-cell-group @click="toDanger(index)" inset v-for="(item, index) in i.messageList"
:key="index"> :key="index">
<van-row gutter> <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>
<van-row gutter> <van-row gutter>
<van-col class="con_inner" span="5">风险因素:</van-col> <van-col class="con_inner" span="5">风险因素:</van-col>
...@@ -138,8 +144,9 @@ export default { ...@@ -138,8 +144,9 @@ export default {
}, },
methods: { methods: {
loadingTabs() { 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)); const tabs = new Set(res.rows.map(x => x.type));
this.lists = res.rows;
Array.from(tabs).forEach(name => { Array.from(tabs).forEach(name => {
this.tabs.push({ this.tabs.push({
title: name, title: name,
...@@ -166,7 +173,8 @@ export default { ...@@ -166,7 +173,8 @@ export default {
factor: item.factor, factor: item.factor,
level: item.level, level: item.level,
type: item.type, type: item.type,
measuresProject: item.measuresProject measuresProject: item.measuresProject,
buildingId: item.buildId
}) })
sessionStorage.setItem("buildingId", item.buildId); //为评测分数添加 sessionStorage.setItem("buildingId", item.buildId); //为评测分数添加
this.$router.push({ this.$router.push({
...@@ -185,10 +193,14 @@ export default { ...@@ -185,10 +193,14 @@ export default {
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0
}); });
// let obj2 = { const list = this.lists.map(x => ({
// cycle: this.id patrolDetailId: x.patrolDetailId,
// }; patrolStatus: x.patrolStatus
postFun("patrol/running/save?cycle=" + this.id) }))
postFun("/risk/currentRiskPatrolDetail/updateStatus", {
patrolId: this.$route.query.patrolId,
list
})
.then(res => { .then(res => {
this.$toast.clear(); this.$toast.clear();
this.$toast.success({ this.$toast.success({
...@@ -310,4 +322,49 @@ export default { ...@@ -310,4 +322,49 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; 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> </style>
...@@ -49,37 +49,44 @@ export default { ...@@ -49,37 +49,44 @@ export default {
{ {
title: "0", title: "0",
imgUrl: require("@/assets/dangerPatrol/day_list.png"), imgUrl: require("@/assets/dangerPatrol/day_list.png"),
content: "日查清单" content: "日查清单",
id: ''
}, },
{ {
title: "1", title: "1",
imgUrl: require("@/assets/dangerPatrol/week_list.png"), imgUrl: require("@/assets/dangerPatrol/week_list.png"),
content: "周查清单" content: "周查清单",
id: ''
}, },
{ {
title: "3", title: "3",
imgUrl: require("@/assets/dangerPatrol/half_month_list.png"), imgUrl: require("@/assets/dangerPatrol/half_month_list.png"),
content: "半月查清单" content: "半月查清单",
id: ''
}, },
{ {
title: "2", title: "2",
imgUrl: require("@/assets/dangerPatrol/month_list.png"), imgUrl: require("@/assets/dangerPatrol/month_list.png"),
content: "月查清单" content: "月查清单",
id: ''
}, },
{ {
title: "3", title: "3",
imgUrl: require("@/assets/dangerPatrol/quarter_list.png"), imgUrl: require("@/assets/dangerPatrol/quarter_list.png"),
content: "季查清单" content: "季查清单",
id: ''
}, },
{ {
title: "6", title: "6",
imgUrl: require("@/assets/dangerPatrol/year_list.png"), imgUrl: require("@/assets/dangerPatrol/year_list.png"),
content: "半年查清单" content: "半年查清单",
id: ''
}, },
{ {
title: "4", title: "4",
imgUrl: require("@/assets/dangerPatrol/year_list.png"), imgUrl: require("@/assets/dangerPatrol/year_list.png"),
content: "年查清单" content: "年查清单",
id: ''
} }
] ]
} }
...@@ -102,9 +109,11 @@ export default { ...@@ -102,9 +109,11 @@ export default {
getFun("risk/riskUserPatrol/list", params).then((res) => { getFun("risk/riskUserPatrol/list", params).then((res) => {
this.contentLists.forEach((x) => { this.contentLists.forEach((x) => {
res.rows.forEach((y) => { res.rows.forEach((y) => {
console.log(y)
if (x.title == y.patrolType) { if (x.title == y.patrolType) {
x.startTime = y.startTime x.startTime = y.startTime
x.validityTime = y.validityTime x.validityTime = y.validityTime
x.id = y.id;
this.contentList.push(x) this.contentList.push(x)
} }
}) })
...@@ -124,7 +133,8 @@ export default { ...@@ -124,7 +133,8 @@ export default {
name: "implement", name: "implement",
query: { query: {
id: this.projectId, id: this.projectId,
content: val.content content: val.content,
patrolId: val.id
} }
}); });
}, },
......
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
patrolTypeList: ['日查', '周查', '月查', '年查'], patrolTypeList: ['日查', '周查', '月查', '年查'],
group: [], group: [],
pages: { pages: {
current: 0 pageNum: 0
}, },
refreshing: false, refreshing: false,
total: 0 total: 0
...@@ -70,31 +70,31 @@ export default { ...@@ -70,31 +70,31 @@ export default {
}, },
methods: { methods: {
onRefresh() { onRefresh() {
this.pages.current = 1; this.pages.pageNum = 1;
this.group = [] this.group = []
this.getData() this.getData()
}, },
//上拉页面加载数据 //上拉页面加载数据
onLoad() { onLoad() {
console.log(123); if (this.total && this.total <= this.group.length) {
if (this.total <= this.group.length) { this.finished = true;
this.finished = true return;
} }
this.pages.current += 1; this.pages.pageNum += 1;
setTimeout(() => {
this.getData(); this.getData();
}, 1000)
}, },
getData() { getData() {
let userInfoData = JSON.parse(localStorage.getItem('LocalUserInfo')) let userInfoData = JSON.parse(localStorage.getItem('LocalUserInfo'))
getFun('/risk/riskUserPatrol/list', { getFun('/risk/riskUserPatrol/detailList', {
userId: userInfoData.userId, userId: userInfoData.userId,
...this.pages ...this.pages
}).then(res => { }).then(res => {
this.group = this.group.concat(res.rows); this.group = this.group.concat(res.rows);
this.refreshing = false; this.refreshing = false;
this.loading = false; this.loading = false;
this.total = !this.total && res.total; if (!this.total) {
this.total = res.total;
}
}) })
} }
}, },
......
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<van-form @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit"> <van-form>
<div class="title"> <div class="title">
<img src="@/assets/accidentIcon/bookmark.svg" alt="" class="title-img" /> <img src="@/assets/accidentIcon/bookmark.svg" alt="" class="title-img" />
基本信息 基本信息
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</div> </div>
<van-field label="巡查地点"> <van-field label="巡查地点">
<template #input> <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" /> placeholder="请输入" style="padding: 0" />
</template> </template>
</van-field> </van-field>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<van-field name="hdPicture1" label="异常照片"> <van-field name="hdPicture1" label="异常照片">
<template #input> <template #input>
<div> <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=""> :key="item.fileId" alt="">
</div> </div>
</template> </template>
......
...@@ -70,6 +70,9 @@ export default { ...@@ -70,6 +70,9 @@ export default {
if (res.data.level) { if (res.data.level) {
this.result.level = res.data.level; this.result.level = res.data.level;
} }
if (res.data.riskColor) {
this.result.riskColor = res.data.riskColor;
}
}) })
}, },
resetClose() { resetClose() {
......
...@@ -21,25 +21,15 @@ ...@@ -21,25 +21,15 @@
<van-cell-group inset v-if="finalRiskList.length > 0"> <van-cell-group inset v-if="finalRiskList.length > 0">
<van-cell value="风险评估管理" /> <van-cell value="风险评估管理" />
<van-grid :column-num="4"> <van-grid :column-num="4">
<van-grid-item <van-grid-item @click="dangerJump(item.path)" v-for="item in finalRiskList" :key="item.key" :icon="item.imgUrl"
@click="dangerJump(item.path)" :text="item.text" />
v-for="item in finalRiskList"
:key="item.key"
:icon="item.imgUrl"
:text="item.text"
/>
</van-grid> </van-grid>
</van-cell-group> </van-cell-group>
<van-cell-group inset v-if="finalRiskPatrol.length > 0"> <van-cell-group inset v-if="finalRiskPatrol.length > 0">
<van-cell value="风险巡查管理" /> <van-cell value="风险巡查管理" />
<van-grid :column-num="4"> <van-grid :column-num="4">
<van-grid-item <van-grid-item @click="dangerJump(item.path)" v-for="item in finalRiskPatrol" :key="item.key"
@click="dangerJump(item.path)" :icon="item.imgUrl" :text="item.text" />
v-for="item in finalRiskPatrol"
:key="item.key"
:icon="item.imgUrl"
:text="item.text"
/>
</van-grid> </van-grid>
</van-cell-group> </van-cell-group>
<!-- <van-cell-group inset v-for="(item, index) in riskList" :key="index"> <!-- <van-cell-group inset v-for="(item, index) in riskList" :key="index">
...@@ -164,7 +154,7 @@ export default { ...@@ -164,7 +154,7 @@ export default {
text: "风险台账" text: "风险台账"
} }
], ],
riskPatrol:[ riskPatrol: [
{ {
key: "1", key: "1",
path: "/patrolExecute", path: "/patrolExecute",
...@@ -218,7 +208,7 @@ export default { ...@@ -218,7 +208,7 @@ export default {
] ]
}; };
}, },
created() {}, created() { },
mounted() { mounted() {
// this.getMenuList(); // this.getMenuList();
this.workBenchList(); this.workBenchList();
...@@ -257,7 +247,6 @@ export default { ...@@ -257,7 +247,6 @@ export default {
this.finalRiskPatrol = [...this.riskPatrol].filter(x => this.finalRiskPatrol = [...this.riskPatrol].filter(x =>
[...this.powerObj.风险巡查管理].some(y => `/${y.path}` == x.path) [...this.powerObj.风险巡查管理].some(y => `/${y.path}` == x.path)
); );
console.log(' this.finalRiskPatrol==>>', this.finalRiskPatrol)
} else { } else {
this.finalRiskPatrol = []; this.finalRiskPatrol = [];
} }
...@@ -266,7 +255,7 @@ export default { ...@@ -266,7 +255,7 @@ export default {
} }
}); });
}, },
onSearch() {}, onSearch() { },
createdClick() { createdClick() {
this.$router.push("/create-task"); this.$router.push("/create-task");
}, },
......
...@@ -9,11 +9,11 @@ module.exports = { ...@@ -9,11 +9,11 @@ module.exports = {
proxy: { proxy: {
//配置跨域 //配置跨域
"/app-api": { "/app-api": {
// target: "http://192.168.4.232:8080/", //这里是后台的地址 target: "http://192.168.4.232:8080/", //这里是后台的地址
// target: "http://localhost:8080/", //这里是后台的地址 // target: "http://localhost:8080/", //这里是后台的地址
// target: 'http://192.168.15.124:8080/', //这里是杨帆的地址 // target: 'http://192.168.15.124:8080/', //这里是杨帆的地址
// target: "http://192.168.14.152: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://localhost:8081/', //这里是后台的地址
// target: 'http://127.0.0.1:8080', //这里是后台的地址 // target: 'http://127.0.0.1:8080', //这里是后台的地址
ws: true, 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