Commit 165a0c1c authored by 杨帆's avatar 杨帆

Merge branch 'dev-yf'' into 'develop'

Dev yf'

See merge request !14
parents c8757c18 3e50c046
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
"riskAssess", "riskAssess",
"riskApprove", "riskApprove",
"taskList", "taskList",
"taskDetail", "taskDetail"
], ],
// cachePage预先定义的缓存页面 // cachePage预先定义的缓存页面
otherCache: [], otherCache: [],
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -210,8 +210,12 @@ ...@@ -210,8 +210,12 @@
</van-checkbox-group> </van-checkbox-group>
</div> </div>
<div style="display: flex;justify-content: space-around;"> <div style="display: flex;justify-content: space-around;">
<van-button native-type="button" type="primary" v-on:click="checkAll">全选</van-button> <van-button native-type="button" type="primary" v-on:click="checkAll"
<van-button native-type="button" type="info" @click="toggleAll">反选</van-button> >全选</van-button
>
<van-button native-type="button" type="info" @click="toggleAll"
>反选</van-button
>
</div> </div>
</van-popup> </van-popup>
...@@ -248,7 +252,7 @@ ...@@ -248,7 +252,7 @@
<!-- 选择时间弹出层 --> <!-- 选择时间弹出层 -->
<van-popup v-model="showTime" position="bottom"> <van-popup v-model="showTime" position="bottom">
<van-datetime-picker <van-datetime-picker
type="datetime" type="date"
@confirm="onConTime" @confirm="onConTime"
@cancel="showTime = false" @cancel="showTime = false"
:min-date="minDate" :min-date="minDate"
...@@ -258,7 +262,7 @@ ...@@ -258,7 +262,7 @@
<div style="margin: 16px 16px 0"> <div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit"
>上报</van-button >提交</van-button
> >
</div> </div>
</van-form> </van-form>
...@@ -379,7 +383,7 @@ export default { ...@@ -379,7 +383,7 @@ export default {
"font-size:13px; background:pink; color:#bf2c9f;", "font-size:13px; background:pink; color:#bf2c9f;",
date date
); );
let time = timestampToTime(date, "DT1", true); let time = timestampToTime(date, "DT2", true);
this.form[this.timeName] = time; this.form[this.timeName] = time;
this.showTime = false; this.showTime = false;
}, },
......
...@@ -8,12 +8,32 @@ ...@@ -8,12 +8,32 @@
<van-tabs v-model="active" @change="tabList" color="#2980f7" animated> <van-tabs v-model="active" @change="tabList" color="#2980f7" animated>
<van-tab :title="buildingName"> <van-tab :title="buildingName">
<van-dropdown-menu z-index="1000"> <van-dropdown-menu z-index="1000">
<van-dropdown-item v-model="value0" @change="changeBuild" :options="option0" get-container="body" /> <van-dropdown-item
<van-dropdown-item v-model="value1" @change="changeFloor" :options="option1" get-container="body" /> v-model="value0"
<van-dropdown-item v-model="value2" @change="changeRoom" :options="option2" get-container="body" /> @change="changeBuild"
:options="option0"
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> </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)"> <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;"> <div style="font-size: 0.45rem;padding: 5px 0;">
{{ item.name }} {{ item.name }}
</div> </div>
...@@ -40,27 +60,33 @@ ...@@ -40,27 +60,33 @@
</van-row> </van-row>
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
<van-button round type="primary" @click="goDetail(item)">编辑</van-button> <van-button round type="primary" @click="goDetail(item)"
>编辑</van-button
>
<!-- <van-button round type="info" @click="goConfirm(item)" v-show="active==0" <!-- <van-button round type="info" @click="goConfirm(item)" v-show="active==0"
>确认</van-button >确认</van-button
> --> > -->
</div> </div>
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
<div style=" <div
style="
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 0.48rem; font-size: 0.48rem;
position: fixed; position: fixed;
top: 30%; top: 30%;
" v-if="messageList['length'] == 0"> "
v-if="messageList['length'] == 0"
>
暂无数据 暂无数据
</div> </div>
</div> </div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
<div style="display: flex; <div
style="display: flex;
justify-content: space-around; justify-content: space-around;
background-color: #fff; background-color: #fff;
border-top: 1px solid #e3e3e3; border-top: 1px solid #e3e3e3;
...@@ -68,12 +94,19 @@ ...@@ -68,12 +94,19 @@
width: 100%; width: 100%;
text-align: center; text-align: center;
position: fixed; position: fixed;
bottom: 0;"> bottom: 0;"
<div @click="performTasks" style="color: #4bced0;font-size: 14px;font-weight: 600;"> >
<div
@click="performTasks"
style="color: #4bced0;font-size: 14px;font-weight: 600;"
>
<div style="font-size: 22px;"><van-icon name="plus" /></div> <div style="font-size: 22px;"><van-icon name="plus" /></div>
<div>新增固有风险</div> <div>新增固有风险</div>
</div> </div>
<div @click="endTasks" style="color: #D9001B;font-size: 14px;font-weight: 600;"> <div
@click="endTasks"
style="color: #D9001B;font-size: 14px;font-weight: 600;"
>
<div style="font-size: 22px;"><van-icon name="cross" /></div> <div style="font-size: 22px;"><van-icon name="cross" /></div>
<div>任务执行结束</div> <div>任务执行结束</div>
</div> </div>
...@@ -82,14 +115,14 @@ ...@@ -82,14 +115,14 @@
</template> </template>
<script> <script>
import { Dialog } from 'vant'; import { Dialog } from "vant";
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js"; import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format"; import { timestampToTime, generateId } from "@/utils/format";
export default { export default {
name: "risk-confirme", name: "risk-confirme",
components: { components: {
LHeader, LHeader
}, },
data() { data() {
return { return {
...@@ -98,10 +131,10 @@ export default { ...@@ -98,10 +131,10 @@ export default {
planId: 0, planId: 0,
buildingId: 0, buildingId: 0,
buildingName: "", buildingName: "",
value0:'', value0: "",
value1: 0, value1: 0,
value2: 0, value2: 0,
option0:[], option0: [],
option1: [], option1: [],
option2: [], option2: [],
isHaveNews: false, isHaveNews: false,
...@@ -112,13 +145,15 @@ export default { ...@@ -112,13 +145,15 @@ export default {
active: 1, active: 1,
form: {}, form: {},
tabs: [], tabs: [],
floorListData:[] floorListData: []
}; };
}, },
created() { 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 || sessionStorage.getItem("buildingId"); this.buildingId =
this.buildingName = this.$route.params.buildingName || sessionStorage.getItem("buildingName"); this.$route.params.buildingId || sessionStorage.getItem("buildingId");
this.buildingName =
this.$route.params.buildingName || sessionStorage.getItem("buildingName");
this.getRiskList(this.planId); this.getRiskList(this.planId);
// this.postList(); // this.postList();
}, },
...@@ -138,9 +173,9 @@ export default { ...@@ -138,9 +173,9 @@ export default {
}, },
//新增固有风险 //新增固有风险
performTasks() { performTasks() {
sessionStorage.setItem('buildingId', this.buildingId) sessionStorage.setItem("buildingId", this.buildingId);
sessionStorage.setItem('planId', this.planId) sessionStorage.setItem("planId", this.planId);
sessionStorage.setItem('buildingName', this.buildingName) sessionStorage.setItem("buildingName", this.buildingName);
this.$router.push({ this.$router.push({
name: "addInherent", name: "addInherent",
...@@ -156,29 +191,28 @@ export default { ...@@ -156,29 +191,28 @@ export default {
endTasks() { endTasks() {
//toDo //toDo
Dialog.confirm({ Dialog.confirm({
title: '任务执行结束', title: "任务执行结束",
message: '是否任务执行结束', message: "是否任务执行结束"
}) })
.then(() => { .then(() => {
postFun( postFun(`/risk/plan/submit/${this.planId}/${this.buildingId}`).then(
`/risk/plan/submit/${this.planId}/${this.buildingId}` res => {
).then(res => {
// Dialog.alert({ // Dialog.alert({
// title: '任务执行结束', // title: '任务执行结束',
// message: res.msg, // message: res.msg,
// }).then(() => { // }).then(() => {
// resolve(res.data); // resolve(res.data);
this.$toast.success(res.msg) this.$toast.success(res.msg);
this.$router.push({ this.$router.push({
name: 'riskAssess' name: "riskAssess"
}) });
// }); // });
}) }
);
}) })
.catch(() => { .catch(() => {
// on cancel // on cancel
}); });
}, },
handadd() { handadd() {
this.$router.push({ this.$router.push({
...@@ -193,10 +227,10 @@ export default { ...@@ -193,10 +227,10 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getFun(`/risk/plan/floor/list/${id}`) getFun(`/risk/plan/floor/list/${id}`)
.then(res => { .then(res => {
this.floorListData = res.data this.floorListData = res.data;
this.changeBuild(res.data[0].name) this.changeBuild(res.data[0].name);
this.option0 = this.changeData(res.data) this.option0 = this.changeData(res.data);
this.value0 = res.data[0].name || '' this.value0 = res.data[0].name || "";
}) })
.catch(() => { .catch(() => {
this.$toast.fail("加载失败,请稍后再试"); this.$toast.fail("加载失败,请稍后再试");
...@@ -245,27 +279,32 @@ export default { ...@@ -245,27 +279,32 @@ export default {
duration: 0 duration: 0
}); });
let floor = await this.floorList(this.buildingId); let floor = await this.floorList(this.buildingId);
let room = await this.roomList(floor[0].id);
let risk = await this.riskList(id, this.buildingId); let risk = await this.riskList(id, this.buildingId);
this.$toast.clear(); this.$toast.clear();
}, },
async tabList(value) { async tabList(value) {
let floor = await this.floorList(value); let floor = await this.floorList(value);
let room = await this.roomList(floor[0].id);
let risk = await this.riskList(this.planId, value); let risk = await this.riskList(this.planId, value);
}, },
changeBuild(name){ changeBuild(name) {
let arr = this.floorListData.map((item)=>{ console.log(name);
if(item.name == name){ let arr = this.floorListData.map(item => {
return item.children if (item.name == name) {
return item.children;
} }
}); });
this.option1 = this.changeData(arr[0]) this.option1 = this.changeData(arr[0]);
this.value1 = this.changeData(arr[0]).id this.value1 = arr[0][0].id;
this.roomList(this.value1);
}, },
async changeFloor() { async changeFloor() {
let room = await this.roomList(this.value1); let room = await this.roomList(this.value1);
let risk = await this.riskList(this.planId, this.buildingId, this.value1, this.value2); let risk = await this.riskList(
this.planId,
this.buildingId,
this.value1,
this.value2
);
}, },
async changeRoom() { async changeRoom() {
let risk = await this.riskList( let risk = await this.riskList(
...@@ -287,10 +326,10 @@ export default { ...@@ -287,10 +326,10 @@ export default {
}, },
// 详情 // 详情
goDetail(data) { goDetail(data) {
sessionStorage.setItem('buildingId', this.buildingId) sessionStorage.setItem("buildingId", this.buildingId);
sessionStorage.setItem('planId', this.planId) sessionStorage.setItem("planId", this.planId);
sessionStorage.setItem('buildingName', this.buildingName) sessionStorage.setItem("buildingName", this.buildingName);
sessionStorage.setItem('inherentId', data.businessId || data.id) sessionStorage.setItem("inherentId", data.businessId || data.id);
this.$router.push({ this.$router.push({
name: "addCurrent", name: "addCurrent",
params: { params: {
......
...@@ -236,15 +236,22 @@ ...@@ -236,15 +236,22 @@
<van-col span="7" <van-col span="7"
><span class="field-title">任务节点:</span></van-col ><span class="field-title">任务节点:</span></van-col
> >
<van-col span="17">{{ item.taskName }}{{ <van-col span="17"
item.taskResult && item.taskResult == 1 ? "(审批通过)" : "(审批否决)" >{{ item.taskName
}}</van-col> }}{{
item.taskResult
? item.taskResult == 1
? "(审批通过)"
: "(审批否决)"
: ""
}}</van-col
>
</van-row> </van-row>
<van-row v-show="item.taskResult"> <van-row v-show="item.taskResult">
<van-col span="7" <van-col span="7"
><span class="field-title">审批意见:</span></van-col ><span class="field-title">审批意见:</span></van-col
> >
<van-col span="17">{{item.taskOpinion}}</van-col> <van-col span="17">{{ item.taskOpinion }}</van-col>
</van-row> </van-row>
<!-- <van-row> <!-- <van-row>
<van-col span="7" <van-col span="7"
...@@ -261,7 +268,7 @@ ...@@ -261,7 +268,7 @@
</van-cell-group> </van-cell-group>
</div> </div>
</van-tab> </van-tab>
<van-tab title="风险评估报告"> <van-tab title="评估报告">
<div <div
style="height: 1.5rem; style="height: 1.5rem;
background-color: #fff; background-color: #fff;
...@@ -766,7 +773,7 @@ export default { ...@@ -766,7 +773,7 @@ export default {
name: "taskDetail", name: "taskDetail",
params: { params: {
id: item.id, id: item.id,
floorId:item.floorId floorId: item.floorId
} }
}); });
} }
......
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
}, },
methods: { methods: {
timestampToTimes(time) { timestampToTimes(time) {
return timestampToTime(new Date(time), "DT1", true); return timestampToTime(new Date(time), "DT2", true);
}, },
handadd() { handadd() {
this.$router.push({ this.$router.push({
...@@ -200,6 +200,7 @@ export default { ...@@ -200,6 +200,7 @@ export default {
}); });
sessionStorage.setItem("pathAuth", "riskManage"); sessionStorage.setItem("pathAuth", "riskManage");
sessionStorage.setItem("planId", data.id); sessionStorage.setItem("planId", data.id);
sessionStorage.setItem("buildingId", "");
this.showIndex = null; this.showIndex = null;
}, },
// 确认 // 确认
......
...@@ -4,34 +4,48 @@ ...@@ -4,34 +4,48 @@
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
</van-sticky> </van-sticky>
<van-sticky offset-top="1.5rem"> <van-sticky offset-top="1.5rem">
<van-search v-model="searchValue" show-action placeholder="请输入搜索内容" @search="onSearch"> <van-search
v-model="searchValue"
show-action
placeholder="请输入搜索内容"
@search="onSearch"
>
<template #action> <template #action>
<div @click="onSearch">搜索</div> <div @click="onSearch">搜索</div>
</template> </template>
</van-search> </van-search>
</van-sticky> </van-sticky>
<div class="con-list"> <div class="con-list">
<van-cell-group v-for="(item, index) in taskList" :key="index" inset @click="touchstart(index, item)"> <van-cell-group
v-for="(item, index) in taskList"
:key="index"
inset
@click="touchstart(index, item)"
>
<div style="font-size: 0.45rem;padding: 5px 0;">{{ item.name }}</div> <div style="font-size: 0.45rem;padding: 5px 0;">{{ item.name }}</div>
<van-row gutter=""> <van-row gutter="">
<van-col span="17"> <van-col span="17">
<van-row gutter=""> <van-row gutter="">
<van-col span="9">发起时间:</van-col> <van-col span="9">发起时间:</van-col>
<van-col span="15">{{ timestampToTimes(item.startTime) }}</van-col> <van-col span="15">{{
timestampToTimes(item.startTime)
}}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">处理人员:</van-col> <van-col span="9">处理人员:</van-col>
<van-col span="15">{{ item.leaderUserName }}</van-col> <van-col span="15">{{ item.leaderUserName }}</van-col>
</van-row> </van-row>
</van-col> </van-col>
<van-col span="7" :style="{ 'color': '#03b615' }"> <van-col span="7" :style="{ color: '#03b615' }">
{{ item.state }} {{ item.state }}
</van-col> </van-col>
</van-row> </van-row>
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
<van-button round type="primary" @click="goDetail(item)">详情</van-button> <van-button round type="primary" @click="goDetail(item)"
>详情</van-button
>
</div> </div>
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
...@@ -86,6 +100,7 @@ export default { ...@@ -86,6 +100,7 @@ export default {
id: item.id, id: item.id,
}, },
}); });
sessionStorage.setItem("buildingId", "");
}, },
onSearch(searchValue) { onSearch(searchValue) {
......
...@@ -8,9 +8,9 @@ module.exports = { ...@@ -8,9 +8,9 @@ module.exports = {
//以上的ip和端口是我们本机的;下面为需要跨域的 //以上的ip和端口是我们本机的;下面为需要跨域的
proxy: { //配置跨域 proxy: { //配置跨域
'/app-api': { '/app-api': {
// target: 'http://192.168.4.232:8080/', //这里是后台的地址 target: 'http://192.168.4.232:8080/', //这里是后台的地址
// target: 'http://192.168.15.124:8080/', //这里是杨帆的地址 // target: 'http://192.168.15.124:8080/', //这里是杨帆的地址
target: 'http://192.168.10.137:8080/', //这里是昊哥的地址 // target: 'http://192.168.10.137:8080/', //这里是昊哥的地址
// target: 'http://192.168.10.36:8080/', //这里是昊哥的地址 // target: 'http://192.168.10.36:8080/', //这里是昊哥的地址
// target: 'http://localhost:8080/', //这里是后台的地址 // target: 'http://localhost: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