- 로그인 모달화 진행
- 로그인이나 이전 수요처등록 이후 수요처 세팅완료(로그인 > 수요처 등록 혹은 빈칸) - 수요정보등록 완료
This commit is contained in:
@@ -39,7 +39,7 @@ const FormUi = React.forwardRef<HTMLDivElement, FormUiProps>(
|
||||
checked={isChecked}
|
||||
onCheckedChange={handleCheckboxChange}
|
||||
/>
|
||||
<label className="w-20 text-xl text-gray-600" htmlFor="check">해당없음</label>
|
||||
<label className="w-28 text-xl text-gray-600" htmlFor="check">해당없음</label>
|
||||
</div>
|
||||
</div>
|
||||
{children}
|
||||
|
||||
@@ -124,7 +124,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
|
||||
form.setValue('dmdCoNm', text);
|
||||
}, [form]);
|
||||
|
||||
const bznNoChange = useCallback((e: React.ChangeEvent<HTMLInputElement>, noType: string) => {
|
||||
const bznNoChange = useCallback((e: React.ChangeEvent<HTMLInputElement>, noType: string, field?: ControllerRenderProps<FormSchema, keyof FormSchema>) => {
|
||||
const value = e.target.value;
|
||||
|
||||
if(noType === 'dmdInfoPk') {
|
||||
@@ -133,17 +133,16 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
|
||||
} else {
|
||||
setIsDuplicate(false);
|
||||
}
|
||||
form.setValue('dmdInfoPk', value);
|
||||
field?.onChange(value);
|
||||
} else {
|
||||
if(orgBznmNo.substring(10,14) === value) {
|
||||
setIsDuplicate(true);
|
||||
} else {
|
||||
setIsDuplicate(false);
|
||||
}
|
||||
form.setValue('bznmTotNo', value);
|
||||
field?.onChange(value);
|
||||
}
|
||||
|
||||
}, [form, orgBznmNo, setIsDuplicate]);
|
||||
}, [orgBznmNo, setIsDuplicate]);
|
||||
|
||||
const formFields: Array<{
|
||||
name: keyof FormSchema;
|
||||
@@ -202,7 +201,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
|
||||
type="text"
|
||||
className="!text-xl text-gray-600"
|
||||
{...field}
|
||||
onChange={(e) => bznNoChange(e, 'dmdInfoPk')}
|
||||
onChange={(e) => bznNoChange(e, 'dmdInfoPk', field)}
|
||||
/>
|
||||
)
|
||||
},
|
||||
@@ -221,7 +220,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
|
||||
className="!mt-5 !text-xl text-gray-600"
|
||||
disabled={isBznmTotNoDisabled}
|
||||
{...field}
|
||||
onChange={(e) => bznNoChange(e, 'bznmTotNo')}
|
||||
onChange={(e) => bznNoChange(e, 'bznmTotNo', field)}
|
||||
/>
|
||||
</FormUi>
|
||||
)
|
||||
|
||||
@@ -176,8 +176,6 @@ export default function SdmInsertForm({selectSidoData, selectSigunData, dataList
|
||||
telno: data.telno,
|
||||
});
|
||||
|
||||
//router.push(`/pages/sdmMng/sdmInfoInsert?${queryParams.toString()}`);
|
||||
toast.success('수요처가 성공적으로 등록되었습니다.');
|
||||
} catch (error) {
|
||||
console.error('Error submitting form:', error);
|
||||
toast.error('수요처 등록에 실패했습니다.');
|
||||
|
||||
Reference in New Issue
Block a user