alert -> swalFire 변경
This commit is contained in:
parent
990ce68672
commit
a3aa1cd216
@ -19,10 +19,10 @@ import { convertNumberToPriceDecimal, convertNumberToPriceDecimalToFixed } from
|
|||||||
import ProductFeaturesPop from './popup/ProductFeaturesPop'
|
import ProductFeaturesPop from './popup/ProductFeaturesPop'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { correntObjectNoState } from '@/store/settingAtom'
|
import { correntObjectNoState } from '@/store/settingAtom'
|
||||||
import { useRouter, useSearchParams } from 'next/navigation'
|
import { useSearchParams } from 'next/navigation'
|
||||||
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
|
||||||
import { usePlan } from '@/hooks/usePlan'
|
import { usePlan } from '@/hooks/usePlan'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
export default function Estimate({}) {
|
export default function Estimate({}) {
|
||||||
const [uniqueData, setUniqueData] = useState([])
|
const [uniqueData, setUniqueData] = useState([])
|
||||||
@ -33,6 +33,8 @@ export default function Estimate({}) {
|
|||||||
const [objectNo, setObjectNo] = useState('') //물건번호
|
const [objectNo, setObjectNo] = useState('') //물건번호
|
||||||
const [planNo, setPlanNo] = useState('') //플랜번호
|
const [planNo, setPlanNo] = useState('') //플랜번호
|
||||||
|
|
||||||
|
const { swalFire } = useSwal()
|
||||||
|
|
||||||
const [files, setFiles] = useState([]) // 보내는 첨부파일
|
const [files, setFiles] = useState([]) // 보내는 첨부파일
|
||||||
const [originFiles, setOriginFiles] = useState([]) //기존 첨부파일
|
const [originFiles, setOriginFiles] = useState([]) //기존 첨부파일
|
||||||
|
|
||||||
@ -347,7 +349,11 @@ export default function Estimate({}) {
|
|||||||
setEstimateContextState({
|
setEstimateContextState({
|
||||||
originFiles: originFiles,
|
originFiles: originFiles,
|
||||||
})
|
})
|
||||||
alert(getMessage('estimate.detail.alert.delFile'))
|
|
||||||
|
swalFire({
|
||||||
|
text: getMessage('estimate.detail.alert.delFile'),
|
||||||
|
type: 'alert',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//가격표시 option 목록 최초세팅 && 주문분류 변경시
|
//가격표시 option 목록 최초세팅 && 주문분류 변경시
|
||||||
@ -359,7 +365,6 @@ export default function Estimate({}) {
|
|||||||
docTpCd: estimateContextState?.estimateType,
|
docTpCd: estimateContextState?.estimateType,
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('param::::::::::', param)
|
|
||||||
const apiUrl = `/api/estimate/price/store-price-list?${queryStringFormatter(param)}`
|
const apiUrl = `/api/estimate/price/store-price-list?${queryStringFormatter(param)}`
|
||||||
get({ url: apiUrl }).then((res) => {
|
get({ url: apiUrl }).then((res) => {
|
||||||
if (isNotEmptyArray(res?.data)) {
|
if (isNotEmptyArray(res?.data)) {
|
||||||
@ -477,7 +482,11 @@ export default function Estimate({}) {
|
|||||||
|
|
||||||
if (!pass) {
|
if (!pass) {
|
||||||
//Pricing이 누락된 아이템이 있습니다. Pricing을 진행해주세요.
|
//Pricing이 누락된 아이템이 있습니다. Pricing을 진행해주세요.
|
||||||
return alert(getMessage('estimate.detail.showPrice.pricingBtn.noItemId'))
|
return swalFire({
|
||||||
|
text: getMessage('estimate.detail.showPrice.pricingBtn.noItemId'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'warning',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -788,7 +797,11 @@ export default function Estimate({}) {
|
|||||||
const removeItem = () => {
|
const removeItem = () => {
|
||||||
const array = [...selection]
|
const array = [...selection]
|
||||||
if (isEmptyArray(array)) {
|
if (isEmptyArray(array)) {
|
||||||
return alert(getMessage('estimate.detail.alert.selectDelItem'))
|
return swalFire({
|
||||||
|
text: getMessage('estimate.detail.alert.selectDelItem'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'warning',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
let delList = []
|
let delList = []
|
||||||
estimateContextState.itemList.filter((row) => {
|
estimateContextState.itemList.filter((row) => {
|
||||||
@ -818,7 +831,11 @@ export default function Estimate({}) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (delCnt === updateList.length) {
|
if (delCnt === updateList.length) {
|
||||||
return alert(getMessage('estimate.detail.save.requiredItem'))
|
return swalFire({
|
||||||
|
text: getMessage('estimate.detail.save.requiredItem'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'warning',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
setEstimateContextState({
|
setEstimateContextState({
|
||||||
|
|||||||
@ -6,9 +6,12 @@ import { useRecoilValue, useRecoilState } from 'recoil'
|
|||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { globalLocaleStore } from '@/store/localeAtom'
|
import { globalLocaleStore } from '@/store/localeAtom'
|
||||||
import { logout, setSession, login } from '@/lib/authActions'
|
import { logout, setSession, login } from '@/lib/authActions'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
export default function ChangePasswordPop(props) {
|
export default function ChangePasswordPop(props) {
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
|
|
||||||
|
const { swalFire } = useSwal()
|
||||||
const { patch } = useAxios(globalLocaleState)
|
const { patch } = useAxios(globalLocaleState)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [sessionState, setSessionState] = useRecoilState(sessionStore)
|
const [sessionState, setSessionState] = useRecoilState(sessionStore)
|
||||||
@ -55,22 +58,38 @@ export default function ChangePasswordPop(props) {
|
|||||||
|
|
||||||
//비밀번호 미입력시
|
//비밀번호 미입력시
|
||||||
if (_password1.trim() === '') {
|
if (_password1.trim() === '') {
|
||||||
alert(getMessage('main.popup.login.validate3'))
|
swalFire({
|
||||||
|
title: getMessage('main.popup.login.validate3'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'error',
|
||||||
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (_password2.trim() === '') {
|
if (_password2.trim() === '') {
|
||||||
alert(getMessage('main.popup.login.validate3'))
|
swalFire({
|
||||||
|
title: getMessage('main.popup.login.validate3'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'error',
|
||||||
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_password1 !== _password2) {
|
if (_password1 !== _password2) {
|
||||||
alert(getMessage('main.popup.login.validate1'))
|
swalFire({
|
||||||
|
title: getMessage('main.popup.login.validate4'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'error',
|
||||||
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
//패스워드 길이수 체크
|
//패스워드 길이수 체크 빈각10 = 전각20
|
||||||
if (checkLength(_password1) > 10) {
|
if (checkLength(_password1) > 20) {
|
||||||
return alert(getMessage('main.popup.login.validate2'))
|
swalFire({
|
||||||
|
title: getMessage('main.popup.login.validate1'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'error',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const param = {
|
const param = {
|
||||||
@ -83,7 +102,10 @@ export default function ChangePasswordPop(props) {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.result?.code === 200) {
|
if (res?.result?.code === 200) {
|
||||||
if (res?.result?.resultCode === 'S') {
|
if (res?.result?.resultCode === 'S') {
|
||||||
alert(getMessage('main.popup.login.success'))
|
swalFire({
|
||||||
|
title: getMessage('main.popup.login.success'),
|
||||||
|
type: 'alert',
|
||||||
|
})
|
||||||
const result = { ...sessionState, pwdInitYn: 'Y' }
|
const result = { ...sessionState, pwdInitYn: 'Y' }
|
||||||
setSession(result)
|
setSession(result)
|
||||||
setSessionState(result)
|
setSessionState(result)
|
||||||
@ -130,6 +152,7 @@ export default function ChangePasswordPop(props) {
|
|||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
onChange={checkValue}
|
onChange={checkValue}
|
||||||
onKeyUp={checkValue}
|
onKeyUp={checkValue}
|
||||||
|
maxLength={20}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -150,6 +173,7 @@ export default function ChangePasswordPop(props) {
|
|||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
onChange={checkValue}
|
onChange={checkValue}
|
||||||
onKeyUp={checkValue}
|
onKeyUp={checkValue}
|
||||||
|
maxLength={20}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -410,11 +410,19 @@ export const useEstimateController = (planNo) => {
|
|||||||
*/
|
*/
|
||||||
const handleEstimateCopy = async (sendPlanNo, copyReceiveUser, saleStoreId, otherSaleStoreId) => {
|
const handleEstimateCopy = async (sendPlanNo, copyReceiveUser, saleStoreId, otherSaleStoreId) => {
|
||||||
if (saleStoreId === '') {
|
if (saleStoreId === '') {
|
||||||
return alert(getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'))
|
return swalFire({
|
||||||
|
text: getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'warning',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copyReceiveUser.trim().length === 0) {
|
if (copyReceiveUser.trim().length === 0) {
|
||||||
return alert(getMessage('estimate.detail.productFeaturesPopup.requiredReceiveUser'))
|
return swalFire({
|
||||||
|
text: getMessage('estimate.detail.productFeaturesPopup.requiredReceiveUser'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'warning',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const params = {
|
const params = {
|
||||||
saleStoreId: session.storeId,
|
saleStoreId: session.storeId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user