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();