alert => swalFire
This commit is contained in:
parent
316dc2c4ff
commit
c8e18bee17
@ -46,7 +46,6 @@ export default function Estimate({}) {
|
|||||||
|
|
||||||
const [selection, setSelection] = useState(new Set())
|
const [selection, setSelection] = useState(new Set())
|
||||||
//견적특이사항 접고 펼치기
|
//견적특이사항 접고 펼치기
|
||||||
// const [hidden, setHidden] = useState(false)
|
|
||||||
const [hidden, setHidden] = useState(true)
|
const [hidden, setHidden] = useState(true)
|
||||||
|
|
||||||
//아이템 자동완성 리스트
|
//아이템 자동완성 리스트
|
||||||
@ -569,7 +568,7 @@ export default function Estimate({}) {
|
|||||||
return selection.size === getAbledItems(estimateContextState.itemList).length
|
return selection.size === getAbledItems(estimateContextState.itemList).length
|
||||||
}
|
}
|
||||||
|
|
||||||
//row 체크박스 컨트롤
|
//아이템row 체크박스 컨트롤
|
||||||
const onChangeSelect = (dispOrder) => {
|
const onChangeSelect = (dispOrder) => {
|
||||||
const newSelection = new Set(selection)
|
const newSelection = new Set(selection)
|
||||||
if (newSelection.has(dispOrder)) {
|
if (newSelection.has(dispOrder)) {
|
||||||
@ -581,10 +580,6 @@ export default function Estimate({}) {
|
|||||||
setSelection(newSelection)
|
setSelection(newSelection)
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatNumberWithComma(number) {
|
|
||||||
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
|
||||||
}
|
|
||||||
|
|
||||||
//주택PKG input 변경
|
//주택PKG input 변경
|
||||||
const onChangePkgAsp = (value) => {
|
const onChangePkgAsp = (value) => {
|
||||||
if (estimateContextState.estimateType === 'YJSS') {
|
if (estimateContextState.estimateType === 'YJSS') {
|
||||||
@ -1140,6 +1135,7 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [estimateContextState])
|
}, [estimateContextState])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="sub-content estimate">
|
<div className="sub-content estimate">
|
||||||
<div className="sub-content-inner">
|
<div className="sub-content-inner">
|
||||||
|
|||||||
@ -119,7 +119,11 @@ export default function ChangePasswordPop(props) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
alert(res?.result?.resultMsg)
|
swalFire({
|
||||||
|
text: getMessage(res?.result?.resultMsg),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'error',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
|
|||||||
@ -75,7 +75,10 @@ export default function Stuff() {
|
|||||||
type: 'alert',
|
type: 'alert',
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert(getMessage('stuff.detail.header.failCopy'))
|
swalFire({
|
||||||
|
text: getMessage('stuff.detail.header.failCopy'),
|
||||||
|
type: 'alert',
|
||||||
|
})
|
||||||
} finally {
|
} finally {
|
||||||
textArea.remove()
|
textArea.remove()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,7 +107,6 @@ export default function StuffDetail() {
|
|||||||
|
|
||||||
const [areaIdList, setAreaIdList] = useState([]) //발전시뮬레이션 리스트
|
const [areaIdList, setAreaIdList] = useState([]) //발전시뮬레이션 리스트
|
||||||
|
|
||||||
const [isFormValid, setIsFormValid] = useState(false) //임시저장, 진짜저장 버튼 컨트롤
|
|
||||||
const [showAddressButtonValid, setShowAddressButtonValid] = useState(false) //주소검색팝업 활성화 컨트롤
|
const [showAddressButtonValid, setShowAddressButtonValid] = useState(false) //주소검색팝업 활성화 컨트롤
|
||||||
const [showDesignRequestButtonValid, setShowDesignRequestButtonValid] = useState(false) //설계의뢰팝업 활성화 컨트롤
|
const [showDesignRequestButtonValid, setShowDesignRequestButtonValid] = useState(false) //설계의뢰팝업 활성화 컨트롤
|
||||||
const [showWindSpeedButtonValid, setShowWindSpeedButtonValid] = useState(false) //풍속선택팝업 활성화 컨트롤
|
const [showWindSpeedButtonValid, setShowWindSpeedButtonValid] = useState(false) //풍속선택팝업 활성화 컨트롤
|
||||||
@ -1094,8 +1093,6 @@ export default function StuffDetail() {
|
|||||||
if (!formData.installHeight) {
|
if (!formData.installHeight) {
|
||||||
errors.installHeight = true
|
errors.installHeight = true
|
||||||
}
|
}
|
||||||
|
|
||||||
setIsFormValid(Object.keys(errors).length === 0 ? true : false)
|
|
||||||
} else {
|
} else {
|
||||||
//상세일떄 폼체크
|
//상세일떄 폼체크
|
||||||
const formData = form.getValues()
|
const formData = form.getValues()
|
||||||
@ -1140,8 +1137,6 @@ export default function StuffDetail() {
|
|||||||
if (!formData.installHeight) {
|
if (!formData.installHeight) {
|
||||||
errors.installHeight = true
|
errors.installHeight = true
|
||||||
}
|
}
|
||||||
|
|
||||||
setIsFormValid(Object.keys(errors).length === 0 ? true : false)
|
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
_receiveUser,
|
_receiveUser,
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import { useContext, useEffect } from 'react'
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||||
// import { ManagementContext } from '@/app/management/ManagementProvider'
|
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
export default function StuffHeader() {
|
export default function StuffHeader() {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -23,7 +22,10 @@ export default function StuffHeader() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
alert(getMessage('stuff.detail.header.failCopy'))
|
swalFire({
|
||||||
|
text: getMessage('stuff.detail.header.failCopy'),
|
||||||
|
type: 'alert',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// Use the 'out of viewport hidden text area' trick
|
// Use the 'out of viewport hidden text area' trick
|
||||||
@ -44,7 +46,10 @@ export default function StuffHeader() {
|
|||||||
type: 'alert',
|
type: 'alert',
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert(getMessage('stuff.detail.header.failCopy'))
|
swalFire({
|
||||||
|
text: getMessage('stuff.detail.header.failCopy'),
|
||||||
|
type: 'alert',
|
||||||
|
})
|
||||||
} finally {
|
} finally {
|
||||||
textArea.remove()
|
textArea.remove()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import { isObjectNotEmpty } from '@/util/common-utils'
|
|||||||
import { SessionContext } from '@/app/SessionProvider'
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
|
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
export default function StuffSearchCondition() {
|
export default function StuffSearchCondition() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -73,17 +74,24 @@ export default function StuffSearchCondition() {
|
|||||||
const [otherSaleStoreId, setOtherSaleStoreId] = useState('')
|
const [otherSaleStoreId, setOtherSaleStoreId] = useState('')
|
||||||
|
|
||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
const { swalFire } = useSwal()
|
||||||
|
|
||||||
// 조회
|
// 조회
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
let diff = dayjs(endDate).diff(startDate, 'day')
|
let diff = dayjs(endDate).diff(startDate, 'day')
|
||||||
|
|
||||||
if (diff > 366) {
|
if (diff > 366) {
|
||||||
return alert(getMessage('stuff.message.periodError'))
|
return swalFire({
|
||||||
|
text: getMessage('stuff.message.periodError'),
|
||||||
|
type: 'alert',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(diff)) {
|
if (isNaN(diff)) {
|
||||||
return alert(getMessage('stuff.message.periodError'))
|
return swalFire({
|
||||||
|
text: getMessage('stuff.message.periodError'),
|
||||||
|
type: 'alert',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user