물건 상세 가대 필드 변경

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 셋팅
* 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,

View File

@ -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() {
</th>
<td>
<div className="flx-box">
<div className="radio-wrap flx-box" style={{ width: '239px' }}>
<div className="d-check-radio light mr10">
<input
type="radio"
name="surfaceType"
value="Ⅲ・Ⅳ"
id="surfaceType0"
{...form.register('surfaceType')}
onChange={(e) => {
handleRadioChange(e)
}}
/>
<label htmlFor="surfaceType0"></label>
{surfaceTypeList.length > 0 && (
<div className="radio-wrap flx-box" style={{ width: '239px' }}>
{surfaceTypeList.map((option, index) => (
<div className={`d-check-radio light ${index === surfaceTypeList.length - 1 ? '' : 'mr10'}`} key={index}>
<input
type="radio"
name="surfaceType"
value={option.clCodeNm}
id={`surfaceType${index}`}
defaultChecked={option.clCodeNm === 'Ⅲ・Ⅳ'}
{...form.register('surfaceType')}
onChange={(e) => {
handleRadioChange(e)
}}
/>
<label htmlFor={`surfaceType${index}`}>{option.clCodeNm}</label>
</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">
<input type="checkbox" id="saltAreaFlg" {...form.register('saltAreaFlg')} />
<label htmlFor="saltAreaFlg">{getMessage('stuff.detail.saltAreaFlg')}</label>
@ -2689,35 +2701,25 @@ export default function StuffDetail() {
</th>
<td>
<div className="flx-box">
<div className="radio-wrap flx-box" style={{ width: '239px' }}>
<div className="d-check-radio light mr10">
<input
type="radio"
name="surfaceType"
value="Ⅲ・Ⅳ"
id="surfaceType0"
{...form.register('surfaceType')}
onChange={(e) => {
handleRadioChange(e)
}}
/>
<label htmlFor="surfaceType0"></label>
{surfaceTypeList.length > 0 && (
<div className="radio-wrap flx-box" style={{ width: '239px' }}>
{surfaceTypeList.map((option, index) => (
<div className={`d-check-radio light ${index === surfaceTypeList.length - 1 ? '' : 'mr10'}`} key={index}>
<input
type="radio"
name="surfaceType"
value={option.clCodeNm}
id={`surfaceType${index}`}
{...form.register('surfaceType')}
onChange={(e) => {
handleRadioChange(e)
}}
/>
<label htmlFor={`surfaceType${index}`}>{option.clCodeNm}</label>
</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">
<input type="checkbox" id="saltAreaFlg" {...form.register('saltAreaFlg')} />
<label htmlFor="saltAreaFlg">{getMessage('stuff.detail.saltAreaFlg')}</label>

View File

@ -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,
}

View File

@ -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": "見積書の照会",

View File

@ -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": "견적서 조회",