-
جزئیات درخواست و اطلاعات مورد نیاز را با دقت و حوصله وار نمایید.
+
جزئیات درخواست و اطلاعات مورد نیاز را با دقت و حوصله وارد نمایید.
-
- زمان تخمینی ثبت گزارش: ۷۲ ساعت
+
+ زمان تخمینی ثبت گزارش: ۷۲ ساعت
-
+ v-model="fastRequestStore.requestDetails.note"
+ size="small"
+ placeholder="شرح درخواست و توضیحات"
+ rows="3"
+ class="w-full h-full" />
-
-
-
-
-
-
-
-
-
![]()
-
-
-
{{ file.name }}
-
{{ formatSize(file.size) }}
-
-
-
-
-
-
-
-
Completed
-
-
-
-
![]()
-
-
{{ file.name }}
-
{{ formatSize(file.size) }}
-
-
-
-
-
-
-
-
-
-
-
سوابق پزشکی قبلی (اختیاری)
-
- جهت آپلود تصویر کلیک کنید و یا فایل خود کشیده و در این قسمت رها (Drag and Drup) کنید.
-
-
-
-
-
-
-
-
-
-
-
-
![]()
-
-
-
{{ file.name }}
-
{{ formatSize(file.size) }}
-
-
-
-
-
-
-
-
Completed
-
-
-
-
![]()
-
-
{{ file.name }}
-
{{ formatSize(file.size) }}
-
-
-
-
-
-
-
-
-
-
-
فایل «CT Scan»
-
- جهت آپلود تصویر کلیک کنید و یا فایل خود کشیده و در این قسمت رها (Drag and Drup) کنید.
-
-
-
-
+
+
+
-
-
-
-
\ No newline at end of file
diff --git a/resources/js/Client/components/dashboard/fastRequest/RequestDoctor.vue b/resources/js/Client/components/dashboard/fastRequest/RequestDoctor.vue
index b22c40c..df91bd8 100644
--- a/resources/js/Client/components/dashboard/fastRequest/RequestDoctor.vue
+++ b/resources/js/Client/components/dashboard/fastRequest/RequestDoctor.vue
@@ -1,29 +1,35 @@
-
+
-
+
-
-

-
دکتر حسین حسینی
-
متخصص جراحی پوست و مو
-
-
-

