|
|
@@ -139,7 +139,7 @@
|
|
|
检查记录
|
|
|
</div>
|
|
|
<div style="margin-bottom: 20px;">
|
|
|
- <el-button type="primary" @click="onAddRecord">新增检查日志</el-button>
|
|
|
+ <!-- <el-button type="primary" @click="onAddRecord">新增检查日志</el-button> -->
|
|
|
</div>
|
|
|
<div class="view-record-toolbar">
|
|
|
<el-input
|
|
|
@@ -157,7 +157,19 @@
|
|
|
value-format="YYYY-MM-DD"
|
|
|
style="margin-right: 12px;max-width: 280px;"
|
|
|
/>
|
|
|
+ <div class="select-box--item" style="margin-right: 12px; width:160px;">
|
|
|
+ <el-select v-model="statusValue" placeholder="请选择状态" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in STATUS_OPTIONS"
|
|
|
+ :key="String(item.value)"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ style="width: 200px;"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
<el-button type="primary" class="view-record-toolbar-btn" @click="onRecordSearch">查询</el-button>
|
|
|
+ <el-button @click="onReset">重置</el-button>
|
|
|
<el-button @click="onRecordExport">导出</el-button>
|
|
|
|
|
|
</div>
|
|
|
@@ -168,6 +180,9 @@
|
|
|
@update:pageSize="handleRecordSizeChange"
|
|
|
@update:pageNumber="handleRecordPageChange"
|
|
|
>
|
|
|
+ <template #status="scope">
|
|
|
+ <span>{{ STATUS_LABEL[scope.row.status] || '-' }}</span>
|
|
|
+ </template>
|
|
|
<template #unqualifiedItemNum="scope">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@@ -205,7 +220,23 @@
|
|
|
<span v-else> - </span>
|
|
|
</template>
|
|
|
<template #action="scope">
|
|
|
- <el-button type="primary" link size="small" @click="onViewRecord(scope.row)">检查记录查看</el-button>
|
|
|
+ <ActionButton
|
|
|
+ text="删除"
|
|
|
+ :popconfirm="{
|
|
|
+ title: '确定要删除?',
|
|
|
+ }"
|
|
|
+ @confirm="onDeleteRecord(scope.row)"
|
|
|
+ />
|
|
|
+ <!-- 待检查时显示 -->
|
|
|
+ <ActionButton
|
|
|
+ text="检查"
|
|
|
+ v-if="Number(scope.row.status) === 1"
|
|
|
+ @click="onReviewDept(scope.row)"
|
|
|
+ />
|
|
|
+ <ActionButton
|
|
|
+ text="检查记录查看"
|
|
|
+ @click="onViewRecord(scope.row)"
|
|
|
+ />
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
</section>
|
|
|
@@ -422,136 +453,6 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <!-- <BasicForm
|
|
|
- ref="sandHiddenDangerFormRefDept"
|
|
|
- :formData="sandHiddenDangerFormDataDept"
|
|
|
- :formRules="sandHiddenDangerFormRulesDept"
|
|
|
- :formConfig="sandHiddenDangerFormConfigDept"
|
|
|
- >
|
|
|
- <template #typeId>
|
|
|
- <el-form-item prop="typeId" style="width: 100%;">
|
|
|
- <el-select
|
|
|
- v-model="sandHiddenDangerFormDataDept.typeId"
|
|
|
- placeholder="请选择隐患问题类别"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in dangerTypeList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.categoryName"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- <template #rectificationDepartmentIds>
|
|
|
- <el-form-item prop="rectificationDepartmentIds" style="width: 100%;">
|
|
|
- <el-cascader
|
|
|
- ref="cascaderDeptRef"
|
|
|
- v-model="sandHiddenDangerFormDataDept.rectificationDepartmentIds"
|
|
|
- :options="issueDeptTree"
|
|
|
- :props="cascaderDeptProp"
|
|
|
- :show-all-levels="false"
|
|
|
- placeholder="请选择整改责任部门"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- @change="onIssueDeptChange"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- <template #rectificationResponsibleIds>
|
|
|
- <el-form-item prop="rectificationResponsibleIds" style="width: 100%;">
|
|
|
- <el-select
|
|
|
- v-model="sandHiddenDangerFormDataDept.rectificationResponsibleIds"
|
|
|
- placeholder="选择整改负责人"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="user in issueUserList"
|
|
|
- :key="user.id"
|
|
|
- :label="user.realname ?? user.username"
|
|
|
- :value="user.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- <template #reviewDepartmentId>
|
|
|
- <el-cascader
|
|
|
- v-model="sandHiddenDangerFormDataDept.reviewDepartmentId"
|
|
|
- :options="deptTree"
|
|
|
- :props="cascaderDeptProp"
|
|
|
- :show-all-levels="false"
|
|
|
- placeholder="请选择复查人员所属部门"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- style="width: 100%"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template #reviewPerson>
|
|
|
- <el-select
|
|
|
- v-model="sandHiddenDangerFormDataDept.reviewPersonId"
|
|
|
- placeholder="请选择复查人员"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="u in reviewUserListDept"
|
|
|
- :key="u.id"
|
|
|
- :label="u.realname || u.username"
|
|
|
- :value="u.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- <template #isDrawLessonsPush>
|
|
|
- <el-radio-group v-model="sandHiddenDangerFormDataDept.isDrawLessonsPush" @change="isDrawLessonsPushChange">
|
|
|
- <el-radio :value="0">否</el-radio>
|
|
|
- <el-radio :value="1">是</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </template>
|
|
|
- <template #drawLessonsContent v-if="sandHiddenDangerFormDataDept.isDrawLessonsPush === 1">
|
|
|
- <el-form-item label-width="136.5px" style="width:100%">
|
|
|
- <el-input placeholder="如:上级检查、院内自查" v-model="sandHiddenDangerFormDataDept.drawLessonsContent" />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- <template #drawLessonsDepartmentId v-if="sandHiddenDangerFormDataDept.isDrawLessonsPush === 1">
|
|
|
- <el-form-item prop="drawLessonsDepartmentIds" style="width: 100%" label="举一反三责任部门:">
|
|
|
- <el-select
|
|
|
- v-model="drawLessonsDeptIdsArrayDept"
|
|
|
- placeholder="请选择举一反三责任部门,可多选"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- multiple
|
|
|
- collapse-tags
|
|
|
- collapse-tags-tooltip
|
|
|
- style="width: 100%"
|
|
|
- @change="() => { sandHiddenDangerFormDataDept.drawLessonsDepartmentIds = drawLessonsDeptIdsArrayDept.join(','); }"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="d in deptOptions"
|
|
|
- :key="d.id"
|
|
|
- :label="d.deptName"
|
|
|
- :value="d.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- </template>
|
|
|
- <template #drawLessonsDeadline v-if="sandHiddenDangerFormDataDept.isDrawLessonsPush === 1">
|
|
|
- <el-form-item prop="drawLessonsDeadline" label="举一反三时限:" style="width: 100%;">
|
|
|
- <el-date-picker
|
|
|
- v-model="sandHiddenDangerFormDataDept.drawLessonsDeadline"
|
|
|
- type="date"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- placeholder="请选择举一反三截止日期(选填)"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </BasicForm> -->
|
|
|
<template #footer>
|
|
|
<el-button @click="showSandConfirmDialogDept = false">取消</el-button>
|
|
|
<el-button type="primary" :loading="sandConfirmLoadingDept" @click="confirmSandToHiddenDangerDept">
|
|
|
@@ -581,6 +482,7 @@
|
|
|
queryUnqualifiedItemNumDeptPage,
|
|
|
sandAreaCheckRecordToProductionHiddenDanger,
|
|
|
exportAreaCheckInspectionRecord,
|
|
|
+ deleteInspectionRecords,
|
|
|
type UnqualifiedItemNumRecord,
|
|
|
type SandAreaCheckRecordToHiddenDangerReq,
|
|
|
} from '@/api/production-safety-system';
|
|
|
@@ -589,7 +491,7 @@
|
|
|
import { useFormConfigHook } from '@/hooks/useFormConfigHook';
|
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
|
import type { DeptTree } from '@/types/dept/type';
|
|
|
-
|
|
|
+ import ActionButton from '@/components/ActionButton.vue';
|
|
|
import { queryAvailableUserList } from '@/api/production-safety/responsibility-implementation';
|
|
|
import { downloadByData } from '@/utils/file/download';
|
|
|
import {
|
|
|
@@ -597,7 +499,7 @@
|
|
|
} from '@/api/production-safety';
|
|
|
|
|
|
import type { CascaderInstance } from 'element-plus'
|
|
|
-
|
|
|
+ import { STATUS_OPTIONS, STATUS_LABEL } from '../configs/status'
|
|
|
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
@@ -680,7 +582,8 @@
|
|
|
|
|
|
const RECORD_TABLE_COLUMNS: TableColumnProps[] = [
|
|
|
{ label: '编号', type: 'index', align: 'center', width: '80px' },
|
|
|
- { label: '检查时间', prop: 'checkTime', minWidth: '160px' },
|
|
|
+ { label: '完成(检查)时间', prop: 'checkTime', minWidth: '180px' },
|
|
|
+ { label: '状态', prop: 'status', slot: 'status', minWidth: '120px' },
|
|
|
{ label: '检查人员', prop: 'checkPerson', minWidth: '140px' },
|
|
|
{ label: '检查场所类别', prop: 'checkPlaceCategory', minWidth: '160px' },
|
|
|
{ label: '检查场所', prop: 'checkPlace', minWidth: '180px' },
|
|
|
@@ -689,7 +592,7 @@
|
|
|
{ label: '不合格项数', prop: 'unqualifiedItemNum', slot: 'unqualifiedItemNum', align: 'center', width: '160px' },
|
|
|
{ label: '整体检查情况描述', prop: 'overallCheckDesc', minWidth: '190px', showOverflowTooltip: true },
|
|
|
{ label: '被检查人签字', slot: 'sign', align: 'center', width: '180px' },
|
|
|
- { label: '操作', slot: 'action', align: 'center', width: '180px', fixed: 'right' },
|
|
|
+ { label: '操作', slot: 'action', align: 'center', width: '220px', fixed: 'right' },
|
|
|
];
|
|
|
const RECORD_TABLE_OPTIONS = {
|
|
|
emptyText: '暂无检查记录',
|
|
|
@@ -705,6 +608,7 @@
|
|
|
|
|
|
const recordSearchKeyword = ref('');
|
|
|
const recordDateRange = ref<[string, string] | null>(null);
|
|
|
+ const statusValue = ref<number | null>(null);
|
|
|
const inspectionRecordList = ref<Array<Record<string, unknown>>>([]);
|
|
|
|
|
|
const paginatedRecordList = computed(() => inspectionRecordList.value);
|
|
|
@@ -871,6 +775,13 @@
|
|
|
recordPagination.pageNumber = 1;
|
|
|
loadRecordList();
|
|
|
};
|
|
|
+ const onReset = () => {
|
|
|
+ recordSearchKeyword.value = '';
|
|
|
+ recordDateRange.value = null;
|
|
|
+ statusValue.value = null;
|
|
|
+ recordPagination.pageNumber = 1;
|
|
|
+ loadRecordList();
|
|
|
+ };
|
|
|
const onRecordExport = async () => {
|
|
|
try {
|
|
|
const [start, end] = recordDateRange.value && recordDateRange.value.length === 2
|
|
|
@@ -1038,7 +949,23 @@
|
|
|
return { fileUrl: part, fileName, fileType };
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
+ // 检查
|
|
|
+const onReviewDept = (row)=>{
|
|
|
+ const needOverallDesc = !viewDetail.value.needOverallDesc ? 0 : 1;
|
|
|
+ const needSigneeSign = !viewDetail.value.needSigneeSign ? 0 : 1;
|
|
|
+ router.push({
|
|
|
+ name: 'areaCheckPlanManagementDeptItem',
|
|
|
+ query: {
|
|
|
+ operate: 'area-check-plan-record-add',
|
|
|
+ planId: currentId.value,
|
|
|
+ recordId: row.id,
|
|
|
+ checkType: row.checkType,
|
|
|
+ areaPlanId: row.areaPlanId,
|
|
|
+ needOverallDesc,
|
|
|
+ needSigneeSign,
|
|
|
+ },
|
|
|
+ });
|
|
|
+}
|
|
|
const onViewRecord = (row: Record<string, unknown>) => {
|
|
|
const needOverallDesc = !viewDetail.value.needOverallDesc ? 0 : 1;
|
|
|
const needSigneeSign = !viewDetail.value.needSigneeSign ? 0 : 1;
|
|
|
@@ -1054,6 +981,19 @@
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ const onDeleteRecord = async (row: Record<string, unknown>) => {
|
|
|
+ if (!row.id) return;
|
|
|
+ try {
|
|
|
+ await deleteInspectionRecords(Number(row.id));
|
|
|
+ ElMessage.success('删除成功');
|
|
|
+ loadRecordList();
|
|
|
+ } catch (e: any) {
|
|
|
+ console.error('删除检查记录失败:', e);
|
|
|
+ ElMessage.error(e?.message || e?.data || '删除失败,请稍后重试');
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
const getDetail = async () => {
|
|
|
if (!currentId.value) return;
|
|
|
try {
|