수요처 관리 조건만 확ㅣ
This commit is contained in:
@@ -24,12 +24,12 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import SdmInsertForm, {
|
||||
type DemandCompType,
|
||||
} from "@common/business_components/ui/sdmInsertForm";
|
||||
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { ToastFormUi } from "@/components/ui/toast/toastFromUi";
|
||||
import { fetchType, getFetch } from "@/components/lib/api";
|
||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
||||
|
||||
export default function CoSttn() {
|
||||
const {
|
||||
@@ -62,6 +62,7 @@ export default function CoSttn() {
|
||||
const [seartchTxt, setSearchTxt] = useState<string>();
|
||||
const [upadateData, setUpdateData] = useState<DemandCompType>();
|
||||
|
||||
|
||||
const getSelCity = (val: string | number) => {
|
||||
const cityValue = String(val); // Ensure val is treated as a string
|
||||
const data = getCity(cityValue, code.sggCd);
|
||||
@@ -75,8 +76,9 @@ export default function CoSttn() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!coSttn.isInit) {
|
||||
const con = objSearch.sgg ? objSearch.sgg : objSearch.city;
|
||||
coSttnInit("1", "13", "45");
|
||||
|
||||
console.log('coSttn.isInit ', coSttn.isInit)
|
||||
coSttnInit("1", "13", "0");
|
||||
}
|
||||
}, [coSttn.isInit, coSttnInit, objSearch]);
|
||||
|
||||
@@ -235,16 +237,16 @@ export default function CoSttn() {
|
||||
}else{
|
||||
const dmd= await getFetch(fetchType.WR,`/reuseFc/request/${data.dmdInfoPk}`)
|
||||
if(dmd) {
|
||||
ToastFormUi({body: `사업자번호 ${dmd.dmdInfoPk}는 이미 등록되었습니다. 다시등록해주세요`, title:"수요처 관리"})
|
||||
toast.error(`사업자번호 ${dmd.dmdInfoPk}는 이미 등록되었습니다. 다시등록해주세요`)
|
||||
return
|
||||
}
|
||||
regDemandCompany(data as DemandCompType);
|
||||
}
|
||||
if(dmdIsSucees ==='success'){
|
||||
ToastFormUi({body: `수요처 등록 및 수정이 완료되었습니다.`, title:"수요처 관리"})
|
||||
toast.success(`수요처 등록 및 수정 완료되었습니다..`)
|
||||
setIsDmdModal({ isMoal: false, data: data as DemandCompType });
|
||||
}else{
|
||||
ToastFormUi({body: `수요처 등록 및 수정 에러입니다.`, title:"수요처 관리"})
|
||||
toast.error(`수요처 등록 및 수정 에러입니다.`)
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user