Added Link Button to Createddocuments when linked document is Present
This commit is contained in:
@@ -13,12 +13,13 @@ const modal = useModal()
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
|
||||||
const itemInfo = ref({})
|
const itemInfo = ref({})
|
||||||
const linkedDocument =ref({})
|
const linkedDocument =ref({})
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
if(route.params) {
|
if(route.params) {
|
||||||
if(route.params.id) itemInfo.value = await useEntities("createddocuments").selectSingle(route.params.id,"*, files(*)")
|
if(route.params.id) itemInfo.value = await useEntities("createddocuments").selectSingle(route.params.id,"*, files(*), linkedDocument(*)")
|
||||||
|
|
||||||
console.log(itemInfo.value)
|
console.log(itemInfo.value)
|
||||||
|
|
||||||
@@ -95,6 +96,14 @@ const openEmail = () => {
|
|||||||
>
|
>
|
||||||
Kunde
|
Kunde
|
||||||
</UButton>
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
v-if="itemInfo.linkedDocument"
|
||||||
|
@click="router.push(`/standardEntity/createDocument/show/${itemInfo.linkedDocument}`)"
|
||||||
|
icon="i-heroicons-link"
|
||||||
|
variant="outline"
|
||||||
|
>
|
||||||
|
{{dataStore.documentTypesForCreation[itemInfo.linkedDocument.type].labelSingle}} - {{itemInfo.linkedDocument.documentNumber}}
|
||||||
|
</UButton>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</UDashboardToolbar>
|
</UDashboardToolbar>
|
||||||
|
|||||||
Reference in New Issue
Block a user