Some Changes
This commit is contained in:
@@ -32,13 +32,23 @@ const toast = useToast()
|
|||||||
const mode = ref(route.params.mode || "show")
|
const mode = ref(route.params.mode || "show")
|
||||||
const itemInfo = ref({
|
const itemInfo = ref({
|
||||||
name: "",
|
name: "",
|
||||||
initialPhases: []
|
initialPhases: [{label:'',icon:''}]
|
||||||
})
|
})
|
||||||
const oldItemInfo = ref({})
|
const oldItemInfo = ref({})
|
||||||
|
|
||||||
const openQuickActionModal = ref(false)
|
const openQuickActionModal = ref(false)
|
||||||
const selectedKeyForQuickAction = ref("")
|
const selectedKeyForQuickAction = ref("")
|
||||||
|
|
||||||
|
const setKeys = () => {
|
||||||
|
itemInfo.value.initialPhases = itemInfo.value.initialPhases.map(i => {
|
||||||
|
return {
|
||||||
|
...i,
|
||||||
|
key: uuidv4(),
|
||||||
|
quickactions: i.quickactions || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const setupPage = async() => {
|
const setupPage = async() => {
|
||||||
|
|
||||||
if(mode.value === "show" ){
|
if(mode.value === "show" ){
|
||||||
@@ -59,14 +69,11 @@ const setupPage = async() => {
|
|||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
|
|
||||||
const setKeys = () => {
|
|
||||||
itemInfo.value.initialPhases = itemInfo.value.initialPhases.map(i => {
|
|
||||||
return {
|
const addPhase = () => {
|
||||||
...i,
|
itemInfo.value.initialPhases.push({label: '', icon: ''}),
|
||||||
key: uuidv4(),
|
setKeys
|
||||||
quickactions: i.quickactions || []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -97,7 +104,7 @@ const setKeys = () => {
|
|||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
v-else-if="mode === 'create'"
|
v-else-if="mode === 'create'"
|
||||||
@click="dataStore.createNewItem('projecttyes', itemInfo)"
|
@click="dataStore.createNewItem('projecttypes', itemInfo)"
|
||||||
>
|
>
|
||||||
Erstellen
|
Erstellen
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -149,6 +156,7 @@ const setKeys = () => {
|
|||||||
color="rose"
|
color="rose"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
class="mb-5"
|
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."
|
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>
|
</UDivider>
|
||||||
<UButton
|
<UButton
|
||||||
class="mt-3"
|
class="mt-3"
|
||||||
@click="itemInfo.initialPhases.push({label: '', icon: ''}),
|
@click="addPhase"
|
||||||
setKeys"
|
|
||||||
>
|
>
|
||||||
+ Phase
|
+ Phase
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -175,11 +182,11 @@ const setKeys = () => {
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>Name</th>
|
<th class="text-left"><span class="ml-2">Name</span></th>
|
||||||
<th>Icon</th>
|
<th class="text-left"><span class="ml-2">Icon</span></th>
|
||||||
<th>Optional</th>
|
<th class="text-left"><span class="ml-2">Optional</span></th>
|
||||||
<th>Beschreibung</th>
|
<th class="text-left"><span class="ml-2">Beschreibung</span></th>
|
||||||
<th>Schnellaktionen</th>
|
<th class="text-left"><span class="ml-2">Schnellaktionen</span></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -203,12 +210,14 @@ const setKeys = () => {
|
|||||||
<UInput
|
<UInput
|
||||||
class="my-2 ml-2"
|
class="my-2 ml-2"
|
||||||
v-model="phase.label"
|
v-model="phase.label"
|
||||||
|
placeholder="Name"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<UInput
|
<UInput
|
||||||
class="my-2 ml-2"
|
class="my-2 ml-2"
|
||||||
v-model="phase.icon"
|
v-model="phase.icon"
|
||||||
|
placeholder="Icon"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -221,6 +230,7 @@ const setKeys = () => {
|
|||||||
<UInput
|
<UInput
|
||||||
class="my-2 ml-2"
|
class="my-2 ml-2"
|
||||||
v-model="phase.description"
|
v-model="phase.description"
|
||||||
|
placeholder="Beschreibung"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -250,6 +260,9 @@ const setKeys = () => {
|
|||||||
<UButton
|
<UButton
|
||||||
class="my-1"
|
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>
|
@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
|
<UButton
|
||||||
class="my-1"
|
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>
|
@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