parent
80b40bad47
commit
ee1a769097
@ -344,10 +344,6 @@ export default function StuffDetail() {
|
|||||||
if (objectNo) {
|
if (objectNo) {
|
||||||
setManagementState({})
|
setManagementState({})
|
||||||
setEditMode('EDIT')
|
setEditMode('EDIT')
|
||||||
if (objectNo.substring(0, 1) !== 'T') {
|
|
||||||
//벨리데이션 체크용..
|
|
||||||
setIsFormValid(true)
|
|
||||||
}
|
|
||||||
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
if (res?.data?.createSaleStoreId === 'T01') {
|
if (res?.data?.createSaleStoreId === 'T01') {
|
||||||
@ -1022,8 +1018,6 @@ export default function StuffDetail() {
|
|||||||
const _receiveUser = watch('receiveUser')
|
const _receiveUser = watch('receiveUser')
|
||||||
//objectName: '', //물건명
|
//objectName: '', //물건명
|
||||||
const _objectName = watch('objectName')
|
const _objectName = watch('objectName')
|
||||||
// objectNameOmit: '', //경칭선택
|
|
||||||
const _objectNameOmit = watch('objectNameOmit')
|
|
||||||
// saleStoreId: '', //1차 판매점ID
|
// saleStoreId: '', //1차 판매점ID
|
||||||
const _saleStoreId = watch('saleStoreId')
|
const _saleStoreId = watch('saleStoreId')
|
||||||
// 2차 판매점명
|
// 2차 판매점명
|
||||||
@ -1051,12 +1045,11 @@ export default function StuffDetail() {
|
|||||||
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
||||||
errors.receiveUser = true
|
errors.receiveUser = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
||||||
errors.objectName = true
|
errors.objectName = true
|
||||||
}
|
}
|
||||||
if (!formData.objectNameOmit) {
|
|
||||||
errors.objectNameOmit = true
|
|
||||||
}
|
|
||||||
if (!formData.saleStoreId) {
|
if (!formData.saleStoreId) {
|
||||||
errors.saleStoreId = true
|
errors.saleStoreId = true
|
||||||
}
|
}
|
||||||
@ -1102,9 +1095,7 @@ export default function StuffDetail() {
|
|||||||
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
||||||
errors.objectName = true
|
errors.objectName = true
|
||||||
}
|
}
|
||||||
if (!formData.objectNameOmit) {
|
|
||||||
errors.objectNameOmit = true
|
|
||||||
}
|
|
||||||
if (!formData.saleStoreId) {
|
if (!formData.saleStoreId) {
|
||||||
errors.saleStoreId = true
|
errors.saleStoreId = true
|
||||||
}
|
}
|
||||||
@ -1144,7 +1135,6 @@ export default function StuffDetail() {
|
|||||||
}, [
|
}, [
|
||||||
_receiveUser,
|
_receiveUser,
|
||||||
_objectName,
|
_objectName,
|
||||||
_objectNameOmit,
|
|
||||||
_saleStoreId,
|
_saleStoreId,
|
||||||
_otherSaleStoreId,
|
_otherSaleStoreId,
|
||||||
_zipNo,
|
_zipNo,
|
||||||
@ -1165,7 +1155,7 @@ export default function StuffDetail() {
|
|||||||
const onSearchDesignRequestPopOpen = () => {
|
const onSearchDesignRequestPopOpen = () => {
|
||||||
const saleStoreId = form.watch('saleStoreId')
|
const saleStoreId = form.watch('saleStoreId')
|
||||||
if (saleStoreId === '') {
|
if (saleStoreId === '') {
|
||||||
swalFire({ text: getMessage('stuff.planReqPopup.error.message2'), type: 'alert' })
|
swalFire({ text: getMessage('stuff.planReqPopup.error.message2'), type: 'alert', icon: 'warning' })
|
||||||
} else {
|
} else {
|
||||||
setShowDesignRequestButtonValid(true)
|
setShowDesignRequestButtonValid(true)
|
||||||
}
|
}
|
||||||
@ -1175,7 +1165,7 @@ export default function StuffDetail() {
|
|||||||
const onSearchWindSpeedPopOpen = () => {
|
const onSearchWindSpeedPopOpen = () => {
|
||||||
const prefName = form.watch('prefName')
|
const prefName = form.watch('prefName')
|
||||||
if (prefName === '') {
|
if (prefName === '') {
|
||||||
swalFire({ text: getMessage('stuff.windSelectPopup.error.message1'), type: 'alert' })
|
swalFire({ text: getMessage('stuff.windSelectPopup.error.message1'), type: 'alert', icon: 'warning' })
|
||||||
} else {
|
} else {
|
||||||
setShowWindSpeedButtonValid(true)
|
setShowWindSpeedButtonValid(true)
|
||||||
}
|
}
|
||||||
@ -1203,54 +1193,10 @@ export default function StuffDetail() {
|
|||||||
const formData = form.getValues()
|
const formData = form.getValues()
|
||||||
let errors = {}
|
let errors = {}
|
||||||
let fieldNm
|
let fieldNm
|
||||||
//담당자
|
|
||||||
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
//설치높이
|
||||||
fieldNm = getMessage('stuff.detail.receiveUser')
|
if (!formData.installHeight) {
|
||||||
errors = fieldNm
|
fieldNm = getMessage('stuff.detail.installHeight')
|
||||||
}
|
|
||||||
//물건명
|
|
||||||
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
|
||||||
fieldNm = getMessage('stuff.detail.objectStatusId')
|
|
||||||
errors = fieldNm
|
|
||||||
}
|
|
||||||
//경칭
|
|
||||||
if (!formData.objectNameOmit) {
|
|
||||||
fieldNm = getMessage('stuff.detail.objectNameOmit')
|
|
||||||
errors = fieldNm
|
|
||||||
}
|
|
||||||
//1차판매점명
|
|
||||||
if (!formData.saleStoreId) {
|
|
||||||
fieldNm = getMessage('stuff.detail.saleStoreId')
|
|
||||||
errors = fieldNm
|
|
||||||
}
|
|
||||||
//우편번호
|
|
||||||
if (!formData.zipNo) {
|
|
||||||
fieldNm = getMessage('stuff.detail.zipNo')
|
|
||||||
errors = fieldNm
|
|
||||||
}
|
|
||||||
//주소
|
|
||||||
if (!formData.address) {
|
|
||||||
fieldNm = getMessage('stuff.detail.address')
|
|
||||||
errors = fieldNm
|
|
||||||
}
|
|
||||||
//도도부현
|
|
||||||
if (!formData.prefId || formData.prefId === '0') {
|
|
||||||
fieldNm = getMessage('stuff.detail.prefId')
|
|
||||||
errors = fieldNm
|
|
||||||
}
|
|
||||||
//발전시뮬레이션지역
|
|
||||||
if (!formData.areaId) {
|
|
||||||
fieldNm = getMessage('stuff.detail.areaId')
|
|
||||||
errors = fieldNm
|
|
||||||
}
|
|
||||||
//기준풍속
|
|
||||||
if (!formData.standardWindSpeedId) {
|
|
||||||
fieldNm = getMessage('stuff.detail.standardWindSpeedId')
|
|
||||||
errors = fieldNm
|
|
||||||
}
|
|
||||||
//수직적설량
|
|
||||||
if (!formData.verticalSnowCover) {
|
|
||||||
fieldNm = getMessage('stuff.detail.verticalSnowCover')
|
|
||||||
errors = fieldNm
|
errors = fieldNm
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1259,14 +1205,63 @@ export default function StuffDetail() {
|
|||||||
fieldNm = getMessage('stuff.detail.surfaceType')
|
fieldNm = getMessage('stuff.detail.surfaceType')
|
||||||
errors = fieldNm
|
errors = fieldNm
|
||||||
}
|
}
|
||||||
//설치높이
|
|
||||||
if (!formData.installHeight) {
|
//수직적설량
|
||||||
fieldNm = getMessage('stuff.detail.installHeight')
|
if (!formData.verticalSnowCover) {
|
||||||
|
fieldNm = getMessage('stuff.detail.verticalSnowCover')
|
||||||
|
errors = fieldNm
|
||||||
|
}
|
||||||
|
|
||||||
|
//기준풍속
|
||||||
|
if (!formData.standardWindSpeedId) {
|
||||||
|
fieldNm = getMessage('stuff.detail.standardWindSpeedId')
|
||||||
|
errors = fieldNm
|
||||||
|
}
|
||||||
|
|
||||||
|
//발전시뮬레이션지역
|
||||||
|
if (!formData.areaId) {
|
||||||
|
fieldNm = getMessage('stuff.detail.areaId')
|
||||||
|
errors = fieldNm
|
||||||
|
}
|
||||||
|
|
||||||
|
//주소
|
||||||
|
if (!formData.address) {
|
||||||
|
fieldNm = getMessage('stuff.detail.address')
|
||||||
|
errors = fieldNm
|
||||||
|
}
|
||||||
|
|
||||||
|
//도도부현
|
||||||
|
if (!formData.prefId || formData.prefId === '0') {
|
||||||
|
fieldNm = getMessage('stuff.detail.prefId')
|
||||||
|
errors = fieldNm
|
||||||
|
}
|
||||||
|
|
||||||
|
//우편번호
|
||||||
|
if (!formData.zipNo) {
|
||||||
|
fieldNm = getMessage('stuff.detail.zipNo')
|
||||||
|
errors = fieldNm
|
||||||
|
}
|
||||||
|
|
||||||
|
//1차판매점명
|
||||||
|
if (!formData.saleStoreId) {
|
||||||
|
fieldNm = getMessage('stuff.detail.saleStoreId')
|
||||||
|
errors = fieldNm
|
||||||
|
}
|
||||||
|
|
||||||
|
//물건명
|
||||||
|
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
||||||
|
fieldNm = getMessage('stuff.detail.objectStatusId')
|
||||||
|
errors = fieldNm
|
||||||
|
}
|
||||||
|
|
||||||
|
//담당자
|
||||||
|
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
||||||
|
fieldNm = getMessage('stuff.detail.receiveUser')
|
||||||
errors = fieldNm
|
errors = fieldNm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(errors).length > 0) {
|
if (Object.keys(errors).length > 0) {
|
||||||
return swalFire({ text: getMessage('stuff.detail.save.valierror3', [errors]), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.save.valierror3', [errors]), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiUrl = '/api/object/save-object'
|
const apiUrl = '/api/object/save-object'
|
||||||
@ -1306,10 +1301,10 @@ export default function StuffDetail() {
|
|||||||
let height = params.installHeight
|
let height = params.installHeight
|
||||||
|
|
||||||
if (snow === '0') {
|
if (snow === '0') {
|
||||||
return swalFire({ text: getMessage('stuff.detail.save.valierror1'), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.save.valierror1'), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
if (height === '0') {
|
if (height === '0') {
|
||||||
return swalFire({ text: getMessage('stuff.detail.save.valierror2'), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.save.valierror2'), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (managementState) {
|
if (managementState) {
|
||||||
@ -1363,29 +1358,29 @@ export default function StuffDetail() {
|
|||||||
delete params_sort.workName
|
delete params_sort.workName
|
||||||
|
|
||||||
if (Object.entries(detail_sort).toString() === Object.entries(params_sort).toString()) {
|
if (Object.entries(detail_sort).toString() === Object.entries(params_sort).toString()) {
|
||||||
return swalFire({ text: getMessage('stuff.detail.noChgData'), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.noChgData'), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params?.receiveUser !== '') {
|
if (params?.receiveUser !== '') {
|
||||||
if (params?.receiveUser.trim().length > 10) {
|
if (params?.receiveUser.trim().length > 10) {
|
||||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//로그인이 2차점인데 otherSaleStoreId가 없으면 알럿
|
//로그인이 2차점인데 otherSaleStoreId가 없으면 알럿
|
||||||
if (session.storeLvl !== '1') {
|
if (session.storeLvl !== '1') {
|
||||||
if (params.saleStoreLevel === '1') {
|
if (params.saleStoreLevel === '1') {
|
||||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editMode === 'NEW') {
|
if (editMode === 'NEW') {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
await promisePost({ url: apiUrl, data: params })
|
await promisePost({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setIsGlobalLoading(true)
|
|
||||||
//상세화면으로 전환
|
//상세화면으로 전환
|
||||||
|
setIsGlobalLoading(false)
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
setIsGlobalLoading(false)
|
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: res?.data?.objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: res?.data?.objectNo })
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('stuff.detail.save'),
|
text: getMessage('stuff.detail.save'),
|
||||||
@ -1397,17 +1392,16 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log('error::::::', error)
|
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
|
console.log('error::::::', error)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 수정모드일때는 PUT
|
// 수정모드일때는 PUT
|
||||||
|
setIsGlobalLoading(true)
|
||||||
await promisePut({ url: apiUrl, data: params })
|
await promisePut({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(false)
|
||||||
|
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
setIsGlobalLoading(false)
|
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('stuff.detail.save'),
|
text: getMessage('stuff.detail.save'),
|
||||||
@ -1426,8 +1420,8 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log('error::::::', error)
|
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
|
console.log('error::::::', error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1474,24 +1468,24 @@ export default function StuffDetail() {
|
|||||||
if (session.storeLvl !== '1') {
|
if (session.storeLvl !== '1') {
|
||||||
//로그인이 1차점이 아닌데 2차점을 안골라서 saleStoreLevel = 1로 셋팅되어있으면 알럿
|
//로그인이 1차점이 아닌데 2차점을 안골라서 saleStoreLevel = 1로 셋팅되어있으면 알럿
|
||||||
if (params.saleStoreLevel === '1') {
|
if (params.saleStoreLevel === '1') {
|
||||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 담당자 자리수 체크
|
// 담당자 자리수 체크
|
||||||
if (params?.receiveUser !== '') {
|
if (params?.receiveUser !== '') {
|
||||||
if (params?.receiveUser.trim().length > 10) {
|
if (params?.receiveUser.trim().length > 10) {
|
||||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiUrl = '/api/object/save-object'
|
const apiUrl = '/api/object/save-object'
|
||||||
if (objectNo) {
|
if (objectNo) {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
await promisePut({ url: apiUrl, data: params })
|
await promisePut({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(false)
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
setIsGlobalLoading(false)
|
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('stuff.detail.tempSave.message1'),
|
text: getMessage('stuff.detail.tempSave.message1'),
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
@ -1506,11 +1500,11 @@ export default function StuffDetail() {
|
|||||||
console.log('error::::::', error)
|
console.log('error::::::', error)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
await promisePost({ url: apiUrl, data: params })
|
await promisePost({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(false)
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
setIsGlobalLoading(false)
|
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('stuff.detail.tempSave.message1'),
|
text: getMessage('stuff.detail.tempSave.message1'),
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
@ -1521,8 +1515,8 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log('error::::::', error)
|
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
|
console.log('error::::::', error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1676,15 +1670,15 @@ export default function StuffDetail() {
|
|||||||
{getMessage('stuff.detail.required')}
|
{getMessage('stuff.detail.required')}
|
||||||
</div>
|
</div>
|
||||||
<div className="left-unit-box">
|
<div className="left-unit-box">
|
||||||
{!isFormValid ? (
|
{/* {!isFormValid ? ( */}
|
||||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.tempSave')}
|
{getMessage('stuff.detail.btn.tempSave')}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
{/* ) : ( */}
|
||||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
{/* )} */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-origin grey"
|
className="btn-origin grey"
|
||||||
@ -2184,15 +2178,15 @@ export default function StuffDetail() {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div className="sub-right-footer">
|
<div className="sub-right-footer">
|
||||||
{!isFormValid ? (
|
{/* {!isFormValid ? ( */}
|
||||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.tempSave')}
|
{getMessage('stuff.detail.btn.tempSave')}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
{/* ) : ( */}
|
||||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
{/* )} */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-origin grey"
|
className="btn-origin grey"
|
||||||
@ -2238,15 +2232,15 @@ export default function StuffDetail() {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="left-unit-box">
|
<div className="left-unit-box">
|
||||||
{!isFormValid ? (
|
{/* {!isFormValid ? ( */}
|
||||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.tempSave')}
|
{getMessage('stuff.detail.btn.tempSave')}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
{/* ) : ( */}
|
||||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
{/* )} */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-origin grey"
|
className="btn-origin grey"
|
||||||
@ -2833,15 +2827,15 @@ export default function StuffDetail() {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="sub-right-footer">
|
<div className="sub-right-footer">
|
||||||
{!isFormValid ? (
|
{/* {!isFormValid ? ( */}
|
||||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.tempSave')}
|
{getMessage('stuff.detail.btn.tempSave')}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
{/* ) : ( */}
|
||||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
{/* )} */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-origin grey"
|
className="btn-origin grey"
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { useRecoilValue } from 'recoil'
|
|||||||
import FindAddressPopQGrid from './FindAddressPopQGrid'
|
import FindAddressPopQGrid from './FindAddressPopQGrid'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { isNotEmptyArray } from '@/util/common-utils'
|
import { isNotEmptyArray } from '@/util/common-utils'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
export default function FindAddressPop(props) {
|
export default function FindAddressPop(props) {
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ export default function FindAddressPop(props) {
|
|||||||
const [address1, setAddress1] = useState(null)
|
const [address1, setAddress1] = useState(null)
|
||||||
const [address2, setAddress2] = useState(null)
|
const [address2, setAddress2] = useState(null)
|
||||||
const [address3, setAddress3] = useState(null)
|
const [address3, setAddress3] = useState(null)
|
||||||
|
const { swalFire } = useSwal()
|
||||||
const [gridProps, setGridProps] = useState({
|
const [gridProps, setGridProps] = useState({
|
||||||
gridData: [],
|
gridData: [],
|
||||||
isPageable: false,
|
isPageable: false,
|
||||||
@ -65,11 +66,11 @@ export default function FindAddressPop(props) {
|
|||||||
if (isNotEmptyArray(res.results)) {
|
if (isNotEmptyArray(res.results)) {
|
||||||
setGridProps({ ...gridProps, gridData: res.results })
|
setGridProps({ ...gridProps, gridData: res.results })
|
||||||
} else {
|
} else {
|
||||||
alert(getMessage('stuff.addressPopup.error.message1'))
|
swalFire({ text: getMessage('stuff.addressPopup.error.message1'), type: 'alert', icon: 'warning' })
|
||||||
setGridProps({ ...gridProps, gridData: [] })
|
setGridProps({ ...gridProps, gridData: [] })
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert(getMessage('stuff.addressPopup.error.message1'))
|
swalFire({ text: getMessage('stuff.addressPopup.error.message1'), type: 'alert', icon: 'warning' })
|
||||||
setGridProps({ ...gridProps, gridData: [] })
|
setGridProps({ ...gridProps, gridData: [] })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -77,7 +78,7 @@ export default function FindAddressPop(props) {
|
|||||||
// 주소적용 클릭
|
// 주소적용 클릭
|
||||||
const applyAddress = () => {
|
const applyAddress = () => {
|
||||||
if (prefId == null) {
|
if (prefId == null) {
|
||||||
alert(getMessage('stuff.addressPopup.error.message2'))
|
swalFire({ text: getMessage('stuff.addressPopup.error.message2'), type: 'alert', icon: 'warning' })
|
||||||
} else {
|
} else {
|
||||||
props.zipInfo({
|
props.zipInfo({
|
||||||
zipNo: zipNo,
|
zipNo: zipNo,
|
||||||
@ -128,7 +129,7 @@ export default function FindAddressPop(props) {
|
|||||||
setZipNo(event.data.zipcode)
|
setZipNo(event.data.zipcode)
|
||||||
|
|
||||||
if (event.data.prefcode == null) {
|
if (event.data.prefcode == null) {
|
||||||
return alert(getMessage('stuff.addressPopup.error.message2'))
|
return swalFire({ text: getMessage('stuff.addressPopup.error.message2'), type: 'alert', icon: 'warning' })
|
||||||
} else {
|
} else {
|
||||||
props.zipInfo({
|
props.zipInfo({
|
||||||
zipNo: event.data.zipcode,
|
zipNo: event.data.zipcode,
|
||||||
|
|||||||
@ -9,11 +9,12 @@ import dayjs from 'dayjs'
|
|||||||
import PlanRequestPopQGrid from './PlanRequestPopQGrid'
|
import PlanRequestPopQGrid from './PlanRequestPopQGrid'
|
||||||
import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
||||||
import QPagination from '@/components/common/pagination/QPagination'
|
import QPagination from '@/components/common/pagination/QPagination'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
export default function PlanRequestPop(props) {
|
export default function PlanRequestPop(props) {
|
||||||
const [pageNo, setPageNo] = useState(1) //현재 페이지 번호
|
const [pageNo, setPageNo] = useState(1) //현재 페이지 번호
|
||||||
const [pageSize, setPageSize] = useState(20) //페이지 당 게시물 개수
|
const [pageSize, setPageSize] = useState(20) //페이지 당 게시물 개수
|
||||||
const [totalCount, setTotalCount] = useState(0) //총 갯수
|
const [totalCount, setTotalCount] = useState(0) //총 갯수
|
||||||
|
const { swalFire } = useSwal()
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
|
|
||||||
const [planReqObject, setPlanReqObject] = useState({})
|
const [planReqObject, setPlanReqObject] = useState({})
|
||||||
@ -214,7 +215,7 @@ export default function PlanRequestPop(props) {
|
|||||||
// 팝업닫기
|
// 팝업닫기
|
||||||
props.setShowDesignRequestButtonValid(false)
|
props.setShowDesignRequestButtonValid(false)
|
||||||
} else {
|
} else {
|
||||||
alert(getMessage('stuff.planReqPopup.error.message1'))
|
swalFire({ text: getMessage('stuff.planReqPopup.error.message1'), type: 'alert', icon: 'warning' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,14 +3,16 @@ import { useMessage } from '@/hooks/useMessage'
|
|||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { globalLocaleStore } from '@/store/localeAtom'
|
import { globalLocaleStore } from '@/store/localeAtom'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { isEmptyArray, isNotEmptyArray } from '@/util/common-utils'
|
import { isEmptyArray } from '@/util/common-utils'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
export default function WindSelectPop(props) {
|
export default function WindSelectPop(props) {
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const { promiseGet } = useAxios(globalLocaleState)
|
const { promiseGet } = useAxios(globalLocaleState)
|
||||||
const [windSpeedList, setWindSpeedList] = useState([])
|
const [windSpeedList, setWindSpeedList] = useState([])
|
||||||
const [windSpeed, setWindSpeed] = useState(null)
|
const [windSpeed, setWindSpeed] = useState(null)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
|
const { swalFire } = useSwal()
|
||||||
//선택한 라디오 값 세팅
|
//선택한 라디오 값 세팅
|
||||||
const handleChangeRadio = (e) => {
|
const handleChangeRadio = (e) => {
|
||||||
setWindSpeed(e.target.value)
|
setWindSpeed(e.target.value)
|
||||||
@ -19,7 +21,7 @@ export default function WindSelectPop(props) {
|
|||||||
//적용
|
//적용
|
||||||
const applyWindSpeed = () => {
|
const applyWindSpeed = () => {
|
||||||
if (windSpeed == null) {
|
if (windSpeed == null) {
|
||||||
alert(getMessage('stuff.windSelectPopup.error.message2'))
|
swalFire({ text: getMessage('stuff.windSelectPopup.error.message2'), type: 'alert', icon: 'warning' })
|
||||||
} else {
|
} else {
|
||||||
props.windSpeedInfo({ windSpeed: windSpeed })
|
props.windSpeedInfo({ windSpeed: windSpeed })
|
||||||
|
|
||||||
|
|||||||
@ -647,7 +647,7 @@
|
|||||||
"stuff.gridData.tempObjectNo": "임시저장물건",
|
"stuff.gridData.tempObjectNo": "임시저장물건",
|
||||||
"stuff.message.periodError": "최대1년 조회 가능합니다.",
|
"stuff.message.periodError": "최대1년 조회 가능합니다.",
|
||||||
"stuff.addressPopup.title": "우편번호",
|
"stuff.addressPopup.title": "우편번호",
|
||||||
"stuff.addressPopup.placeholder": "우편번호의 7자리를 입력하세요.",
|
"stuff.addressPopup.placeholder": "우편번호 7자리를 입력하세요.",
|
||||||
"stuff.addressPopup.error.message1": "등록된 우편번호에서 주소를 찾을 수 없습니다. 다시 입력해주세요.",
|
"stuff.addressPopup.error.message1": "등록된 우편번호에서 주소를 찾을 수 없습니다. 다시 입력해주세요.",
|
||||||
"stuff.addressPopup.error.message2": "주소를 선택해주세요.",
|
"stuff.addressPopup.error.message2": "주소를 선택해주세요.",
|
||||||
"stuff.addressPopup.gridHeader.address1": "도도부현",
|
"stuff.addressPopup.gridHeader.address1": "도도부현",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user