Merge commit '8b6ade0541e7473a597a5c5dc52e001a9cbc8274' into iipbs/wr/dev
iipbs_wr / build (push) Waiting to run
iipbs_wr / build (push) Waiting to run
This commit is contained in:
@@ -110,40 +110,32 @@ export default function CoSttn() {
|
|||||||
}
|
}
|
||||||
}, [coSttnRes, code]);
|
}, [coSttnRes, code]);
|
||||||
|
|
||||||
// useEffect(() => {
|
useEffect(() => {
|
||||||
// if (coSttn.excelList.length > 0) {
|
|
||||||
// if (coSttn.excelList.length === 0) return;
|
|
||||||
// excelDownload(
|
|
||||||
// coSttn.excelList,
|
|
||||||
// "수요처 관리",
|
|
||||||
// "sample_coSttn.xlsx",
|
|
||||||
// "A1:H1",
|
|
||||||
// 2
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }, [coSttn.excelList]);
|
|
||||||
|
|
||||||
|
if (coSttn.excelList.length > 0) {
|
||||||
|
if (coSttn.excelList.length === 0) return;
|
||||||
|
|
||||||
|
const coExcel = excelCoSttnParsing(coSttn.excelList, code.cityCd, code.sggCd);
|
||||||
const excelClick = useCallback(() => {
|
|
||||||
// const con = objSearch.sgg ? objSearch.sgg : objSearch.city;
|
|
||||||
// if (con) coSttnSearch("1", "10000", String(con));
|
|
||||||
if(bdstTable){
|
|
||||||
const excelData = excelCoSttnParsing(bdstTable);
|
|
||||||
excelDownload(
|
excelDownload(
|
||||||
excelData as [],
|
coExcel as [],
|
||||||
"수요처 관리",
|
"수요처 관리",
|
||||||
"sample_coSttn.xlsx",
|
"sample_coSttn.xlsx",
|
||||||
"A1:G1",
|
"A1:H1",
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}, [coSttn.excelList, code]);
|
||||||
|
|
||||||
// }, [coSttnSearch, objSearch.city, objSearch.sgg]);
|
const excelClick = useCallback(() => {
|
||||||
}, [excelDownload, bdstTable]);
|
|
||||||
const searchClick = () => {
|
|
||||||
const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city;
|
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 (con) {
|
||||||
if (seartchTxt && seartchTxt?.length > 0) {
|
if (seartchTxt && seartchTxt?.length > 0) {
|
||||||
|
|
||||||
@@ -154,12 +146,6 @@ export default function CoSttn() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() =>{
|
|
||||||
|
|
||||||
},[pageNation])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ContentsDiv>
|
<ContentsDiv>
|
||||||
@@ -249,7 +235,7 @@ export default function CoSttn() {
|
|||||||
tableData={bdstTable || []}
|
tableData={bdstTable || []}
|
||||||
headlist={coSttn.coSttHeadList}
|
headlist={coSttn.coSttHeadList}
|
||||||
pageSize={20}
|
pageSize={20}
|
||||||
total={ coSttnResCount || 0 }
|
total={ coSttnResCount+10 || 0 }
|
||||||
cellClick={(index: number | undefined, headId: string) => {
|
cellClick={(index: number | undefined, headId: string) => {
|
||||||
setUpdateData(coSttnRes[index as number]);
|
setUpdateData(coSttnRes[index as number]);
|
||||||
}}
|
}}
|
||||||
@@ -265,7 +251,10 @@ export default function CoSttn() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<UiModal
|
<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}
|
open={isDmdModal.isMoal}
|
||||||
onOpenChange={() => {
|
onOpenChange={() => {
|
||||||
setIsDmdModal({ isMoal: false, data: {} as DemandCompType });
|
setIsDmdModal({ isMoal: false, data: {} as DemandCompType });
|
||||||
@@ -280,9 +269,9 @@ export default function CoSttn() {
|
|||||||
}}
|
}}
|
||||||
rtnInputData={ async(data) => {
|
rtnInputData={ async(data) => {
|
||||||
const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city;
|
const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city;
|
||||||
|
console.log('data ', data)
|
||||||
if(upadateData?.dmdInfoPk){
|
if(upadateData?.dmdInfoPk){
|
||||||
|
console.log('data ', data)
|
||||||
await updateDemandCompany(data as DemandCompType)
|
await updateDemandCompany(data as DemandCompType)
|
||||||
coSttnInit("1", "13", String(con));
|
coSttnInit("1", "13", String(con));
|
||||||
setIsDmdModal({ isMoal: false, data: data as DemandCompType });
|
setIsDmdModal({ isMoal: false, data: data as DemandCompType });
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
|||||||
let message = "";
|
let message = "";
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
message = "success";
|
message = "success";
|
||||||
|
toast.success('수요처 정보가 변경되었습니다. ' )
|
||||||
} else {
|
} else {
|
||||||
message = "fail";
|
message = "fail";
|
||||||
}
|
}
|
||||||
@@ -144,6 +145,8 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
|||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
toast.success('수요처 정보가 오류입니다. ' )
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getRateFee: async (year: string) => {
|
getRateFee: async (year: string) => {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
|
import type { SelectDataType } from "@common/business_components/ui";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
export const excelCoSttnParsing = (data: any[]): string[][] => {
|
export const excelCoSttnParsing = (data: any[],sidoCode:SelectDataType[] , sggCode:SelectDataType[]): string[][] => {
|
||||||
const excelExportData: string[][] = [];
|
const excelExportData: string[][] = [];
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
excelExportData.push([
|
excelExportData.push([
|
||||||
String(item.cityText)??'',
|
sidoCode.find((sido) => sido.val === item.ctpvCd.toString().trim() )?.text ?? "",
|
||||||
String(item.sggText)??'',
|
sggCode.find((sgg) => sgg.val === item.sggCd.toString().trim() )?.text ?? "",
|
||||||
item.dmdCoNm ?? "",
|
item.dmdCoNm ?? "",
|
||||||
item.daddr ?? "",
|
item.daddr ?? "",
|
||||||
String(item.dmdInfoPk ?? ""),
|
String(item.dmdInfoPk ?? ""),
|
||||||
|
|||||||
@@ -77,14 +77,13 @@ export const coSttnActionsExport: (set: any) => coSttnActions = (
|
|||||||
`/reuseFc/request/${pageNo}/${pageCnt}/${con}`
|
`/reuseFc/request/${pageNo}/${pageCnt}/${con}`
|
||||||
);
|
);
|
||||||
if (Number(pageCnt) >= 10000) {
|
if (Number(pageCnt) >= 10000) {
|
||||||
const coExcel = excelCoSttnParsing(coSttnRes.data);
|
|
||||||
set((state: coSttnState) => {
|
set((state: coSttnState) => {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
coSttn: {
|
coSttn: {
|
||||||
...state.coSttn,
|
...state.coSttn,
|
||||||
excelList: coExcel,
|
excelList: coSttnRes.data,
|
||||||
isInit: false,
|
//isInit: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user