From 37788272e49a964071db00e59592e822c7a00b88 Mon Sep 17 00:00:00 2001 From: gaojs <757918719@qq.com> Date: Fri, 7 Jun 2024 17:32:32 +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=E5=AE=8C=E6=88=90=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/equipmentRepairJobMain/index.ts | 7 +++- .../eam/equipmentRepairJobMain/index.vue | 33 +++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/api/eam/equipmentRepairJobMain/index.ts b/src/api/eam/equipmentRepairJobMain/index.ts index 0d19f793a..ed01ac342 100644 --- a/src/api/eam/equipmentRepairJobMain/index.ts +++ b/src/api/eam/equipmentRepairJobMain/index.ts @@ -104,8 +104,13 @@ export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data }) } -//验证不通过,打回维修工单 +//维修验证不通过,打回维修工单 export const backEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => { return await request.post({ url: `/eam/equipment-repair-job-main/fallback`, data }) } +//报修验证不通过,生成新工单 +export const createEquipmentRepairNewOrder = async (data: EquipmentRepairJobMainVO) => { + return await request.post({ url: `/eam/equipment-repair-job-main/createNew`, data }) +} + diff --git a/src/views/eam/equipmentRepairJobMain/index.vue b/src/views/eam/equipmentRepairJobMain/index.vue index 4360f477d..0fd5b724c 100644 --- a/src/views/eam/equipmentRepairJobMain/index.vue +++ b/src/views/eam/equipmentRepairJobMain/index.vue @@ -88,6 +88,7 @@ import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail. import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue' import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue' import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue' +import {createEquipmentRepairNewOrder} from "@/api/eam/equipmentRepairJobMain"; defineOptions({ name: 'EquipmentRepairJobMain' }) @@ -267,20 +268,26 @@ const finishForm3Ref = ref() const handleValidateReport = async (row) => { await message.delConfirm('是否验证所选中工单?'); message.confirmPassword(t('')).then(async () => { - // 二次确认 - //打开提交表单 - finishForm3Ref.value.open('update', row); + const params = ref({id: '', status:''}) + params.value.id = row.id + params.value.status = '8' + //完结流转 + await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value) + message.success(t('工单已结束')) + // 刷新列表 + await getList() + }).catch (async (action: Action) => { - if(action === 'cancel'){ - const params = ref({id: '', status:''}) - params.value.id = row.id - params.value.status = '5' - //生成新工单 - await EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value) - message.success(t('工单已打回')) - // 刷新列表 - await getList() - } + if(action === 'cancel'){ + const params = ref({id: '', number:''}) + params.value.id = row.id + params.value.number = row.number + //生成新工单 + await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value) + message.success(t('工单已结束')) + // 刷新列表 + await getList() + } }) }