This commit is contained in:
2025-07-30 16:26:34 +08:00
parent 496adee0b4
commit 3ff2728466
24 changed files with 506 additions and 1182 deletions

View File

@ -4,22 +4,19 @@
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="类别" prop="recordCategory">
<el-select v-model="queryParams.recordCategory" placeholder="请选择类别" clearable>
<el-form-item label="类别" prop="tourCategory">
<el-select v-model="queryParams.tourCategory" placeholder="请选择类别" clearable>
<el-option v-for="dict in recordCategoryType" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="类型" prop="violationType">
<el-select v-model="queryParams.violationType" placeholder="请选择违章类型" clearable>
<el-option v-for="dict in violation_level_type" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-form-item label="违章类型" prop="tourType">
<el-select v-model="queryParams.tourType" placeholder="全部" clearable>
<el-option v-for="dict in safety_inspection_violation_type" :key="dict.key" :label="dict.value" :value="dict.key" />
</el-select>
</el-form-item>
<el-form-item label="故障描述" prop="description">
<el-input v-model="queryParams.description" placeholder="请输入故障描述" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker clearable v-model="queryParams.createTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择创建时间" />
</el-form-item>
<!-- <el-form-item label="故障描述" prop="describe">
<el-input v-model="queryParams.describe" placeholder="请输入故障描述" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
@ -32,16 +29,15 @@
<el-card shadow="never">
<el-table v-loading="loading" :data="recognizeRecordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" v-if="false" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备名称" align="center" prop="sxtName" />
<el-table-column label="识别类别" align="center" prop="recordCategory">
<template #default="scope">
{{ scope.row.recordCategory === '1' ? '无人机识别' : '监控拍摄' }}
</template>
</el-table-column>
<el-table-column label="违章类型" align="center" prop="violationType">
<el-table-column label="违章类型" align="center">
<template #default="scope">
<dict-tag :options="violation_level_type" :value="scope.row.violationType" />
<span>{{ filterRiskTourType(scope.row.tourType) }}</span>
</template>
</el-table-column>
<el-table-column label="图片路径" align="center" prop="picture" width="100">
@ -49,60 +45,11 @@
<image-preview :src="scope.row.picture" :width="50" :height="50" />
</template>
</el-table-column>
<el-table-column label="故障描述" align="center" prop="description" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template #default="scope">
<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">
<template #default="scope">
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:recognizeRecord:remove']"
>删除</el-button
>
</template>
</el-table-column>
<el-table-column label="故障描述" align="center" prop="describe" />
<el-table-column label="创建时间" align="center" prop="createdAt" width="180"> </el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改识别记录对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="recognizeRecordFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="项目id" prop="projectId">
<el-input v-model="form.projectId" placeholder="请输入项目id" />
</el-form-item>
<el-form-item label="设备序列号" prop="deviceSerial">
<el-input v-model="form.deviceSerial" placeholder="请输入设备序列号" />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="违章类型" prop="violationType">
<el-select v-model="form.violationType" placeholder="请选择违章类型">
<el-option v-for="dict in violation_level_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="图片路径" prop="picture">
<image-upload v-model="form.picture" />
</el-form-item>
<el-form-item label="违规数量" prop="num">
<el-input v-model="form.num" placeholder="请输入违规数量" />
</el-form-item>
<el-form-item label="故障描述" prop="description">
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
@ -110,6 +57,7 @@
import { listRecognizeRecord, getRecognizeRecord, delRecognizeRecord, addRecognizeRecord, updateRecognizeRecord } from '@/api/safety/recognizeRecord';
import { RecognizeRecordVO, RecognizeRecordQuery, RecognizeRecordForm } from '@/api/safety/recognizeRecord/types';
import { useUserStoreHook } from '@/store/modules/user';
import { getDictData } from '@/api/project/goUser/index';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { violation_level_type } = toRefs<any>(proxy?.useDict('violation_level_type'));
@ -132,7 +80,7 @@ const recognizeRecordFormRef = ref<ElFormInstance>();
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const safety_inspection_violation_type = ref([]); // 违章类型
const dialog = reactive<DialogOption>({
visible: false,
title: ''
@ -140,7 +88,7 @@ const dialog = reactive<DialogOption>({
const initFormData: RecognizeRecordForm = {
id: undefined,
projectId: undefined,
projectId: currentProject.value.goId,
deviceSerial: undefined,
deviceName: undefined,
recordCategory: undefined,
@ -155,7 +103,7 @@ const data = reactive<PageData<RecognizeRecordForm, RecognizeRecordQuery>>({
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: undefined,
projectId: currentProject.value.goId,
deviceName: undefined,
recordCategory: undefined,
violationType: undefined,
@ -174,11 +122,15 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => {
loading.value = true;
const res = await listRecognizeRecord(queryParams.value);
recognizeRecordList.value = res.rows;
total.value = res.total;
recognizeRecordList.value = res.data.list;
total.value = res.data.total;
loading.value = false;
};
// 获取字典
const getDictDataList = async () => {
const res1 = await getDictData('tour_type');
safety_inspection_violation_type.value = res1.data.values;
};
/** 取消按钮 */
const cancel = () => {
reset();
@ -243,7 +195,17 @@ const submitForm = () => {
}
});
};
const filterRiskTourType = (val: any) => {
let label = '';
if (val) {
safety_inspection_violation_type.value.forEach((item: any) => {
if (val == item.key) {
label = item.value;
}
});
}
return label;
};
/** 删除按钮操作 */
const handleDelete = async (row?: RecognizeRecordVO) => {
const _ids = row?.id || ids.value;
@ -265,14 +227,16 @@ const handleExport = () => {
};
onMounted(() => {
getDictDataList();
getList();
});
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value.goId,
(nid, oid) => {
queryParams.value.projectId = nid;
getDictDataList();
getList();
}
);

View File

@ -5,8 +5,8 @@
<div class="resultIcon"><img :src="'../../../../../src/assets/icons/svg/' + inspectionType + '.png'" alt="" /></div>
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2>
<el-row>
<el-col :span="12" style="text-align: left">填报人{{ safetyInspectionDetail?.creatorName }}</el-col>
<el-col :span="12" style="text-align: right">填报时间{{ safetyInspectionDetail?.createTime }}</el-col>
<el-col :span="12" style="text-align: left">填报人{{ safetyInspectionDetail?.fill }}</el-col>
<el-col :span="12" style="text-align: right">填报时间{{ safetyInspectionDetail?.createdAt }}</el-col>
</el-row>
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
<el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item>
@ -19,7 +19,7 @@
<el-descriptions-item label-align="center" label="检查时间" class-name="zebra">{{ safetyInspectionDetail?.checkTime }} </el-descriptions-item>
<el-descriptions-item label-align="center" label="检查人" class-name="zebra">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item>
<el-descriptions-item label-align="center" label="整改人" label-class-name="white"
>{{ safetyInspectionDetail?.correctorName }}
>{{ safetyInspectionDetail?.abarbeitung }}
</el-descriptions-item>
<el-descriptions-item label-align="center" label="要求整改期限" label-class-name="white">
{{ dayjs(safetyInspectionDetail?.rectificationDeadline).format('YYYY 年 MM 月 DD 日') }}
@ -67,9 +67,9 @@
</el-descriptions-item>
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
<el-space wrap>
<div v-for="item in rectificationFileList" :key="item.ossId">
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
<image-preview :src="item.url" width="200px" />
<div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.id">
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
<image-preview :src="item.path" width="200px" />
</span>
<span v-else>
<el-link :href="`${item.url}`" :underline="false" target="_blank">
@ -84,9 +84,7 @@
<el-descriptions-item label-align="center" label="复查结果" class-name="none"></el-descriptions-item>
</el-descriptions>
<el-descriptions :column="2" border label-width="160px" size="large">
<el-descriptions-item label-align="center" label="复查人" label-class-name="white"
>{{ safetyInspectionDetail?.creatorName }}
</el-descriptions-item>
<el-descriptions-item label-align="center" label="复查人" label-class-name="white">{{ safetyInspectionDetail?.fill }} </el-descriptions-item>
<el-descriptions-item label-align="center" label="复查日期" label-class-name="white"
>{{ safetyInspectionDetail?.reviewTime }}
</el-descriptions-item>
@ -103,10 +101,10 @@
<img src="../../../../assets/icons/svg/derived.png" />
<span>导出</span>
</div>
<div class="btn-item" v-print="'#printMe'">
<!-- <div class="btn-item" v-print="'#printMe'">
<img src="../../../../assets/icons/svg/print.png" />
<span>打印</span>
</div>
</div> -->
</div>
</template>
@ -132,7 +130,7 @@ const userStore = useUserStoreHook();
const currentProject = computed(() => userStore.selectedProject);
const props = defineProps<Props>();
const loading = ref<boolean>(false);
const safetyInspectionDetail = ref<SafetyInspectionVO>();
const safetyInspectionDetail = ref({ checkAttachment: [] });
const checkFileList = ref<OssVO[]>();
const rectificationFileList = ref<OssVO[]>();
//检查状态图片
@ -148,17 +146,9 @@ const inspectionType = computed(() => {
const get = async () => {
loading.value = true;
const res = await getSafetyInspection(props.safetyInspectionId);
if (res.data && res.code === 200) {
const res = await getSafetyInspection({ id: props.safetyInspectionId });
if (res.data && res.code === 0) {
safetyInspectionDetail.value = res.data;
if (res.data.checkFile) {
const checkFileRes = await listByIds(res.data.checkFile.split(','));
checkFileList.value = checkFileRes.data;
}
if (res.data.rectificationFile) {
const rectificationFileRes = await listByIds(res.data.rectificationFile.split(','));
rectificationFileList.value = rectificationFileRes.data;
}
}
loading.value = false;
};

View File

@ -4,19 +4,14 @@
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="检查类型" prop="checkType">
<el-select v-model="queryParams.checkType" placeholder="全部" clearable>
<el-option v-for="dict in safety_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-form-item label="检查类型" prop="studyType">
<el-select v-model="queryParams.studyType" placeholder="全部" clearable>
<el-option v-for="dict in safety_inspection_check_type" :key="dict.key" :label="dict.value" :value="dict.key" />
</el-select>
</el-form-item>
<el-form-item label="违章类型" prop="violationType">
<el-select v-model="queryParams.violationType" placeholder="全部" clearable>
<el-option v-for="dict in safety_inspection_violation_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="处理状态" prop="status">
<el-select v-model="queryParams.status" placeholder="全部" clearable>
<el-option v-for="dict in safety_inspection_type" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-option v-for="dict in safety_inspection_violation_type" :key="dict.key" :label="dict.value" :value="dict.key" />
</el-select>
</el-form-item>
<el-form-item>
@ -29,45 +24,32 @@
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyInspection:add']"> 新增 </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:safetyInspection:remove']">
删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:safetyInspection:export']">导出 </el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="safetyInspectionList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="处理状态" align="center" prop="status">
<el-table-column label="处理状态" align="center" prop="status" min-width="100px">
<template #default="scope">
<dict-tag :options="safety_inspection_type" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="检查人" align="center" prop="correctorName" />
<el-table-column label="检查时间" align="center" prop="rectificationDeadline" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.rectificationDeadline, '{y}-{m}-{d}') }}</span>
<template v-if="scope.row.isReply == 1">
<el-tag type="primary" v-if="scope.row.status && scope.row.status == 1">通知</el-tag>
<el-tag type="warning" v-if="scope.row.status && scope.row.status == 2">整改</el-tag>
<el-tag type="success" v-if="scope.row.status && scope.row.status == 3 && scope.row.reviewType == 1">通过</el-tag>
<el-tag type="danger" v-if="scope.row.status && scope.row.status == 3 && scope.row.reviewType == 2">未通过</el-tag>
</template>
<template v-if="scope.row.isReply == 2">
<el-tag type="success">通过</el-tag>
</template>
</template>
</el-table-column>
<el-table-column label="检查人" align="center" prop="fill" />
<el-table-column label="检查时间" align="center" prop="checkTime" width="180"> </el-table-column>
<el-table-column label="检查类型" align="center" prop="checkType">
<template #default="scope">
<dict-tag :options="safety_inspection_check_type" :value="scope.row.checkType" />
<span>{{ filterType(scope.row.studyType) }}</span>
</template>
</el-table-column>
<el-table-column label="违章类型" align="center" prop="violationType">
<template #default="scope">
<dict-tag :options="safety_inspection_violation_type" :value="scope.row.violationType" />
<span>{{ filterTypeS(scope.row.violationType) }}</span>
</template>
</el-table-column>
<el-table-column label="巡检结果" align="center" prop="inspectionResult">
@ -82,28 +64,22 @@
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="整改人" align="center" prop="correctorName" />
<el-table-column label="整改人" align="center" prop="abarbeitung" />
<el-table-column label="复查状态" align="center" prop="reviewType">
<template #default="scope">
<dict-tag :options="review_type" :value="scope.row.reviewType" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
<template #default="scope">
<el-space>
<el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)" v-hasPermi="['safety:safetyInspection:query']">
详情
</el-button>
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyInspection:edit']">修改 </el-button> -->
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyInspection:remove']">
删除
</el-button>
</el-space>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改安全巡检工单对话框 -->
@ -177,11 +153,10 @@ import { useUserStoreHook } from '@/store/modules/user';
import SafetyInspectionDetailDialog from '@/views/safety/safetyInspection/component/SafetyInspectionDetailDialog.vue';
import { listProjectTeamForeman } from '@/api/project/projectTeam';
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
import { getDictData } from '@/api/project/goUser/index';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { safety_inspection_violation_type, review_type, safety_inspection_type, safety_inspection_check_type } = toRefs<any>(
proxy?.useDict('safety_inspection_violation_type', 'review_type', 'safety_inspection_type', 'safety_inspection_check_type')
);
const { review_type } = toRefs<any>(proxy?.useDict('review_type', 'safety_inspection_type'));
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
@ -194,7 +169,8 @@ const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const safety_inspection_check_type = ref([]); // 检查类型
const safety_inspection_violation_type = ref([]); // 违章类型
const queryFormRef = ref<ElFormInstance>();
const safetyInspectionFormRef = ref<ElFormInstance>();
@ -206,7 +182,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SafetyInspectionForm = {
id: undefined,
pid: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value.goId,
checkType: undefined,
violationType: undefined,
inspectionResult: undefined,
@ -234,7 +210,7 @@ const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({
pageSize: 10,
id: undefined,
pid: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value.goId,
checkType: undefined,
violationType: undefined,
inspectionResult: undefined,
@ -270,8 +246,8 @@ const teamList = ref<ProjectTeamForemanResp[]>();
const getList = async () => {
loading.value = true;
const res = await listSafetyInspection(queryParams.value);
safetyInspectionList.value = res.rows;
total.value = res.total;
safetyInspectionList.value = res.data.list;
total.value = res.data.total;
// 获取项目班组信息
const teamRes = await listProjectTeamForeman(currentProject.value.id);
teamList.value = teamRes.data;
@ -282,7 +258,13 @@ const getList = async () => {
loading.value = false;
};
// 获取字典
const getDictDataList = async () => {
const res = await getDictData('study_type');
safety_inspection_check_type.value = res.data.values;
const res1 = await getDictData('tour_type');
safety_inspection_violation_type.value = res1.data.values;
};
const changeForeman = (value: string | number) => {
const team = teamList.value.filter((team) => team.id === value)[0];
foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({
@ -297,7 +279,6 @@ const currentSafetyInspectionId = ref<string | number>();
const showDetailDialog = ref<boolean>(false);
const handleShowDialog = (row?: SafetyInspectionVO) => {
currentSafetyInspectionId.value = row.id;
showDetailDialog.value = true;
};
@ -331,24 +312,6 @@ const handleSelectionChange = (selection: SafetyInspectionVO[]) => {
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加安全巡检工单';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: SafetyInspectionVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getSafetyInspection(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改安全巡检工单';
};
/** 提交按钮 */
const submitForm = () => {
safetyInspectionFormRef.value?.validate(async (valid: boolean) => {
@ -367,29 +330,27 @@ const submitForm = () => {
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: SafetyInspectionVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除安全巡检工单编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delSafetyInspection(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
const filterType = (studyType) => {
let label = '';
safety_inspection_check_type.value.map((item) => {
if (item.key == studyType) {
label = item.value;
}
});
return label;
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'safety/safetyInspection/export',
{
...queryParams.value
},
`safetyInspection_${new Date().getTime()}.xlsx`
);
const filterTypeS = (violationType) => {
let label = '';
safety_inspection_violation_type.value.map((item) => {
if (item.key == violationType) {
label = item.value;
}
});
return label;
};
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value.goId,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;
@ -402,6 +363,7 @@ onUnmounted(() => {
});
onMounted(() => {
getDictDataList();
getList();
});
</script>

View File

@ -4,11 +4,8 @@
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="发生日期" prop="dateOfOccurrence">
<el-date-picker clearable v-model="queryParams.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期" />
</el-form-item>
<el-form-item label="录入人" prop="creatorName">
<el-input clearable v-model="queryParams.creatorName" placeholder="请输入录入人" />
<el-form-item label="录入人" prop="fill">
<el-input clearable v-model="queryParams.fill" placeholder="请输入录入人" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@ -22,21 +19,9 @@
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyLog:add']">新增 </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:safetyLog:remove']">
批量删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:safetyLog:export']">导出 </el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="safetyLogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="60" align="center" />
@ -138,6 +123,7 @@ import { addSafetyLog, delSafetyLog, getSafetyLog, listSafetyLog, updateSafetyLo
import { SafetyLogForm, SafetyLogQuery, SafetyLogVO } from '@/api/safety/safetyLog/types';
import { useUserStoreHook } from '@/store/modules/user';
import { dayjs } from 'element-plus';
import { busHseSecurityLogList } from '@/api/project/goUser/index';
import SafetyLogDetailDialog from '@/views/safety/safetyLog/component/SafetyLogDetailDialog.vue';
@ -165,7 +151,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SafetyLogForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value.goId,
dateOfOccurrence: undefined,
airTemperatureMax: undefined,
airTemperatureMin: undefined,
@ -188,7 +174,7 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value.id,
projectId: currentProject.value.goId,
dateOfOccurrence: undefined,
airTemperatureMax: undefined,
airTemperatureMin: undefined,
@ -217,9 +203,9 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询安全日志列表 */
const getList = async () => {
loading.value = true;
const res = await listSafetyLog(queryParams.value);
safetyLogList.value = res.rows;
total.value = res.total;
const res = await busHseSecurityLogList(queryParams.value);
safetyLogList.value = res.data.list;
total.value = res.data.total;
loading.value = false;
};
@ -261,24 +247,6 @@ const handleShowDialog = (row?: SafetyLogVO) => {
currentSafetyLogId.value = row.id;
showDetailDialog.value = true;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加安全日志';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: SafetyLogVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getSafetyLog(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改安全日志';
};
/** 提交按钮 */
const submitForm = () => {
safetyLogFormRef.value?.validate(async (valid: boolean) => {
@ -306,20 +274,9 @@ const handleDelete = async (row?: SafetyLogVO) => {
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'safety/safetyLog/export',
{
...queryParams.value
},
`safetyLog_${new Date().getTime()}.xlsx`
);
};
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value.goId,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -3,12 +3,12 @@
<el-descriptions v-loading="loading" :column="2">
<el-descriptions-item :span="2" label="宣讲人">{{ teamMeetingDetail?.compereName }}</el-descriptions-item>
<el-descriptions-item :span="2" label="参与人">
<span :key="item.id" v-for="item in teamMeetingDetail?.participantList">{{ item.name }}</span>
<span :key="item.id" v-for="item in teamMeetingDetail?.participantName.split(',')">{{ item }}</span>
</el-descriptions-item>
<el-descriptions-item label="班组名称">{{ teamMeetingDetail?.teamName }}</el-descriptions-item>
<el-descriptions-item label="施工单位">{{ teamMeetingDetail?.contractorName }}</el-descriptions-item>
<el-descriptions-item label="施工单位">{{ teamMeetingDetail?.labourserviceName }}</el-descriptions-item>
<el-descriptions-item label="开会时间">{{ dayjs(teamMeetingDetail?.meetingDate).format('YYYY 年 MM 月 DD 日') }}</el-descriptions-item>
<el-descriptions-item label="上传时间">{{ teamMeetingDetail?.createTime }}</el-descriptions-item>
<el-descriptions-item label="上传时间">{{ teamMeetingDetail?.createdAt }}</el-descriptions-item>
<el-descriptions-item :span="2" label="班会内容">{{ teamMeetingDetail?.content }}</el-descriptions-item>
<el-descriptions-item :span="2" label="班会图片">
<el-space wrap>
@ -35,8 +35,8 @@ const loading = ref<boolean>(false);
const teamMeetingDetail = ref<TeamMeetingVO>();
const get = async () => {
loading.value = true;
const res = await getTeamMeeting(props.teamMeetingId);
if (res.data && res.code === 200) {
const res = await getTeamMeeting({ id: props.teamMeetingId });
if (res.data && res.code === 0) {
teamMeetingDetail.value = res.data;
}
loading.value = false;

View File

@ -19,17 +19,6 @@
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:teamMeeting:add']"> 新增 </el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:teamMeeting:remove']">
删除
</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:teamMeeting:export']">导出 </el-button>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
@ -38,11 +27,11 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="宣讲人" align="center" prop="compereName" />
<el-table-column label="施工单位" align="center" prop="contractorName" />
<el-table-column label="施工单位" align="center" prop="labourserviceName" />
<el-table-column label="班组名称" align="center" prop="teamName" />
<el-table-column label="参与人数" align="center">
<template #default="scope">
<span>{{ scope.row.participantList.length + 1 }}</span>
<span>{{ scope.row.participantId.split(',').length }}</span>
</template>
</el-table-column>
<el-table-column label="开会时间" align="center" prop="meetingDate" width="180">
@ -50,27 +39,17 @@
<span>{{ parseTime(scope.row.meetingDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="上传时间" align="center" prop="createTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="上传时间" align="center" prop="createdAt" width="180"> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-space>
<el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['safety:teamMeeting:query']">
详情
</el-button>
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:teamMeeting:edit']"> 修改 </el-button> -->
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:teamMeeting:remove']">
删除
</el-button>
</el-space>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改站班会对话框 -->
@ -103,8 +82,6 @@
</template>
<script setup name="TeamMeeting" lang="ts">
console.log(111);
import { addTeamMeeting, delTeamMeeting, getTeamMeeting, listTeamMeeting, updateTeamMeeting } from '@/api/safety/teamMeeting';
import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/teamMeeting/types';
import { useUserStoreHook } from '@/store/modules/user';
@ -135,7 +112,7 @@ const dialog = reactive<DialogOption>({
const initFormData: TeamMeetingForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value.goId,
teamId: undefined,
contractorId: undefined,
meetingDate: undefined,
@ -150,7 +127,7 @@ const data = reactive<PageData<TeamMeetingForm, TeamMeetingQuery>>({
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value.id,
projectId: currentProject.value.goId,
teamId: undefined,
contractorId: undefined,
meetingDate: undefined,
@ -173,8 +150,8 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => {
loading.value = true;
const res = await listTeamMeeting(queryParams.value);
teamMeetingList.value = res.rows;
total.value = res.total;
teamMeetingList.value = res.data.list;
total.value = res.data.total;
loading.value = false;
};
@ -222,17 +199,6 @@ const handleShowDrawer = (row?: TeamMeetingVO) => {
currentTeamMeetingId.value = row.id;
showDetailDrawer.value = true;
};
/** 修改按钮操作 */
const handleUpdate = async (row?: TeamMeetingVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getTeamMeeting(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改站班会';
};
/** 提交按钮 */
const submitForm = () => {
teamMeetingFormRef.value?.validate(async (valid: boolean) => {
@ -249,30 +215,9 @@ const submitForm = () => {
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: TeamMeetingVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除站班会编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delTeamMeeting(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'safety/teamMeeting/export',
{
...queryParams.value
},
`teamMeeting_${new Date().getTime()}.xlsx`
);
};
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value.goId,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -6,8 +6,8 @@
<el-row>
<el-col :span="8" class="colBlock">
<el-form-item label="违章类型" prop="tourType">
<el-select v-model="state.tableData.param.violationType" placeholder="请选择违章类型" clearable>
<el-option v-for="dict in violation_level_type" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-select v-model="state.tableData.param.tourType" placeholder="全部" clearable>
<el-option v-for="dict in safety_inspection_violation_type" :key="dict.key" :label="dict.value" :value="dict.key" />
</el-select>
</el-form-item>
</el-col>
@ -23,54 +23,27 @@
</el-col>
</el-row>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" @click="handleAdd" v-auth="'api/v1/system/busViolationLevel/add'">
<el-icon><Plus /></el-icon>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" :disabled="single" @click="handleUpdate(null)" v-auth="'api/v1/system/busViolationLevel/edit'">
<el-icon><Edit /></el-icon>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busViolationLevel/delete'">
<el-icon><Delete /></el-icon>删除
</el-button>
</el-col>
</el-row>
</div>
<el-table v-loading="loading" :data="state.tableData.data" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" :index="indexMethod" width="60" />
<el-table-column label="违章等级" align="center" prop="violationLevel" width="100px" />
<el-table-column label="违章等级" align="center" prop="grade" width="100px" />
<el-table-column label="颜色" align="center" prop="color" width="100px">
<template #default="scope">
<div :style="`background: ${scope.row.color};width:15px;height:15px;margin:auto;`"></div>
</template>
</el-table-column>
<el-table-column label="风险等级" align="center" prop="riskType" width="150px">
<el-table-column label="风险等级" align="center" width="150px">
<template #default="scope">
<span>{{ filterRiskLevelType(scope.row.riskType) }}</span>
<span>{{ filterRiskLevelType(scope.row.risx) }}</span>
</template>
</el-table-column>
<el-table-column label="违章类型" show-overflow-tooltip align="center" prop="violationType" :formatter="tourTypeFormat" min-width="100px" />
<el-table-column label="创建时间" align="center" prop="createTime" width="150px">
<el-table-column label="违章类型" align="center">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding" width="160px" fixed="right">
<template #default="scope">
<el-button type="success" link @click="handleUpdate(scope.row)" v-auth="'api/v1/system/busViolationLevel/edit'">
<el-icon><EditPen /></el-icon>修改
</el-button>
<el-button type="danger" link @click="handleDelete(scope.row)" v-auth="'api/v1/system/busViolationLevel/delete'">
<el-icon><DeleteFilled /></el-icon>删除
</el-button>
<span>{{ filterRiskTourType(scope.row.tourType) }}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createdAt"> </el-table-column>
</el-table>
<pagination
v-show="state.tableData.total > 0"
@ -107,6 +80,8 @@ import apiV1SystemBusViolationLevelAdd from '@/views/safety/violationLevel/compo
import apiV1SystemBusViolationLevelEdit from '@/views/safety/violationLevel/component/edit.vue';
import { useUserStoreHook } from '@/store/modules/user';
import { listPost, listTreeByProject, optionselect } from '@/api/system/post';
import { getDictData } from '@/api/project/goUser/index';
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
@ -118,7 +93,8 @@ const queryRef = ref<FormInstance>();
const addRef = ref<InstanceType<typeof apiV1SystemBusViolationLevelAdd>>();
const editRef = ref<InstanceType<typeof apiV1SystemBusViolationLevelEdit>>();
const detailRef = ref<any>();
const risx = ref([]); // 风险等级
const safety_inspection_violation_type = ref([]); // 违章类型
const showAll = ref(false);
const single = ref(true);
const multiple = ref(true);
@ -133,7 +109,7 @@ const state = reactive<any>({
total: 0,
loading: false,
param: {
projectId: currentProject.value?.id,
projectId: currentProject.value?.goId,
pageNum: 1,
pageSize: 10,
tourType: undefined,
@ -164,27 +140,17 @@ const resetQuery = (formEl?: FormInstance) => {
const busViolationLevelList = () => {
loading.value = true;
listViolationLevel(state.tableData.param).then((res: any) => {
const list = res.rows ?? [];
state.tableData.data = list;
state.tableData.total = res.total;
state.tableData.data = res.data.list;
state.tableData.total = res.data.total;
loading.value = false;
});
};
const toggleSearch = () => {
showAll.value = !showAll.value;
};
const tourTypeFormat = (row: ViolationLevelVO) => {
const type: string[] = [];
if (row.violationType.includes(',')) {
(row.violationType as string).split(',').forEach((item) => {
type.push(proxy.selectDictLabel(violation_level_type.value, item));
});
} else {
type.push(proxy.selectDictLabel(violation_level_type.value, row.violationType as string));
}
return type.join(',');
// 获取字典
const getDictDataList = async () => {
const res = await getDictData('risx');
risx.value = res.data.values;
const res1 = await getDictData('tour_type');
safety_inspection_violation_type.value = res1.data.values;
};
const handleSelectionChange = (selection: ViolationLevelForm[]) => {
@ -233,10 +199,6 @@ const handleDelete = (row: ViolationLevelVO | null) => {
.catch(() => {});
};
const handleView = (row: ViolationLevelVO) => {
detailRef.value?.openDialog(toRaw(row));
};
const indexMethod = (index: number) => {
const pageNum = state.tableData.param.pageNum - 1;
if (pageNum !== -1 && pageNum !== 0) {
@ -247,27 +209,41 @@ const indexMethod = (index: number) => {
};
const filterRiskLevelType = (val: any) => {
console.log(val);
let label = '';
if (val) {
if (risk_level_type.value.length) {
risk_level_type.value.forEach((item: any) => {
if (item.value == val) {
label = item.label;
if (risx.value.length) {
risx.value.forEach((item: any) => {
if (item.key == val) {
label = item.value;
}
});
}
}
return label;
};
const filterRiskTourType = (val: any) => {
let label = '';
if (val) {
if (risx.value.length) {
safety_inspection_violation_type.value.forEach((item: any) => {
if (val.split(',').includes(item.key)) {
label += item.value + ',';
}
});
}
}
return label;
};
onMounted(() => {
getDictDataList();
postList();
initTableData();
});
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value.goId,
(nid, oid) => {
state.tableData.param.projectId = nid;
initTableData();

View File

@ -6,21 +6,16 @@
<!-- <h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2> -->
<el-row>
<el-col :span="12" style="text-align: left">填报人{{ safetyInspectionDetail?.createByName }}</el-col>
<el-col :span="12" style="text-align: right">填报时间{{ safetyInspectionDetail?.createTime }}</el-col>
<el-col :span="12" style="text-align: right">填报时间{{ safetyInspectionDetail?.createdAt }}</el-col>
</el-row>
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
<el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item>
<el-descriptions-item label-align="center" label="违章类型" label-class-name="white" width="300px">
<dict-tag :options="violation_level_type" :value="safetyInspectionDetail?.violationType" />
{{ safetyInspectionDetail?.tt }}
</el-descriptions-item>
<el-descriptions-item label-align="center" label="违章等级" label-class-name="white">
<div class="flex">
{{ safetyInspectionDetail?.levelVo.violationLevel }}<dict-tag
:options="risk_level_type"
:value="safetyInspectionDetail?.levelVo.riskType"
/>
</div>
{{ safetyInspectionDetail?.level }}
</el-descriptions-item>
<el-descriptions-item label-align="center" label="检查时间" class-name="zebra"
>{{ safetyInspectionDetail?.violationTime }}
@ -39,24 +34,24 @@
<el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item>
</el-descriptions>
<el-descriptions :column="2" border label-width="160px" size="large">
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white"
>{{ safetyInspectionDetail?.recognizeVo.description }}
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white">
{{ safetyInspectionDetail?.tt }}
</el-descriptions-item>
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
<el-space wrap>
<!-- <div v-for="item in checkFileList" :key="item.ossId">
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
<image-preview :src="item.url" width="200px" />
<div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.ossId">
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
<image-preview :src="item.path" width="200px" />
</span>
<span v-else>
<el-link :href="`${item.url}`" type="primary" :underline="false" target="_blank">
<span> {{ item.originalName }} </span>
<el-link :href="`${item.path}`" type="primary" :underline="false" target="_blank">
<span> {{ item.name }} </span>
</el-link>
</span>
</div> -->
<span>
</div>
<!-- <span>
<image-preview :src="safetyInspectionDetail?.recognizeVo.picture" width="200px" />
</span>
</span> -->
</el-space>
</el-descriptions-item>
<el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white">
@ -69,16 +64,16 @@
</div>
<!-- </el-card> -->
<!-- <div class="dialog-footer">
<div class="btn-item" @click="handleExport">
<div class="dialog-footer">
<!-- <div class="btn-item" @click="handleExport">
<img src="../../../../assets/icons/svg/derived.png" />
<span>导出</span>
</div>
</div> -->
<div class="btn-item" v-print="'#printMe'">
<img src="../../../../assets/icons/svg/print.png" />
<span>打印</span>
</div>
</div> -->
</div>
</template>
<script setup lang="ts">
@ -91,6 +86,7 @@ import { ViolationRecordVO } from '@/api/safety/violationRecord/types';
interface Props {
violationRecordId?: string | number;
safety_inspection_violation_type?: Array<any>;
}
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -103,7 +99,11 @@ const userStore = useUserStoreHook();
const currentProject = computed(() => userStore.selectedProject);
const props = defineProps<Props>();
const loading = ref<boolean>(false);
const safetyInspectionDetail = ref<any>();
const safetyInspectionDetail = ref<any>([
{
checkAttachment: []
}
]);
const checkFileList = ref<OssVO[]>();
const rectificationFileList = ref<OssVO[]>();
//检查状态图片
@ -119,17 +119,9 @@ const inspectionType = computed(() => {
const get = async () => {
loading.value = true;
const res = await getViolationRecord(props.violationRecordId);
if (res.data && res.code === 200) {
const res = await getViolationRecord({ id: props.violationRecordId });
if (res.data && res.code === 0) {
safetyInspectionDetail.value = res.data;
if (res.data.checkFile) {
const checkFileRes = await listByIds(res.data.checkFile.split(','));
checkFileList.value = checkFileRes.data;
}
if (res.data.rectificationFile) {
const rectificationFileRes = await listByIds(res.data.rectificationFile.split(','));
rectificationFileList.value = rectificationFileRes.data;
}
}
loading.value = false;
};
@ -142,7 +134,17 @@ onMounted(() => {
console.log('🚀 ~ onMounted ~ props.safetyInspectionId:', props.violationRecordId);
get();
});
const filterRiskTourType = (val: any) => {
let label = '';
if (val) {
props.safety_inspection_violation_type.value.forEach((item: any) => {
if (val == item.key) {
label = item.value;
}
});
}
return label;
};
watch(
() => props.violationRecordId,
(newId, oldId) => {

View File

@ -7,10 +7,11 @@
<el-form-item label="工单号" prop="id">
<el-input v-model="queryParams.id" placeholder="请输入工单号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="违章时间" prop="violationTime">
<el-date-picker clearable v-model="queryParams.violationTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择违章时间" />
<el-form-item label="违章类型" prop="tourType">
<el-select v-model="queryParams.tourType" placeholder="全部" clearable>
<el-option v-for="dict in safety_inspection_violation_type" :key="dict.key" :label="dict.value" :value="dict.key" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
@ -19,15 +20,9 @@
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:violationRecord:remove']"
>删除</el-button
>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
@ -35,45 +30,39 @@
<el-table v-loading="loading" :data="violationRecordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工单号" align="center" prop="id" v-if="true" />
<el-table-column label="违章等级" align="center" prop="levelVo" width="180">
<el-table-column label="违章/风险等级" align="center" prop="level" width="180"> </el-table-column>
<el-table-column label="数据源头" align="center" prop="dataSource" width="180">
<template #default="scope">
<div class="flex justify-center">
{{ scope.row.levelVo.violationLevel }}<dict-tag :options="risk_level_type" :value="scope.row.levelVo.riskType" />
</div>
<span>{{ filterRiskTourTypes(scope.row.dataSource) }}</span>
</template>
</el-table-column>
<el-table-column label="违章类型" align="center" prop="violationType">
<el-table-column label="违章类型" align="center">
<template #default="scope">
<dict-tag :options="violation_level_type" :value="scope.row.violationType" />
<span>{{ filterRiskTourType(scope.row.tourType) }}</span>
</template>
</el-table-column>
<el-table-column label="违章时间" align="center" prop="violationTime" width="180">
<el-table-column label="处理人" align="center" prop="nickName" min-width="100px">
<template #default="scope">
<span>{{ parseTime(scope.row.violationTime, '{y}-{m}-{d}') }}</span>
{{ scope.row.userName ? scope.row.userName : scope.row.nickName }}
</template>
</el-table-column>
<el-table-column label="处理人" align="center" prop="handlerName" />
<el-table-column label="整改措施" align="center" prop="measure" />
<el-table-column label="整改时间" align="center" prop="rectificationTime" width="180">
<el-table-column label="状态" align="center" prop="status" min-width="100px">
<template #default="scope">
<span>{{ parseTime(scope.row.rectificationTime, '{y}-{m}-{d}') }}</span>
<el-tag type="primary" v-if="scope.row.status == 1">通知</el-tag>
<el-tag type="warning" v-if="scope.row.status == 2">整改</el-tag>
<el-tag type="success" v-if="scope.row.status == 3 && scope.row.reviewType == 1">复查成功</el-tag>
<el-tag type="danger" v-if="scope.row.status == 3 && scope.row.reviewType == 2">复查失败</el-tag>
</template>
</el-table-column>
<el-table-column label="复查情况" align="center" prop="review" />
<el-table-column label="复查状态" align="center" prop="reviewType">
<el-table-column label="违规时间" align="center" prop="createdAt" min-width="100px">
<template #default="scope">
{{ scope.row.reviewType ? (scope.row.reviewType == 1 ? '已通过' : '未通过') : '' }}
<span v-if="scope.row.dataSource == 'artificial'">{{ scope.row.laborDate }}</span>
<span v-else>{{ scope.row.createdAt }}</span>
</template>
</el-table-column>
<el-table-column label="复查时间" align="center" prop="reviewTime" width="180">
<el-table-column label="复查记录" align="center" min-width="100px">
<template #default="scope">
<span>{{ parseTime(scope.row.reviewTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="处理流程类型(0仅通知 1通知整改复查)" align="center" prop="processType" /> -->
<el-table-column label="工单状态" align="center" prop="status">
<template #default="scope">
<dict-tag :options="safety_inspection_type" :value="scope.row.status" />
<span>{{ filterHis(scope.row.refuseList) }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
@ -88,12 +77,6 @@
v-hasPermi="['safety:violationRecord:view']"
></el-button>
</el-tooltip>
<el-tooltip content="违章处理人" placement="top">
<el-button link type="primary" icon="User" @click="handleUpdate(scope.row)" v-hasPermi="['safety:violationRecord:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:violationRecord:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
@ -122,7 +105,10 @@
</template>
</el-dialog>
<el-dialog title="违规记录详情" v-model="showDetailDialog" width="60vw">
<ViolationRecordDetailDialog :violation-record-id="currentViolationRecordId" />
<ViolationRecordDetailDialog
:violation-record-id="currentViolationRecordId"
:safety_inspection_violation_type="safety_inspection_violation_type"
/>
</el-dialog>
</div>
</template>
@ -131,11 +117,16 @@
import { listViolationRecord, getViolationRecord, delViolationRecord, addViolationRecord, updateViolationRecord } from '@/api/safety/violationRecord';
import { ViolationRecordVO, ViolationRecordQuery, ViolationRecordForm } from '@/api/safety/violationRecord/types';
import ViolationRecordDetailDialog from './component/violationRecordDetailDialog.vue';
import { useUserStoreHook } from '@/store/modules/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { getDictData } from '@/api/project/goUser/index';
const { violation_level_type, risk_level_type, safety_inspection_type } = toRefs<any>(
proxy?.useDict('violation_level_type', 'risk_level_type', 'safety_inspection_type')
);
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const violationRecordList = ref<ViolationRecordVO[]>([]);
const buttonLoading = ref(false);
@ -150,7 +141,8 @@ const showDetailDialog = ref(false);
const queryFormRef = ref<ElFormInstance>();
const violationRecordFormRef = ref<ElFormInstance>();
const safety_inspection_violation_type = ref([]); // 违章类型
const violation_record_data_source = ref([]); // 数据来源
const dialog = reactive<DialogOption>({
visible: false,
title: ''
@ -158,7 +150,7 @@ const dialog = reactive<DialogOption>({
const initFormData: ViolationRecordForm = {
id: undefined,
projectId: undefined,
projectId: currentProject.value.goId,
levelId: undefined,
recognizeId: undefined,
violationType: undefined,
@ -181,7 +173,7 @@ const data = reactive<PageData<ViolationRecordForm, ViolationRecordQuery>>({
pageNum: 1,
pageSize: 10,
id: undefined,
projectId: undefined,
projectId: currentProject.value.goId,
violationType: undefined,
violationTime: undefined,
handlerId: undefined,
@ -212,8 +204,8 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => {
loading.value = true;
const res = await listViolationRecord(queryParams.value);
violationRecordList.value = res.rows;
total.value = res.total;
violationRecordList.value = res.data.list;
total.value = res.data.total;
loading.value = false;
};
@ -300,8 +292,42 @@ const handleExport = () => {
`violationRecord_${new Date().getTime()}.xlsx`
);
};
const filterHis = (list) => {
if (list && list.length) {
return '重新复查';
}
};
const filterRiskTourType = (val: any) => {
let label = '';
if (val) {
safety_inspection_violation_type.value.forEach((item: any) => {
if (val == item.key) {
label = item.value;
}
});
}
return label;
};
const filterRiskTourTypes = (val: any) => {
let label = '';
if (val) {
violation_record_data_source.value.forEach((item: any) => {
if (val == item.key) {
label = item.value;
}
});
}
return label;
};
// 获取字典
const getDictDataList = async () => {
const res = await getDictData('tour_type');
safety_inspection_violation_type.value = res.data.values;
const res1 = await getDictData('violation_record_data_source');
violation_record_data_source.value = res1.data.values;
};
onMounted(() => {
getDictDataList();
getList();
});
</script>