feat:update all page
This commit is contained in:
@@ -12,6 +12,8 @@ import { ContextFormCustom } from "@/components/utils/FormCustom/contexts";
|
||||
import { QUERY_KEY, TYPE_GENDER } from "@/constant/config/enum";
|
||||
import { httpRequest } from "@/services";
|
||||
import patientServices, { PatientDetail } from "@/services/patientServices";
|
||||
import { toastWarn } from "@/common/funcs/toast";
|
||||
import { timeSubmit } from "@/common/funcs/optionConvert";
|
||||
interface PopupUpdatePatientProps {
|
||||
onClose: () => void;
|
||||
id: string;
|
||||
@@ -147,6 +149,10 @@ const PopupUpdatePatient = ({ onClose, id }: PopupUpdatePatientProps) => {
|
||||
});
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (!form.gender) {
|
||||
return toastWarn({ msg: "Vui lòng chọn giới tính!" });
|
||||
}
|
||||
|
||||
updatePatientMutation.mutate();
|
||||
};
|
||||
|
||||
@@ -268,23 +274,6 @@ const PopupUpdatePatient = ({ onClose, id }: PopupUpdatePatientProps) => {
|
||||
|
||||
<label htmlFor="female">Nữ</label>
|
||||
</div>
|
||||
|
||||
{/* KHÁC */}
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
type="radio"
|
||||
id="other"
|
||||
checked={form.gender === TYPE_GENDER.OTHER}
|
||||
onChange={() =>
|
||||
setForm((prev) => ({
|
||||
...prev,
|
||||
gender: TYPE_GENDER.OTHER,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
|
||||
<label htmlFor="other">Khác</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -297,23 +286,19 @@ const PopupUpdatePatient = ({ onClose, id }: PopupUpdatePatientProps) => {
|
||||
}
|
||||
placeholder="Số điện thoại"
|
||||
name="phone"
|
||||
type="text"
|
||||
type="number"
|
||||
isPhone
|
||||
value={form.phone}
|
||||
isRequired
|
||||
/>
|
||||
|
||||
<InputForm
|
||||
label={
|
||||
<span>
|
||||
Email
|
||||
<span className="text-red-500"> *</span>
|
||||
</span>
|
||||
}
|
||||
label={<span>Email</span>}
|
||||
placeholder="Email"
|
||||
name="email"
|
||||
type="text"
|
||||
type="email"
|
||||
isEmail
|
||||
value={form.email}
|
||||
isRequired
|
||||
/>
|
||||
|
||||
<TextArea
|
||||
@@ -321,11 +306,13 @@ const PopupUpdatePatient = ({ onClose, id }: PopupUpdatePatientProps) => {
|
||||
placeholder="Địa chỉ"
|
||||
label="Địa chỉ"
|
||||
value={form.address}
|
||||
isRequired
|
||||
isBlur
|
||||
max={5000}
|
||||
/>
|
||||
|
||||
<InputForm
|
||||
isRequired
|
||||
label="Người liên hệ khẩn cấp"
|
||||
placeholder="Người liên hệ khẩn cấp"
|
||||
name="emergencyContactName"
|
||||
@@ -337,7 +324,9 @@ const PopupUpdatePatient = ({ onClose, id }: PopupUpdatePatientProps) => {
|
||||
label="SĐT khẩn cấp"
|
||||
placeholder="SĐT khẩn cấp"
|
||||
name="emergencyContactPhone"
|
||||
type="text"
|
||||
type="number"
|
||||
isRequired
|
||||
isPhone
|
||||
value={form.emergencyContactPhone}
|
||||
/>
|
||||
|
||||
@@ -364,6 +353,7 @@ const PopupUpdatePatient = ({ onClose, id }: PopupUpdatePatientProps) => {
|
||||
placeholder="Số bảo hiểm"
|
||||
name="insuranceNumber"
|
||||
type="text"
|
||||
isRequired
|
||||
value={form.insuranceNumber}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user