Mager updated

This commit is contained in:
Simon Pocrnjič
2025-09-27 17:45:55 +02:00
parent d17e34941b
commit 7227c888d4
74 changed files with 6339 additions and 342 deletions
@@ -1,7 +1,7 @@
<script setup>
import ActionMessage from '@/Components/ActionMessage.vue';
import BasicButton from '@/Components/buttons/BasicButton.vue';
import Drawer from '@/Components/Drawer.vue';
import DialogModal from '@/Components/DialogModal.vue';
import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue';
import SectionTitle from '@/Components/SectionTitle.vue';
@@ -87,7 +87,7 @@ const store = () => {
</script>
<template>
<Drawer
<DialogModal
:show="show"
@close="close"
>
@@ -161,5 +161,5 @@ const store = () => {
</div>
</form>
</template>
</Drawer>
</DialogModal>
</template>
@@ -1,6 +1,6 @@
<script setup>
import ActionMessage from '@/Components/ActionMessage.vue';
import Drawer from '@/Components/Drawer.vue';
import DialogModal from '@/Components/DialogModal.vue';
import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue';
import SectionTitle from '@/Components/SectionTitle.vue';
@@ -48,7 +48,7 @@ const storeContract = () => {
</script>
<template>
<Drawer
<DialogModal
:show="show"
@close="close"
>
@@ -97,6 +97,6 @@ const storeContract = () => {
</div>
</form>
</template>
</Drawer>
</DialogModal>
</template>
+52 -1
View File
@@ -8,6 +8,11 @@ import ContractDrawer from "./Partials/ContractDrawer.vue";
import ContractTable from "./Partials/ContractTable.vue";
import ActivityDrawer from "./Partials/ActivityDrawer.vue";
import ActivityTable from "./Partials/ActivityTable.vue";
import DocumentsTable from "@/Components/DocumentsTable.vue";
import DocumentUploadDialog from "@/Components/DocumentUploadDialog.vue";
import DocumentViewerDialog from "@/Components/DocumentViewerDialog.vue";
import { classifyDocument } from "@/Services/documents";
import { router } from '@inertiajs/vue3';
import { AngleDownIcon, AngleUpIcon } from "@/Utilities/Icons";
import Pagination from "@/Components/Pagination.vue";
@@ -18,9 +23,32 @@ const props = defineProps({
activities: Object,
contract_types: Array,
actions: Array,
types: Object
types: Object,
documents: Array
});
const showUpload = ref(false);
const openUpload = () => { showUpload.value = true; };
const closeUpload = () => { showUpload.value = false; };
const onUploaded = () => {
// Refresh page data to include the new document
router.reload({ only: ['documents'] });
};
const viewer = ref({ open: false, src: '', title: '' });
const openViewer = (doc) => {
const kind = classifyDocument(doc)
if (kind === 'preview') {
const url = route('clientCase.document.view', { client_case: props.client_case.uuid, document: doc.uuid })
viewer.value = { open: true, src: url, title: doc.original_name || doc.name };
} else {
const url = route('clientCase.document.download', { client_case: props.client_case.uuid, document: doc.uuid })
// immediate download: navigate to URL
window.location.href = url
}
};
const closeViewer = () => { viewer.value.open = false; viewer.value.src = ''; };
const clientDetails = ref(true);
//Drawer add new contract
@@ -131,6 +159,29 @@ const hideClietnDetails = () => {
</div>
</div>
</div>
<!-- Documents section -->
<div class="pt-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg border-l-4">
<div class="mx-auto max-w-4x1">
<div class="flex justify-between p-4">
<SectionTitle>
<template #title>Dokumenti</template>
</SectionTitle>
<FwbButton @click="openUpload">Dodaj</FwbButton>
</div>
<DocumentsTable :documents="documents" @view="openViewer" />
</div>
</div>
</div>
</div>
<DocumentUploadDialog
:show="showUpload"
@close="closeUpload"
@uploaded="onUploaded"
:post-url="route('clientCase.document.store', client_case)"
/>
<DocumentViewerDialog :show="viewer.open" :src="viewer.src" :title="viewer.title" @close="closeViewer" />
<div class="pt-12 pb-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg border-l-4">