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() + } }) }