From 660fd34238e170ccac71f3deeda30cd74ac0121d Mon Sep 17 00:00:00 2001 From: tcy <1193318383@qq.com> Date: Sun, 14 Sep 2025 16:04:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=AE=89=E5=85=A8=E5=B7=A1=E6=A3=80):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E5=8D=95=E5=A4=8D=E6=9F=A5=E5=92=8C?= =?UTF-8?q?=E6=95=B4=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加安全巡检工单复查和整改的API接口 - 在工单列表页添加复查和整改按钮 - 实现复查和整改的对话框表单及提交逻辑 --- src/api/safety/safetyInspection/index.ts | 23 ++++++ src/views/safety/safetyInspection/index.vue | 80 ++++++++++++++++++++- 2 files changed, 101 insertions(+), 2 deletions(-) diff --git a/src/api/safety/safetyInspection/index.ts b/src/api/safety/safetyInspection/index.ts index cd9076c..8fc0707 100644 --- a/src/api/safety/safetyInspection/index.ts +++ b/src/api/safety/safetyInspection/index.ts @@ -61,3 +61,26 @@ export const delSafetyInspection = (id: string | number | Array method: 'delete' }); }; +/** + * + * 新增安全巡检工单复查 + * @param data + */ +export const addSafetyInspectionReview = (data: any) => { + return request({ + url: '/safety/safetyInspection/review', + method: 'post', + data: data + }); +} +/** + * 新增安全巡检工单整改 + * @param data + */ +export const addSafetyInspectionRectification = (data: any) => { + return request({ + url: '/safety/safetyInspection/rectification', + method: 'post', + data: data + }); +} diff --git a/src/views/safety/safetyInspection/index.vue b/src/views/safety/safetyInspection/index.vue index a061c75..8a00977 100644 --- a/src/views/safety/safetyInspection/index.vue +++ b/src/views/safety/safetyInspection/index.vue @@ -104,6 +104,14 @@ v-hasPermi="['safety:safetyInspection:query']"> 详情 + + 整改 + + + 复查 + @@ -195,6 +203,29 @@ + + + + + + + + + + + + + + + + + + 确 定 + + + @@ -204,7 +235,9 @@ import { delSafetyInspection, getSafetyInspection, listSafetyInspection, - updateSafetyInspection + updateSafetyInspection, + addSafetyInspectionReview, + addSafetyInspectionRectification, } from '@/api/safety/safetyInspection'; import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from '@/api/safety/safetyInspection/types'; import { useUserStoreHook } from '@/store/modules/user'; @@ -242,7 +275,14 @@ const dialog = reactive({ visible: false, title: '' }); - +const handleForm = ref({ + id: undefined, + measure: undefined, + rectificationFile: undefined, + review: undefined, + reviewType: undefined, + remark: undefined, +}) const initFormData: SafetyInspectionForm = { id: undefined, pid: undefined, @@ -310,6 +350,10 @@ const { queryParams, form, rules } = toRefs(data); const teamOpt = ref([]); const foremanOpt = ref([]); const teamList = ref(); +const handleType = ref("") + + + /** 查询安全巡检工单列表 */ const getList = async () => { loading.value = true; @@ -335,16 +379,48 @@ const changeForeman = (value: string | number) => { })); form.value.correctorId = ''; }; +/** 处理安全巡查工单 */ +const handleSubmit = async () => { + let flag = false; + if (handleType.value == "rectification") { + const { code } = await addSafetyInspectionRectification(handleForm.value) + if (code == 200) flag = true + } else { + const { code } = await addSafetyInspectionReview(handleForm.value) + if (code == 200) flag = true + } + if (flag) { + ElMessage.success("处理成功") + handleDialogVisible.value = false; + getList() + reset() + } else { + ElMessage.error("处理失败") + } + +} + /** 展开安全巡检工单详情对话框操作 */ const currentSafetyInspectionId = ref(); const showDetailDialog = ref(false); +const handleDialogVisible = ref(false); const handleShowDialog = (row?: SafetyInspectionVO) => { currentSafetyInspectionId.value = row.id; showDetailDialog.value = true; }; +/**打开整改/复查对话框操作*/ +const handleDialog = (row?: SafetyInspectionVO) => { + if (row.status == '1') { + handleType.value = "rectification" + } else { + handleType.value = "review" + } + handleForm.value.id = row.id; + handleDialogVisible.value = true; +}; /** 取消按钮 */ const cancel = () => { reset();