Commit a4aa1936 authored by p-wanping.song's avatar p-wanping.song

Merge branch 'develop' of http://git.censoft.com.cn/rongtong/ruoyi-ui into swp-develop

parents 17699257 ee16aa03
...@@ -144,7 +144,21 @@ export const dynamicRoutes = [ ...@@ -144,7 +144,21 @@ export const dynamicRoutes = [
path: 'index/:id(\\d+)', path: 'index/:id(\\d+)',
component: () => import('@/views/risk/plan/ledgerdata'), component: () => import('@/views/risk/plan/ledgerdata'),
name: 'ledgerdata', name: 'ledgerdata',
meta: { title: '台账数据', activeMenu: '/risk/plan/ledgerdata' } meta: { title: '任务详情', activeMenu: '/risk/plan/ledgerdata' }
}
]
},
{
path: '/risk/drawCanvas/index',
component: Layout,
hidden: true,
permissions: ['system:ledgerRoom:list'],
children: [
{
path: 'index/:id(\\d+)',
component: () => import('@/views/risk/drawCanvas/index'),
name: 'drawCanvas',
meta: { title: '四色图', activeMenu: '/risk/drawCanvas/index' }
} }
] ]
}, },
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<img src="../../assets/imgs/north.png" alt="" /> <img src="../../assets/imgs/north.png" alt="" />
</div> --> </div> -->
<grid-layout <grid-layout
id="gridView"
:layout.sync="layout" :layout.sync="layout"
:col-num="colNum" :col-num="colNum"
:row-height="30" :row-height="30"
...@@ -27,7 +28,7 @@ ...@@ -27,7 +28,7 @@
@moved="movedEvent" @moved="movedEvent"
:style="{ :style="{
backgroundColor: item.c, backgroundColor: item.c,
border: item.type == 'thorough' ? 'none !important' : '' border: item.type == 'thorough' ? 'none !important' : '',
}" }"
> >
<span class="text" :class="item.w > item.h * 5 ? '' : 'rowText'">{{ <span class="text" :class="item.w > item.h * 5 ? '' : 'rowText'">{{
...@@ -36,19 +37,25 @@ ...@@ -36,19 +37,25 @@
<!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> --> <!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> -->
</grid-item> </grid-item>
</grid-layout> </grid-layout>
<el-row style="margin-top: 20px; margin-left: 20px">
<el-button type="primary" @click="getPdf">导 出</el-button>
<el-button @click="cancelDraw">取 消</el-button>
</el-row>
</div> </div>
</template> </template>
<script> <script>
import html2Canvas from "html2canvas";
import JsPDF from "jspdf";
import { GridLayout, GridItem } from "vue-grid-layout"; import { GridLayout, GridItem } from "vue-grid-layout";
import { ledgerRoomList ,getDictList} from "@/api/risk/draw"; import { ledgerRoomList, getDictList } from "@/api/risk/draw";
// 动态添加/删除 // 动态添加/删除
export default { export default {
name: "riskView", name: "riskView",
components: { components: {
GridLayout, GridLayout,
GridItem GridItem,
}, },
data() { data() {
return { return {
...@@ -78,14 +85,14 @@ export default { ...@@ -78,14 +85,14 @@ export default {
isBase: false, isBase: false,
baseName: "", baseName: "",
baseArr: [], baseArr: [],
layoutData: [] layoutData: [],
}; };
}, },
props: { props: {
isView: { isView: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
mounted() { mounted() {
// screenfull.toggle(this.$refs.mapbox); // screenfull.toggle(this.$refs.mapbox);
...@@ -110,6 +117,53 @@ export default { ...@@ -110,6 +117,53 @@ export default {
this.getRoomInfo(); this.getRoomInfo();
}, },
methods: { methods: {
getPdf() {
var title = "四色图";
// html2Canvas(document.querySelector('#pdfDom'), { //这是在界面上设置一个id
//只下载id为pdfDom的内容
html2Canvas(document.querySelector("#gridView"), {
//body是下载整个界面
useCORS: true, //是否尝试使用CORS从服务器加载图像
allowTaint: true,
dpi: 300, //解决生产图片模糊
// width: 490, //canvas宽度
// height: 240, //canvas高度
// x: 0, //x坐标
// y: 0, //y坐标
async: false, //是否异步解析和呈现元素
foreignObjectRendering: true, //是否在浏览器支持的情况下使用ForeignObject渲染
}).then(function (canvas) {
console.log(canvas);
let contentWidth = canvas.width;
let contentHeight = canvas.height;
let pageHeight = (contentWidth / 592.28) * 841.89; // 一页pdf显示html页面生成的canvas高度;
let leftHeight = contentHeight; //未生成pdf的html页面高度
let position = 0; //pdf页面偏移
//a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
let imgWidth = 595.28;
let imgHeight = (592.28 / contentWidth) * contentHeight;
let pageData = canvas.toDataURL("image/jpeg", 1.0);
let PDF = new JsPDF("", "pt", "a4");
// 有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
//当内容未超过pdf一页显示的范围,无需分页
if (leftHeight < pageHeight) {
PDF.addImage(pageData, "JPEG", 0, 0, imgWidth, imgHeight);
} else {
while (leftHeight > 0) {
PDF.addImage(pageData, "JPEG", 20, position, imgWidth, imgHeight);
leftHeight -= pageHeight;
position -= 841.89;
if (leftHeight > 0) {
PDF.addPage();
}
}
}
PDF.save(title + ".pdf");
});
},
cancelDraw() {
this.$router.go(-1);
},
orientationChange() { orientationChange() {
if (window.orientation === 180 || window.orientation === 0) { if (window.orientation === 180 || window.orientation === 0) {
console.log("竖屏状态!"); console.log("竖屏状态!");
...@@ -179,14 +233,14 @@ export default { ...@@ -179,14 +233,14 @@ export default {
}, },
getRoomInfo() { getRoomInfo() {
let data = { let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : "4" floorId: this.$route.params.floorId ? this.$route.params.floorId : "4",
}; };
ledgerRoomList(data) ledgerRoomList(data)
.then(res => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.layout = []; this.layout = [];
this.layoutData = res.data; this.layoutData = res.data;
res.data.forEach(item => { res.data.forEach((item) => {
item.position = JSON.parse(item.position); item.position = JSON.parse(item.position);
item.position.i = item.id; item.position.i = item.id;
item.position.id = item.id; item.position.id = item.id;
...@@ -198,49 +252,49 @@ export default { ...@@ -198,49 +252,49 @@ export default {
// //添加页面不显示颜色 // //添加页面不显示颜色
// item.position.c = "#e6e5e5"; // item.position.c = "#e6e5e5";
// } else { // } else {
/** /**
* 根据风险评分来匹配相应的颜色 * 根据风险评分来匹配相应的颜色
* score 风险评分字段 * score 风险评分字段
*/ */
// item.score = Number(item.score) // item.score = Number(item.score)
// if (item.score>=21 && item.score <= 27) { //优 // if (item.score>=21 && item.score <= 27) { //优
// item.position.c = this.colorList[3] // item.position.c = this.colorList[3]
// }else if(item.score>=14 && item.score <=20){ //良 // }else if(item.score>=14 && item.score <=20){ //良
// item.position.c = this.colorList[2] // item.position.c = this.colorList[2]
// }else if (item.score>=7&& item.score <= 13) { //中 // }else if (item.score>=7&& item.score <= 13) { //中
// item.position.c = this.colorList[1] // item.position.c = this.colorList[1]
// }else if (item.score>=0 && item.score <= 6) { //差 // }else if (item.score>=0 && item.score <= 6) { //差
// item.position.c = this.colorList[0] // item.position.c = this.colorList[0]
// } // }
item.position.c = this.colorList[Math.floor(Math.random() * 4)]; item.position.c = this.colorList[Math.floor(Math.random() * 4)];
// } // }
this.layout.push(item.position); this.layout.push(item.position);
}); });
// console.log('layout==>>',this.layout) // console.log('layout==>>',this.layout)
} }
}) })
.catch(err => { .catch((err) => {
console.log("err==>>", err); console.log("err==>>", err);
}); });
// getDictList({ // getDictList({
// dictType: "risk_plan_room_type" // dictType: "risk_plan_room_type"
// }).then(res => { // }).then(res => {
// this.roomArr = res.data; // this.roomArr = res.data;
// }); // });
// getDictList({ // getDictList({
// dictType: "risk_plan_base_room" // dictType: "risk_plan_base_room"
// }).then(res => { // }).then(res => {
// this.baseArr = res.data; // this.baseArr = res.data;
// }); // });
}, },
// 增加 // 增加
addItem() { addItem() {
if (this.layout.find(item => item.i == "")) { if (this.layout.find((item) => item.i == "")) {
Toast.fail({ Toast.fail({
title: "提示", title: "提示",
forbidClick: true, forbidClick: true,
message: "请先点击确定,保存当前房间信息" message: "请先点击确定,保存当前房间信息",
}); });
return; return;
} }
...@@ -253,11 +307,11 @@ export default { ...@@ -253,11 +307,11 @@ export default {
}, },
// 添加其他 // 添加其他
addOther() { addOther() {
if (this.layout.find(item => item.i == "")) { if (this.layout.find((item) => item.i == "")) {
Toast.fail({ Toast.fail({
title: "提示", title: "提示",
forbidClick: true, forbidClick: true,
message: "请先点击确定,保存当前房间信息" message: "请先点击确定,保存当前房间信息",
}); });
return; return;
} }
...@@ -271,11 +325,11 @@ export default { ...@@ -271,11 +325,11 @@ export default {
//添加基础设施 //添加基础设施
addBase() { addBase() {
if (this.layout.find(item => item.i == "")) { if (this.layout.find((item) => item.i == "")) {
Toast.fail({ Toast.fail({
title: "提示", title: "提示",
forbidClick: true, forbidClick: true,
message: "请先点击确定,保存当前房间信息" message: "请先点击确定,保存当前房间信息",
}); });
return; return;
} }
...@@ -294,7 +348,7 @@ export default { ...@@ -294,7 +348,7 @@ export default {
// console.log('this.layout==>>',this.layout) // console.log('this.layout==>>',this.layout)
}, },
// 调整大小后的事件 // 调整大小后的事件
resizedEvent: function(i, newH, newW) { resizedEvent: function (i, newH, newW) {
this.layOutItem.w = newW; this.layOutItem.w = newW;
this.layOutItem.h = newH; this.layOutItem.h = newH;
// console.log('layOutItem==>>',this.layOutItem) // console.log('layOutItem==>>',this.layOutItem)
...@@ -342,8 +396,8 @@ export default { ...@@ -342,8 +396,8 @@ export default {
this.roomName = value.dictValue; this.roomName = value.dictValue;
} }
this.showPicker = false; this.showPicker = false;
} },
} },
}; };
</script> </script>
...@@ -353,7 +407,7 @@ export default { ...@@ -353,7 +407,7 @@ export default {
} }
.wrap { .wrap {
/* height: 100vh; */ /* height: 100vh; */
width: 100vw; width: 100%;
position: relative; position: relative;
} }
.north { .north {
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="任务名称" prop="name"> :model="queryParams"
<el-input v-model="queryParams.name" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery" /> ref="queryForm"
</el-form-item> size="small"
<!-- <el-form-item label="任务编号" prop="no"> :inline="true"
<el-input v-show="showSearch"
v-model="queryParams.no" label-width="68px"
placeholder="请输入任务编号" >
clearable <el-form-item label="任务名称" prop="name">
@keyup.enter.native="handleQuery" <el-input
/> v-model="queryParams.name"
</el-form-item> placeholder="请输入任务名称"
<el-form-item label="项目id" prop="projectId"> clearable
<el-input @keyup.enter.native="handleQuery"
v-model="queryParams.projectId" />
placeholder="请输入项目id" </el-form-item>
clearable <el-form-item>
@keyup.enter.native="handleQuery" <el-button
/> type="primary"
</el-form-item> icon="el-icon-search"
<el-form-item label="楼栋ids" prop="buildingIds"> size="mini"
<el-input @click="handleQuery"
v-model="queryParams.buildingIds" >搜索</el-button
placeholder="请输入楼栋ids" >
clearable <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
@keyup.enter.native="handleQuery" >重置</el-button
/> >
</el-form-item> </el-form-item>
<el-form-item label="创建人员id" prop="createUserId"> </el-form>
<el-input
v-model="queryParams.createUserId"
placeholder="请输入创建人员id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建单位" prop="createDeptId">
<el-input
v-model="queryParams.createDeptId"
placeholder="请输入创建单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="负责人id" prop="leaderUserId">
<el-input
v-model="queryParams.leaderUserId"
placeholder="请输入负责人id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="执行人员ids" prop="workUserIds">
<el-input
v-model="queryParams.workUserIds"
placeholder="请输入执行人员ids"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择结束时间">
</el-date-picker>
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange"> <el-table
<el-table-column label="序号" align="center"> v-loading="loading"
<template slot-scope="scope"> :data="planList"
<span>{{ scope.$index + 1 }}</span> @selection-change="handleSelectionChange"
</template> >
</el-table-column> <el-table-column label="序号" align="center">
<el-table-column label="任务名称" align="center" prop="name" /> <template slot-scope="scope">
<el-table-column label="任务编号" align="center" prop="no" /> <span>{{ scope.$index + 1 }}</span>
<el-table-column label="项目名称" align="center" prop="projectName" /> </template>
<el-table-column label="楼栋名称" align="center" prop="buildingNames" /> </el-table-column>
<el-table-column label="创建人员" align="center" prop="createUserName" /> <el-table-column label="任务名称" align="center" prop="name" />
<el-table-column label="创建单位" align="center" prop="createDeptName" /> <el-table-column label="任务编号" align="center" prop="no" />
<el-table-column label="负责人" align="center" prop="leaderUserName" /> <el-table-column label="项目名称" align="center" prop="projectName" />
<el-table-column label="执行人员" align="center" prop="workUserNames" /> <el-table-column label="楼栋名称" align="center" prop="buildingNames" />
<el-table-column label="开始时间" align="center" prop="startTime" width="180"> <el-table-column label="创建人员" align="center" prop="createUserName" />
<template slot-scope="scope"> <el-table-column label="创建单位" align="center" prop="createDeptName" />
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span> <el-table-column label="负责人" align="center" prop="leaderUserName" />
</template> <el-table-column label="执行人员" align="center" prop="workUserNames" />
</el-table-column> <el-table-column
<el-table-column label="结束时间" align="center" prop="endTime" width="180"> label="开始时间"
<template slot-scope="scope"> align="center"
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span> prop="startTime"
</template> width="180"
</el-table-column> >
<el-table-column label="状态" align="center" prop="status" /> <template slot-scope="scope">
<el-table-column label="操作" align="center" :show-overflow-tooltip="true"> <span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
<template slot-scope="scope"> </template>
<router-link :to="'/risk/plan/ledgerdata/index/' + scope.row.id" class="link-type"> </el-table-column>
<el-button size="mini" type="text" icon="el-icon-view">详情</el-button> <el-table-column
</router-link> label="结束时间"
</template> align="center"
</el-table-column> prop="endTime"
</el-table> width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" />
<el-table-column
label="操作"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<router-link
:to="'/risk/plan/ledgerdata/index/' + scope.row.id"
class="link-type"
>
<el-button size="mini" type="text" icon="el-icon-view"
>详情</el-button
>
</router-link>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination
@pagination="getList" /> v-show="total > 0"
:total="total"
</div> :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template> </template>
<script> <script>
import { listPlan, addPlan, updatePlan } from "@/api/risk/plan"; import { listPlan, addPlan, updatePlan } from "@/api/risk/plan";
export default { export default {
name: "Plan", name: "Plan",
data() { data() {
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
multiple: true, multiple: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 风险计划表格数据 // 风险计划表格数据
planList: [], planList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: null, name: null,
no: null, no: null,
projectId: null, projectId: null,
buildingIds: null, buildingIds: null,
createUserId: null, createUserId: null,
createDeptId: null, createDeptId: null,
leaderUserId: null, leaderUserId: null,
workUserIds: null, workUserIds: null,
startTime: null, startTime: null,
endTime: null, endTime: null,
status: null, status: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {},
} };
}; },
created() {
this.getList();
},
methods: {
/** 查询风险计划列表 */
getList() {
this.loading = true;
listPlan(this.queryParams).then((response) => {
this.planList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
name: null,
no: null,
projectId: null,
buildingIds: null,
createUserId: null,
createDeptId: null,
leaderUserId: null,
workUserIds: null,
startTime: null,
endTime: null,
status: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
}, },
created() { // 多选框选中数据
this.getList(); handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
}, },
methods: { },
/** 查询风险计划列表 */
getList() {
this.loading = true;
listPlan(this.queryParams).then(response => {
this.planList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
name: null,
no: null,
projectId: null,
buildingIds: null,
createUserId: null,
createDeptId: null,
leaderUserId: null,
workUserIds: null,
startTime: null,
endTime: null,
status: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
}
}; };
</script> </script>
\ No newline at end of file
<template> <template>
<div class="wrapper"> <div class="wrapper">
<el-descriptions title="集团安全咨询服务项目"> <el-descriptions title="集团安全咨询服务项目">
<el-descriptions-item label="创建人">{{ InfoList.createUserName }}</el-descriptions-item> <el-descriptions-item label="创建人">{{
<el-descriptions-item label="创建单位">{{ InfoList.detailsDto.createDeptName }}</el-descriptions-item> InfoList.createUserName
<el-descriptions-item label="创建时间">{{ InfoList.detailsDto.createTime }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="所属单位">{{ InfoList.createDeptId }}</el-descriptions-item> <el-descriptions-item label="创建单位">{{
<el-descriptions-item label="所属省市">苏州市</el-descriptions-item> InfoList.detailsDto.createDeptName
<el-descriptions-item label="项目坐标">{{ InfoList.workUserIds }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="项目负责人">{{ InfoList.detailsDto.createUserName }}</el-descriptions-item> <el-descriptions-item label="创建时间">{{
<el-descriptions-item label="评估组成员">{{ InfoList.detailsDto.workUserNames }}</el-descriptions-item> InfoList.detailsDto.createTime
<el-descriptions-item label="开始时间">{{ InfoList.startTime }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="联系地址">{{ InfoList.name }}</el-descriptions-item> <el-descriptions-item label="所属单位">{{
</el-descriptions> InfoList.createDeptId
<el-tabs v-model="activeName" @tab-click="handleClick"> }}</el-descriptions-item>
<el-tab-pane label="风险评估清单" name="first"> <el-descriptions-item label="所属省市">苏州市</el-descriptions-item>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" <el-descriptions-item label="项目坐标">{{
label-width="82px"> InfoList.workUserIds
<el-form-item label="风险源名称" prop="name"> }}</el-descriptions-item>
<el-input v-model="queryParams.name" placeholder="请输入风险源名称" clearable <el-descriptions-item label="项目负责人">{{
@keyup.enter.native="handleQuery" /> InfoList.detailsDto.createUserName
</el-form-item> }}</el-descriptions-item>
<el-form-item label="风险等级" prop="level"> <el-descriptions-item label="评估组成员">{{
<el-input v-model="queryParams.level" placeholder="请输入风险等级" clearable InfoList.detailsDto.workUserNames
@keyup.enter.native="handleQuery" /> }}</el-descriptions-item>
</el-form-item> <el-descriptions-item label="开始时间">{{
<el-form-item label="风险类型" prop="factor"> InfoList.startTime
<el-input v-model="queryParams.factor" placeholder="请输入风险因素" clearable }}</el-descriptions-item>
@keyup.enter.native="handleQuery" /> <el-descriptions-item label="联系地址">{{
</el-form-item> InfoList.name
<el-form-item label="存在部位" prop="referenceBasis"> }}</el-descriptions-item>
<el-input v-model="queryParams.referenceBasis" placeholder="请输入参考依据" clearable </el-descriptions>
@keyup.enter.native="handleQuery" /> <el-tabs v-model="activeName" @tab-click="handleClick">
</el-form-item> <el-tab-pane label="风险评估清单" name="first">
<el-form-item> <!-- <el-form
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> :model="queryParams"
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> ref="queryForm"
</el-form-item> size="small"
</el-form> :inline="true"
v-show="showSearch"
label-width="82px"
>
<el-form-item label="风险源名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入风险源名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="风险等级" prop="level">
<el-input
v-model="queryParams.level"
placeholder="请输入风险等级"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="风险类型" prop="factor">
<el-input
v-model="queryParams.factor"
placeholder="请输入风险因素"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="存在部位" prop="referenceBasis">
<el-input
v-model="queryParams.referenceBasis"
placeholder="请输入参考依据"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form> -->
<el-table v-loading="loading" :data="listList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="listList">
<el-table-column type="selection" width="55" align="center" /> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="id" align="center" prop="id" /> <el-table-column type="index" width="50" />
<el-table-column label="风险名称" align="center" prop="name" /> <!-- <el-table-column label="id" align="center" prop="id" /> -->
<el-table-column label="所属建筑" align="center" prop="buildingName" /> <el-table-column label="风险名称" align="center" prop="name" />
<el-table-column label="所属楼层" align="center" prop="floorName" /> <el-table-column
<el-table-column label="所属房间" align="center" prop="roomName" /> label="所属建筑"
<el-table-column label="风险等级(系数)" align="center" prop="level" /> align="center"
<el-table-column label="风险因素" align="center" prop="factor" /> prop="buildingName"
<el-table-column label="准事故类型" align="center" prop="type" /> />
<el-table-column label="存在部位" align="center" prop="presenceLocation" /> <el-table-column label="所属楼层" align="center" prop="floorName" />
<el-table-column label="操作" align="center" prop="describe"> <el-table-column label="所属房间" align="center" prop="roomName" />
<template slot-scope="scope"> <el-table-column
<div> label="风险等级(系数)"
<el-button size="mini" type="text" icon="el-icon-download" align="center"
@click="exportList(scope.row.id)">下载风险告知卡</el-button> prop="level"
</div> />
</template> <el-table-column label="风险因素" align="center" prop="factor" />
</el-table-column> <el-table-column label="准事故类型" align="center" prop="type" />
</el-table> <el-table-column
label="存在部位"
align="center"
prop="presenceLocation"
/>
<el-table-column label="操作" align="center" prop="describe">
<template slot-scope="scope">
<div>
<el-button
size="mini"
type="text"
icon="el-icon-download"
@click="exportList(scope.row.id)"
>下载风险告知卡</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="showDrawCanvas(scope.row.floorId)"
>查看四色图</el-button
>
</div>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" <pagination
:limit.sync="queryParams.pageSize" @pagination="getRiskList" /> v-show="total > 0"
</el-tab-pane> :total="total"
<el-tab-pane label="评估结果审核" name="second"> :page.sync="queryParams.pageNum"
<div class="approveResult"> :limit.sync="queryParams.pageSize"
<div class="approveL"> @pagination="getRiskList"
<div class="titles">审批流程</div> />
<el-steps direction="vertical" :active="1"> </el-tab-pane>
<el-step title="发起审批" icon="el-icon-success"></el-step> <el-tab-pane label="评估结果审核" name="second">
<el-step title="评估负责人审批" icon="el-icon-success"></el-step> <div class="approveResult">
<el-step title="项目负责人审批" icon="el-icon-success"></el-step> <div class="approveL">
</el-steps> <div class="titles">审批流程</div>
</div> <el-steps direction="vertical" :active="1">
<div class="approveR"> <el-step title="发起审批" icon="el-icon-success"></el-step>
<div class="titles">审批信息</div> <el-step title="评估负责人审批" icon="el-icon-success"></el-step>
<el-steps direction="vertical" :active="1"> <el-step title="项目负责人审批" icon="el-icon-success"></el-step>
<el-step title="发起审批" icon="el-icon-success"></el-step> </el-steps>
<el-step title="评估负责人审批" icon="el-icon-success"></el-step> </div>
<el-step title="项目负责人审批" icon="el-icon-success" description="这是一段很长很长很长的描述性文字"></el-step> <div class="approveR">
</el-steps> <div class="titles">审批信息</div>
</div> <el-steps direction="vertical" :active="1">
</div> <el-step title="发起审批" icon="el-icon-success"></el-step>
</el-tab-pane> <el-step title="评估负责人审批" icon="el-icon-success"></el-step>
<el-tab-pane label="风险评估报告" name="third"> <el-step
<div class="titles">评估报告生成</div> title="项目负责人审批"
<el-table :data="reportList"> icon="el-icon-success"
<el-table-column label="编号" align="center" prop="id" /> description="这是一段很长很长很长的描述性文字"
<el-table-column label="生成时间" align="center" prop="inherentId" /> ></el-step>
<el-table-column label="生成人员" align="center" prop="code" /> </el-steps>
<el-table-column label="所属建筑" align="center" prop="name" /> </div>
<el-table-column label="所属承租户" align="center" prop="type" /> </div>
<el-table-column label="操作" align="center" prop="describe"> </el-tab-pane>
<template slot-scope="scope"> <el-tab-pane label="风险评估报告" name="third">
<div> <div class="titles">评估报告生成</div>
<el-button size="mini" type="text" icon="el-icon-download">下载</el-button> <el-table :data="reportList">
</div> <el-table-column label="编号" align="center" prop="id" />
</template> <el-table-column label="生成时间" align="center" prop="inherentId" />
</el-table-column> <el-table-column label="生成人员" align="center" prop="code" />
</el-table> <el-table-column label="所属建筑" align="center" prop="name" />
</el-tab-pane> <el-table-column label="所属承租户" align="center" prop="type" />
<el-table-column label="操作" align="center" prop="describe">
</el-tabs> <template slot-scope="scope">
</div> <div>
<el-button size="mini" type="text" icon="el-icon-download"
>下载</el-button
>
</div>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</template> </template>
<script> <script>
import { getPlan, riskListInfo, riskList, exportRiskList } from "@/api/risk/plan"; import {
getPlan,
riskListInfo,
riskList,
exportRiskList,
} from "@/api/risk/plan";
export default { export default {
data() { data() {
return { return {
activeName: 'first', activeName: "first",
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
multiple: true, multiple: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 现有风险清单库表格数据 // 现有风险清单库表格数据
listList: [], listList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
inherentId: null, inherentId: null,
code: null, code: null,
name: null, name: null,
type: null, type: null,
describe: null, describe: null,
evaluationModel: null, evaluationModel: null,
evaluationRange: null, evaluationRange: null,
level: null, level: null,
factor: null, factor: null,
measuresProject: null, measuresProject: null,
measuresProjectFileIds: null, measuresProjectFileIds: null,
measuresAdministration: null, measuresAdministration: null,
measuresAdministrationFileIds: null, measuresAdministrationFileIds: null,
measuresEmergency: null, measuresEmergency: null,
measuresEmergencyFileIds: null, measuresEmergencyFileIds: null,
referenceBasis: null, referenceBasis: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {},
}, reportList: [],
reportList: [], InfoList: {},
InfoList: {}, };
} },
}, mounted() {
mounted() { // console.log(this.$route.params, 'lll')
// console.log(this.$route.params, 'lll') this.getInfo(this.$route.params.id);
this.getInfo(this.$route.params.id) this.getRiskList(this.$route.params.id);
this.getRiskList(this.$route.params.id) },
}, methods: {
methods: { showDrawCanvas(floorId) {
getInfo(id) { this.$router.push({
riskListInfo(id).then(res => { name: "drawCanvas",
this.InfoList = res.data params: {
}) floorId: floorId,
}, },
getRiskList(id) { });
riskList({ planId: id }).then(res => {
this.loading = false
this.listList = res.rows
})
},
exportList(id) {
console.log(id,'kkkk')
this.download('system/risk/plan/exportWord/riskNotification/' + id, {}, `风险告知卡.docx`)
}
},
handleClick() {
}, },
// 表单重置 getInfo(id) {
reset() { riskListInfo(id).then((res) => {
this.form = { this.InfoList = res.data;
id: null, });
inherentId: null,
code: null,
name: null,
type: null,
describe: null,
evaluationModel: null,
evaluationRange: null,
level: null,
factor: null,
measuresProject: null,
measuresProjectFileIds: null,
measuresAdministration: null,
measuresAdministrationFileIds: null,
measuresEmergency: null,
measuresEmergencyFileIds: null,
referenceBasis: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
}, },
/** 搜索按钮操作 */ getRiskList(id) {
handleQuery() { riskList({ planId: id }).then((res) => {
this.queryParams.pageNum = 1; this.loading = false;
this.getList(); this.listList = res.rows;
});
}, },
/** 重置按钮操作 */ exportList(id) {
resetQuery() { console.log(id, "kkkk");
this.resetForm("queryForm"); this.download(
this.handleQuery(); "system/risk/plan/exportWord/riskNotification/" + id,
{},
`风险告知卡.docx`
);
}, },
handleSelectionChange() { },
handleClick() {},
} // 表单重置
} reset() {
this.form = {
id: null,
inherentId: null,
code: null,
name: null,
type: null,
describe: null,
evaluationModel: null,
evaluationRange: null,
level: null,
factor: null,
measuresProject: null,
measuresProjectFileIds: null,
measuresAdministration: null,
measuresAdministrationFileIds: null,
measuresEmergency: null,
measuresEmergencyFileIds: null,
referenceBasis: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleSelectionChange() {},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.wrapper { .wrapper {
height: 100%; height: 100%;
width: 100%; width: 100%;
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
::v-deep .el-tabs__content { ::v-deep .el-tabs__content {
height: calc(100vh - 334px) !important; height: calc(100vh - 334px) !important;
} }
.titles { .titles {
position: relative; position: relative;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
margin: 10px 0 10px 20px; margin: 10px 0 10px 20px;
color: #666666; color: #666666;
} }
.titles::before { .titles::before {
content: ""; content: "";
width: 8px; width: 8px;
height: 20px; height: 20px;
background: #3f9eff; background: #3f9eff;
position: absolute; position: absolute;
left: -14px; left: -14px;
top: 0; top: 0;
} }
.approveResult { .approveResult {
flex: 1; flex: 1;
width: 100%; width: 100%;
height: calc(100vh - 360px) !important; height: calc(100vh - 360px) !important;
overflow-y: auto; overflow-y: auto;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.approveL { .approveL {
flex: 3; flex: 3;
width: 100%; width: 100%;
} }
.approveR {
flex: 7;
width: 100%;
padding: 0 0 0 30px;
border-left: 1px solid #d7d7d7d7;
}
.approveR {
flex: 7;
width: 100%;
padding: 0 0 0 30px;
border-left: 1px solid #d7d7d7d7;
}
} }
</style> </style>
\ No newline at end of file
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