Commit aaa85b0d authored by 王李辉's avatar 王李辉

巡查模拟接口初次对接

parent f1505463
Pipeline #8244 passed with stage
in 5 minutes and 2 seconds
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
inset inset
v-for="(item, index) in contentList" v-for="(item, index) in contentList"
:key="index" :key="index"
@click="onClick(item.content)" @click="onClick(item)"
> >
<div class="icon-wrap"> <div class="icon-wrap">
<span class="icon-img"> <span class="icon-img">
...@@ -98,7 +98,10 @@ export default { ...@@ -98,7 +98,10 @@ export default {
}, },
onClick(val) { onClick(val) {
this.$router.push({ this.$router.push({
name: "implement" name: "implement",
query:{
id:val.title
}
}); });
} }
} }
......
...@@ -15,14 +15,13 @@ ...@@ -15,14 +15,13 @@
<van-tab v-for="(item, key) in tabs" :key="key" :title="item.title"> <van-tab v-for="(item, key) in tabs" :key="key" :title="item.title">
<!-- 内容列表 --> <!-- 内容列表 -->
<div class="con-list"> <div class="con-list">
<!-- v-for="(item, index) in messageList" :key="index" --> <van-cell-group inset v-for="(item, index) in messageList" :key="index">
<van-cell-group inset>
<van-row gutter> <van-row gutter>
<!-- <van-col span="18"> <!-- <van-col span="18">
<span class="con_title">日查</span> <span class="con_title">日查</span>
<span>&nbsp;&nbsp;制度、规程、方案</span> <span>&nbsp;&nbsp;制度、规程、方案</span>
</van-col> --> </van-col>-->
<van-col span="24" class="con_type">危险隐患</van-col> <van-col span="24" class="con_type">{{item.hdLev}}</van-col>
</van-row> </van-row>
<van-row gutter> <van-row gutter>
<van-col span="24">应建立地下有限空间作业安全生产责任制、安全生产规章制度和操作规程。</van-col> <van-col span="24">应建立地下有限空间作业安全生产责任制、安全生产规章制度和操作规程。</van-col>
...@@ -30,30 +29,30 @@ ...@@ -30,30 +29,30 @@
<van-row gutter class="cont-operation"> <van-row gutter class="cont-operation">
<van-col span="10" class="con_type"> <van-col span="10" class="con_type">
<van-popover <van-popover
v-model="showPopover" v-model="showPopoverFlag[index]"
theme="dark" theme="dark"
trigger="click" trigger="click"
placement="bottom-start" placement="bottom-start"
> >
<span class="tip" @click="showPopover = false">《北京市地下有限空间管理办法》</span> <span class="tip">《北京市地下有限空间管理办法》</span>
<template #reference class="width-auto">法律依据/出处</template> <template #reference>法律依据/出处</template>
</van-popover> </van-popover>
</van-col> </van-col>
<van-col span="14" class="con_right"> <van-col span="14" class="con_right">
<van-radio-group <van-radio-group
v-model="radio" v-model="item.result"
direction="horizontal" direction="horizontal"
@change="operation" @change="operation(item.result,index)"
> >
<van-radio name="1" shape="square">合格</van-radio> <van-radio :name="1" shape="square" :disabled="item.result == '2'">合格</van-radio>
<van-radio name="2" shape="square">不合格</van-radio> <van-radio :name="2" shape="square" >不合格</van-radio>
</van-radio-group> </van-radio-group>
</van-col> </van-col>
</van-row> </van-row>
</van-cell-group> </van-cell-group>
</div> </div>
<!-- 暂无数据 --> <!-- 暂无数据 -->
<!-- <div <div
style=" style="
width: 100%; width: 100%;
text-align: center; text-align: center;
...@@ -62,7 +61,7 @@ ...@@ -62,7 +61,7 @@
top: 30%; top: 30%;
" "
v-if="messageList.length == 0" v-if="messageList.length == 0"
>暂无数据</div> --> >暂无数据</div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
...@@ -88,10 +87,10 @@ export default { ...@@ -88,10 +87,10 @@ export default {
}, },
data() { data() {
return { return {
id: "", //巡查周期id
text: "执行巡查", text: "执行巡查",
messageList: [], messageList: [],
active: 0, active: 0,
radio: "1",
tabs: [ tabs: [
{ {
title: "安全管理类", title: "安全管理类",
...@@ -106,10 +105,14 @@ export default { ...@@ -106,10 +105,14 @@ export default {
api: "/rectification/finishList" api: "/rectification/finishList"
} }
], ],
showPopover: false showPopover: false,
showPopoverFlag:[],
}; };
}, },
created() { mounted() {
if (this.$route.query.id) {
this.id = this.$route.query.id;
}
this.postList(); this.postList();
}, },
methods: { methods: {
...@@ -124,11 +127,10 @@ export default { ...@@ -124,11 +127,10 @@ export default {
duration: 0 duration: 0
}); });
let obj = { let obj = {
cycle: 1 cycle: this.id
} };
postWork("patrol/running/list",obj) postWork("patrol/running/list", obj)
.then(res => { .then(res => {
console.log(res);
this.messageList = res.data; this.messageList = res.data;
this.$toast.clear(); this.$toast.clear();
}) })
...@@ -137,13 +139,24 @@ export default { ...@@ -137,13 +139,24 @@ export default {
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
}); });
}, },
operation() { operation(val, index) {
if(val == 1){
return
}
// 如果不合格跳转到隐患上报页面 // 如果不合格跳转到隐患上报页面
if (this.radio == "2") { this.$dialog
this.$router.push({ .confirm({
name: "add-danger" title: "提示",
message: "确定跳转到隐患上报页面吗?"
})
.then(() => {
this.$router.push({
name: "add-danger"
});
})
.catch(() => {
this.messageList[index].result = 1
}); });
}
}, },
finish() { finish() {
this.$toast.loading({ this.$toast.loading({
...@@ -153,7 +166,7 @@ export default { ...@@ -153,7 +166,7 @@ export default {
duration: 0 duration: 0
}); });
let obj2 = { let obj2 = {
cycle: 1 cycle: this.id
}; };
postWork("patrol/running/save", obj2) postWork("patrol/running/save", obj2)
.then(res => { .then(res => {
...@@ -179,7 +192,7 @@ export default { ...@@ -179,7 +192,7 @@ export default {
color: #2c3e50; color: #2c3e50;
} }
.con-list { .con-list {
padding: 0; padding: 0 0 60px;
background-color: #f0f1f5; background-color: #f0f1f5;
.van-cell-group--inset { .van-cell-group--inset {
margin: 0; margin: 0;
...@@ -232,7 +245,7 @@ export default { ...@@ -232,7 +245,7 @@ export default {
} }
.operation-btn { .operation-btn {
width: 95%; width: 95%;
margin: 20px 10px 10px; margin: 10px 10px;
position: fixed; position: fixed;
bottom: 50px; bottom: 50px;
right: 0; right: 0;
......
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