수요처 등록 컴포넌트 파라미터 추가

This commit is contained in:
leedj312
2025-09-17 18:03:20 +09:00
parent 75d2d0c827
commit 41b90bd7b5
2 changed files with 25 additions and 19 deletions
@@ -68,6 +68,7 @@ interface SdmRegFormProps {
setIsDuplicate: (value: boolean) => void;
updateList?: DemandCompType;
readOnly?: boolean;
openNetwork?: boolean;
}
type FieldComponent = (
@@ -84,6 +85,7 @@ export function SdmRegForm({
setIsDuplicate,
updateList,
readOnly,
openNetwork,
}: SdmRegFormProps) {
const [sidoValue, setSidoValue] = useState<string>("");
const [sigunValue, setSigunValue] = useState<string>("");
@@ -403,22 +405,24 @@ export function SdmRegForm({
{
name: "daddr",
label: "사업자주소",
component: (field) => (
// <Input
// placeholder="주소를 입력하세요"
// type="text"
// className="!text-xl text-gray-600"
// readOnly={readOnly}
// {...field}
// />
<SearchInputAddress
initValue={updateList?.daddr || ""}
readonly={readOnly ??false}
setRtnData={(rtnData: addressType)=> {
field.onChange(rtnData.roadAddrPart1);
}}
/>
),
component: (field) =>
openNetwork ? (
<SearchInputAddress
initValue={updateList?.daddr || ""}
readonly={readOnly ?? false}
setRtnData={(rtnData: addressType) => {
field.onChange(rtnData.roadAddrPart1);
}}
/>
) : (
<Input
placeholder="주소를 입력하세요"
type="text"
className="!text-xl text-gray-600"
readOnly={readOnly}
{...field}
/>
),
},
{
name: "telno",
@@ -16,8 +16,9 @@ type thisProps = {
rtnValue: (searchText: string, pageCnt: number) => void;
rtnInputData: (data: DemandCompType) => void;
bodyClassNm?: string;
updateList?:DemandCompType
readOnly?:boolean
updateList?:DemandCompType;
readOnly?:boolean;
openNetwork:boolean
}
const createFormSchema = (isBznmTotNoDisabled: boolean, isDuplicate: boolean ,updateList?:DemandCompType) => z.object({
@@ -88,7 +89,7 @@ const defaultValues: FormSchema = {
* @returns
*/
export default function SdmInsertForm({selectSidoData, selectSigunData, dataList, rtnValue, rtnInputData,bodyClassNm, updateList,readOnly}: thisProps) {
export default function SdmInsertForm({selectSidoData, selectSigunData, dataList, rtnValue, rtnInputData,bodyClassNm, updateList,readOnly,openNetwork}: thisProps) {
const [isBznmTotNoDisabled, setIsBznmTotNoDisabled] = useState(false);
const [isDuplicate, setIsDuplicate] = useState(false);
@@ -165,6 +166,7 @@ export default function SdmInsertForm({selectSidoData, selectSigunData, dataList
setIsDuplicate={setIsDuplicate}
updateList={updateList}
readOnly={readOnly}
openNetwork={openNetwork}
/>
<div className="flex justify-center pt-4">
{readOnly==true?<>