feat(appointments): rich create drawer (اضافه کردن نوبت جدید) — phase C1
NewAppointmentDrawer implements add.pdf: patient search-or-new (patient-list search), بخش/سرویس/پرسنل selects (service-sections, service-items, staff), Jalali date + default-duration with auto end-time, deposit toggle + PriceInput, status pick (applied via the status endpoint after create) and notes. The toolbar «نوبت جدید» button now opens it instead of only hinting at slot click; the slot-click quick modal stays. isReserve mode (day-level, no time fields) is reused by the upcoming reserve list page. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import { formatDate, toGregorianDate } from '../lib/utils';
|
||||
import { useAuthStore } from '../stores/authStore';
|
||||
import AppointmentStatusDropdown from '../components/ui/AppointmentStatusDropdown';
|
||||
import AppointmentActionsMenu from '../components/AppointmentActions';
|
||||
import NewAppointmentDrawer from '../components/NewAppointmentDrawer';
|
||||
import PersianCalendar from '../components/ui/PersianCalendar';
|
||||
import SearchableSelect from '../components/ui/SearchableSelect';
|
||||
|
||||
@@ -547,6 +548,7 @@ export default function AppointmentsPage() {
|
||||
const [selectedDoctorUuid, setSelectedDoctorUuid] = useState<string>(isDoctor && dbUuid ? dbUuid : '');
|
||||
const [bookingSlot, setBookingSlot] = useState<BookingSlot | null>(null);
|
||||
const [bookingHint, setBookingHint] = useState(false);
|
||||
const [drawerOpen, setDrawerOpen] = useState(false);
|
||||
const qc = useQueryClient();
|
||||
|
||||
// ── Appointments query
|
||||
@@ -694,8 +696,7 @@ export default function AppointmentsPage() {
|
||||
className="btn primary sm"
|
||||
onClick={() => {
|
||||
if (!selectedDoctorUuid) { toast.error('ابتدا یک پزشک انتخاب کنید'); return; }
|
||||
setViewMode('schedule');
|
||||
setBookingHint(true);
|
||||
setDrawerOpen(true);
|
||||
}}
|
||||
style={{ display: 'flex', alignItems: 'center', gap: 5 }}
|
||||
>
|
||||
@@ -805,6 +806,16 @@ export default function AppointmentsPage() {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Rich create drawer (اضافه کردن نوبت جدید) */}
|
||||
{drawerOpen && (
|
||||
<NewAppointmentDrawer
|
||||
doctorUuid={selectedDoctorUuid}
|
||||
defaultDate={selectedDate}
|
||||
queryKey={apptQueryKey}
|
||||
onClose={() => setDrawerOpen(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user