Changes to documents able to edit them now, also support for auto mail attechemnts
This commit is contained in:
@@ -9,6 +9,7 @@ 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 DocumentEditDialog from "@/Components/DocumentEditDialog.vue";
|
||||
import DocumentUploadDialog from "@/Components/DocumentUploadDialog.vue";
|
||||
import DocumentViewerDialog from "@/Components/DocumentViewerDialog.vue";
|
||||
import { classifyDocument } from "@/Services/documents";
|
||||
@@ -46,6 +47,21 @@ const onUploaded = () => {
|
||||
router.reload({ only: ["documents"] });
|
||||
};
|
||||
|
||||
// Document edit dialog state
|
||||
const showDocEdit = ref(false)
|
||||
const editingDoc = ref(null)
|
||||
const openDocEdit = (doc) => {
|
||||
editingDoc.value = doc
|
||||
showDocEdit.value = true
|
||||
}
|
||||
const closeDocEdit = () => {
|
||||
showDocEdit.value = false
|
||||
editingDoc.value = null
|
||||
}
|
||||
const onDocSaved = () => {
|
||||
router.reload({ only: ['documents'] })
|
||||
}
|
||||
|
||||
const viewer = ref({ open: false, src: "", title: "" });
|
||||
const openViewer = (doc) => {
|
||||
const kind = classifyDocument(doc);
|
||||
@@ -337,6 +353,7 @@ const submitAttachSegment = () => {
|
||||
<DocumentsTable
|
||||
:documents="documents"
|
||||
@view="openViewer"
|
||||
@edit="openDocEdit"
|
||||
:download-url-builder="
|
||||
(doc) => {
|
||||
const isContractDoc = (doc?.documentable_type || '')
|
||||
@@ -365,6 +382,14 @@ const submitAttachSegment = () => {
|
||||
:post-url="route('clientCase.document.store', client_case)"
|
||||
:contracts="contracts"
|
||||
/>
|
||||
<DocumentEditDialog
|
||||
:show="showDocEdit"
|
||||
:client_case_uuid="client_case.uuid"
|
||||
:document="editingDoc"
|
||||
:contracts="contracts"
|
||||
@close="closeDocEdit"
|
||||
@saved="onDocSaved"
|
||||
/>
|
||||
<DocumentViewerDialog
|
||||
:show="viewer.open"
|
||||
:src="viewer.src"
|
||||
@@ -386,6 +411,8 @@ const submitAttachSegment = () => {
|
||||
:client_case="client_case"
|
||||
:actions="actions"
|
||||
:contract-uuid="activityContractUuid"
|
||||
:documents="documents"
|
||||
:contracts="contracts"
|
||||
/>
|
||||
<ConfirmDialog
|
||||
:show="confirmDelete.show"
|
||||
|
||||
Reference in New Issue
Block a user