diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 9faec3f8c..0e13e51f7 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -415,6 +415,19 @@ export function mainListFinishBtn(option:any) { }) } +// 主列表-作废按钮 +export function mainListCancelBtn(option:any) { + return __defaultBtnOption(option,{ + label: t(`ts.作废`).replace('ts.', ''), + name: 'cancel', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + // 主列表-验证按钮 export function mainListValidateBtn(option:any) { return __defaultBtnOption(option,{ diff --git a/src/views/eam/equipmentRepairJobMain/index.vue b/src/views/eam/equipmentRepairJobMain/index.vue index f92a39da0..214dddcf9 100644 --- a/src/views/eam/equipmentRepairJobMain/index.vue +++ b/src/views/eam/equipmentRepairJobMain/index.vue @@ -95,6 +95,7 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data"; import * as ToolItemApi from "@/api/eam/toolAccounts"; +import {mainListCancelBtn} from "@/utils/disposition/defaultButtons"; defineOptions({ name: 'EquipmentRepairJobMain' }) @@ -188,6 +189,7 @@ const butttondata = (row) => { defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 执行 defaultButtons.mainListTransferBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 转办 defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //完成 + defaultButtons.mainListCancelBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //作废 defaultButtons.mainListValidateRepairBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 维修验证 defaultButtons.mainListValidateReportBtn({hide: isShowBaoXiuButton(row),hasPermi:'eam:equipmentRepairJobMain:update'}), // 报修验证 ] @@ -205,6 +207,8 @@ const buttonTableClick = async (val, row) => { handleExecute(row.id) } else if (val == 'finish') { // 完成 handleFinish(row) + } else if (val == 'cancel') { // 作废 + handleCancel(row.id) } else if (val == 'validate_repair') { // 维修验证 handleValidateRepair(row) } else if (val == 'validate_report') { // 报修验证 @@ -390,6 +394,27 @@ const handleReceive = async (id: number) => { } catch {} } + +/** 作废按钮操作 */ +const handleCancel = async (id: number) => { + try { + // 二次确认 + await message.delConfirm('是否作废所选中任务?'); + const params = ref({ + id: '', + status:'', + }) + params.value.id = id + params.value.status = '9' + // 发起 + await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) + message.success(t('执行成功')) + // 刷新列表 + await getList() + } catch {} +} + + /** 执行按钮操作 */ const handleExecute = async (id: number) => { try { diff --git a/src/views/eam/equipmentSpotCheckMain/SpotCheckOrderDetail.vue b/src/views/eam/equipmentSpotCheckMain/SpotCheckOrderDetail.vue index 6c175bcfc..a32c35280 100644 --- a/src/views/eam/equipmentSpotCheckMain/SpotCheckOrderDetail.vue +++ b/src/views/eam/equipmentSpotCheckMain/SpotCheckOrderDetail.vue @@ -917,7 +917,7 @@ const submitForm = async (formType, data) => { await getList() updateKey.value += 1 } finally { - formRef.value.formLoading = false + //formRef.value.formLoading = false } } diff --git a/src/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data.ts b/src/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data.ts index 076f07400..f1581ad93 100644 --- a/src/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data.ts +++ b/src/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data.ts @@ -315,9 +315,14 @@ export const EquipmentSpotCheckMain = useCrudSchemas(reactive([ isSearch: true, dictType: DICT_TYPE.FALSE_OR_TRUE, dictClass: 'string', - form: { - component: 'Radio' - }, + }, + { + label: '是否需要维修', + field: 'isRepair', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.FALSE_OR_TRUE, + dictClass: 'string', }, { label: '流程状态', diff --git a/src/views/eam/equipmentSpotCheckMain/finishForm1.vue b/src/views/eam/equipmentSpotCheckMain/finishForm1.vue index 80434c83c..da8b44232 100644 --- a/src/views/eam/equipmentSpotCheckMain/finishForm1.vue +++ b/src/views/eam/equipmentSpotCheckMain/finishForm1.vue @@ -67,6 +67,7 @@ const formData = ref({ // verifyer: '', verifyContent: '', verifyTime: '', + isRepair:"", }) const formRules = reactive({ // verifyer: [ @@ -92,6 +93,7 @@ const open = async (type: string, row?: object) => { //初始化数据 formData.value.id = row.id formData.value.number = row.planNumber + formData.value.isRepair = row.isRepair } defineExpose({ open }) // 提供 open 方法,用于打开弹窗