2. Zwischenstand
This commit is contained in:
@@ -460,34 +460,34 @@ onMounted(async () => {
|
||||
v-else-if="filteredTasks.length"
|
||||
:data="filteredTasks"
|
||||
:columns="normalizedListColumns"
|
||||
@select="(task) => openTaskViaRoute(task)"
|
||||
:on-select="(task) => openTaskViaRoute(task)"
|
||||
>
|
||||
<template #actions-data="{ row }">
|
||||
<template #actions-cell="{ row }">
|
||||
<UButton
|
||||
v-if="normalizeStatus(row.categorie) !== 'Abgeschlossen' && canCreate"
|
||||
v-if="normalizeStatus(row.original.categorie) !== 'Abgeschlossen' && canCreate"
|
||||
size="xs"
|
||||
variant="soft"
|
||||
icon="i-heroicons-check"
|
||||
:loading="quickCompleteLoadingId === row.id"
|
||||
@click.stop="completeTaskQuick(row)"
|
||||
:loading="quickCompleteLoadingId === row.original.id"
|
||||
@click.stop="completeTaskQuick(row.original)"
|
||||
>
|
||||
Erledigt
|
||||
</UButton>
|
||||
</template>
|
||||
<template #categorie-data="{ row }">
|
||||
<UBadge variant="soft">{{ normalizeStatus(row.categorie) }}</UBadge>
|
||||
<template #categorie-cell="{ row }">
|
||||
<UBadge variant="soft">{{ normalizeStatus(row.original.categorie) }}</UBadge>
|
||||
</template>
|
||||
<template #assignee-data="{ row }">
|
||||
{{ getAssigneeLabel(row) }}
|
||||
<template #assignee-cell="{ row }">
|
||||
{{ getAssigneeLabel(row.original) }}
|
||||
</template>
|
||||
<template #project-data="{ row }">
|
||||
{{ getEntityLabel(projectOptions, row.project?.id || row.project) || "-" }}
|
||||
<template #project-cell="{ row }">
|
||||
{{ getEntityLabel(projectOptions, row.original.project?.id || row.original.project) || "-" }}
|
||||
</template>
|
||||
<template #customer-data="{ row }">
|
||||
{{ getEntityLabel(customerOptions, row.customer?.id || row.customer) || "-" }}
|
||||
<template #customer-cell="{ row }">
|
||||
{{ getEntityLabel(customerOptions, row.original.customer?.id || row.original.customer) || "-" }}
|
||||
</template>
|
||||
<template #plant-data="{ row }">
|
||||
{{ getEntityLabel(plantOptions, row.plant?.id || row.plant) || "-" }}
|
||||
<template #plant-cell="{ row }">
|
||||
{{ getEntityLabel(plantOptions, row.original.plant?.id || row.original.plant) || "-" }}
|
||||
</template>
|
||||
</UTable>
|
||||
<UAlert
|
||||
@@ -499,13 +499,14 @@ onMounted(async () => {
|
||||
</UDashboardPanelContent>
|
||||
|
||||
<UModal v-model:open="isModalOpen" :prevent-close="saving || deleting">
|
||||
<UCard>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="font-semibold">{{ modalTitle }}</h3>
|
||||
<UBadge variant="subtle">{{ taskForm.id ? `#${taskForm.id}` : "Neu" }}</UBadge>
|
||||
</div>
|
||||
</template>
|
||||
<template #content>
|
||||
<UCard>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="font-semibold">{{ modalTitle }}</h3>
|
||||
<UBadge variant="subtle">{{ taskForm.id ? `#${taskForm.id}` : "Neu" }}</UBadge>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
@@ -519,105 +520,106 @@ onMounted(async () => {
|
||||
|
||||
<USelectMenu
|
||||
v-model="taskForm.categorie"
|
||||
:options="STATUS_COLUMNS.map((status) => ({ label: status, value: status }))"
|
||||
value-attribute="value"
|
||||
option-attribute="label"
|
||||
:items="STATUS_COLUMNS.map((status) => ({ label: status, value: status }))"
|
||||
value-key="value"
|
||||
label-key="label"
|
||||
:disabled="isFormReadonly || !canCreate"
|
||||
>
|
||||
<template #label>
|
||||
<template #default>
|
||||
{{ taskForm.categorie || "Status auswählen" }}
|
||||
</template>
|
||||
</USelectMenu>
|
||||
|
||||
<USelectMenu
|
||||
v-model="taskForm.userId"
|
||||
:options="assigneeOptions"
|
||||
value-attribute="value"
|
||||
option-attribute="label"
|
||||
:items="assigneeOptions"
|
||||
value-key="value"
|
||||
label-key="label"
|
||||
:disabled="isFormReadonly || !canCreate"
|
||||
searchable
|
||||
>
|
||||
<template #label>
|
||||
<template #default>
|
||||
{{ assigneeOptions.find((option) => option.value === taskForm.userId)?.label || "Zuweisung" }}
|
||||
</template>
|
||||
</USelectMenu>
|
||||
|
||||
<USelectMenu
|
||||
v-model="taskForm.project"
|
||||
:options="projectOptions"
|
||||
value-attribute="value"
|
||||
option-attribute="label"
|
||||
:items="projectOptions"
|
||||
value-key="value"
|
||||
label-key="label"
|
||||
:disabled="isFormReadonly || !canCreate"
|
||||
searchable
|
||||
clear-search-on-close
|
||||
>
|
||||
<template #label>
|
||||
<template #default>
|
||||
{{ getEntityLabel(projectOptions, taskForm.project) || "Projekt" }}
|
||||
</template>
|
||||
</USelectMenu>
|
||||
|
||||
<USelectMenu
|
||||
v-model="taskForm.customer"
|
||||
:options="customerOptions"
|
||||
value-attribute="value"
|
||||
option-attribute="label"
|
||||
:items="customerOptions"
|
||||
value-key="value"
|
||||
label-key="label"
|
||||
:disabled="isFormReadonly || !canCreate"
|
||||
searchable
|
||||
clear-search-on-close
|
||||
>
|
||||
<template #label>
|
||||
<template #default>
|
||||
{{ getEntityLabel(customerOptions, taskForm.customer) || "Kunde" }}
|
||||
</template>
|
||||
</USelectMenu>
|
||||
|
||||
<USelectMenu
|
||||
v-model="taskForm.plant"
|
||||
:options="plantOptions"
|
||||
value-attribute="value"
|
||||
option-attribute="label"
|
||||
:items="plantOptions"
|
||||
value-key="value"
|
||||
label-key="label"
|
||||
:disabled="isFormReadonly || !canCreate"
|
||||
searchable
|
||||
clear-search-on-close
|
||||
>
|
||||
<template #label>
|
||||
<template #default>
|
||||
{{ getEntityLabel(plantOptions, taskForm.plant) || "Objekt" }}
|
||||
</template>
|
||||
</USelectMenu>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<div class="flex gap-2">
|
||||
<UButton
|
||||
v-if="taskForm.id && canCreate"
|
||||
variant="soft"
|
||||
:loading="deleting"
|
||||
@click="archiveTask"
|
||||
>
|
||||
Archivieren
|
||||
</UButton>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<div class="flex gap-2">
|
||||
<UButton
|
||||
v-if="taskForm.id && canCreate"
|
||||
variant="soft"
|
||||
:loading="deleting"
|
||||
@click="archiveTask"
|
||||
>
|
||||
Archivieren
|
||||
</UButton>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2">
|
||||
<UButton variant="ghost" @click="closeModal">Schließen</UButton>
|
||||
<UButton
|
||||
v-if="modalMode === 'show' && canCreate"
|
||||
variant="soft"
|
||||
@click="modalMode = 'edit'"
|
||||
>
|
||||
Bearbeiten
|
||||
</UButton>
|
||||
<UButton
|
||||
v-if="modalMode !== 'show' && canCreate"
|
||||
:loading="saving"
|
||||
@click="saveTask"
|
||||
>
|
||||
Speichern
|
||||
</UButton>
|
||||
<div class="flex gap-2">
|
||||
<UButton variant="ghost" @click="closeModal">Schließen</UButton>
|
||||
<UButton
|
||||
v-if="modalMode === 'show' && canCreate"
|
||||
variant="soft"
|
||||
@click="modalMode = 'edit'"
|
||||
>
|
||||
Bearbeiten
|
||||
</UButton>
|
||||
<UButton
|
||||
v-if="modalMode !== 'show' && canCreate"
|
||||
:loading="saving"
|
||||
@click="saveTask"
|
||||
>
|
||||
Speichern
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</UCard>
|
||||
</template>
|
||||
</UCard>
|
||||
</template>
|
||||
</UModal>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user