diff --git a/src/views/erp/mold/components/MoldMaintainView.vue b/src/views/erp/mold/components/MoldMaintainView.vue index f82b8a28..764bf7b6 100644 --- a/src/views/erp/mold/components/MoldMaintainView.vue +++ b/src/views/erp/mold/components/MoldMaintainView.vue @@ -129,7 +129,7 @@ - - + + + + + + + + + + + {{ t('common.query') }} + + + + {{ t('common.reset') }} + + + + + + + + + + + + + + + + + +
+
+ 已选择 {{ moldDialogSelectedIds.length }} 个模具 +
+ +
+ + +
+ + + + + + + + + + + + + + + + {{ t('common.query') }} + + + + {{ t('common.reset') }} + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + diff --git a/src/views/mold/taskConfiguration/index.vue b/src/views/mold/taskConfiguration/index.vue index cc5029d7..fbbb0779 100644 --- a/src/views/mold/taskConfiguration/index.vue +++ b/src/views/mold/taskConfiguration/index.vue @@ -107,7 +107,8 @@ {{ t('EquipmentManagement.TaskManagement.createWorkOrder') }} @@ -164,7 +165,7 @@ const planPaginationRef = ref() const updatePlanTableMaxHeight = async () => { await nextTick() const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0 - const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72 + const paginationHeight = planPaginationRef.value?.$el?.getBoundingClientRect().height ?? 72 const pageBottomGap = 56 const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight))) @@ -253,6 +254,8 @@ const openForm = (type: string, row?: TaskManagementVO) => { formRef.value.open(type, row) } +const isTaskEnabled = (row: TaskManagementVO) => row.enabled === true || (row.enabled as any) === 'true' + const handleDelete = async (id?: number) => { if (!id) return try { @@ -264,11 +267,25 @@ const handleDelete = async (id?: number) => { } const ticketLoadingId = ref(undefined) -const handleCreateTicket = async (id?: number) => { - if (!id) return - ticketLoadingId.value = id +const handleCreateTicket = async (row?: TaskManagementVO) => { + if (!row?.id) return + if (!isTaskEnabled(row)) { + message.warning(t('EquipmentManagement.TaskManagement.createTicketDisabledTip')) + return + } + + try { + await message.confirm( + t('EquipmentManagement.TaskManagement.createTicketConfirm'), + t('common.reminder') + ) + } catch { + return + } + + ticketLoadingId.value = row.id try { - await TaskManagementApi.createTaskManagementTicket(id) + await TaskManagementApi.createTaskManagementTicket(row.id) message.success(t('EquipmentManagement.TaskManagement.createTicketSuccess')) } catch { message.error(t('EquipmentManagement.TaskManagement.createTicketFail'))