2023-06-07 16:32:03 +08:00

569 lines
14 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="overview">
<el-dialog :show-close="false" v-model="visible1" :style="dialogStyle" @close="closeMain">
<template #title>
<div class="title-detail">
<img src="@/assets/images/tableIcon/look.png" alt="" />
<span>查看隐患整改信息</span>
<el-icon>
<close @click="closeMain" />
</el-icon>
</div>
</template>
<div class="detail-content">
<div class="content-title">隐患记录</div>
<div class="row">
<el-row :gutter="20">
<el-col :span="8">
<span class="row-span"
>检查情况:
<span>{{
basicData?.state == 1
? "执法中"
: basicData?.state == 2
? "待整改"
: basicData?.state == 3
? "待审核"
: basicData?.state == 4
? "已闭合"
: basicData?.state == 5
? "已驳回"
: ""
}}</span>
</span>
</el-col>
<el-col :span="8">
<span class="row-span">工程名称:{{ basicData?.engineeringName }}</span></el-col
>
<el-col :span="8">
<span class="row-span">监督员:{{ basicData?.inspectUserName }}</span></el-col
>
</el-row>
</div>
<div class="row">
<el-row :gutter="20">
<el-col :span="8">
<span class="row-span">检查时间:{{ basicData?.createTime }}</span>
</el-col>
<el-col :span="8">
<span class="row-span">建设单位:{{ basicData?.buildEnt }}</span></el-col
>
<el-col :span="8">
<span class="row-span">监理单位:{{ basicData?.supervisorEnt }}</span></el-col
>
</el-row>
</div>
<div class="row">
<el-row :gutter="20">
<el-col :span="8">
<span class="row-span">施工单位:{{ basicData?.opEnt }}</span>
</el-col>
<el-col :span="8">
<span class="row-span">勘察单位:{{ basicData?.surveyEnt }}</span></el-col
>
<el-col :span="8">
<span class="row-span">设计单位:{{ basicData?.designEnt }}</span></el-col
>
</el-row>
</div>
<div class="row">
<el-row :gutter="20">
<el-col :span="8">
<span class="row-span">责任区域:{{ basicData?.address }}</span>
</el-col>
<el-col :span="8">
<span class="row-span">整改期限:{{ basicData?.deadline }}</span></el-col
>
</el-row>
</div>
</div>
<div class="detail-table">
<div class="content-title">整改/复查记录</div>
<div class="table">
<el-table
:data="recordData"
class="el-table"
:row-style="{ height: '40px' }"
:header-cell-style="{ backgroundColor: '#F5F7FA', textAlign: 'center', height: '40px' }"
:cell-style="{ textAlign: 'center', height: '40px' }"
@row-click="rowClick"
>
<el-table-column prop="createByName" label="创建人" />
<el-table-column prop="questionDesc" label="隐患问题" />
<el-table-column label="隐患照片">
<template #default="scope">
<el-image style="width: 38px; height: 28px" :src="scope.row.image[0].url" fit="fill"></el-image>
</template>
</el-table-column>
<el-table-column prop="state" label="整改状态">
<template #default="scope">
<span>{{
scope.row.state == 1
? "待整改"
: scope.row.state == 2
? "待审核"
: scope.row.state == 3
? "已闭合"
: scope.row.state == 4
? "已驳回"
: ""
}}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="operation-btn" v-if="basicData?.state != 1 || basicData?.state != 4">
<el-button type="info" style="margin-right: 98px; border: 0; background-color: #e6e6e6; color: #000000" @click="backAll"
>驳回,请尽快整改</el-button
>
<el-button type="primary" @click="allSubmit">整改完成,全部合格</el-button>
</div>
</div>
<div class="transform-record" v-if="transformDialog">
<div class="title-detail">
<img src="@/assets/images/tableIcon/look.png" alt="" />
<span>整改记录</span>
<el-icon>
<close @click="closeSecondary" />
</el-icon>
</div>
<div class="content-title">隐患问题</div>
<div class="row">
<span>创建人:</span>
<span>{{ recordRowData.createByName }}</span>
</div>
<div class="row">
<span>创建时间:</span>
<span>{{ recordRowData.createTime }}</span>
</div>
<div class="row">
<span>隐患问题:</span>
<span>{{ recordRowData.questionDesc }}</span>
</div>
<div class="row">
<span>备注:</span>
<span>{{ recordRowData.remark }}</span>
</div>
<div class="row">
<span>隐患照片:</span>
<div class="imgList">
<el-image
:src="item.url"
fit="fill"
v-for="(item, index) in recordRowData.image"
:key="index"
:preview-src-list="[item.url]"
>
</el-image>
</div>
</div>
<div class="situation">
<span>整改情况</span>
</div>
<div class="situation-step">
<el-timeline>
<el-timeline-item :timestamp="item.createTime" placement="top" v-for="(item, index) in timelineList" :key="index">
<div class="row">
<span>整改人:</span>
<span>{{ item.solveBy }}</span>
</div>
<div class="row">
<span>整改回复:</span>
<span>{{ item.solveDesc }}</span>
</div>
<div class="row">
<span>整改照片:</span>
<div class="imgList">
<el-image
:src="item2.url"
fit="fill"
v-for="(item2, index) in item.solveImage"
:key="index"
:preview-src-list="[item2.url]"
>
</el-image>
</div>
</div>
<div class="row" v-if="item.suggest">
<span>审核意见:</span>
<span>{{ item.suggest }}</span>
</div>
<div
class="status-name"
:style="{ color: item.examineState === 0 ? '#008BFF' : item.examineState === 1 ? '#30AC7C' : '#F64D31' }"
>
{{ item.examineState == 0 ? "待审核" : item.examineState == 1 ? "已通过" : "已驳回" }}
</div>
<div class="status-operate" v-if="item.examineState === 0">
<el-button type="primary" @click="singleAudit(item)">审核</el-button>
</div>
</el-timeline-item>
</el-timeline>
</div>
</div>
</el-dialog>
<el-dialog v-model="auditVisible" :append-to-body="true">
<template #title>
<div style="border-left: 2px solid #0f81ff; font-size: 20px; color: #333333">
<span style="margin-left: 5px">审核意见</span>
</div>
</template>
<el-input v-model="auditForm.content" type="textarea" :rows="2" placeholder="请输入内容" />
<template #footer>
<span class="dialog-footer">
<el-button @click="singleAuditSubmit(1)"> </el-button>
<el-button type="primary" @click="singleAuditSubmit(2)"> </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, watch, reactive } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import type { FormInstance, UploadProps } from "element-plus";
import { relativeInfo, timeLineData, singleOptionAudit, allOptionAudit } from "@/api/modules/goverment";
const baseUrl = import.meta.env.VITE_API_URL;
const props = defineProps({
detailsDialog: Boolean,
relativeId: String
});
const emits = defineEmits(["update:detailsDialog", "confirm"]);
const visible1 = ref(false);
const transformDialog = ref(false); // 整改记录对话框
const recordData = ref([]); // 整改记录表格数据
const recordRowData = ref(); // 整改记录表格行数据
const basicData = ref(); // 基础信息
const dialogStyle = ref({
"min-width": "824px"
});
const reformInfo = ref({
solveBy: "",
solveDesc: "",
solveImage: []
});
const singleData = ref(); // 单个整改情况数据
const auditForm = ref({
content: ""
});
// 单项审核提交
const singleAuditSubmit = async index => {
if (index == 1) {
let requestData = {
id: singleData.value.id,
suggest: auditForm.value.content,
examineState: 2
};
const res = await singleOptionAudit(requestData);
ElMessage.success("操作成功");
} else {
let requestData = {
id: singleData.value.id,
suggest: auditForm.value.content,
examineState: 1
};
const res = await singleOptionAudit(requestData);
ElMessage.success("操作成功");
}
transformDialog.value = false;
};
// 单个整改情况审核
const singleAudit = item => {
console.log(item);
singleData.value = item;
auditVisible.value = true;
};
// 全部审核完成,驳回
const backAll = async () => {
const res = await allOptionAudit({ id: basicData.value.id, state: 5, type: 1 });
closeMain();
emits("confirm");
ElMessage.success("操作成功");
};
// 全部审核完成,提交
const allSubmit = async () => {
const res = await allOptionAudit({ id: basicData.value.id, state: 4, type: 1 });
closeMain();
emits("confirm");
ElMessage.success("操作成功");
};
// 关闭两个对话框
const closeMain = () => {
visible1.value = false;
transformDialog.value = false;
dialogStyle.value = {
"min-width": "824px",
transform: "translateX(0px)"
};
};
// 关闭整改记录辅弹框
const closeSecondary = () => {
transformDialog.value = false;
dialogStyle.value = {
"min-width": "824px",
transform: "translateX(0px)"
};
};
// 点击表格任意一行时
const rowClick = row => {
recordRowData.value = row;
transformDialog.value = true;
dialogStyle.value = {
"min-width": "824px",
transform: "translateX(-170px)"
};
getTimeLineList();
};
// 相关信息接口调用
const getInfo = async () => {
const res = await relativeInfo({ id: props.relativeId });
basicData.value = res.result;
recordData.value = res.result.inspectQuestionList;
recordData.value.map(item => {
item.image = eval(item.image);
});
console.log(recordData);
};
const timelineList = ref([{ name: 1 }]);
// 获取整改情况时间轴列表
const getTimeLineList = async () => {
const res = await timeLineData({ inspectQuestionId: recordRowData.value.id });
res.result.map(item => {
item.solveImage = eval(item.solveImage);
});
timelineList.value = res.result;
};
const auditVisible = ref(false);
// 监听父组件的visible用来简介控制el-dialog的弹框开关一般是用于开
watch(
() => props.detailsDialog,
(n, o) => {
visible1.value = n;
if (n) {
getInfo();
}
}
);
// 监听el-dialog显示状态再通过@update:visible 通知父组件,一般是用于关
watch(visible1, (n, o) => {
emits("update:detailsDialog", n);
});
onMounted(() => {});
</script>
<style lang="scss" scoped>
@mixin fullwidth {
width: -webkit-fill-available;
width: -moz-available;
width: stretch;
}
@mixin flex {
display: flex;
align-items: center;
}
@mixin title {
font-size: 14px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
border-left: 2px solid #008bff;
padding-left: 5px;
}
.overview {
// background-color: #fff;
flex: 1;
:deep(.el-dialog) {
position: relative;
}
.title-detail {
@include flex;
> img {
width: 16px;
height: 18px;
}
> span {
font-size: 18px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
margin-left: 5px;
margin-right: auto;
}
:deep(.el-icon) {
cursor: pointer;
color: #a8abb2;
}
}
.detail-content {
.content-title {
@include title;
}
.row {
margin-top: 14px;
.row-span {
font-size: 12px;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #333333;
}
> span {
font-weight: 400;
color: #008bff;
}
}
}
.detail-table {
height: 391px;
margin-top: 20px;
.content-title {
@include title;
}
.table {
height: 310px;
margin-top: 20px;
:deep(.el-table) {
height: 100%;
}
}
.operation-btn {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
}
}
.transform-record {
position: absolute;
top: 0;
right: -460px;
width: 380px;
height: 650px;
min-width: 420px;
background: #ffffff;
box-shadow: 0px 4px 8px 0px rgba(48, 62, 100, 0.2);
border-radius: 8px 8px 8px 8px;
padding: 15px 20px;
.content-title {
@include title;
margin-top: 45px;
margin-bottom: 24px;
}
.row {
display: flex;
margin-bottom: 12px;
span:nth-child(1) {
width: 56px;
text-align: right;
font-size: 12px;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #333333;
white-space: nowrap;
margin-right: 10px;
}
span:nth-child(2) {
font-size: 12px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
}
.imgList {
display: flex;
flex-wrap: wrap;
:deep(.el-image) {
width: 95px;
height: 53px;
margin-right: 15px;
}
}
.face-img {
width: 100%;
align-self: flex-start;
@include flex;
flex-wrap: wrap;
:deep(.face-uploader .el-upload) {
border: 1px dashed #d9d9d9 !important;
border-radius: 6px !important;
cursor: pointer !important;
position: relative !important;
overflow: hidden !important;
}
.face-uploader .el-upload:hover {
border-color: #409eff !important;
}
:deep(.el-icon) {
font-size: 28px;
color: #8c939d;
width: 53px;
height: 53px;
line-height: 53px;
text-align: center;
}
.face-avatar {
width: 53px;
height: 53px;
display: block;
}
}
}
.situation {
@include flex;
border-left: 2px solid #008bff;
margin-top: 20px;
span {
margin-right: auto;
margin-left: 5px;
}
}
.situation-step {
margin-top: 20px;
overflow-y: scroll;
height: 300px;
.row {
span:nth-child(1) {
text-align: left;
}
}
:deep(.el-timeline-item) {
position: relative;
padding-bottom: 14px !important;
}
:deep(.el-timeline) {
padding: 0;
}
.status-name {
position: absolute;
right: 0;
top: 0;
font-size: 12px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
}
.status-operate {
position: absolute;
right: 0;
bottom: -10px;
}
}
}
.audit-title {
border-left: 2px solid #0f81ff !important;
}
}
.test :deep(.el-input__wrapper) {
box-shadow: 0 0 0 0;
}
.test :deep(.el-input__inner) {
text-align: center;
}
:deep(.el-table__empty-text) {
min-height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
</style>