feat: implement media download functionality and enhance case handling in reports
This commit is contained in:
@@ -11,6 +11,7 @@ import ReportSectionCard from '../../../components/dashboard/cases/ReportSection
|
||||
import FileUploadBox from '../../../components/dashboard/fastRequest/FileUploadBox.vue';
|
||||
import { modalityTitle } from '../../../data/fastRequestOptions';
|
||||
import { convertEnglishToPersian } from '../../../utils/numberUtils';
|
||||
import { downloadFiles } from '../../../utils/fileUtils';
|
||||
|
||||
const props = defineProps({
|
||||
case: {
|
||||
@@ -73,10 +74,6 @@ onMounted(() => {
|
||||
|
||||
onUnmounted(() => clearInterval(timerId));
|
||||
|
||||
const openFiles = (files) => {
|
||||
files.forEach((file) => window.open(file.url, '_blank'));
|
||||
};
|
||||
|
||||
const reportForm = useForm({
|
||||
document_id: props.case.id,
|
||||
technique: props.case.report?.technique || '',
|
||||
@@ -149,9 +146,9 @@ const submitReject = () => {
|
||||
<p class="font-normal text-[#3E4C63] whitespace-pre-line">{{ props.case.note || 'توضیحی ثبت نشده است.' }}</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 flex-wrap pt-2 border-t border-[#EBEBEB]">
|
||||
<UiButton label="دانلود فایل درخواست" severity="secondary" size="small" :disabled="!props.case.primary_files.length" @click="openFiles(props.case.primary_files)" />
|
||||
<UiButton label="دانلود سوابق پزشکی قبلی" severity="secondary" size="small" :disabled="!props.case.history_files.length" @click="openFiles(props.case.history_files)" />
|
||||
<UiButton v-if="!canReport && props.case.report" label="دانلود فایل گزارش" severity="secondary" size="small" :disabled="!props.case.report.attachments.length" @click="openFiles(props.case.report.attachments)" />
|
||||
<UiButton label="دانلود فایل درخواست" severity="secondary" size="small" :disabled="!props.case.primary_files.length" @click="downloadFiles(props.case.primary_files)" />
|
||||
<UiButton label="دانلود سوابق پزشکی قبلی" severity="secondary" size="small" :disabled="!props.case.history_files.length" @click="downloadFiles(props.case.history_files)" />
|
||||
<UiButton v-if="!canReport && props.case.report" label="دانلود فایل گزارش" severity="secondary" size="small" :disabled="!props.case.report.attachments.length" @click="downloadFiles(props.case.report.attachments)" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ const openInvoice = (invoice) => {
|
||||
<UiButton
|
||||
v-if="data.status === 'در انتظار پرداخت'"
|
||||
label="پرداخت"
|
||||
icon="fi fi-rr-credit-card"
|
||||
severity="success"
|
||||
size="small"
|
||||
@click="openInvoice(data)"
|
||||
|
||||
@@ -2,41 +2,69 @@
|
||||
import ClientLayout from '../../../layouts/ClientLayout.vue';
|
||||
import TableGeneric from '../../../components/ui/TableGeneric.vue';
|
||||
import UiCard from '../../../components/ui/UiCard.vue';
|
||||
import UiButton from '../../../components/ui/UiButton.vue';
|
||||
import EyeSvg from '../../../components/svg/eye.svg';
|
||||
import { Link } from '@inertiajs/inertia-vue3';
|
||||
import { Inertia } from '@inertiajs/inertia';
|
||||
import { reportColumns } from '../../../data/reportsTableColumns';
|
||||
import { caseColumns } from '../../../data/casesTableColumns';
|
||||
|
||||
defineProps({
|
||||
reports: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
pendingCases: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ClientLayout>
|
||||
<UiCard title="گزارشات" variant="default">
|
||||
<TableGeneric
|
||||
class="bg-white !rounded-2xl"
|
||||
:data="reports.data"
|
||||
customStyle="!text-[11px] !font-normal"
|
||||
:searchable="false"
|
||||
:columns="reportColumns"
|
||||
:selectable="false"
|
||||
:pagination="reports.meta"
|
||||
:model-value="[]"
|
||||
>
|
||||
<template #column-actions="{ data }">
|
||||
<div class="flex items-center justify-end">
|
||||
<Link :href="`/dashboard/cases/${data.document?.id}`"
|
||||
class="text-primary-500 bg-complement-100 flex items-center justify-end p-1.5 rounded-md"
|
||||
>
|
||||
<EyeSvg class="w-4 h-4 text-primary-500" />
|
||||
</Link>
|
||||
</div>
|
||||
</template>
|
||||
</TableGeneric>
|
||||
</UiCard>
|
||||
<div class="flex flex-col gap-4">
|
||||
<UiCard v-if="pendingCases" title="پروندههای در انتظار گزارش" variant="default">
|
||||
<TableGeneric
|
||||
class="bg-white !rounded-2xl"
|
||||
:data="pendingCases.data"
|
||||
customStyle="!text-[11px] !font-normal"
|
||||
:searchable="false"
|
||||
:columns="caseColumns"
|
||||
:selectable="false"
|
||||
:pagination="null"
|
||||
:model-value="[]"
|
||||
>
|
||||
<template #column-actions="{ data }">
|
||||
<div class="flex items-center justify-end">
|
||||
<UiButton label="ثبت گزارش" severity="success" size="small" @click="Inertia.visit(`/dashboard/cases/${data.id}`)" />
|
||||
</div>
|
||||
</template>
|
||||
</TableGeneric>
|
||||
</UiCard>
|
||||
|
||||
<UiCard title="گزارشات" variant="default">
|
||||
<TableGeneric
|
||||
class="bg-white !rounded-2xl"
|
||||
:data="reports.data"
|
||||
customStyle="!text-[11px] !font-normal"
|
||||
:searchable="false"
|
||||
:columns="reportColumns"
|
||||
:selectable="false"
|
||||
:pagination="reports.meta"
|
||||
:model-value="[]"
|
||||
>
|
||||
<template #column-actions="{ data }">
|
||||
<div class="flex items-center justify-end">
|
||||
<Link :href="`/dashboard/cases/${data.document?.id}`"
|
||||
class="text-primary-500 bg-complement-100 flex items-center justify-end p-1.5 rounded-md"
|
||||
>
|
||||
<EyeSvg class="w-4 h-4 text-primary-500" />
|
||||
</Link>
|
||||
</div>
|
||||
</template>
|
||||
</TableGeneric>
|
||||
</UiCard>
|
||||
</div>
|
||||
</ClientLayout>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user