Commit c55a7209 authored by wei's avatar wei

Merge branch 'develop' into dev-lv

parents 4bea91a3 ecd8470c
......@@ -5,33 +5,40 @@
<LHeader :text="text"></LHeader>
</van-sticky>
<div style="margin-bottom: 1.5rem;">
<van-tabs
v-model="active"
@change="tabList"
color="#2980f7"
animated
>
<van-tab v-for="(item) in riskLogList" :title="item.name" :name="item.id" :key="item.id">
<van-tabs v-model="active" @change="tabList" color="#2980f7" animated>
<van-tab :title="buildingName">
<van-dropdown-menu z-index="1000">
<van-dropdown-item v-model="value1" @change="changeFloor" :options="option1" get-container="body"/>
<van-dropdown-item v-model="value2" @change="changeRoom" :options="option2" get-container="body"/>
<van-dropdown-item
v-model="value1"
@change="changeFloor"
:options="option1"
get-container="body"
/>
<van-dropdown-item
v-model="value2"
@change="changeRoom"
:options="option2"
get-container="body"
/>
</van-dropdown-menu>
<div
class="con-list"
>
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"
>
<div style="font-size: 0.45rem;padding: 5px 0;">{{item.title}}</div>
<div style="font-size: 0.45rem;padding: 5px 0;">
{{ item.title }}
</div>
<van-row gutter="">
<van-col span="17">
<van-row gutter="">
<van-col span="9">发起时间:</van-col>
<van-col span="15">{{ timestampToTimes(item.createTime)}}</van-col>
<van-col span="15">{{
timestampToTimes(item.createTime)
}}</van-col>
</van-row>
<van-row gutter="">
<van-col span="9">楼层:</van-col>
......@@ -42,14 +49,16 @@
<van-col span="15">{{ item.roomName }}</van-col>
</van-row>
</van-col>
<van-col span="7" :style="{'color':item.state == 1 ? '#0069e5':'#03b615'}">
{{ '●待审批'}}
<van-col
span="7"
:style="{ color: item.state == 1 ? '#0069e5' : '#03b615' }"
>
{{ "●待审批" }}
</van-col>
</van-row>
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null">
<van-button round type="primary" @click="goDetail(item)"
>编辑</van-button
>
<!-- <van-button round type="info" @click="goConfirm(item)" v-show="active==0"
......@@ -66,7 +75,7 @@
position: fixed;
top: 30%;
"
v-if="messageList['length']==0"
v-if="messageList['length'] == 0"
>
暂无数据
</div>
......@@ -74,7 +83,8 @@
</van-tab>
</van-tabs>
</div>
<div style="display: flex;
<div
style="display: flex;
justify-content: space-around;
background-color: #fff;
border-top: 1px solid #e3e3e3;
......@@ -82,164 +92,174 @@
width: 100%;
text-align: center;
position: fixed;
bottom: 0;">
<div @click="performTasks" style="color: #4bced0;font-size: 14px;font-weight: 600;">
bottom: 0;"
>
<div
@click="performTasks"
style="color: #4bced0;font-size: 14px;font-weight: 600;"
>
<div style="font-size: 22px;"><van-icon name="plus" /></div>
<div>新增固有风险</div>
</div>
<div
@click="endTasks"
style="color: #D9001B;font-size: 14px;font-weight: 600;"
>
<div style="font-size: 22px;"><van-icon name="cross" /></div>
<div>任务执行结束</div>
</div>
</div>
</div>
</template>
</template>
<script>
import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format";
export default {
name:'risk-confirme',
<script>
import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format";
export default {
name: "risk-confirme",
components: {
LHeader,
LHeader
},
data() {
return {
text: "固有风险列表",
searchValue: "",
planId: 0,
buildingId: 0,
buildingName: "",
value1: 1,
value2: 1,
option1: [],
option2: [],
isHaveNews: false,
messageList: [],
riskLogList:[],
riskLogList: [],
Loop: "", // 定时器
showIndex: null, // 是否显示遮罩层,
active: 1,
form:{
},
tabs: [
],
form: {},
tabs: []
};
},
created() {
this.planId=this.$route.params.id || sessionStorage.getItem('planId')
this.planId = this.$route.params.id || sessionStorage.getItem("planId");
this.buildingId = this.$route.params.buildingId;
this.buildingName = this.$route.params.buildingName;
console.log(this.buildingId, this.buildingName);
this.getRiskList(this.planId);
// this.postList();
},
methods: {
timestampToTimes(time){
return timestampToTime(new Date(time),"DT2", true)
timestampToTimes(time) {
return timestampToTime(new Date(time), "DT2", true);
},
changeData(arr){
var arrList=[]
arr.forEach(item=>{
arrList.push(
{
text:item.name,
value:item.id
}
)
})
return arrList
changeData(arr) {
var arrList = [];
arr.forEach(item => {
arrList.push({
text: item.name,
value: item.id
});
});
return arrList;
},
performTasks(){
//新增固有风险
performTasks() {
this.$router.push({
name: "addInherent",
params: {
id:this.active,
planId:this.planId
id: this.active,
planId: this.planId
}
});
},
})
//任务执行结束
endTasks() {
//toDo
},
handadd(){
handadd() {
this.$router.push({
name: "riskAdd",
params: {
title:'新增'
},
})
},
buildingList(id) {
return new Promise((resolve, reject) => {
getFun(`/risk/plan/plan/building/list/${id}`).then((res) => {
this.riskLogList =res.data||res.rows;
resolve(res.data)
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
title: "新增"
}
});
})
},
floorList(id) {
return new Promise((resolve, reject) => {
getFun(`/risk/plan/floor/list/${id}`).then((res) => {
this.option1=this.changeData(res.data)
resolve(res.data)
getFun(`/risk/plan/floor/list/${id}`)
.then(res => {
this.option1 = this.changeData(res.data);
resolve(res.data);
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
})
});
},
roomList(id) {
return new Promise((resolve, reject) => {
getFun(`/risk/plan/room/list/${id}`).then((res) => {
this.option2=this.changeData(res.data)
resolve(res.data)
getFun(`/risk/plan/room/list/${id}`)
.then(res => {
this.option2 = this.changeData(res.data);
resolve(res.data);
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
})
});
},
riskList(planId,buildingId,floorId,roomId) {
riskList(planId, buildingId, floorId, roomId) {
return new Promise((resolve, reject) => {
var paramsJson={}
if(floorId||roomId){
paramsJson={
var paramsJson = {};
if (floorId || roomId) {
paramsJson = {
floorId,
roomId
};
} else {
paramsJson = {};
}
}else{
paramsJson={}
}
getFun(`/risk/plan/inherent/list/${planId}/${buildingId}`,paramsJson).then((res) => {
this.messageList=res.data
resolve(res.data)
getFun(`/risk/plan/inherent/list/${planId}/${buildingId}`, paramsJson)
.then(res => {
this.messageList = res.data;
resolve(res.data);
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
});
})
});
},
async getRiskList(id){
async getRiskList(id) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
duration: 0
});
let building= await this.buildingList(id)
let floor= await this.floorList(building[0].id)
let room= await this.roomList(floor[0].id)
let risk= await this.riskList(id,building[0].id)
let floor = await this.floorList(this.buildingId);
let room = await this.roomList(floor[0].id);
let risk = await this.riskList(id, this.buildingId);
this.$toast.clear();
},
async tabList(value){
let floor= await this.floorList(value)
let room= await this.roomList(floor[0].id)
let risk= await this.riskList(this.planId,value)
async tabList(value) {
let floor = await this.floorList(value);
let room = await this.roomList(floor[0].id);
let risk = await this.riskList(this.planId, value);
},
async changeFloor(){
let room= await this.roomList(this.value1)
let risk= await this.riskList(this.planId,this.active,this.value1)
async changeFloor() {
let room = await this.roomList(this.value1);
let risk = await this.riskList(this.planId, this.active, this.value1);
},
async changeRoom(){
let risk= await this.riskList(this.planId,this.active,this.value1,this.value2)
async changeRoom() {
let risk = await this.riskList(
this.planId,
this.active,
this.value1,
this.value2
);
},
onSearch(val) {
this.postList(this.searchValue);
......@@ -256,9 +276,9 @@
this.$router.push({
name: "addCurrent",
params: {
inherentId: data.businessId||data.id,
buildingIds:this.active,
},
inherentId: data.businessId || data.id,
buildingIds: this.active
}
});
this.showIndex = null;
},
......@@ -267,31 +287,30 @@
this.$router.push({
name: "risk-affirm",
params: {
data: data,
},
data: data
}
});
this.showIndex = null;
},
},
};
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50
}
.cell-wrap {
position: relative;
}
p {
};
</script>
<style lang="less" scoped>
#app {
font-family: "";
color: #2c3e50;
}
.cell-wrap {
position: relative;
}
p {
font-size: 0.4rem;
font-weight: none;
padding-left: 0.16rem;
margin: 0.186667rem 0;
color: #7f7f7f;
}
.van-cell-group--inset {
}
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
......@@ -301,30 +320,30 @@
margin-bottom: 0.133333rem;
line-height: 0.64rem;
}
}
.journal-wrap {
}
.journal-wrap {
position: relative;
}
.supervise-wrap {
}
.supervise-wrap {
position: relative;
}
.info-title {
}
.info-title {
color: #2980f7;
font-weight: none;
}
.field-title {
}
.field-title {
color: black;
font-weight: none;
}
.more {
}
.more {
position: absolute;
bottom: 0.32rem;
right: 15px;
color: #2a80f7;
font-weight: none;
z-index: 99;
}
.con-list {
}
.con-list {
padding: 0;
min-height: 10rem;
background-color: #f0f1f5;
......@@ -353,6 +372,5 @@
}
}
}
}
</style>
\ No newline at end of file
}
</style>
......@@ -301,7 +301,9 @@ export default {
this.$router.push({
name: "riskInherent",
params: {
id: this.messageList.id
id: this.messageList.id,
buildingId: this.messageList.riskBuildingListDtos[0].buildingId,
buildingName: this.messageList.riskBuildingListDtos[0].buildingName
}
});
},
......
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