安全隐患整改列表处理

dev_xd
haha 2025-03-02 23:21:59 +08:00
parent deca8b10fc
commit 2536e68a0d
5 changed files with 195 additions and 177 deletions

View File

@ -214,54 +214,94 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<sql id="countUserWhere"> <sql id="countUserWhere">
<if test="problemType != null and problemType != ''"> and problemType = #{problemType}</if> <if test="problemType != null and problemType != ''"> and a,problemType = #{problemType}</if>
<if test="dangerType != null and dangerType != ''"> and danger_type = #{dangerType}</if> <if test="dangerType != null and dangerType != ''"> and a.danger_type = #{dangerType}</if>
<if test="createTime != null "> and date(createTime) &gt;= date(#{createTime})</if> <if test="createTime != null "> and date(a.createTime) &gt;= date(#{createTime})</if>
<if test="updateTime != null "> and date(updateTime) &lt;= date(#{updateTime})</if> <if test="updateTime != null "> and date(a.updateTime) &lt;= date(#{updateTime})</if>
<if test="createUser != null"> and createUser = #{createUser}</if> <if test="createUser != null"> and a.createUser = #{createUser}</if>
<if test="lordSent != null and lordSent != ''"> and lordSent = #{lordSent}</if> <if test="lordSent != null and lordSent != ''"> and a.lordSent = #{lordSent}</if>
<if test="currentUserId != null and currentUserId!=''"> <if test="currentUserId != null and currentUserId!=''">
AND AND
( (
createUser=#{currentUserId} or lordSent=#{currentUserId} or find_in_set(#{currentUserId},copySend) or recheckSend=#{currentUserId} a.createUser=#{currentUserId} or a.lordSent=#{currentUserId} or find_in_set(#{currentUserId},a.copySend) or a.recheckSend=#{currentUserId}
) )
</if> </if>
</sql> </sql>
<select id="getListCount" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult"> <select id="getListCount" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult">
select 'a' projectName, count(1) id ,'全部' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 select 'a' projectName, count(1) id ,'全部' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0
<include refid="countUserWhere"></include> <include refid="countUserWhere"></include>
union union
select 'b' projectName, count(1) id,'待整改' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState in (0,3) select 'b' projectName, count(1) id,'待整改' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0 and a.checkState in (0,3)
<include refid="countUserWhere"></include> <include refid="countUserWhere"></include>
union union
select 'c' projectName, count(1) id,'待复检' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState in (1) select 'c' projectName, count(1) id,'待复检' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0 and a.checkState in (1)
<include refid="countUserWhere"></include> <include refid="countUserWhere"></include>
union union
select 'd' projectName, count(1) id,'整改完成' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState in (4) select 'd' projectName, count(1) id,'整改完成' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0 and a.checkState in (4)
<include refid="countUserWhere"></include> <include refid="countUserWhere"></include>
union union
select 'e' projectName, count(1) id,'整改超时' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState not in (4) and date(nickedTime) &lt;= curdate() select 'e' projectName, count(1) id,'整改超时' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0 and a.checkState not in (4) and date(a.nickedTime) &lt;= curdate()
<include refid="countUserWhere"></include> <include refid="countUserWhere"></include>
</select> </select>
<select id="selectList" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult"> <select id="selectList" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult">
<include refid="selectSmzSspProblemmodifyVo"/> SELECT
where isDel=0 and projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} a.id,
a.comId,
a.projectId,
a.infoType,
a.marks_picture,
a.marks_video,
a.correction_picture,
a.problemArea,
a.workParts,
a.changeInfo,
CONCAT(a.lordSentUser ,'【',b.sub_dept_name,'】',b.user_phone) as lordSent,
a.lordSentUser,
a.copySend,
a.copySendUser,
a.checkState,
a.nickedArea,
a.nickedTime,
a.projectType,
a.processName,
a.projectName,
a.nickedInfo,
a.checkUser,
a.checkUserPhone,
a.smark_url,
a.isDel,
c.nick_name as createUser,
a.createTime,
a.updateUser,
a.updateTime,
a.danger_type,
CONCAT(a.recheckSendUser ,'【',d.sub_dept_name,'】',d.user_phone) as recheckSend,
a.recheckSendUser,
a.roleType,
a.problemType
FROM
smz_ssp_problemmodify a
LEFT JOIN pro_project_info_subdepts_users b ON a.lordSent = b.user_id AND a.projectId = b.project_id AND a.comId = b.com_id
LEFT JOIN pro_project_info_subdepts_users d ON a.recheckSend = d.user_id AND a.projectId = d.project_id AND a.comId = d.com_id
LEFT JOIN sys_user c ON a.createUser = c.user_id
where a.isDel=0 and a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType}
<if test="projectName==1"> <if test="projectName==1">
</if> </if>
<if test="projectName==2"> <if test="projectName==2">
and checkState in (0,3) and a.checkState in (0,3)
</if> </if>
<if test="projectName==3"> <if test="projectName==3">
and checkState in (1) and a.checkState in (1)
</if> </if>
<if test="projectName==4"> <if test="projectName==4">
and checkState in (4) and a.checkState in (4)
</if> </if>
<if test="projectName==5"> <if test="projectName==5">
and checkState not in (4) and date(nickedTime) &lt;= curdate() and a.checkState not in (4) and date(nickedTime) &lt;= curdate()
</if> </if>
<include refid="countUserWhere"></include> <include refid="countUserWhere"></include>
</select> </select>

