feat(appointment): derive service section from service item when missing in appointment
This commit is contained in:
@@ -6,9 +6,7 @@ import { toast } from 'sonner';
|
||||
import { api } from '../lib/api';
|
||||
import type { ApiResponse } from '../lib/api';
|
||||
import PersianDateInput from '../components/ui/PersianDateInput';
|
||||
import PriceInput from '../components/ui/PriceInput';
|
||||
import SearchableSelect from '../components/ui/SearchableSelect';
|
||||
import { WalletChargeLink } from '../components/AppointmentActions';
|
||||
import { formatRial, rialToToman, tomanToRial } from '../lib/utils';
|
||||
import { DEFAULT_SERVICE_CATEGORY } from '../lib/insuranceShares';
|
||||
import BackButton from '../components/ui/BackButton';
|
||||
@@ -16,7 +14,6 @@ import { useAppointmentInsurance } from '../hooks/useAppointmentInsurance';
|
||||
import { useDoctorBookingServices } from '../hooks/useDoctorBookingServices';
|
||||
import ServiceSlotPicker from '../components/appointments/ServiceSlotPicker';
|
||||
import type { PickedService, ServicePick } from '../components/appointments/ServiceSlotPicker';
|
||||
import Switch from '../components/ui/Switch';
|
||||
|
||||
interface Option { uuid: string; name?: string; full_name?: string }
|
||||
|
||||
@@ -357,24 +354,12 @@ export default function AppointmentEditPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{ fontSize: 14, fontWeight: 700, marginBottom: 12 }}>بیعانه:</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 16, flexWrap: 'wrap', marginBottom: 18 }}>
|
||||
<Switch
|
||||
inline
|
||||
checked={depositRequired}
|
||||
onChange={setDepositRequired}
|
||||
label="بیعانه مورد نیاز است."
|
||||
/>
|
||||
{depositRequired && (
|
||||
<>
|
||||
<div style={{ minWidth: 220 }}>
|
||||
<label style={label}>مبلغ بیعانه (تومان)</label>
|
||||
<div style={{ marginTop: 6 }}><PriceInput value={depositToman} onChange={setDepositToman} /></div>
|
||||
</div>
|
||||
<WalletChargeLink mobile={a.patient_mobile || a.user?.mobile || ''} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{/*
|
||||
بخش «بیعانه» فعلاً از فرم برداشته شد (درخواست ۲۰۲۶-۰۸-۰۸).
|
||||
state و ارسالش عمداً سر جایشان ماندند: مقدارِ فعلیِ نوبت هنگام هیدریت
|
||||
خوانده و همان هنگام ذخیره پس فرستاده میشود، پس ویرایشِ بقیهٔ فیلدها
|
||||
بیعانهٔ ثبتشده را پاک نمیکند. برگرداندنِ UI یعنی همین بلوک، نه بیشتر.
|
||||
*/}
|
||||
|
||||
<div style={{ maxWidth: 320, marginBottom: 18 }}>
|
||||
<label style={label}>انتخاب وضعیت</label>
|
||||
|
||||
Reference in New Issue
Block a user