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