View File

@ -2,22 +2,11 @@
<div> <div>
<template v-for="(item, index) in options"> <template v-for="(item, index) in options">
<template v-if="values.includes(item.value)"> <template v-if="values.includes(item.value)">
<span <span v-if="item.elTagType == 'default' || item.elTagType == ''" :key="item.value" :index="index"
v-if="item.elTagType == 'default' || item.elTagType == ''" :class="item.elTagClass">{{ item.label + " " }}</span>
:key="item.value" <el-tag v-else :disable-transitions="true" :key="item.value + ''" :index="index"
:index="index" :type="item.elTagType === 'primary' ? 'info' : item.elTagType" :class="item.elTagClass">{{ item.label + " "
:class="item.elTagClass" }}</el-tag>
>{{ item.label + " " }}</span
>
<el-tag
v-else
:disable-transitions="true"
:key="item.value + ''"
:index="index"
:type="item.elTagType === 'primary' ? 'info' : item.elTagType"
:class="item.elTagClass"
>{{ item.label + " " }}</el-tag
>
</template> </template>
</template> </template>
@ -45,10 +34,6 @@ const props = defineProps({
const values = computed(() => { const values = computed(() => {
if (props.value !== null && typeof props.value !== "undefined") { if (props.value !== null && typeof props.value !== "undefined") {
console.log("sssssssssssss1==>",Array.isArray(props.value))
console.log("sssssssssssss2==>",props.value)
console.log("sssssssssssss3==>",String(props.value))
console.log("sssssssssssss4==>",[String(props.value)])
return Array.isArray(props.value) ? props.value : [String(props.value)]; return Array.isArray(props.value) ? props.value : [String(props.value)];
} else { } else {
return []; return [];
@ -84,7 +69,7 @@ function handleArray(array) {
</script> </script>
<style scoped> <style scoped>
.el-tag + .el-tag { .el-tag+.el-tag {
margin-left: 10px; margin-left: 10px;
} }
</style> </style>

View File

@ -0,0 +1,58 @@
<template>
<el-drawer v-model="data.visible" :close-on-click-modal="false" :close-on-press-escape="false" size="960px"
:append-to-body="true" title="安全隐患详情" class="problemmodify-detail-drawer">
<el-row>
<el-col :span="12" class="detail-left">
<el-steps style="max-width: 600px" :active="1" finish-status="success" simple>
<el-step title="待整改" />
<el-step title="待复检" />
<el-step title="复检驳回" />
<el-step title="复检通过" />
</el-steps>
</el-col>
<el-col :span="12">
</el-col>
</el-row>
</el-drawer>
</template>
<script setup name="Problemmodify">
let data = reactive({
visible: false,
row: null
});
function showDrawer(row) {
data.row = row;
data.visible = true;
}
defineExpose({
showDrawer
});
</script>
<style lang="scss">
.problemmodify-detail-drawer {
.el-drawer__header {
margin-bottom: 20px;
}
.el-drawer__body {
padding: 0px 20px;
.detail-left {
.el-steps--simple {
padding: 13px;
.el-step__title {
font-size: 12px;
max-width: unset;
}
}
}
}
}
</style>

View File

@ -3,7 +3,7 @@
<el-form class="header-form" :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> <el-form class="header-form" :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
<el-form-item label="检查类型" prop="problemType"> <el-form-item label="检查类型" prop="problemType">
<el-select v-model="queryParams.problemType" placeholder="请选择检查类型" clearable4 style="width: 160px;"> <el-select v-model="queryParams.problemType" placeholder="请选择检查类型" clearable style="width: 160px;">
<el-option v-for="dict in ssp_proble_type" :key="dict.value" :label="dict.label" :value="dict.value"> <el-option v-for="dict in ssp_proble_type" :key="dict.value" :label="dict.label" :value="dict.value">
</el-option> </el-option>
</el-select> </el-select>
@ -29,80 +29,73 @@
<el-button icon="Refresh" @click="resetQuery"></el-button> <el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-tabs v-model="data.activeName" class="main-tabs"> <el-tabs v-model="data.activeName" class="main-tabs" @tab-click="tabClick">
<el-tab-pane :label="data.tabInfo['a']" name="a"></el-tab-pane> <el-tab-pane :label="data.tabInfo['a']" name="a"></el-tab-pane>
<el-tab-pane :label="data.tabInfo['b']" name="b"></el-tab-pane> <el-tab-pane :label="data.tabInfo['b']" name="b"></el-tab-pane>
<el-tab-pane :label="data.tabInfo['c']" name="c"></el-tab-pane> <el-tab-pane :label="data.tabInfo['c']" name="c"></el-tab-pane>
<el-tab-pane :label="data.tabInfo['d']" name="d"></el-tab-pane> <el-tab-pane :label="data.tabInfo['d']" name="d"></el-tab-pane>
<el-tab-pane :label="data.tabInfo['e']" name="e"></el-tab-pane> <el-tab-pane :label="data.tabInfo['e']" name="e"></el-tab-pane>
</el-tabs> </el-tabs>
<el-table v-loading="loading" :data="problemmodifyList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="problemmodifyList">
<el-table-column type="selection" width="55" align="center" /> <el-table-column prop="id" width="55" label="序号" align="center">
<el-table-column label="${comment}" align="center" prop="id" /> <template #default="scope">{{ scope.$index + 1 + (queryParams.pageNum - 1) * queryParams.pageSize }}</template>
<el-table-column label="租户ID" align="center" prop="comId" /> </el-table-column>
<el-table-column label="项目id" align="center" prop="projectId" /> <el-table-column label="问题图片" align="center" prop="smarkUrl">
<el-table-column label="信息类型" align="center" prop="infoType" />
<el-table-column label="留痕图片" align="center" prop="marksPicture" />
<el-table-column label="留痕视频" align="center" prop="marksVideo" />
<el-table-column label="整改图片" align="center" prop="correctionPicture" />
<el-table-column label="拍摄位置" align="center" prop="problemArea" />
<el-table-column label="施工部位" align="center" prop="workParts" />
<el-table-column label="整改要求" align="center" prop="changeInfo" />
<el-table-column label="主送人姓名" align="center" prop="lordSent" />
<el-table-column label="主送人手机号" align="center" prop="lordSentUser" />
<el-table-column label="抄送人姓名" align="center" prop="copySend" />
<el-table-column label="抄送人手机号" align="center" prop="copySendUser" />
<el-table-column label="流程状态" align="center" prop="checkState" />
<el-table-column label="整改定位" align="center" prop="nickedArea" />
<el-table-column label="整改截至时间" align="center" prop="nickedTime" width="180">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.nickedTime, '{y}-{m}-{d}') }}</span> <el-image :src="scope.row.smarkUrlPic" style="height:80px;" :preview-teleported="true"
:preview-src-list="scope.row.smarkUrlPics"></el-image>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工程类型" align="center" prop="projectType" /> <el-table-column label="检查类型" align="center" prop="problemType">
<el-table-column label="工序名称" align="center" prop="processName" /> <template #default="scope">
<el-table-column label="工程名称" align="center" prop="projectName" /> <dict-tag :options="ssp_proble_type" :value="scope.row.problemType" />
<el-table-column label="留痕说明" align="center" prop="nickedInfo" /> </template>
<el-table-column label="审核人" align="center" prop="checkUser" /> </el-table-column>
<el-table-column label="审核人手机号" align="center" prop="checkUserPhone" /> <el-table-column label="隐患类型" align="center" prop="dangerType">
<el-table-column label="智能公司展示的图片url" align="center" prop="smarkUrl" /> <template #default="scope">
<el-table-column label="删除状态" align="center" prop="isDel" /> <dict-tag :options="ssp_proble_sub_type" :value="scope.row.dangerType" />
<el-table-column label="创建人" align="center" prop="createUser" /> </template>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> </el-table-column>
<el-table-column label="施工部位" align="center" prop="workParts" />
<el-table-column label="整改要求" align="center" prop="changeInfo" />
<el-table-column label="整改截至时间" align="center" prop="nickedTime" width="120" />
<el-table-column label="整改人" align="center" prop="lordSent" width="200" />
<el-table-column label="复检人" align="center" prop="recheckSend" width="200" />
<el-table-column label="抄送人" align="center" prop="copySendUser" width="200" />
<el-table-column label="流程状态" align="center" prop="checkState">
<template #default="scope">
<dict-tag :options="data.checkStates" :value="scope.row.checkState" />
</template>
</el-table-column>
<el-table-column label="提交人" align="center" prop="createUser" />
<el-table-column label="提交时间" align="center" prop="createTime" width="180">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="修改人" align="center" prop="updateUser" /> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
<el-table-column label="修改时间" align="center" prop="updateTime" width="180">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template> <el-button v-if="getIsModify(scope.row)" link type="primary" size="small" :icon="Check"
</el-table-column> @click="handleModify(scope.row)" v-hasPermi="['trouble:problemmodify:edit']">处理</el-button>
<el-table-column label="隐患类型" align="center" prop="dangerType" /> <el-button size="small" :icon="Document" link type="primary" @click="handleDetail(scope.row)"
<el-table-column label="复检人" align="center" prop="recheckSend" /> v-hasPermi="['trouble:problemmodify:query']">详情</el-button>
<el-table-column label="复检人手机号" align="center" prop="recheckSendUser" /> <el-button v-if="getIsVdel(scope.row)" size="small" link type="primary" :icon="Delete"
<el-table-column label="角色类型" align="center" prop="roleType" /> @click="handleDelete(scope.row)" v-hasPermi="['trouble:problemmodify:remove']">删除</el-button>
<el-table-column label="问题类型" align="center" prop="problemType" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['trouble:problemmodify:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['trouble:problemmodify:remove']">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getList" /> v-model:limit="queryParams.pageSize" @pagination="getList" />
<detailDrawer ref="detailDrawerRef"></detailDrawer>
</div> </div>
</template> </template>
<script setup name="Problemmodify"> <script setup name="Problemmodify">
import detailDrawer from "./detailDrawer.vue";
import { Check, Document, Delete } from '@element-plus/icons-vue'
import { listProblemmodify, getProblemmodify, delProblemmodify, addProblemmodify, updateProblemmodify, getListCount } from "@/api/trouble/problemmodify"; import { listProblemmodify, getProblemmodify, delProblemmodify, addProblemmodify, updateProblemmodify, getListCount } from "@/api/trouble/problemmodify";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { ssp_proble_type, ssp_proble_sub_type } = proxy.useDict('ssp_proble_type', 'ssp_proble_sub_type'); const { ssp_proble_type, ssp_proble_sub_type } = proxy.useDict('ssp_proble_type', 'ssp_proble_sub_type');
const problemmodifyList = ref([]); const problemmodifyList = ref([]);
@ -114,7 +107,7 @@ const single = ref(true);
const multiple = ref(true); const multiple = ref(true);
const total = ref(0); const total = ref(0);
const title = ref(""); const title = ref("");
const detailDrawerRef = ref();
const data = reactive({ const data = reactive({
form: {}, form: {},
queryParams: { queryParams: {
@ -135,7 +128,10 @@ const data = reactive({
], ],
}, },
activeName: 'a', activeName: 'a',
tabInfo: {} tabInfo: {},
checkStates: [{ value: "0", label: '待整改' }, { value: "1", label: '待复检' },
{ value: "2", label: '复检驳回' },
{ value: "3", label: '复检通过' }]
}); });
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
@ -156,60 +152,39 @@ function getList() {
postData.updateTime = queryParams.value.dataRange[1]; postData.updateTime = queryParams.value.dataRange[1];
} }
listProblemmodify(postData).then(response => { listProblemmodify(postData).then(response => {
problemmodifyList.value = response.rows; problemmodifyList.value = (response.rows || []).map(it => {
it.smarkUrlPic = it.smarkUrl.split(",")[0];
it.smarkUrlPics = it.smarkUrl.split(",")
return it;
});
total.value = response.total; total.value = response.total;
loading.value = false; loading.value = false;
}); });
} }
//
function reset() {
form.value = {
id: null,
comId: null,
projectId: null,
infoType: null,
marksPicture: null,
marksVideo: null,
correctionPicture: null,
problemArea: null,
workParts: null,
changeInfo: null,
lordSent: null,
lordSentUser: null,
copySend: null,
copySendUser: null,
checkState: null,
nickedArea: null,
nickedTime: null,
projectType: null,
processName: null,
projectName: null,
nickedInfo: null,
checkUser: null,
checkUserPhone: null,
smarkUrl: null,
isDel: null,
createUser: null,
createTime: null,
updateUser: null,
updateTime: null,
dangerType: null,
recheckSend: null,
recheckSendUser: null,
roleType: null,
problemType: null
};
proxy.resetForm("problemmodifyRef");
}
/** 搜索按钮操作 */ /** 搜索按钮操作 */
function handleQuery() { function handleQuery() {
queryParams.value.pageNum = 1; queryParams.value.pageNum = 1;
getCount();
getList(); getList();
} }
function tabClick() {
setTimeout(handleQuery, 800);
}
function handleModify(row) {
}
function handleDetail(row) {
detailDrawerRef.value.showDrawer(row);
}
function getIsVdel(row) {
return true;
}
function getIsModify(row) {
return true;
}
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {
proxy.resetForm("queryRef"); proxy.resetForm("queryRef");
@ -223,46 +198,6 @@ function handleSelectionChange(selection) {
single.value = selection.length != 1; single.value = selection.length != 1;
multiple.value = !selection.length; multiple.value = !selection.length;
} }
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加安全隐患整改";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getProblemmodify(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改安全隐患整改";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["problemmodifyRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateProblemmodify(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addProblemmodify(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDelete(row) { function handleDelete(row) {
const _ids = row.id || ids.value; const _ids = row.id || ids.value;
@ -305,10 +240,10 @@ function getCount() {
data.tabInfo[it.projectName] = obj[it.projectName] + `(${it.id || 0})` data.tabInfo[it.projectName] = obj[it.projectName] + `(${it.id || 0})`
}); });
}); });
handleQuery();
} }
getCount(); getCount();
handleQuery();
</script> </script>
<style lang="scss"> <style lang="scss">
.trouble-problemodify-index { .trouble-problemodify-index {