-
دکتر امین حسینی
-
متخصص و رادیولوژیست
-
+
+
-
-
-
-
\ No newline at end of file
diff --git a/resources/js/Client/components/dashboard/fastRequest/RequestReview.vue b/resources/js/Client/components/dashboard/fastRequest/RequestReview.vue
index e96a417..e2cca0a 100644
--- a/resources/js/Client/components/dashboard/fastRequest/RequestReview.vue
+++ b/resources/js/Client/components/dashboard/fastRequest/RequestReview.vue
@@ -1,15 +1,22 @@
-
+
- شما در حال تکمیل فرایند ثبت درخواست
- ((CT Scan))
+ شما در حال تکمیل فرایند ثبت درخواست
+ (({{ modalityTitle(fastRequestStore.requestType) }}))
با اولویت
- ((اورژانسی)) برای کیس ((مایلو)) با شماره کیس ((۱۲۳۴۵۶)) میباشید. درخواست شما در ابتدا توسط کارشناسان ما بررسی و در صورت تایید به ((اولین پزشک در دسترس)) جهت بررسی و گزارش نویسی ارجاع خواهد شد.
+ (({{ priorityTitle(fastRequestStore.requestDetails.priority) }})) برای کیس (({{ caseName }})) با شماره کیس (({{ caseNumber }})) میباشید. درخواست شما در ابتدا توسط کارشناسان ما بررسی و در صورت تایید به (({{ doctorName }})) جهت بررسی و گزارش نویسی ارجاع خواهد شد.
وضعیت و مراحل پرونده از طریق ((پیامک)) به شما اطلاعرسانی خواهد شد.
@@ -17,9 +24,3 @@
-
-
-
-
\ No newline at end of file
diff --git a/resources/js/Client/components/dashboard/fastRequest/RequestType.vue b/resources/js/Client/components/dashboard/fastRequest/RequestType.vue
index 4729ad1..1d1808f 100644
--- a/resources/js/Client/components/dashboard/fastRequest/RequestType.vue
+++ b/resources/js/Client/components/dashboard/fastRequest/RequestType.vue
@@ -1,23 +1,21 @@
-
+
نوع درخواست خود را مشخص کنید
-
-
-
-
-
+
-
-
-
-
\ No newline at end of file
diff --git a/resources/js/Client/data/casesTableColumns.js b/resources/js/Client/data/casesTableColumns.js
new file mode 100644
index 0000000..d8e9cd2
--- /dev/null
+++ b/resources/js/Client/data/casesTableColumns.js
@@ -0,0 +1,39 @@
+import { modalityTitle } from './fastRequestOptions'
+import { convertEnglishToPersian } from '../utils/numberUtils'
+
+export const caseColumns = [
+ {
+ title: 'شماره پرونده',
+ key: 'code'
+ },
+ {
+ title: 'وضعیت',
+ key: 'status'
+ },
+ {
+ title: 'نوع درخواست',
+ key: 'modality',
+ render: (row) => modalityTitle(row.modality)
+ },
+ {
+ title: 'درخواستکننده',
+ key: 'requester'
+ },
+ {
+ title: 'تاریخ ثبت',
+ key: 'submitted_at',
+ render: (row) => row.submitted_at ? convertEnglishToPersian(row.submitted_at) : '-'
+ },
+ {
+ title: 'فرصت رسیدگی',
+ key: 'processing_deadline',
+ render: (row) => row.processing_deadline ? convertEnglishToPersian(row.processing_deadline) : '-'
+ },
+ {
+ title: '',
+ key: 'actions',
+ width: 80,
+ style: 'grid grid-cols-1',
+ slot: true,
+ }
+]
diff --git a/resources/js/Client/data/fastRequestOptions.js b/resources/js/Client/data/fastRequestOptions.js
new file mode 100644
index 0000000..2cb9a46
--- /dev/null
+++ b/resources/js/Client/data/fastRequestOptions.js
@@ -0,0 +1,44 @@
+export const modalities = [
+ { code: 'ct-scan', title: 'CT Scan', icon: 'ct-scan' },
+ { code: 'mri', title: 'MRI', icon: 'mri' },
+ { code: 'sonography', title: 'سونوگرافی', icon: 'sonography' },
+ { code: 'echo', title: 'اکوکاردیوگرافی', icon: 'echo' },
+ { code: 'radiology', title: 'رادیولوژی', icon: 'radiology' },
+]
+
+export const petTypes = [
+ { name: 'سگ', code: 'Dog' },
+ { name: 'گربه', code: 'Cat' },
+ { name: 'پرنده', code: 'Bird' },
+ { name: 'ماهی', code: 'Fish' },
+ { name: 'خرگوش', code: 'Rabbit' },
+ { name: 'همستر', code: 'Hamster' },
+ { name: 'خوکچه هندی', code: 'GuineaPig' },
+ { name: 'لاک پشت', code: 'Turtle' },
+ { name: 'مار', code: 'Snake' },
+ { name: 'مارمولک', code: 'Lizard' },
+ { name: 'سایر', code: 'Other' },
+]
+
+export const petGenders = [
+ { name: 'نر', code: 'Male' },
+ { name: 'ماده', code: 'Female' },
+]
+
+export const neuteredOptions = [
+ { name: 'عقیم سازی شده', code: true },
+ { name: 'عقیم سازی نشده', code: false },
+]
+
+export const priorities = [
+ { name: 'عادی', code: 'Medium' },
+ { name: 'اورژانسی', code: 'High' },
+]
+
+export const modalityTitle = (code) => {
+ return modalities.find((modality) => modality.code === code)?.title || code
+}
+
+export const priorityTitle = (code) => {
+ return priorities.find((priority) => priority.code === code)?.name || code
+}
diff --git a/resources/js/Client/store/FastRequest.js b/resources/js/Client/store/FastRequest.js
index e6fedf4..37c0cf2 100644
--- a/resources/js/Client/store/FastRequest.js
+++ b/resources/js/Client/store/FastRequest.js
@@ -1,22 +1,104 @@
-import { step } from '@primeuix/themes/aura/stepper'
import { defineStore } from 'pinia'
+
+const emptyCase = () => ({
+ petId: null,
+ name: null,
+ type: null,
+ gender: null,
+ breed: null,
+ age: null,
+ weight: null,
+ sterilized: null,
+})
+
export const useFastRequestStore = defineStore('FastRequestStore', {
state: () => ({
+ endpoints: {
+ create: '/dashboard/fast-requests/create',
+ store: '/dashboard/fast-requests',
+ },
step: 1,
requestType: null,
- requestCase: {
- name: null,
- species: null,
- gender: null,
- age: null,
- weight: null,
- neutered: null,
+ requestCase: emptyCase(),
+ requestDetails: {
+ priority: null,
+ note: null,
},
- requestDetails: null,
- requestDoctor: null,
- requestReview: null,
+ historyFiles: [],
+ scanFiles: [],
+ doctorId: null,
+ pets: [],
+ doctors: [],
+ submitting: false,
+ submittedDocument: null,
}),
+ getters: {
+ selectedPet: (state) => state.pets.find((pet) => pet.id === state.requestCase.petId) || null,
+ selectedDoctor: (state) => state.doctors.find((doctor) => doctor.id === state.doctorId) || null,
+ canProceed: (state) => {
+ switch (state.step) {
+ case 1:
+ return !!state.requestType
+ case 2:
+ return !!state.requestCase.petId || (!!state.requestCase.name && !!state.requestCase.type)
+ case 3:
+ return !!state.requestDetails.priority
+ default:
+ return true
+ }
+ },
+ },
actions: {
+ async fetchCreateData() {
+ const { data } = await window.axios.get(this.endpoints.create)
+ this.pets = data.pets
+ this.doctors = data.doctors
+ },
+ selectArchivePet(petId) {
+ this.requestCase = emptyCase()
+ this.requestCase.petId = petId
+ },
+ clearArchivePet() {
+ this.requestCase.petId = null
+ },
+ nextStep() {
+ if (this.step < 5) this.step++
+ },
+ prevStep() {
+ if (this.step > 1) this.step--
+ },
+ async submit() {
+ this.submitting = true
+ try {
+ const formData = new FormData()
+ formData.append('modality', this.requestType)
+ formData.append('priority', this.requestDetails.priority)
+ if (this.requestDetails.note) formData.append('note', this.requestDetails.note)
- }
+ if (this.requestCase.petId) {
+ formData.append('pet_id', this.requestCase.petId)
+ } else {
+ Object.entries(this.requestCase).forEach(([key, value]) => {
+ if (key !== 'petId' && value !== null && value !== '') {
+ formData.append(`pet[${key}]`, key === 'sterilized' ? (value ? 1 : 0) : value)
+ }
+ })
+ }
+
+ if (this.doctorId) formData.append('doctor_id', this.doctorId)
+
+ this.historyFiles.forEach((file) => formData.append('history_files[]', file))
+ this.scanFiles.forEach((file) => formData.append('scan_files[]', file))
+
+ const { data } = await window.axios.post(this.endpoints.store, formData)
+ this.submittedDocument = data.document
+ return data.document
+ } finally {
+ this.submitting = false
+ }
+ },
+ reset() {
+ this.$reset()
+ },
+ },
})
diff --git a/resources/js/Client/utils/fileUtils.js b/resources/js/Client/utils/fileUtils.js
new file mode 100644
index 0000000..bc55c1c
--- /dev/null
+++ b/resources/js/Client/utils/fileUtils.js
@@ -0,0 +1,13 @@
+const sizes = ['B', 'KB', 'MB', 'GB']
+
+export const formatFileSize = (bytes) => {
+ if (!bytes) {
+ return `0 ${sizes[0]}`
+ }
+
+ const k = 1024
+ const i = Math.floor(Math.log(bytes) / Math.log(k))
+ const formattedSize = parseFloat((bytes / Math.pow(k, i)).toFixed(1))
+
+ return `${formattedSize} ${sizes[i]}`
+}
diff --git a/routes/web.php b/routes/web.php
index 41b7881..b546c1c 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -3,6 +3,7 @@
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
use App\Http\Controllers\Client\AuthController;
+use App\Http\Controllers\Client\FastRequestController;
use App\Http\Controllers\Client\Doctor\DashboardController;
use App\Http\Controllers\Client\Doctor\CaseController;
use App\Http\Controllers\Client\Doctor\DocumentController;
@@ -38,6 +39,9 @@ Route::group(['prefix' => 'auth','middleware' => 'guest'] , function (){
Route::group(['prefix' => 'dashboard' , 'middleware' => 'auth' , 'as' => 'dashboard.'] , function (){
Route::get('/', [DashboardController::class, 'index'])->name('index');
+ Route::get('fast-requests/create', [FastRequestController::class, 'create'])->name('fastRequests.create');
+ Route::post('fast-requests', [FastRequestController::class, 'store'])->name('fastRequests.store');
+
Route::resource('/documents', DocumentController::class);
Route::resource('cases', CaseController::class);