починил выдачу линз
This commit is contained in:
parent
6c4ecc49ac
commit
b0e654a367
@ -118,7 +118,11 @@ const LensIssueFormModal = ({visible, onCancel, onSubmit}) => {
|
||||
);
|
||||
}, [lensIssueFormModalUI.blockStepStyle, lensIssueFormModalUI.chooseContainerStyle, lensIssueFormModalUI.handleSetSearchLensString, lensIssueFormModalUI.resetLens, lensIssueFormModalUI.searchInputStyle, lensIssueFormModalUI.searchLensString, lensIssueFormModalUI.selectedLens, lensesItems]);
|
||||
|
||||
const ConfirmStep = () => {
|
||||
const ConfirmStep = useMemo(() => {
|
||||
if (!lensIssueFormModalUI.selectedPatient || !lensIssueFormModalUI.selectedLens) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Alert
|
||||
@ -175,7 +179,7 @@ const LensIssueFormModal = ({visible, onCancel, onSubmit}) => {
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
}, [lensIssueFormModalUI]);
|
||||
|
||||
const steps = [{
|
||||
title: 'Выбор пациента', content: SelectPatientStep,
|
||||
@ -185,6 +189,8 @@ const LensIssueFormModal = ({visible, onCancel, onSubmit}) => {
|
||||
title: 'Подтверждение', content: ConfirmStep,
|
||||
}];
|
||||
|
||||
console.log(steps[lensIssueFormModalUI.currentStep].title)
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Выдача линзы пациенту"
|
||||
|
||||
@ -3,8 +3,14 @@ import {useGetNotIssuedLensesQuery} from "../../../../../Api/lensesApi.js";
|
||||
|
||||
|
||||
const useLensIssueForm = () => {
|
||||
const {data: patients = [], isLoading: isLoadingPatients, isError: isErrorPatients} = useGetPatientsQuery(undefined);
|
||||
const {data: lenses = [], isLoading: isLoadingLenses, isError: isErrorLenses} = useGetNotIssuedLensesQuery(undefined);
|
||||
const {data: patients = [], isLoading: isLoadingPatients, isError: isErrorPatients} = useGetPatientsQuery(undefined, {
|
||||
pollingInterval: 10000,
|
||||
});
|
||||
const {data: lenses = [], isLoading: isLoadingLenses, isError: isErrorLenses} = useGetNotIssuedLensesQuery(undefined, {
|
||||
pollingInterval: 10000,
|
||||
});
|
||||
|
||||
console.log(lenses)
|
||||
|
||||
return {
|
||||
patients,
|
||||
|
||||
@ -85,7 +85,7 @@ const useLensesUI = (lenses) => {
|
||||
|
||||
return textMatch && advancedMatch && (searchParams.issued || lens.issued === false);
|
||||
}).sort((a, b) => {
|
||||
return a.preset_refraction - b.preset_refraction;
|
||||
return b.id - a.id;
|
||||
});
|
||||
}, [lenses, searchText, searchParams]);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user