From 5d9b97d5ed6fc26e5aed4e6ff04af182ebf154da Mon Sep 17 00:00:00 2001 From: gaojs <757918719@qq.com> Date: Thu, 6 Jun 2024 11:59:34 +0800 Subject: [PATCH] =?UTF-8?q?EAM=20=E2=80=94=E2=80=94>=20=20=E7=BB=B4?= =?UTF-8?q?=E4=BF=AE=E5=B7=A5=E5=8D=95=20=E5=AE=8C=E6=88=90=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/equipmentMaintenanceMain/index.ts | 5 + src/api/eam/equipmentRepairJobMain/index.ts | 11 +- .../equipmentMaintenanceMain/finishForm2.vue | 9 +- .../eam/equipmentMaintenanceMain/index.vue | 2 +- .../equipmentRepairJobMain.data.ts | 3 + .../equipmentRepairJobMain/finishForm2.vue | 262 ++++++++++++++++++ .../eam/equipmentRepairJobMain/index.vue | 46 +++ 7 files changed, 333 insertions(+), 5 deletions(-) create mode 100644 src/views/eam/equipmentRepairJobMain/finishForm2.vue diff --git a/src/api/eam/equipmentMaintenanceMain/index.ts b/src/api/eam/equipmentMaintenanceMain/index.ts index 1a0396846..e257dd16a 100644 --- a/src/api/eam/equipmentMaintenanceMain/index.ts +++ b/src/api/eam/equipmentMaintenanceMain/index.ts @@ -70,6 +70,11 @@ export const updateEquipmentMaintenanceMain = async (data: EquipmentMaintenanceM return await request.put({ url: `/eam/equipment-maintenance-main/update`, data }) } +// 修改设备保养工单主 +export const updateEquipmentMaintenance = async (data: EquipmentMaintenanceMainVO) => { + return await request.post({ url: `/eam/equipment-maintenance-main/updateOrders`, data }) +} + // 删除设备保养工单主 export const deleteEquipmentMaintenanceMain = async (id: number) => { return await request.delete({ url: `/eam/equipment-maintenance-main/delete?id=` + id }) diff --git a/src/api/eam/equipmentRepairJobMain/index.ts b/src/api/eam/equipmentRepairJobMain/index.ts index 471f98905..0d83bcb3e 100644 --- a/src/api/eam/equipmentRepairJobMain/index.ts +++ b/src/api/eam/equipmentRepairJobMain/index.ts @@ -1,5 +1,4 @@ import request from '@/config/axios' -import {EquipmentReportRepairRequestVO} from "@/api/eam/equipmentReportRepairRequest"; export interface EquipmentRepairJobMainVO { id: number @@ -72,6 +71,16 @@ export const updateEquipmentRepairJobMain = async (data: EquipmentRepairJobMainV return await request.put({ url: `/eam/equipment-repair-job-main/update`, data }) } +// 修改维修工单主 +export const updateEquipmentRepairMain = async (data: EquipmentRepairJobMainVO) => { + return await request.post({ url: `/eam/equipment-repair-job-main/updateRepair`, data }) +} + +// 完成维修工单主 +export const executeEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => { + return await request.post({ url: `/eam/equipment-repair-job-main/execute`, data }) +} + // 删除维修工单主 export const deleteEquipmentRepairJobMain = async (id: number) => { return await request.delete({ url: `/eam/equipment-repair-job-main/delete?id=` + id }) diff --git a/src/views/eam/equipmentMaintenanceMain/finishForm2.vue b/src/views/eam/equipmentMaintenanceMain/finishForm2.vue index 60b73fe59..946493a41 100644 --- a/src/views/eam/equipmentMaintenanceMain/finishForm2.vue +++ b/src/views/eam/equipmentMaintenanceMain/finishForm2.vue @@ -50,6 +50,7 @@ import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain' import { SearchTable } from '@/components/SearchTable' import {ElInput} from "element-plus"; +import {updateEquipmentMaintenance} from "@/api/eam/equipmentMaintenanceMain"; defineOptions({ name: 'TeamForm' }) @@ -168,15 +169,17 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const submitForm = async (val) => { - //把success函数传递到父页面 - emit('success',formData.value.id) + // 校验表单 if (!basicFormRef) return const valid = await basicFormRef.value.validate() if (!valid) return //发送数据 - await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value) + await EquipmentMaintenanceMainApi.updateEquipmentMaintenance(formData.value); + + //把success函数传递到父页面 + emit('success',formData.value.id) dialogVisible.value = false } diff --git a/src/views/eam/equipmentMaintenanceMain/index.vue b/src/views/eam/equipmentMaintenanceMain/index.vue index e4219bc6d..d9f106904 100644 --- a/src/views/eam/equipmentMaintenanceMain/index.vue +++ b/src/views/eam/equipmentMaintenanceMain/index.vue @@ -547,7 +547,7 @@ const getData2=(val)=> { params.value.status = '5' // 发起 await EquipmentMaintenanceMainApi.executeMaintenanceOrder(params.value) - message.success(t('工单已完成')) + //message.success(t('工单已完成')) // 刷新列表 await getList() }) diff --git a/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts b/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts index 4be0eadb5..2b9c97950 100644 --- a/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts +++ b/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts @@ -245,6 +245,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isTable: false, + isForm: false, + isDetail:false, search: { component: 'DatePicker', componentProps: { diff --git a/src/views/eam/equipmentRepairJobMain/finishForm2.vue b/src/views/eam/equipmentRepairJobMain/finishForm2.vue new file mode 100644 index 000000000..9228d1980 --- /dev/null +++ b/src/views/eam/equipmentRepairJobMain/finishForm2.vue @@ -0,0 +1,262 @@ + + + + diff --git a/src/views/eam/equipmentRepairJobMain/index.vue b/src/views/eam/equipmentRepairJobMain/index.vue index 2d5d60699..dbfbfb27e 100644 --- a/src/views/eam/equipmentRepairJobMain/index.vue +++ b/src/views/eam/equipmentRepairJobMain/index.vue @@ -50,6 +50,8 @@ :isBusiness="false" /> + + { handleReceive(row.id) } else if (val == 'execute') { // 执行 handleExecute(row.id) + } else if (val == 'finish') { // 完成 + handleFinish(row) } @@ -220,6 +230,16 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentRepairJobMain') } +/** 完成按钮操作 */ +const finishForm2Ref = ref() +const handleFinish = async (row) => { + // 二次确认 + await message.delConfirm('是否完成所选中工单?'); + + //打开提交表单 + finishForm2Ref.value.open('update', row); +} + /** 接单按钮操作 */ const handleReceive = async (id: number) => { try { @@ -271,6 +291,32 @@ const handleDelete = async (id: number) => { } catch {} } + + +//finishForm2 关闭按钮回传 +const getClosed2=(val)=> { + nextTick?.(() => { + getList() + }) +} + +//finishForm2 提交按钮回传 +const getData2=(val)=> { + nextTick?.(async () => { + const params = ref({ + id: '', + status: '', + }) + params.value.id = val + params.value.status = '5' + // 发起 + await EquipmentRepairJobMainApi.executeEquipmentRepairJobMain(params.value) + message.success(t('工单已完成')) + // 刷新列表 + await getList() + }) +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => {