물건 상세 가대 필드 변경

This commit is contained in:
basssy 2025-02-18 11:35:23 +09:00
parent d91c2c8ef5
commit 96006188e8
5 changed files with 64 additions and 93 deletions

View File

@ -69,9 +69,9 @@ export default function Estimate({}) {
* objectNo 셋팅 * objectNo 셋팅
* url로 넘어온 objectNo을 리코일에 세팅 * url로 넘어온 objectNo을 리코일에 세팅
*/ */
const setCurrentObjectNo = useSetRecoilState(correntObjectNoState)
const searchParams = useSearchParams() const searchParams = useSearchParams()
const objectRecoil = useRecoilValue(floorPlanObjectState) const objectRecoil = useRecoilValue(floorPlanObjectState)
const currentObjectNo = searchParams.get('objectNo')
const currentPid = searchParams.get('pid') const currentPid = searchParams.get('pid')
// //
const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(currentPid, false) const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(currentPid, false)
@ -92,9 +92,6 @@ export default function Estimate({}) {
const { closeAll } = usePopup() const { closeAll } = usePopup()
const currentObjectNo = searchParams.get('objectNo')
setCurrentObjectNo(currentObjectNo)
// props // props
const fileUploadProps = { const fileUploadProps = {
uploadFiles: files, uploadFiles: files,

View File

@ -76,7 +76,7 @@ export default function StuffDetail() {
standardWindSpeedId: '', // standardWindSpeedId: '', //
verticalSnowCover: '', // verticalSnowCover: '', //
coldRegionFlg: false, //(true : 1 / false : 0) coldRegionFlg: false, //(true : 1 / false : 0)
surfaceType: 'Ⅲ・Ⅳ', //( / ) surfaceType: '', //( / )
saltAreaFlg: false, // (true : 1 / false : 0) saltAreaFlg: false, // (true : 1 / false : 0)
installHeight: '', // installHeight: '', //
conType: '0', //( / ) conType: '0', //( / )
@ -95,6 +95,7 @@ export default function StuffDetail() {
const [selectObjectStatusId, setSelectObjectStatusId] = useState('0') // const [selectObjectStatusId, setSelectObjectStatusId] = useState('0') //
const [windSpeedList, setWindSpeedList] = useState([]) // const [windSpeedList, setWindSpeedList] = useState([]) //
const [surfaceTypeList, setSurfaceTypeList] = useState([]) //
const [prefCodeList, setPrefCodeList] = useState([]) // const [prefCodeList, setPrefCodeList] = useState([]) //
const [prefValue, setPrefValue] = useState('') const [prefValue, setPrefValue] = useState('')
const [saleStoreList, setSaleStoreList] = useState([]) // const [saleStoreList, setSaleStoreList] = useState([]) //
@ -493,6 +494,7 @@ export default function StuffDetail() {
const code1 = findCommonCode(200800) // const code1 = findCommonCode(200800) //
const code2 = findCommonCode(201700) /// const code2 = findCommonCode(201700) ///
const code3 = findCommonCode(202000) // 202000 const code3 = findCommonCode(202000) // 202000
const code4 = findCommonCode(113700) //
if (code1 != null) { if (code1 != null) {
setHonorificCodeList(code1) setHonorificCodeList(code1)
} }
@ -502,6 +504,9 @@ export default function StuffDetail() {
if (code3 != null) { if (code3 != null) {
setWindSpeedList(code3) setWindSpeedList(code3)
} }
if (code4 != null) {
setSurfaceTypeList(code4)
}
}, [commonCode]) }, [commonCode])
useEffect(() => { 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 onTempSave = async () => {
const formData = form.getValues() const formData = form.getValues()
@ -1482,7 +1502,7 @@ export default function StuffDetail() {
// //
if (params?.receiveUser !== '') { 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' }) return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' })
} }
} }
@ -2101,34 +2121,26 @@ export default function StuffDetail() {
</th> </th>
<td> <td>
<div className="flx-box"> <div className="flx-box">
<div className="radio-wrap flx-box" style={{ width: '239px' }}> {surfaceTypeList.length > 0 && (
<div className="d-check-radio light mr10"> <div className="radio-wrap flx-box" style={{ width: '239px' }}>
<input {surfaceTypeList.map((option, index) => (
type="radio" <div className={`d-check-radio light ${index === surfaceTypeList.length - 1 ? '' : 'mr10'}`} key={index}>
name="surfaceType" <input
value="Ⅲ・Ⅳ" type="radio"
id="surfaceType0" name="surfaceType"
{...form.register('surfaceType')} value={option.clCodeNm}
onChange={(e) => { id={`surfaceType${index}`}
handleRadioChange(e) defaultChecked={option.clCodeNm === 'Ⅲ・Ⅳ'}
}} {...form.register('surfaceType')}
/> onChange={(e) => {
<label htmlFor="surfaceType0"></label> handleRadioChange(e)
}}
/>
<label htmlFor={`surfaceType${index}`}>{option.clCodeNm}</label>
</div>
))}
</div> </div>
<div className="d-check-radio light"> )}
<input
type="radio"
name="surfaceType"
value="Ⅱ"
id="surfaceType1"
{...form.register('surfaceType')}
onChange={(e) => {
handleRadioChange(e)
}}
/>
<label htmlFor="surfaceType1"></label>
</div>
</div>
<div className="d-check-box light mr5"> <div className="d-check-box light mr5">
<input type="checkbox" id="saltAreaFlg" {...form.register('saltAreaFlg')} /> <input type="checkbox" id="saltAreaFlg" {...form.register('saltAreaFlg')} />
<label htmlFor="saltAreaFlg">{getMessage('stuff.detail.saltAreaFlg')}</label> <label htmlFor="saltAreaFlg">{getMessage('stuff.detail.saltAreaFlg')}</label>
@ -2689,35 +2701,25 @@ export default function StuffDetail() {
</th> </th>
<td> <td>
<div className="flx-box"> <div className="flx-box">
<div className="radio-wrap flx-box" style={{ width: '239px' }}> {surfaceTypeList.length > 0 && (
<div className="d-check-radio light mr10"> <div className="radio-wrap flx-box" style={{ width: '239px' }}>
<input {surfaceTypeList.map((option, index) => (
type="radio" <div className={`d-check-radio light ${index === surfaceTypeList.length - 1 ? '' : 'mr10'}`} key={index}>
name="surfaceType" <input
value="Ⅲ・Ⅳ" type="radio"
id="surfaceType0" name="surfaceType"
{...form.register('surfaceType')} value={option.clCodeNm}
onChange={(e) => { id={`surfaceType${index}`}
handleRadioChange(e) {...form.register('surfaceType')}
}} onChange={(e) => {
/> handleRadioChange(e)
<label htmlFor="surfaceType0"></label> }}
/>
<label htmlFor={`surfaceType${index}`}>{option.clCodeNm}</label>
</div>
))}
</div> </div>
<div className="d-check-radio light"> )}
<input
type="radio"
name="surfaceType"
value="Ⅱ"
id="surfaceType1"
{...form.register('surfaceType')}
onChange={(e) => {
handleRadioChange(e)
}}
/>
<label htmlFor="surfaceType1"></label>
</div>
</div>
<div className="d-check-box light mr5"> <div className="d-check-box light mr5">
<input type="checkbox" id="saltAreaFlg" {...form.register('saltAreaFlg')} /> <input type="checkbox" id="saltAreaFlg" {...form.register('saltAreaFlg')} />
<label htmlFor="saltAreaFlg">{getMessage('stuff.detail.saltAreaFlg')}</label> <label htmlFor="saltAreaFlg">{getMessage('stuff.detail.saltAreaFlg')}</label>

View File

@ -14,19 +14,6 @@ export const useMainContentsController = () => {
setIsGlobalLoading(true) 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, url: apiUrl,
}).then((res) => { }).then((res) => {
if (res.status === 200) { 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({ setQcastState({
saleStoreId: res.data.saleStoreId, saleStoreId: res.data.saleStoreId,
saleStoreName: res.data.saleStoreName, saleStoreName: res.data.saleStoreName,
@ -52,12 +33,6 @@ export const useMainContentsController = () => {
}) })
setIsGlobalLoading(false) setIsGlobalLoading(false)
} else { } else {
// setSaleStoreId('')
// setSaleStoreName('')
// setObjectList([])
// setBusinessCharger(null)
// setBusinessChargerMail(null)
setQcastState({ setQcastState({
saleStoreId: '', saleStoreId: '',
saleStoreName: '', saleStoreName: '',
@ -65,9 +40,11 @@ export const useMainContentsController = () => {
businessCharger: null, businessCharger: null,
businessChargerMail: null, businessChargerMail: null,
}) })
setIsGlobalLoading(false)
} }
}) })
} catch (error) { } catch (error) {
setIsGlobalLoading(false)
console.error('MAIN API fetching error:', error) console.error('MAIN API fetching error:', error)
} }
} }
@ -83,11 +60,6 @@ export const useMainContentsController = () => {
} }
return { return {
// saleStoreId,
// saleStoreName,
// objectList,
// businessCharger,
// businessChargerMail,
fetchObjectList, fetchObjectList,
initObjectList, initObjectList,
} }

