Some Changes
This commit is contained in:
@@ -32,13 +32,23 @@ const toast = useToast()
|
||||
const mode = ref(route.params.mode || "show")
|
||||
const itemInfo = ref({
|
||||
name: "",
|
||||
initialPhases: []
|
||||
initialPhases: [{label:'',icon:''}]
|
||||
})
|
||||
const oldItemInfo = ref({})
|
||||
|
||||
const openQuickActionModal = ref(false)
|
||||
const selectedKeyForQuickAction = ref("")
|
||||
|
||||
const setKeys = () => {
|
||||
itemInfo.value.initialPhases = itemInfo.value.initialPhases.map(i => {
|
||||
return {
|
||||
...i,
|
||||
key: uuidv4(),
|
||||
quickactions: i.quickactions || []
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const setupPage = async() => {
|
||||
|
||||
if(mode.value === "show" ){
|
||||
@@ -59,14 +69,11 @@ const setupPage = async() => {
|
||||
|
||||
setupPage()
|
||||
|
||||
const setKeys = () => {
|
||||
itemInfo.value.initialPhases = itemInfo.value.initialPhases.map(i => {
|
||||
return {
|
||||
...i,
|
||||
key: uuidv4(),
|
||||
quickactions: i.quickactions || []
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const addPhase = () => {
|
||||
itemInfo.value.initialPhases.push({label: '', icon: ''}),
|
||||
setKeys
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -97,7 +104,7 @@ const setKeys = () => {
|
||||
</UButton>
|
||||
<UButton
|
||||
v-else-if="mode === 'create'"
|
||||
@click="dataStore.createNewItem('projecttyes', itemInfo)"
|
||||
@click="dataStore.createNewItem('projecttypes', itemInfo)"
|
||||
>
|
||||
Erstellen
|
||||
</UButton>
|
||||
@@ -149,6 +156,7 @@ const setKeys = () => {
|
||||
color="rose"
|
||||
variant="outline"
|
||||
class="mb-5"
|
||||
v-if="mode === 'edit'"
|
||||
description="Achtung Änderungen an diesem Projekttypen betreffen nur Projekte die damit neu erstellt werden. Bestehende Projekte bleiben unverändert."
|
||||
/>
|
||||
|
||||
@@ -165,8 +173,7 @@ const setKeys = () => {
|
||||
</UDivider>
|
||||
<UButton
|
||||
class="mt-3"
|
||||
@click="itemInfo.initialPhases.push({label: '', icon: ''}),
|
||||
setKeys"
|
||||
@click="addPhase"
|
||||
>
|
||||
+ Phase
|
||||
</UButton>
|
||||
@@ -175,11 +182,11 @@ const setKeys = () => {
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Icon</th>
|
||||
<th>Optional</th>
|
||||
<th>Beschreibung</th>
|
||||
<th>Schnellaktionen</th>
|
||||
<th class="text-left"><span class="ml-2">Name</span></th>
|
||||
<th class="text-left"><span class="ml-2">Icon</span></th>
|
||||
<th class="text-left"><span class="ml-2">Optional</span></th>
|
||||
<th class="text-left"><span class="ml-2">Beschreibung</span></th>
|
||||
<th class="text-left"><span class="ml-2">Schnellaktionen</span></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -203,12 +210,14 @@ const setKeys = () => {
|
||||
<UInput
|
||||
class="my-2 ml-2"
|
||||
v-model="phase.label"
|
||||
placeholder="Name"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<UInput
|
||||
class="my-2 ml-2"
|
||||
v-model="phase.icon"
|
||||
placeholder="Icon"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
@@ -221,6 +230,7 @@ const setKeys = () => {
|
||||
<UInput
|
||||
class="my-2 ml-2"
|
||||
v-model="phase.description"
|
||||
placeholder="Beschreibung"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
@@ -250,6 +260,9 @@ const setKeys = () => {
|
||||
<UButton
|
||||
class="my-1"
|
||||
@click="itemInfo.initialPhases[itemInfo.initialPhases.findIndex(i=> i.key === selectedKeyForQuickAction)].quickactions.push({label:'+ Angebot',link:'/createDocument/edit/?type=quotes'})">Angebot Erstellen</UButton>
|
||||
<UButton
|
||||
class="my-1"
|
||||
@click="itemInfo.initialPhases[itemInfo.initialPhases.findIndex(i=> i.key === selectedKeyForQuickAction)].quickactions.push({label:'+ Auftrag',link:'/createDocument/edit/?type=confirmationOrders'})">Auftrag Erstellen</UButton>
|
||||
<UButton
|
||||
class="my-1"
|
||||
@click="itemInfo.initialPhases[itemInfo.initialPhases.findIndex(i=> i.key === selectedKeyForQuickAction)].quickactions.push({label:'+ Lieferschein',link:'/createDocument/edit/?type=deliveryNotes'})">Lieferschein Erstellen</UButton>
|
||||
|
||||
Reference in New Issue
Block a user