2025-02-15 16:57:13 +08:00
|
|
|
<template>
|
2025-03-01 00:06:15 +08:00
|
|
|
<div class="app-container trouble-problemodify-index">
|
|
|
|
<el-form class="header-form" :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
|
|
|
<el-form-item label="检查类型" prop="problemType">
|
2025-06-28 16:51:10 +08:00
|
|
|
<el-select v-model="queryParams.problemType" placeholder="请选择检查类型" clearable>
|
2025-03-01 00:06:15 +08:00
|
|
|
<el-option v-for="dict in ssp_proble_type" :key="dict.value" :label="dict.label" :value="dict.value">
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
2025-02-15 16:57:13 +08:00
|
|
|
</el-form-item>
|
2025-03-01 00:06:15 +08:00
|
|
|
<el-form-item label="隐患类型" prop="dangerType">
|
|
|
|
<el-select v-model="queryParams.dangerType" placeholder="请选择隐患类型" clearable>
|
2025-06-28 16:51:10 +08:00
|
|
|
<el-option v-for="dict in ssp_proble_sub_type.filter(d => d.remark == '0')" :key="dict.value" :label="dict.label" :value="dict.value">
|
2025-03-01 00:06:15 +08:00
|
|
|
</el-option>
|
|
|
|
</el-select>
|
2025-02-15 16:57:13 +08:00
|
|
|
</el-form-item>
|
2025-03-01 00:06:15 +08:00
|
|
|
<el-form-item label="整改人" prop="lordSent">
|
2025-06-28 16:51:10 +08:00
|
|
|
<el-input v-model="queryParams.lordSent" placeholder="请输入人员姓名/联系方式" clearable/>
|
2025-02-15 16:57:13 +08:00
|
|
|
</el-form-item>
|
2025-03-01 00:06:15 +08:00
|
|
|
<el-form-item label="提交人" prop="createUser">
|
2025-06-28 16:51:10 +08:00
|
|
|
<el-input v-model="queryParams.createUser" placeholder="请输入人员姓名/联系方式" clearable/>
|
2025-02-15 16:57:13 +08:00
|
|
|
</el-form-item>
|
2025-03-01 00:06:15 +08:00
|
|
|
<el-form-item label="提交时间" prop="dateRange">
|
2025-06-28 16:51:10 +08:00
|
|
|
<el-date-picker v-model="queryParams.dataRange" type="daterange" style="width: 308px;" range-separator="--"
|
2025-03-01 16:11:56 +08:00
|
|
|
start-placeholder="开始日期" end-placeholder="结束日期" />
|
2025-02-15 16:57:13 +08:00
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
2025-03-02 23:21:59 +08:00
|
|
|
<el-tabs v-model="data.activeName" class="main-tabs" @tab-click="tabClick">
|
2025-03-01 16:11:56 +08:00
|
|
|
<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['c']" name="c"></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-tabs>
|
2025-03-02 23:21:59 +08:00
|
|
|
<el-table v-loading="loading" :data="problemmodifyList">
|
2025-06-28 16:51:10 +08:00
|
|
|
<el-table-column label="序号" align="center" type="index" width="60" />
|
|
|
|
<el-table-column label="项目名称" align="center" prop="projectName" />
|
2025-03-02 23:21:59 +08:00
|
|
|
<el-table-column label="问题图片" align="center" prop="smarkUrl">
|
2025-02-15 16:57:13 +08:00
|
|
|
<template #default="scope">
|
2025-03-02 23:21:59 +08:00
|
|
|
<el-image :src="scope.row.smarkUrlPic" style="height:80px;" :preview-teleported="true"
|
|
|
|
:preview-src-list="scope.row.smarkUrlPics"></el-image>
|
2025-02-15 16:57:13 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2025-03-02 23:21:59 +08:00
|
|
|
<el-table-column label="检查类型" align="center" prop="problemType">
|
2025-02-15 16:57:13 +08:00
|
|
|
<template #default="scope">
|
2025-03-02 23:21:59 +08:00
|
|
|
<dict-tag :options="ssp_proble_type" :value="scope.row.problemType" />
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="隐患类型" align="center" prop="dangerType">
|
|
|
|
<template #default="scope">
|
|
|
|
<dict-tag :options="ssp_proble_sub_type" :value="scope.row.dangerType" />
|
2025-02-15 16:57:13 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2025-03-02 23:21:59 +08:00
|
|
|
<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" />
|
2025-06-28 16:51:10 +08:00
|
|
|
<el-table-column label="整改人" align="center" prop="lordSentUser" width="180"/>
|
|
|
|
<el-table-column label="复检人" align="center" prop="recheckSendUser" width="180"/>
|
|
|
|
<el-table-column label="抄送人" align="center" prop="copySendUser" width="100"/>
|
2025-03-02 23:21:59 +08:00
|
|
|
<el-table-column label="流程状态" align="center" prop="checkState">
|
2025-02-15 16:57:13 +08:00
|
|
|
<template #default="scope">
|
2025-03-02 23:21:59 +08:00
|
|
|
<dict-tag :options="data.checkStates" :value="scope.row.checkState" />
|
2025-02-15 16:57:13 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2025-06-28 16:51:10 +08:00
|
|
|
<el-table-column label="提交时间" align="center" prop="createTime" width="120">
|
2025-02-15 16:57:13 +08:00
|
|
|
<template #default="scope">
|
2025-03-02 23:21:59 +08:00
|
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
|
|
<el-button v-if="getIsModify(scope.row)" link type="primary" size="small" :icon="Check"
|
|
|
|
@click="handleModify(scope.row)" v-hasPermi="['trouble:problemmodify:edit']">处理</el-button>
|
|
|
|
<el-button size="small" :icon="Document" link type="primary" @click="handleDetail(scope.row)"
|
|
|
|
v-hasPermi="['trouble:problemmodify:query']">详情</el-button>
|
|
|
|
<el-button v-if="getIsVdel(scope.row)" size="small" link type="primary" :icon="Delete"
|
|
|
|
@click="handleDelete(scope.row)" v-hasPermi="['trouble:problemmodify:remove']">删除</el-button>
|
2025-02-15 16:57:13 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
2025-02-28 00:27:10 +08:00
|
|
|
|
2025-03-01 00:06:15 +08:00
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
|
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
2025-03-05 00:14:39 +08:00
|
|
|
<detailDrawer ref="detailDrawerRef" @success="handleQuery"></detailDrawer>
|
2025-02-15 16:57:13 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="Problemmodify">
|
2025-03-02 23:21:59 +08:00
|
|
|
import detailDrawer from "./detailDrawer.vue";
|
2025-03-05 00:14:39 +08:00
|
|
|
import useUserStore from '@/store/modules/user'
|
2025-03-02 23:21:59 +08:00
|
|
|
import { Check, Document, Delete } from '@element-plus/icons-vue'
|
2025-03-01 00:06:15 +08:00
|
|
|
import { listProblemmodify, getProblemmodify, delProblemmodify, addProblemmodify, updateProblemmodify, getListCount } from "@/api/trouble/problemmodify";
|
2025-02-15 16:57:13 +08:00
|
|
|
const { proxy } = getCurrentInstance();
|
2025-03-01 00:06:15 +08:00
|
|
|
const { ssp_proble_type, ssp_proble_sub_type } = proxy.useDict('ssp_proble_type', 'ssp_proble_sub_type');
|
2025-02-15 16:57:13 +08:00
|
|
|
const problemmodifyList = ref([]);
|
2025-03-05 00:14:39 +08:00
|
|
|
const userStore = useUserStore()
|
2025-02-15 16:57:13 +08:00
|
|
|
const loading = ref(true);
|
|
|
|
const showSearch = ref(true);
|
|
|
|
const ids = ref([]);
|
|
|
|
const single = ref(true);
|
|
|
|
const multiple = ref(true);
|
|
|
|
const total = ref(0);
|
2025-03-02 23:21:59 +08:00
|
|
|
const detailDrawerRef = ref();
|
2025-02-15 16:57:13 +08:00
|
|
|
const data = reactive({
|
|
|
|
form: {},
|
|
|
|
queryParams: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
2025-03-01 00:06:15 +08:00
|
|
|
problemType: null,
|
|
|
|
dangerType: null,
|
2025-02-15 16:57:13 +08:00
|
|
|
lordSent: null,
|
|
|
|
createUser: null,
|
2025-06-28 16:51:10 +08:00
|
|
|
checkState: null,
|
|
|
|
dateRange: [],
|
2025-02-15 16:57:13 +08:00
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
comId: [
|
|
|
|
{ required: true, message: "租户ID不能为空", trigger: "blur" }
|
|
|
|
],
|
2025-03-01 16:11:56 +08:00
|
|
|
},
|
|
|
|
activeName: 'a',
|
2025-03-02 23:21:59 +08:00
|
|
|
tabInfo: {},
|
|
|
|
checkStates: [{ value: "0", label: '待整改' }, { value: "1", label: '待复检' },
|
2025-03-15 00:12:16 +08:00
|
|
|
{ value: "3", label: '复检驳回' },
|
|
|
|
{ value: "4", label: '复检通过' }]
|
2025-02-15 16:57:13 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
|
|
|
/** 查询安全隐患整改列表 */
|
|
|
|
function getList() {
|
2025-06-28 16:51:10 +08:00
|
|
|
if (!userStore.currentPrjId) {
|
|
|
|
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
|
|
|
return false;
|
|
|
|
}
|
2025-02-15 16:57:13 +08:00
|
|
|
loading.value = true;
|
2025-03-01 16:11:56 +08:00
|
|
|
let postData = {
|
|
|
|
infoType: 0,
|
|
|
|
problemType: queryParams.value.problemType,
|
|
|
|
dangerType: queryParams.value.dangerType,
|
|
|
|
lordSent: queryParams.value.lordSent,
|
|
|
|
createUser: queryParams.value.createUser,
|
2025-07-08 19:30:31 +08:00
|
|
|
checkState: " abcde".indexOf(data.activeName),
|
|
|
|
pageNum:queryParams.value.pageNum,
|
|
|
|
pageSize:queryParams.value.pageSize
|
2025-03-01 16:11:56 +08:00
|
|
|
};
|
|
|
|
if (queryParams.value.dataRange && queryParams.value.dataRange.length > 0) {
|
|
|
|
postData.createTime = queryParams.value.dataRange[0];
|
|
|
|
postData.updateTime = queryParams.value.dataRange[1];
|
|
|
|
}
|
|
|
|
listProblemmodify(postData).then(response => {
|
2025-03-02 23:21:59 +08:00
|
|
|
problemmodifyList.value = (response.rows || []).map(it => {
|
|
|
|
it.smarkUrlPic = it.smarkUrl.split(",")[0];
|
|
|
|
it.smarkUrlPics = it.smarkUrl.split(",")
|
|
|
|
return it;
|
|
|
|
});
|
2025-02-15 16:57:13 +08:00
|
|
|
total.value = response.total;
|
|
|
|
loading.value = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
function handleQuery() {
|
|
|
|
queryParams.value.pageNum = 1;
|
2025-03-02 23:21:59 +08:00
|
|
|
getCount();
|
2025-02-15 16:57:13 +08:00
|
|
|
getList();
|
|
|
|
}
|
|
|
|
|
2025-03-02 23:21:59 +08:00
|
|
|
function tabClick() {
|
|
|
|
setTimeout(handleQuery, 800);
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleModify(row) {
|
2025-03-05 00:14:39 +08:00
|
|
|
detailDrawerRef.value.showDrawer(row, 'edit');
|
2025-03-02 23:21:59 +08:00
|
|
|
}
|
|
|
|
function handleDetail(row) {
|
2025-03-05 00:14:39 +08:00
|
|
|
detailDrawerRef.value.showDrawer(row, 'show');
|
2025-03-02 23:21:59 +08:00
|
|
|
}
|
|
|
|
function getIsVdel(row) {
|
2025-03-05 23:20:06 +08:00
|
|
|
let isAdmin = userStore.isAdmin;
|
|
|
|
if (isAdmin) {
|
|
|
|
return true;
|
|
|
|
} else if (row.updateUser == userStore.uid && row.checkState != 3) {
|
|
|
|
return true;
|
|
|
|
}
|
2025-03-05 00:14:39 +08:00
|
|
|
return false;
|
2025-03-02 23:21:59 +08:00
|
|
|
}
|
|
|
|
function getIsModify(row) {
|
2025-03-05 00:14:39 +08:00
|
|
|
if (row.checkState == 0 || row.checkState == 2) {
|
|
|
|
return row.lordSent == userStore.uid;
|
|
|
|
}
|
|
|
|
if (row.checkState == 1) {
|
|
|
|
return row.recheckSend == userStore.uid;
|
|
|
|
}
|
|
|
|
return false;
|
2025-03-02 23:21:59 +08:00
|
|
|
}
|
2025-02-15 16:57:13 +08:00
|
|
|
/** 重置按钮操作 */
|
|
|
|
function resetQuery() {
|
|
|
|
proxy.resetForm("queryRef");
|
2025-03-01 00:06:15 +08:00
|
|
|
queryParams.value.dataRange = [];
|
2025-02-15 16:57:13 +08:00
|
|
|
handleQuery();
|
|
|
|
}
|
|
|
|
|
|
|
|
// 多选框选中数据
|
|
|
|
function handleSelectionChange(selection) {
|
|
|
|
ids.value = selection.map(item => item.id);
|
|
|
|
single.value = selection.length != 1;
|
|
|
|
multiple.value = !selection.length;
|
|
|
|
}
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
function handleDelete(row) {
|
|
|
|
const _ids = row.id || ids.value;
|
2025-02-28 00:27:10 +08:00
|
|
|
proxy.$modal.confirm('是否确认删除安全隐患整改编号为"' + _ids + '"的数据项?').then(function () {
|
2025-02-15 16:57:13 +08:00
|
|
|
return delProblemmodify(_ids);
|
|
|
|
}).then(() => {
|
|
|
|
getList();
|
|
|
|
proxy.$modal.msgSuccess("删除成功");
|
2025-02-28 00:27:10 +08:00
|
|
|
}).catch(() => { });
|
2025-02-15 16:57:13 +08:00
|
|
|
}
|
|
|
|
|
2025-03-01 16:11:56 +08:00
|
|
|
function getCount() {
|
2025-06-28 16:51:10 +08:00
|
|
|
if (!userStore.currentPrjId) {
|
|
|
|
return false;
|
|
|
|
}
|
2025-03-01 16:11:56 +08:00
|
|
|
let postData = {
|
|
|
|
infoType: 0,
|
|
|
|
problemType: queryParams.value.problemType,
|
|
|
|
dangerType: queryParams.value.dangerType,
|
|
|
|
lordSent: queryParams.value.lordSent,
|
|
|
|
createUser: queryParams.value.createUser
|
|
|
|
};
|
|
|
|
if (queryParams.value.dataRange && queryParams.value.dataRange.length > 0) {
|
|
|
|
postData.createTime = queryParams.value.dataRange[0];
|
|
|
|
postData.updateTime = queryParams.value.dataRange[1];
|
|
|
|
}
|
|
|
|
data.tabInfo = {
|
|
|
|
a: '全部数据(0)',
|
|
|
|
b: '待整改(0)',
|
|
|
|
c: '待复检(0)',
|
|
|
|
d: '整改完成(0)',
|
|
|
|
e: '整改超时(0)',
|
|
|
|
};
|
|
|
|
getListCount(postData).then(response => {
|
|
|
|
let obj = {
|
|
|
|
a: '全部数据',
|
|
|
|
b: '待整改',
|
|
|
|
c: '待复检',
|
|
|
|
d: '整改完成',
|
|
|
|
e: '整改超时',
|
|
|
|
};
|
|
|
|
(response.data || []).forEach(it => {
|
|
|
|
data.tabInfo[it.projectName] = obj[it.projectName] + `(${it.id || 0})`
|
|
|
|
});
|
|
|
|
});
|
2025-02-15 16:57:13 +08:00
|
|
|
}
|
|
|
|
|
2025-03-01 16:11:56 +08:00
|
|
|
getCount();
|
2025-03-02 23:21:59 +08:00
|
|
|
handleQuery();
|
2025-02-15 16:57:13 +08:00
|
|
|
</script>
|
2025-03-01 00:06:15 +08:00
|
|
|
<style lang="scss">
|
|
|
|
.trouble-problemodify-index {
|
|
|
|
.header-form {
|
|
|
|
.el-form-item {
|
|
|
|
margin-right: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|