View File

@ -783,7 +783,7 @@
"stuff.detail.planGridHeader.capacity": "システム容量", "stuff.detail.planGridHeader.capacity": "システム容量",
"stuff.detail.planGridHeader.roofMaterialIdMulti": "屋根材", "stuff.detail.planGridHeader.roofMaterialIdMulti": "屋根材",
"stuff.detail.planGridHeader.constructSpecificationMulti": "施工方法", "stuff.detail.planGridHeader.constructSpecificationMulti": "施工方法",
"stuff.detail.planGridHeader.standTypeNo": "架台", "stuff.detail.planGridHeader.supprotMethodIdMulti": "架台",
"stuff.detail.planGridHeader.pcTypeNo": "パワーコンディショナー", "stuff.detail.planGridHeader.pcTypeNo": "パワーコンディショナー",
"stuff.detail.planGridHeader.management": "管理", "stuff.detail.planGridHeader.management": "管理",
"stuff.detail.planGrid.btn1": "見積書の照会", "stuff.detail.planGrid.btn1": "見積書の照会",

View File

@ -783,7 +783,7 @@
"stuff.detail.planGridHeader.capacity": "시스템용량", "stuff.detail.planGridHeader.capacity": "시스템용량",
"stuff.detail.planGridHeader.roofMaterialIdMulti": "지붕재", "stuff.detail.planGridHeader.roofMaterialIdMulti": "지붕재",
"stuff.detail.planGridHeader.constructSpecificationMulti": "시공방법", "stuff.detail.planGridHeader.constructSpecificationMulti": "시공방법",
"stuff.detail.planGridHeader.standTypeNo": "가대", "stuff.detail.planGridHeader.supprotMethodIdMulti": "가대",
"stuff.detail.planGridHeader.pcTypeNo": "파워컨디셔너", "stuff.detail.planGridHeader.pcTypeNo": "파워컨디셔너",
"stuff.detail.planGridHeader.management": "관리", "stuff.detail.planGridHeader.management": "관리",
"stuff.detail.planGrid.btn1": "견적서 조회", "stuff.detail.planGrid.btn1": "견적서 조회",