87 lines
3.5 KiB
Vue
87 lines
3.5 KiB
Vue
<script setup>
|
||
import Select from 'primevue/select';
|
||
import InputText from 'primevue/inputtext';
|
||
import { ref } from 'vue';
|
||
import ArchiveCase from './ArchiveCase.vue';
|
||
import { useFastRequestStore } from '../../../store/FastRequest';
|
||
import { petTypes, petGenders, neuteredOptions } from '../../../data/fastRequestOptions';
|
||
|
||
const fastRequestStore = useFastRequestStore();
|
||
|
||
const isChooseArchive = ref(false);
|
||
|
||
const showChooseArchive = () => {
|
||
isChooseArchive.value = true;
|
||
}
|
||
</script>
|
||
|
||
<template>
|
||
<div class="w-full space-y-2 py-6">
|
||
<div class="w-full h-[12px] flex items-center justify-between">
|
||
<p class="flex h-full items-center justify-start text-[11px] font-[600] text-[#3E4C63]">مشخصات کیس(حیوان) مورد نظر را وارد نمایید.</p>
|
||
<button type="button" @click="showChooseArchive" class="flex h-full items-center justify-end text-[11px] font-[400] text-[#7A1419] cursor-pointer">انتخاب از آرشیو</button>
|
||
</div>
|
||
<p class="flex items-center justify-start text-[11px] font-[600] text-[#576989]">
|
||
در صورتی که قبلا این کیس در پلتفرم رادیکال ثبت شده، برای بررسی سوابق قبلی از دکمه «انتخاب از آرشیو» استفاده نمایید.
|
||
</p>
|
||
<div v-if="fastRequestStore.requestCase.petId" class="w-full flex items-center justify-between border border-[#DEE3EB] rounded-[8px] p-3">
|
||
<p class="text-[11px] font-[600] text-[#3E4C63]">
|
||
کیس انتخابشده از آرشیو:
|
||
<span v-if="fastRequestStore.selectedPet" class="text-[#7A1419]">{{ fastRequestStore.selectedPet.name }} ({{ fastRequestStore.selectedPet.type }})</span>
|
||
<span v-else class="text-[#7A1419]">شناسه {{ fastRequestStore.requestCase.petId }}</span>
|
||
</p>
|
||
<button type="button" @click="fastRequestStore.clearArchivePet" class="text-[11px] font-[400] text-[#7A1419] cursor-pointer">حذف و ثبت کیس جدید</button>
|
||
</div>
|
||
<form v-else class="p-4 grid grid-cols-1 sm:grid-cols-2 gap-4 w-full">
|
||
<InputText
|
||
v-model="fastRequestStore.requestCase.name"
|
||
type="text"
|
||
placeholder="نام"
|
||
size="large"
|
||
/>
|
||
<Select
|
||
v-model="fastRequestStore.requestCase.type"
|
||
:options="petTypes"
|
||
optionLabel="name"
|
||
optionValue="code"
|
||
placeholder="نوع"
|
||
/>
|
||
<InputText
|
||
v-model="fastRequestStore.requestCase.breed"
|
||
type="text"
|
||
placeholder="نژاد"
|
||
size="large"
|
||
/>
|
||
<Select
|
||
v-model="fastRequestStore.requestCase.gender"
|
||
:options="petGenders"
|
||
optionLabel="name"
|
||
optionValue="code"
|
||
placeholder="جنسیت"
|
||
size="small"
|
||
/>
|
||
<InputText
|
||
v-model="fastRequestStore.requestCase.age"
|
||
type="number"
|
||
placeholder="سن (سال)"
|
||
size="large"
|
||
/>
|
||
<InputText
|
||
v-model="fastRequestStore.requestCase.weight"
|
||
type="number"
|
||
placeholder="وزن (کیلوگرم)"
|
||
size="large"
|
||
/>
|
||
<Select
|
||
v-model="fastRequestStore.requestCase.sterilized"
|
||
:options="neuteredOptions"
|
||
optionLabel="name"
|
||
optionValue="code"
|
||
placeholder="وضعیت عقیم سازی"
|
||
size="small"
|
||
/>
|
||
</form>
|
||
<archive-case v-model:visible="isChooseArchive"></archive-case>
|
||
</div>
|
||
</template>
|