Merge commit '8b6ade0541e7473a597a5c5dc52e001a9cbc8274' into iipbs/wr/dev
iipbs_wr / build (push) Waiting to run

This commit is contained in:
leedj312
2025-07-09 01:37:33 +09:00
4 changed files with 31 additions and 39 deletions
+22 -33
View File
@@ -110,40 +110,32 @@ export default function CoSttn() {
}
}, [coSttnRes, code]);
// useEffect(() => {
// if (coSttn.excelList.length > 0) {
// if (coSttn.excelList.length === 0) return;
// excelDownload(
// coSttn.excelList,
// "수요처 관리",
// "sample_coSttn.xlsx",
// "A1:H1",
// 2
// );
// }
// }, [coSttn.excelList]);
useEffect(() => {
if (coSttn.excelList.length > 0) {
if (coSttn.excelList.length === 0) return;
const excelClick = useCallback(() => {
// const con = objSearch.sgg ? objSearch.sgg : objSearch.city;
// if (con) coSttnSearch("1", "10000", String(con));
if(bdstTable){
const excelData = excelCoSttnParsing(bdstTable);
const coExcel = excelCoSttnParsing(coSttn.excelList, code.cityCd, code.sggCd);
excelDownload(
excelData as [],
coExcel as [],
"수요처 관리",
"sample_coSttn.xlsx",
"A1:G1",
"A1:H1",
2
);
}
}, [coSttn.excelList, code]);
// }, [coSttnSearch, objSearch.city, objSearch.sgg]);
}, [excelDownload, bdstTable]);
const searchClick = () => {
const excelClick = useCallback(() => {
const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city;
if (con) coSttnSearch("1", "10000", String(con));
}, [coSttnSearch, objSearch.city, objSearch.sgg]);
// }, [excelDownload, bdstTable]);
const searchClick = () => {
const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city;
if (con) {
if (seartchTxt && seartchTxt?.length > 0) {
@@ -154,12 +146,6 @@ export default function CoSttn() {
}
};
useEffect(() =>{
},[pageNation])
return (
<>
<ContentsDiv>
@@ -249,7 +235,7 @@ export default function CoSttn() {
tableData={bdstTable || []}
headlist={coSttn.coSttHeadList}
pageSize={20}
total={ coSttnResCount || 0 }
total={ coSttnResCount+10 || 0 }
cellClick={(index: number | undefined, headId: string) => {
setUpdateData(coSttnRes[index as number]);
}}
@@ -265,7 +251,10 @@ export default function CoSttn() {
</div>
</div>
<UiModal
bodyClass={"w-[40vw] max-w-none h-[90vh]"}
bodyClass={"w-[40vw] max-w-none h-[80vh] "// +upadateData?.dmdInfoPk?'h-[60vh]':'h-[90vh]'
}
open={isDmdModal.isMoal}
onOpenChange={() => {
setIsDmdModal({ isMoal: false, data: {} as DemandCompType });
@@ -280,9 +269,9 @@ export default function CoSttn() {
}}
rtnInputData={ async(data) => {
const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city;
console.log('data ', data)
if(upadateData?.dmdInfoPk){
console.log('data ', data)
await updateDemandCompany(data as DemandCompType)
coSttnInit("1", "13", String(con));
setIsDmdModal({ isMoal: false, data: data as DemandCompType });
@@ -132,6 +132,7 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
let message = "";
if (response.status === 200) {
message = "success";
toast.success('수요처 정보가 변경되었습니다. ' )
} else {
message = "fail";
}
@@ -144,6 +145,8 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
});
} catch (err) {
console.log(err);
toast.success('수요처 정보가 오류입니다. ' )
}
},
getRateFee: async (year: string) => {
+4 -3
View File
@@ -1,11 +1,12 @@
import type { SelectDataType } from "@common/business_components/ui";
import moment from "moment";
export const excelCoSttnParsing = (data: any[]): string[][] => {
export const excelCoSttnParsing = (data: any[],sidoCode:SelectDataType[] , sggCode:SelectDataType[]): string[][] => {
const excelExportData: string[][] = [];
data.forEach((item) => {
excelExportData.push([
String(item.cityText)??'',
String(item.sggText)??'',
sidoCode.find((sido) => sido.val === item.ctpvCd.toString().trim() )?.text ?? "",
sggCode.find((sgg) => sgg.val === item.sggCd.toString().trim() )?.text ?? "",
item.dmdCoNm ?? "",
item.daddr ?? "",
String(item.dmdInfoPk ?? ""),
+2 -3
View File
@@ -77,14 +77,13 @@ export const coSttnActionsExport: (set: any) => coSttnActions = (
`/reuseFc/request/${pageNo}/${pageCnt}/${con}`
);
if (Number(pageCnt) >= 10000) {
const coExcel = excelCoSttnParsing(coSttnRes.data);
set((state: coSttnState) => {
return {
...state,
coSttn: {
...state.coSttn,
excelList: coExcel,
isInit: false,
excelList: coSttnRes.data,
//isInit: false,
},
};
});