diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index be1ea754..82ee8c72 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -69,9 +69,9 @@ export default function Estimate({}) { * objectNo 셋팅 * url로 넘어온 objectNo을 리코일에 세팅 */ - const setCurrentObjectNo = useSetRecoilState(correntObjectNoState) const searchParams = useSearchParams() const objectRecoil = useRecoilValue(floorPlanObjectState) + const currentObjectNo = searchParams.get('objectNo') const currentPid = searchParams.get('pid') //견적서 상세데이터 const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(currentPid, false) @@ -92,9 +92,6 @@ export default function Estimate({}) { const { closeAll } = usePopup() - const currentObjectNo = searchParams.get('objectNo') - setCurrentObjectNo(currentObjectNo) - //새로 추가한 첨부파일 props const fileUploadProps = { uploadFiles: files, diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 6a2ea628..0b722f35 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -76,7 +76,7 @@ export default function StuffDetail() { standardWindSpeedId: '', //기준풍속 verticalSnowCover: '', //수직적설량 coldRegionFlg: false, //한랭지대책시행(true : 1 / false : 0) - surfaceType: 'Ⅲ・Ⅳ', //면조도구분(Ⅲ・Ⅳ / Ⅱ) + surfaceType: '', //면조도구분(Ⅲ・Ⅳ / Ⅱ) saltAreaFlg: false, //염해지역용아이템사용 (true : 1 / false : 0) installHeight: '', //설치높이 conType: '0', //계약조건(잉여 / 전량) @@ -95,6 +95,7 @@ export default function StuffDetail() { const [selectObjectStatusId, setSelectObjectStatusId] = useState('0') //신축기축 선택값 const [windSpeedList, setWindSpeedList] = useState([]) //기준 풍속 공통코드 리스트 + const [surfaceTypeList, setSurfaceTypeList] = useState([]) //면조도도 공통코드 리스트 const [prefCodeList, setPrefCodeList] = useState([]) //도도부현 코트 리스트 const [prefValue, setPrefValue] = useState('') const [saleStoreList, setSaleStoreList] = useState([]) // 판매점 리스트 @@ -493,6 +494,7 @@ export default function StuffDetail() { const code1 = findCommonCode(200800) //경칭 const code2 = findCommonCode(201700) //신축/기축 const code3 = findCommonCode(202000) //기준풍속 202000 + const code4 = findCommonCode(113700) //면조도 if (code1 != null) { setHonorificCodeList(code1) } @@ -502,6 +504,9 @@ export default function StuffDetail() { if (code3 != null) { setWindSpeedList(code3) } + if (code4 != null) { + setSurfaceTypeList(code4) + } }, [commonCode]) useEffect(() => { @@ -1434,6 +1439,21 @@ export default function StuffDetail() { } } + const checkLength = (value) => { + let str = new String(value) + let _byte = 0 + if (str.length !== 0) { + for (let i = 0; i < str.length; i++) { + let str2 = str.charAt(i) + if (encodeURIComponent(str2).length > 4) { + _byte += 2 + } else { + _byte++ + } + } + } + return _byte + } // 임시저장 const onTempSave = async () => { const formData = form.getValues() @@ -1482,7 +1502,7 @@ export default function StuffDetail() { // 담당자 자리수 체크 if (params?.receiveUser !== '') { - if (params?.receiveUser.trim().length > 10) { + if (checkLength(params?.receiveUser.trim()) > 10) { return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' }) } } @@ -2101,34 +2121,26 @@ export default function StuffDetail() {
-
-
- { - handleRadioChange(e) - }} - /> - + {surfaceTypeList.length > 0 && ( +
+ {surfaceTypeList.map((option, index) => ( +
+ { + handleRadioChange(e) + }} + /> + +
+ ))}
-
- { - handleRadioChange(e) - }} - /> - -
-
+ )}
@@ -2689,35 +2701,25 @@ export default function StuffDetail() {
-
-
- { - handleRadioChange(e) - }} - /> - + {surfaceTypeList.length > 0 && ( +
+ {surfaceTypeList.map((option, index) => ( +
+ { + handleRadioChange(e) + }} + /> + +
+ ))}
-
- { - handleRadioChange(e) - }} - /> - -
-
- + )}
diff --git a/src/hooks/main/useMainContentsController.js b/src/hooks/main/useMainContentsController.js index 01f75658..09b4fc0c 100644 --- a/src/hooks/main/useMainContentsController.js +++ b/src/hooks/main/useMainContentsController.js @@ -14,19 +14,6 @@ export const useMainContentsController = () => { setIsGlobalLoading(true) }, []) - /** - * main search area - */ - // const [saleStoreId, setSaleStoreId] = useState('') - // const [saleStoreName, setSaleStoreName] = useState('') - - /** - * main contents area - */ - // const [objectList, setObjectList] = useState([]) - // const [businessCharger, setBusinessCharger] = useState(null) - // const [businessChargerMail, setBusinessChargerMail] = useState(null) - /** * 최근 물건 목록 조회 */ @@ -37,12 +24,6 @@ export const useMainContentsController = () => { url: apiUrl, }).then((res) => { if (res.status === 200) { - // setSaleStoreId(res.data.saleStoreId) - // setSaleStoreName(res.data.saleStoreName) - - // setObjectList(res.data.objectList) - // setBusinessCharger(res.data.businessCharger) - // setBusinessChargerMail(res.data.businessChargerMail) setQcastState({ saleStoreId: res.data.saleStoreId, saleStoreName: res.data.saleStoreName, @@ -52,12 +33,6 @@ export const useMainContentsController = () => { }) setIsGlobalLoading(false) } else { - // setSaleStoreId('') - // setSaleStoreName('') - - // setObjectList([]) - // setBusinessCharger(null) - // setBusinessChargerMail(null) setQcastState({ saleStoreId: '', saleStoreName: '', @@ -65,9 +40,11 @@ export const useMainContentsController = () => { businessCharger: null, businessChargerMail: null, }) + setIsGlobalLoading(false) } }) } catch (error) { + setIsGlobalLoading(false) console.error('MAIN API fetching error:', error) } } @@ -83,11 +60,6 @@ export const useMainContentsController = () => { } return { - // saleStoreId, - // saleStoreName, - // objectList, - // businessCharger, - // businessChargerMail, fetchObjectList, initObjectList, } diff --git a/src/locales/ja.json b/src/locales/ja.json index 1255e72b..9f06310e 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -783,7 +783,7 @@ "stuff.detail.planGridHeader.capacity": "システム容量", "stuff.detail.planGridHeader.roofMaterialIdMulti": "屋根材", "stuff.detail.planGridHeader.constructSpecificationMulti": "施工方法", - "stuff.detail.planGridHeader.standTypeNo": "架台", + "stuff.detail.planGridHeader.supprotMethodIdMulti": "架台", "stuff.detail.planGridHeader.pcTypeNo": "パワーコンディショナー", "stuff.detail.planGridHeader.management": "管理", "stuff.detail.planGrid.btn1": "見積書の照会", diff --git a/src/locales/ko.json b/src/locales/ko.json index 5ea7765f..b43e6853 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -783,7 +783,7 @@ "stuff.detail.planGridHeader.capacity": "시스템용량", "stuff.detail.planGridHeader.roofMaterialIdMulti": "지붕재", "stuff.detail.planGridHeader.constructSpecificationMulti": "시공방법", - "stuff.detail.planGridHeader.standTypeNo": "가대", + "stuff.detail.planGridHeader.supprotMethodIdMulti": "가대", "stuff.detail.planGridHeader.pcTypeNo": "파워컨디셔너", "stuff.detail.planGridHeader.management": "관리", "stuff.detail.planGrid.btn1": "견적서 조회",