물건상세화면
This commit is contained in:
parent
6da947f6da
commit
ba23e3b55c
@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import React, { useState, useEffect, useRef } from 'react'
|
||||
import { useState, useEffect, useRef, useContext } from 'react'
|
||||
import { useRouter, useSearchParams, usePathname } from 'next/navigation'
|
||||
import { Button } from '@nextui-org/react'
|
||||
import Select, { components } from 'react-select'
|
||||
@ -12,6 +12,7 @@ import { useMessage } from '@/hooks/useMessage'
|
||||
import { useForm } from 'react-hook-form'
|
||||
import { useRecoilValue, useSetRecoilState } from 'recoil'
|
||||
import { sessionStore } from '@/store/commonAtom'
|
||||
import { SessionContext } from '@/app/SessionProvider'
|
||||
import FindAddressPop from './popup/FindAddressPop'
|
||||
import PlanRequestPop from './popup/PlanRequestPop'
|
||||
import WindSelectPop from './popup/WindSelectPop'
|
||||
@ -22,19 +23,13 @@ import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
||||
export default function StuffDetail() {
|
||||
const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) //견적서 화면용 물건번호리코일
|
||||
|
||||
// const inputReceiveUserEl = useRef(null) //담당자ref
|
||||
// const inputObjectNameEl = useRef(null) //물건명ref
|
||||
// const inputZipNoEl = useRef(null) //우편번호ref
|
||||
// const inputAddressEl = useRef(null) //주소ref
|
||||
// const inputVerticalSnowCoverEl = useRef(null) //수직적설량ref
|
||||
// const inputInstallHeightEl = useRef(null) //설치높이ref
|
||||
|
||||
//공통코드
|
||||
const { commonCode, findCommonCode } = useCommonCode()
|
||||
const [selOptions, setSelOptions] = useState('') //선택한 1차점
|
||||
const [otherSelOptions, setOtherSelOptions] = useState('') //선택한 1차점외
|
||||
|
||||
const sessionState = useRecoilValue(sessionStore)
|
||||
const { session } = useContext(SessionContext)
|
||||
|
||||
const router = useRouter()
|
||||
const pathname = usePathname()
|
||||
@ -252,6 +247,7 @@ export default function StuffDetail() {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('buttonStyle:::', buttonStyle, params.value)
|
||||
return (
|
||||
<>
|
||||
<div className="grid-cell-btn">
|
||||
@ -322,55 +318,132 @@ export default function StuffDetail() {
|
||||
//1차점 : X167 T01
|
||||
//2차점 : 10X22, 201X112
|
||||
let url
|
||||
if (sessionState?.storeId === 'T01') {
|
||||
// url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=an1`
|
||||
url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=${sessionState?.userId}`
|
||||
let firstList
|
||||
let otherList
|
||||
let favList
|
||||
// if (sessionState?.storeId === 'T01') {
|
||||
if (session?.storeId === 'T01') {
|
||||
console.log('신규T01::::::::::::::::::::::::::::::::::::')
|
||||
// url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=${sessionState?.userId}`
|
||||
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
|
||||
} else {
|
||||
url = `/api/object/saleStore/${sessionState?.storeId}/list`
|
||||
// url = `/api/object/saleStore/${sessionState?.storeId}/list`
|
||||
if (session.storeLvl === '1') {
|
||||
console.log('로그인이1차:::::::')
|
||||
//url = `/api/object/saleStore/${session?.storeId}/list`
|
||||
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||
} else {
|
||||
console.log('로그인이2차:::')
|
||||
url = ``
|
||||
}
|
||||
}
|
||||
|
||||
get({ url: url }).then((res) => {
|
||||
if (!isEmptyArray(res)) {
|
||||
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||
let favList
|
||||
if (sessionState?.storeId === 'T01') {
|
||||
res.map((row) => {
|
||||
row.value = row.saleStoreId
|
||||
row.label = row.saleStoreName
|
||||
})
|
||||
if (session?.storeId === 'T01') {
|
||||
firstList = res
|
||||
firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
||||
favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
||||
|
||||
setSaleStoreList(firstList)
|
||||
setFavoriteStoreList(favList)
|
||||
setShowSaleStoreList(favList)
|
||||
} else {
|
||||
//1차점 셀렉트박스
|
||||
setSaleStoreList(firstList)
|
||||
}
|
||||
const otherList = res.filter((row) => row.saleStoreLevel !== '1')
|
||||
let filterOtherList
|
||||
if (sessionState?.storeId === 'T01') {
|
||||
filterOtherList = otherList.filter((row) => row.firstAgentId === 'T01')
|
||||
setSelOptions(session?.storeId)
|
||||
form.setValue('saleStoreId', session?.storeId)
|
||||
form.setValue('saleStoreLevel', session?.storeLvl)
|
||||
//T01일떄는 1차점을 고른다음 2차점 목록 조회하기
|
||||
//디폴트 값(T01)으로 2차점목록 조회하기
|
||||
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=0&userId=${session?.userId}`
|
||||
get({ url: url }).then((res) => {
|
||||
if (!isEmptyArray(res)) {
|
||||
res.map((row) => {
|
||||
row.value = row.saleStoreId
|
||||
row.label = row.saleStoreName
|
||||
})
|
||||
|
||||
setOriginOtherSaleStoreList(filterOtherList)
|
||||
setOtherSaleStoreList(filterOtherList)
|
||||
otherList = res
|
||||
setOtherSaleStoreList(otherList)
|
||||
} else {
|
||||
setOtherSaleStoreList([])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
//T01 아니고 2차점 판매점 셀렉트박스
|
||||
setOriginOtherSaleStoreList(otherList)
|
||||
setOtherSaleStoreList(otherList)
|
||||
}
|
||||
if (session?.storeLvl === '1') {
|
||||
firstList = res
|
||||
favList = res.filter((row) => row.priority !== 'B')
|
||||
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
||||
|
||||
if (sessionState?.storeLvl === '1') {
|
||||
setSelOptions(sessionState?.storeId)
|
||||
form.setValue('saleStoreId', sessionState?.storeId)
|
||||
form.setValue('saleStoreLevel', sessionState?.storeLvl)
|
||||
} else {
|
||||
setSelOptions(firstList[0].saleStoreId)
|
||||
setOtherSelOptions(sessionState?.storeId)
|
||||
form.setValue('saleStoreId', firstList[0].saleStoreId)
|
||||
form.setValue('otherSaleStoreId', sessionState?.storeId)
|
||||
form.setValue('otherSaleStoreLevel', sessionState?.storeLvl)
|
||||
setSaleStoreList(firstList)
|
||||
setFavoriteStoreList(firstList)
|
||||
setShowSaleStoreList(firstList)
|
||||
setSelOptions(firstList[0].saleStoreId)
|
||||
form.setValue('saleStoreId', session?.storeId)
|
||||
form.setValue('saleStoreLevel', session?.storeLvl)
|
||||
|
||||
setOtherSaleStoreList(otherList)
|
||||
} else {
|
||||
console.log('1차점아님:::::::::', res)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// get({ url: url }).then((res) => {
|
||||
// if (!isEmptyArray(res)) {
|
||||
// const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||
// let favList
|
||||
// // if (sessionState?.storeId === 'T01') {
|
||||
// if (session?.storeId === 'T01') {
|
||||
// firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
||||
// favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
||||
// setSaleStoreList(firstList)
|
||||
// setFavoriteStoreList(favList)
|
||||
// setShowSaleStoreList(favList)
|
||||
// } else {
|
||||
// //1차점 셀렉트박스
|
||||
// setSaleStoreList(firstList)
|
||||
// }
|
||||
// const otherList = res.filter((row) => row.saleStoreLevel !== '1')
|
||||
// let filterOtherList
|
||||
// // if (sessionState?.storeId === 'T01') {
|
||||
// if (session?.storeId === 'T01') {
|
||||
// filterOtherList = otherList.filter((row) => row.firstAgentId === 'T01')
|
||||
|
||||
// setOriginOtherSaleStoreList(filterOtherList)
|
||||
// setOtherSaleStoreList(filterOtherList)
|
||||
// } else {
|
||||
// //T01 아니고 2차점 판매점 셀렉트박스
|
||||
// setOriginOtherSaleStoreList(otherList)
|
||||
// setOtherSaleStoreList(otherList)
|
||||
// }
|
||||
|
||||
// // if (sessionState?.storeLvl === '1') {
|
||||
// if (session?.storeLvl === '1') {
|
||||
// // setSelOptions(sessionState?.storeId)
|
||||
// setSelOptions(session?.storeId)
|
||||
// // form.setValue('saleStoreId', sessionState?.storeId)
|
||||
// form.setValue('saleStoreId', session?.storeId)
|
||||
// // form.setValue('saleStoreLevel', sessionState?.storeLvl)
|
||||
// form.setValue('saleStoreLevel', session?.storeLvl)
|
||||
// } else {
|
||||
// setSelOptions(firstList[0].saleStoreId)
|
||||
// // setOtherSelOptions(sessionState?.storeId)
|
||||
// setOtherSelOptions(session?.storeId)
|
||||
// form.setValue('saleStoreId', firstList[0].saleStoreId)
|
||||
// // form.setValue('otherSaleStoreId', sessionState?.storeId)
|
||||
// form.setValue('otherSaleStoreId', session?.storeId)
|
||||
// // form.setValue('otherSaleStoreLevel', sessionState?.storeLvl)
|
||||
// form.setValue('otherSaleStoreLevel', session?.storeLvl)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}, [objectNo, sessionState])
|
||||
// }, [objectNo, sessionState])
|
||||
}, [objectNo, session])
|
||||
|
||||
useEffect(() => {
|
||||
const code1 = findCommonCode(200800) //경칭
|
||||
@ -389,7 +462,7 @@ export default function StuffDetail() {
|
||||
|
||||
useEffect(() => {
|
||||
if (isObjectNotEmpty(detailData)) {
|
||||
// console.log('상세데이타세팅:::::', detailData)
|
||||
console.log('상세데이타세팅:::::', detailData)
|
||||
// 도도부현API
|
||||
get({ url: '/api/object/prefecture/list' }).then((res) => {
|
||||
if (!isEmptyArray(res)) {
|
||||
@ -400,38 +473,73 @@ export default function StuffDetail() {
|
||||
//1차점 : X167 T01
|
||||
//2차점 : 10X22, 201X112
|
||||
let url
|
||||
if (sessionState?.storeId === 'T01') {
|
||||
// url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=an1`
|
||||
url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=${sessionState?.userId}`
|
||||
let firstList
|
||||
let otherList
|
||||
let favList
|
||||
// if (sessionState?.storeId === 'T01') {
|
||||
if (session?.storeId === 'T01') {
|
||||
// url = `/api/object/saleStore/${sessionState?.storeId}/firstList?userId=${sessionState?.userId}`
|
||||
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
|
||||
} else {
|
||||
url = `/api/object/saleStore/${sessionState?.storeId}/list`
|
||||
// if (sessionState.storeLvl === '1') {
|
||||
if (session.storeLvl === '1') {
|
||||
// url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
|
||||
} else {
|
||||
// url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
|
||||
}
|
||||
}
|
||||
get({ url: url }).then((res) => {
|
||||
if (!isEmptyArray(res)) {
|
||||
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||
const otherList = res.filter((row) => row.saleStoreLevel !== '1')
|
||||
let favList
|
||||
|
||||
if (sessionState?.storeId === 'T01') {
|
||||
// if (sessionState?.storeId === 'T01') {
|
||||
if (session?.storeId === 'T01') {
|
||||
firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||
firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
||||
favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
||||
setSaleStoreList(firstList)
|
||||
setFavoriteStoreList(favList)
|
||||
setShowSaleStoreList(favList)
|
||||
|
||||
//상세데이터의 1차점 아이디로 2차점 목록 조회하기
|
||||
// url = `/api/object/saleStore/${detailData?.saleStoreId}/list?firstFlg=0&userId=${sessionState?.userId}`
|
||||
url = `/api/object/saleStore/${detailData?.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||
|
||||
get({ url: url }).then((res) => {
|
||||
if (!isEmptyArray(res)) {
|
||||
res.map((row) => {
|
||||
row.value = row.saleStoreId
|
||||
row.label = row.saleStoreName
|
||||
})
|
||||
|
||||
otherList = res
|
||||
setOriginOtherSaleStoreList(otherList)
|
||||
setOtherSaleStoreList(otherList)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
//1차점 셀렉트박스
|
||||
setSaleStoreList(firstList)
|
||||
}
|
||||
// if (sessionState?.storeLvl === '1') {
|
||||
if (session?.storeLvl === '1') {
|
||||
firstList = res
|
||||
favList = res.filter((row) => row.priority !== 'B')
|
||||
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
||||
|
||||
let filterOtherList
|
||||
if (sessionState?.storeId === 'T01') {
|
||||
filterOtherList = otherList.filter((row) => row.firstAgentId === 'T01')
|
||||
setOriginOtherSaleStoreList(filterOtherList)
|
||||
setOtherSaleStoreList(filterOtherList)
|
||||
} else {
|
||||
//1차점 아닌 판매점 셀렉트박스
|
||||
setOriginOtherSaleStoreList(otherList)
|
||||
setOtherSaleStoreList(otherList)
|
||||
setSaleStoreList(firstList)
|
||||
setFavoriteStoreList(firstList)
|
||||
setShowSaleStoreList(firstList)
|
||||
|
||||
setOtherSaleStoreList(otherList)
|
||||
} else {
|
||||
setSelOptions(res[0].saleStoreId)
|
||||
form.setValue('saleStoreId', res[0].saleStoreId)
|
||||
form.setValue('saleStoreLevel', res[0].storeLvl)
|
||||
setSaleStoreList(res)
|
||||
setFavoriteStoreList(res)
|
||||
setShowSaleStoreList(res)
|
||||
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
||||
setOtherSaleStoreList(otherList)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -442,9 +550,6 @@ export default function StuffDetail() {
|
||||
form.setValue('saleStoreId', detailData.saleStoreId)
|
||||
form.setValue('saleStoreLevel', detailData.saleStoreLevel)
|
||||
} else {
|
||||
setSelOptions(sessionState?.storeId)
|
||||
form.setValue('saleStoreId', sessionState?.storeId)
|
||||
form.setValue('saleStoreLevel', sessionState?.storeLvl)
|
||||
setOtherSelOptions(detailData.saleStoreId)
|
||||
form.setValue('otherSaleStoreId', detailData.saleStoreId)
|
||||
form.setValue('otherSaleStoreLevel', detailData.saleStoreLevel)
|
||||
@ -504,7 +609,8 @@ export default function StuffDetail() {
|
||||
form.setValue('remarks', detailData.remarks)
|
||||
})
|
||||
}
|
||||
}, [detailData, sessionState])
|
||||
// }, [detailData, sessionState])
|
||||
}, [detailData, session])
|
||||
|
||||
//경칭선택 변경 이벤트
|
||||
const onChangeHonorificCode = (key) => {
|
||||
@ -586,8 +692,9 @@ export default function StuffDetail() {
|
||||
setSelOptions(key.saleStoreId)
|
||||
//선택한 1차점 정보로 2차점 list 추리기
|
||||
//長府工産株式会社 大阪支社
|
||||
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
||||
setOtherSaleStoreList(newOtherSaleStoreList)
|
||||
console.log('여기도?????????????????????')
|
||||
// let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
||||
// setOtherSaleStoreList(newOtherSaleStoreList)
|
||||
} else {
|
||||
//X누름
|
||||
setSelOptions('')
|
||||
@ -604,15 +711,38 @@ export default function StuffDetail() {
|
||||
}
|
||||
} else {
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSaleStoreList(otherSaleStoreList)
|
||||
setSelOptions(key.saleStoreId)
|
||||
form.setValue('saleStoreId', key.saleStoreId)
|
||||
form.setValue('saleStoreName', key.saleStoreName)
|
||||
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
||||
setSelOptions(key.saleStoreId)
|
||||
//선택한 1차점 정보로 2차점 list 추리기
|
||||
//선택한 1차점 정보로 2차점 조회하기
|
||||
//長府工産株式会社 大阪支社
|
||||
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
||||
setOtherSaleStoreList(newOtherSaleStoreList)
|
||||
console.log('바꿔조ㅜㅝ............', key.saleStoreId)
|
||||
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||
let otherList
|
||||
get({ url: url }).then((res) => {
|
||||
console.log('고른1차점으로 2차점목록조회결과;:::', res)
|
||||
if (!isEmptyArray(res)) {
|
||||
res.map((row) => {
|
||||
row.value = row.saleStoreId
|
||||
row.label = row.saleStoreName
|
||||
})
|
||||
|
||||
otherList = res
|
||||
console.log('otherList::::::::', otherList)
|
||||
setOtherSaleStoreList(otherList)
|
||||
setOtherSelOptions('')
|
||||
form.setValue('otherSaleStoreId', '')
|
||||
form.setValue('otherSaleStoreName', '')
|
||||
form.setValue('otherSaleStoreLevel', '')
|
||||
} else {
|
||||
setOtherSelOptions('')
|
||||
form.setValue('otherSaleStoreId', '')
|
||||
form.setValue('otherSaleStoreName', '')
|
||||
form.setValue('otherSaleStoreLevel', '')
|
||||
setOtherSaleStoreList([])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
//X누름
|
||||
setSelOptions('')
|
||||
@ -636,8 +766,9 @@ export default function StuffDetail() {
|
||||
setSelOptions(key.saleStoreId)
|
||||
//선택한 1차점 정보로 2차점 list 추리기
|
||||
//長府工産株式会社 大阪支社
|
||||
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
||||
setOtherSaleStoreList(newOtherSaleStoreList)
|
||||
console.log('여기도용')
|
||||
// let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
||||
// setOtherSaleStoreList(newOtherSaleStoreList)
|
||||
} else {
|
||||
//X누름
|
||||
setSelOptions('')
|
||||
@ -1170,8 +1301,10 @@ export default function StuffDetail() {
|
||||
|
||||
//1차점 or 2차점 안고르고 임시저장하면
|
||||
if (params.saleStoreId == '') {
|
||||
params.saleStoreId = sessionState.storeId
|
||||
params.saleStoreLevel = sessionState.storeLvl
|
||||
// params.saleStoreId = sessionState.storeId
|
||||
params.saleStoreId = session.storeId
|
||||
// params.saleStoreLevel = sessionState.storeLvl
|
||||
params.saleStoreLevel = session.storeLvl
|
||||
}
|
||||
//수직적설량, 설치높이 0인지 체크
|
||||
// let snow = params.verticalSnowCover
|
||||
@ -1343,7 +1476,113 @@ export default function StuffDetail() {
|
||||
</th>
|
||||
<td>
|
||||
<div className="flx-box">
|
||||
{(sessionState?.storeId === 'T01' && (
|
||||
{/* {sessionState?.storeId === 'T01' && ( */}
|
||||
{session?.storeId === 'T01' && (
|
||||
<>
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
<Select
|
||||
id="long-value-select1"
|
||||
instanceId="long-value-select1"
|
||||
className="react-select-custom"
|
||||
classNamePrefix="custom"
|
||||
placeholder="Select"
|
||||
options={showSaleStoreList}
|
||||
onInputChange={onInputChange}
|
||||
onChange={onSelectionChange}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
// isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
isClearable={session?.storeLvl === '1' ? true : false}
|
||||
// isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
||||
isDisabled={session?.storeLvl !== '1' ? true : false}
|
||||
value={saleStoreList.filter(function (option) {
|
||||
// console.log('showSaleStoreList:::::', option.saleStoreId)
|
||||
return option.saleStoreId === selOptions
|
||||
})}
|
||||
></Select>
|
||||
</div>
|
||||
<div className="input-wrap" style={{ width: '216px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-light"
|
||||
value={form.watch('saleStoreId') || ''}
|
||||
{...form.register('saleStoreId')}
|
||||
readOnly
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl === '1' && ( */}
|
||||
{session?.storeId !== 'T01' && session?.storeLvl === '1' && (
|
||||
<>
|
||||
신규 T01아닌 1차점
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
<Select
|
||||
id="long-value-select1"
|
||||
instanceId="long-value-select1"
|
||||
className="react-select-custom"
|
||||
classNamePrefix="custom"
|
||||
placeholder="Select"
|
||||
options={showSaleStoreList[0]}
|
||||
onChange={onSelectionChange}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
isClearable={session?.storeLvl === '1' ? true : false}
|
||||
isDisabled={session?.storeLvl !== '1' ? true : session?.storeId !== 'T01' ? true : false}
|
||||
value={showSaleStoreList.filter(function (option) {
|
||||
return option.saleStoreId === selOptions
|
||||
})}
|
||||
></Select>
|
||||
</div>
|
||||
<div className="input-wrap" style={{ width: '216px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-light"
|
||||
value={form.watch('saleStoreId') || ''}
|
||||
{...form.register('saleStoreId')}
|
||||
readOnly
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl !== '1' && ( */}
|
||||
{session?.storeId !== 'T01' && session?.storeLvl !== '1' && (
|
||||
<>
|
||||
신규 로그인이2차점
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
<Select
|
||||
id="long-value-select1"
|
||||
instanceId="long-value-select1"
|
||||
className="react-select-custom"
|
||||
classNamePrefix="custom"
|
||||
placeholder="Select"
|
||||
options={saleStoreList}
|
||||
onChange={onSelectionChange}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
// isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
isClearable={session?.storeLvl === '1' ? true : false}
|
||||
// isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
||||
isDisabled={session?.storeLvl !== '1' ? true : false}
|
||||
value={saleStoreList.filter(function (option) {
|
||||
return option.saleStoreId === selOptions
|
||||
})}
|
||||
></Select>
|
||||
</div>
|
||||
<div className="input-wrap" style={{ width: '216px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-light"
|
||||
value={form.watch('saleStoreId') || ''}
|
||||
{...form.register('saleStoreId')}
|
||||
readOnly
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* {(sessionState?.storeId === 'T01' && (
|
||||
<>
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
<Select
|
||||
@ -1377,6 +1616,7 @@ export default function StuffDetail() {
|
||||
)) || (
|
||||
<>
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
T01아님
|
||||
<Select
|
||||
id="long-value-select1"
|
||||
instanceId="long-value-select1"
|
||||
@ -1404,7 +1644,7 @@ export default function StuffDetail() {
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
)} */}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1432,8 +1672,10 @@ export default function StuffDetail() {
|
||||
onChange={onSelectionChange2}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
isDisabled={sessionState?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
// isDisabled={session?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
||||
isDisabled={session?.storeLvl === '1' && form.watch('saleStoreId') != '' && otherSaleStoreList.length > 1 ? false : true}
|
||||
// isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
isClearable={session?.storeLvl === '1' ? true : false}
|
||||
value={otherSaleStoreList.filter(function (option) {
|
||||
return option.saleStoreId === otherSelOptions
|
||||
})}
|
||||
@ -1688,7 +1930,7 @@ export default function StuffDetail() {
|
||||
<div className="product-input-wrap mr5">
|
||||
<input type="text" className="product-input" readOnly value={form.watch('planReqNo') || ''} />
|
||||
{/* {detailData?.tempFlg === '1' && form.watch('planReqNo') ? ( */}
|
||||
{objectNo.substring(0, 1) === 'T' && form.watch('planReqNo') ? (
|
||||
{detailData?.tempFlg === '1' && form.watch('planReqNo') ? (
|
||||
<button
|
||||
type="button"
|
||||
className="product-delete"
|
||||
@ -1699,7 +1941,7 @@ export default function StuffDetail() {
|
||||
) : null}
|
||||
</div>
|
||||
{/* {detailData?.tempFlg === '1' ? ( */}
|
||||
{objectNo.substring(0, 1) === 'T' ? (
|
||||
{detailData?.tempFlg === '1' ? (
|
||||
<>
|
||||
<Button className="btn-origin grey" onPress={onSearchDesignRequestPopOpen}>
|
||||
{getMessage('stuff.planReqPopup.title')}
|
||||
@ -1790,10 +2032,12 @@ export default function StuffDetail() {
|
||||
</th>
|
||||
<td>
|
||||
<div className="flx-box">
|
||||
{(sessionState?.storeId === 'T01' && (
|
||||
{/* {sessionState?.storeId === 'T01' && ( */}
|
||||
{session?.storeId === 'T01' && (
|
||||
<>
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
<Select
|
||||
menuPlacement={'auto'}
|
||||
id="long-value-select1"
|
||||
instanceId="long-value-select1"
|
||||
className="react-select-custom"
|
||||
@ -1804,8 +2048,10 @@ export default function StuffDetail() {
|
||||
onChange={onSelectionChange}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
||||
// isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
isClearable={session?.storeLvl === '1' ? true : false}
|
||||
// isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
||||
isDisabled={session?.storeLvl !== '1' ? true : false}
|
||||
value={saleStoreList.filter(function (option) {
|
||||
return option.saleStoreId === selOptions
|
||||
})}
|
||||
@ -1821,22 +2067,26 @@ export default function StuffDetail() {
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)) || (
|
||||
)}
|
||||
{/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl === '1' && ( */}
|
||||
{session?.storeId !== 'T01' && session?.storeLvl === '1' && (
|
||||
<>
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
<Select
|
||||
menuPlacement={'auto'}
|
||||
id="long-value-select1"
|
||||
instanceId="long-value-select1"
|
||||
className="react-select-custom"
|
||||
classNamePrefix="custom"
|
||||
placeholder="Select"
|
||||
options={saleStoreList}
|
||||
options={showSaleStoreList[0]}
|
||||
onChange={onSelectionChange}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
||||
value={saleStoreList.filter(function (option) {
|
||||
isClearable={false}
|
||||
// isDisabled={sessionState?.storeLvl !== '1' ? true : sessionState?.storeId !== 'T01' ? true : false}
|
||||
isDisabled={session?.storeLvl !== '1' ? true : session?.storeId !== 'T01' ? true : false}
|
||||
value={showSaleStoreList.filter(function (option) {
|
||||
return option.saleStoreId === selOptions
|
||||
})}
|
||||
/>
|
||||
@ -1852,6 +2102,41 @@ export default function StuffDetail() {
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl !== '1' && ( */}
|
||||
{session?.storeId !== 'T01' && session?.storeLvl !== '1' && (
|
||||
<>
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
<Select
|
||||
menuPlacement={'auto'}
|
||||
id="long-value-select1"
|
||||
instanceId="long-value-select1"
|
||||
className="react-select-custom"
|
||||
classNamePrefix="custom"
|
||||
placeholder="Select"
|
||||
options={showSaleStoreList[0]}
|
||||
onChange={onSelectionChange}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
isClearable={false}
|
||||
isDisabled={true}
|
||||
value={showSaleStoreList.filter(function (option) {
|
||||
if (option.firstAgentYn === 'Y') {
|
||||
return option.saleStoreId
|
||||
}
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<div className="input-wrap" style={{ width: '216px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-light"
|
||||
value={form.watch('saleStoreId') || ''}
|
||||
{...form.register('saleStoreId')}
|
||||
readOnly
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1878,8 +2163,10 @@ export default function StuffDetail() {
|
||||
onChange={onSelectionChange2}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
isDisabled={sessionState?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
// isDisabled={sessionState?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
||||
isDisabled={session?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
||||
// isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||
isClearable={session?.storeLvl === '1' ? true : false}
|
||||
value={otherSaleStoreList.filter(function (option) {
|
||||
return option.saleStoreId === otherSelOptions
|
||||
})}
|
||||
@ -2112,7 +2399,7 @@ export default function StuffDetail() {
|
||||
</div>
|
||||
</div>
|
||||
{/* {detailData?.tempFlg === '0' ? ( */}
|
||||
{objectNo.substring(0, 1) !== 'T' ? (
|
||||
{detailData?.tempFlg === '0' ? (
|
||||
<>
|
||||
{/* 진짜R 플랜시작 */}
|
||||
<div className="table-box-title-wrap">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user