물건현황 리스트 사양확정일 필드명 수정 & 임시저장 & 상세화면 ...
This commit is contained in:
parent
4d859d1530
commit
cc9eee731b
@ -123,8 +123,8 @@ export default function Stuff() {
|
|||||||
{ field: 'dispCompanyName', headerName: getMessage('stuff.gridHeader.dispCompanyName'), cellStyle: { textAlign: 'left' } },
|
{ field: 'dispCompanyName', headerName: getMessage('stuff.gridHeader.dispCompanyName'), cellStyle: { textAlign: 'left' } },
|
||||||
{ field: 'receiveUser', headerName: getMessage('stuff.gridHeader.receiveUser'), cellStyle: { textAlign: 'left' } },
|
{ field: 'receiveUser', headerName: getMessage('stuff.gridHeader.receiveUser'), cellStyle: { textAlign: 'left' } },
|
||||||
{
|
{
|
||||||
field: 'specDate',
|
field: 'specificationConfirmDate',
|
||||||
headerName: getMessage('stuff.gridHeader.specDate'),
|
headerName: getMessage('stuff.gridHeader.specificationConfirmDate'),
|
||||||
valueFormatter: function (params) {
|
valueFormatter: function (params) {
|
||||||
if (params.value) {
|
if (params.value) {
|
||||||
return dayjs(params?.value).format('YYYY.MM.DD')
|
return dayjs(params?.value).format('YYYY.MM.DD')
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export default function StuffDetail() {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const ref = useRef()
|
const ref = useRef()
|
||||||
const { get, del, promisePost } = useAxios(globalLocaleState)
|
const { get, del, promisePost, promisePut } = useAxios(globalLocaleState)
|
||||||
//form
|
//form
|
||||||
const formInitValue = {
|
const formInitValue = {
|
||||||
// 물건번호 T...(임시) R...(진짜)
|
// 물건번호 T...(임시) R...(진짜)
|
||||||
@ -71,6 +71,8 @@ export default function StuffDetail() {
|
|||||||
const [honorificCodeList, setHonorificCodeList] = useState([]) //경칭 공통코드 리스트
|
const [honorificCodeList, setHonorificCodeList] = useState([]) //경칭 공통코드 리스트
|
||||||
const [selHonorificCode, setSelHonorificCode] = useState('') //선택한 경칭코드
|
const [selHonorificCode, setSelHonorificCode] = useState('') //선택한 경칭코드
|
||||||
const [objectStatusList, setObjectStatusList] = useState([]) //물건구분 공통코드 리스트
|
const [objectStatusList, setObjectStatusList] = useState([]) //물건구분 공통코드 리스트
|
||||||
|
|
||||||
|
const [selectObjectStatusId, setSelectObjectStatusId] = useState('0') //신축기축 선택값
|
||||||
const [windSpeedList, setWindSpeedList] = useState([]) //기준 풍속 공통코드 리스트
|
const [windSpeedList, setWindSpeedList] = useState([]) //기준 풍속 공통코드 리스트
|
||||||
const [prefCodeList, setPrefCodeList] = useState([]) //도도부현 코트 리스트
|
const [prefCodeList, setPrefCodeList] = useState([]) //도도부현 코트 리스트
|
||||||
const [prefValue, setPrefValue] = useState('')
|
const [prefValue, setPrefValue] = useState('')
|
||||||
@ -93,7 +95,6 @@ export default function StuffDetail() {
|
|||||||
// console.log('objectNo::', objectNo)
|
// console.log('objectNo::', objectNo)
|
||||||
|
|
||||||
if (objectNo) {
|
if (objectNo) {
|
||||||
console.log('수정화면')
|
|
||||||
setEditMode('EDIT')
|
setEditMode('EDIT')
|
||||||
|
|
||||||
if (objectNo.substring(0, 1) === 'R') {
|
if (objectNo.substring(0, 1) === 'R') {
|
||||||
@ -116,7 +117,6 @@ export default function StuffDetail() {
|
|||||||
|
|
||||||
//1차점 : X167 T01
|
//1차점 : X167 T01
|
||||||
//2차점 : 10X22, 201X112
|
//2차점 : 10X22, 201X112
|
||||||
// get({ url: `/api/object/saleStore/T100/list` }).then((res) => {
|
|
||||||
get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => {
|
get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||||
@ -171,11 +171,8 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//상세정보로 1차점 목록등 셋팅??
|
//1차점 : X167 T01
|
||||||
// 임시 1차점 판매점코드 saleStoreId=201TES01
|
//2차점 : 10X22, 201X112
|
||||||
// T01
|
|
||||||
//1차점 : X167
|
|
||||||
// get({ url: `/api/object/saleStore/T01/list` }).then((res) => {
|
|
||||||
get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => {
|
get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||||
@ -186,11 +183,44 @@ export default function StuffDetail() {
|
|||||||
setOriginOtherSaleStoreList(otherList)
|
setOriginOtherSaleStoreList(otherList)
|
||||||
setOtherSaleStoreList(otherList)
|
setOtherSaleStoreList(otherList)
|
||||||
}
|
}
|
||||||
})
|
console.log('상세데이타::세팅:::::', detailData)
|
||||||
|
//설계의뢰No.
|
||||||
|
form.setValue('planReqNo', detailData.planReqNo)
|
||||||
|
//담당자
|
||||||
|
form.setValue('dispCompanyName', detailData.dispCompanyName)
|
||||||
|
|
||||||
console.log('상세데이타::세팅:::::', detailData)
|
//물건구분objectStatusId
|
||||||
|
setSelectObjectStatusId(detailData.objectStatusId)
|
||||||
|
form.setValue('objectStatusId', detailData.objectStatusId)
|
||||||
|
|
||||||
|
//물건명
|
||||||
|
form.setValue('objectName', detailData.objectName)
|
||||||
|
|
||||||
|
//경칭코드
|
||||||
|
|
||||||
|
setSelHonorificCode(detailData.objectNameOmit)
|
||||||
|
form.setValue('objectNameOmit', detailData.objectNameOmit)
|
||||||
|
|
||||||
|
//물건명 후리가나
|
||||||
|
form.setValue('objectNameKana', detailData.objectNameKana)
|
||||||
|
|
||||||
|
// console.log('1차점리스트::', firstList)
|
||||||
|
// console.log('2차점리스트::', otherList)
|
||||||
|
setSelOptions(detailData.saleStoreId)
|
||||||
|
form.setValue('saleStoreId', detailData.saleStoreId)
|
||||||
|
form.setValue('saleStoreLevel', sessionState?.storeLvl)
|
||||||
|
|
||||||
|
//2차점까지 고른경우 확인필요
|
||||||
|
console.log('2차점까지 고른경우 확인필요')
|
||||||
|
// setOtherSelOptions(sessionState?.storeId)
|
||||||
|
// form.setValue('saleStoreId', firstList[0].saleStoreId)
|
||||||
|
// form.setValue('otherSaleStoreId', sessionState?.storeId)
|
||||||
|
// form.setValue('otherSaleStoreLevel', sessionState?.storeLvl)
|
||||||
|
|
||||||
|
form.setValue('zipNo', detailData.zipNo)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}, [detailData])
|
}, [detailData, sessionState])
|
||||||
|
|
||||||
//경칭선택 변경 이벤트
|
//경칭선택 변경 이벤트
|
||||||
const onChangeHonorificCode = (key) => {
|
const onChangeHonorificCode = (key) => {
|
||||||
@ -212,45 +242,117 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//물건구분 변경 이벤트
|
||||||
|
const onRadioChange = (key) => {
|
||||||
|
setSelectObjectStatusId(key.target.value)
|
||||||
|
}
|
||||||
//1차점 변경 이벤트
|
//1차점 변경 이벤트
|
||||||
const onSelectionChange = (key) => {
|
const onSelectionChange = (key) => {
|
||||||
if (isObjectNotEmpty(key)) {
|
const planReqNo = form.watch('planReqNo')
|
||||||
setOtherSaleStoreList(otherSaleStoreList)
|
|
||||||
form.setValue('saleStoreId', key.saleStoreId)
|
let delFlg = false
|
||||||
form.setValue('saleStoreName', key.saleStoreName)
|
if (planReqNo !== '') {
|
||||||
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
if (confirm('stuff.detail.confirm.message1')) {
|
||||||
setSelOptions(key.saleStoreId)
|
delFlg = true
|
||||||
//선택한 1차점 정보로 2차점 list 추리기
|
} else {
|
||||||
//長府工産株式会社 大阪支社
|
delFlg = false
|
||||||
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
}
|
||||||
setOtherSaleStoreList(newOtherSaleStoreList)
|
}
|
||||||
|
|
||||||
|
if (planReqNo !== '') {
|
||||||
|
if (delFlg) {
|
||||||
|
form.setValue('planReqNo', '')
|
||||||
|
if (isObjectNotEmpty(key)) {
|
||||||
|
setOtherSaleStoreList(otherSaleStoreList)
|
||||||
|
form.setValue('saleStoreId', key.saleStoreId)
|
||||||
|
form.setValue('saleStoreName', key.saleStoreName)
|
||||||
|
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
||||||
|
setSelOptions(key.saleStoreId)
|
||||||
|
//선택한 1차점 정보로 2차점 list 추리기
|
||||||
|
//長府工産株式会社 大阪支社
|
||||||
|
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
||||||
|
setOtherSaleStoreList(newOtherSaleStoreList)
|
||||||
|
} else {
|
||||||
|
//X누름
|
||||||
|
setSelOptions('')
|
||||||
|
form.setValue('saleStoreId', '')
|
||||||
|
form.setValue('saleStoreName', '')
|
||||||
|
form.setValue('saleStoreLevel', '')
|
||||||
|
form.setValue('otherSaleStoreId', '')
|
||||||
|
form.setValue('otherSaleStoreName', '')
|
||||||
|
form.setValue('otherSaleStoreLevel', '')
|
||||||
|
//1차점 지웠을때 2차점 자동완성 초기화
|
||||||
|
setOtherSaleStoreList(originOtherSaleStoreList)
|
||||||
|
handleClear()
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//X누름
|
if (isObjectNotEmpty(key)) {
|
||||||
setSelOptions('')
|
setOtherSaleStoreList(otherSaleStoreList)
|
||||||
form.setValue('saleStoreId', '')
|
form.setValue('saleStoreId', key.saleStoreId)
|
||||||
form.setValue('saleStoreName', '')
|
form.setValue('saleStoreName', key.saleStoreName)
|
||||||
form.setValue('saleStoreLevel', '')
|
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
||||||
form.setValue('otherSaleStoreId', '')
|
setSelOptions(key.saleStoreId)
|
||||||
form.setValue('otherSaleStoreName', '')
|
//선택한 1차점 정보로 2차점 list 추리기
|
||||||
form.setValue('otherSaleStoreLevel', '')
|
//長府工産株式会社 大阪支社
|
||||||
setOtherSaleStoreList(originOtherSaleStoreList)
|
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
||||||
//1차점 지웠을때 2차점 자동완성 초기화
|
setOtherSaleStoreList(newOtherSaleStoreList)
|
||||||
handleClear()
|
} else {
|
||||||
|
//X누름
|
||||||
|
setSelOptions('')
|
||||||
|
form.setValue('saleStoreId', '')
|
||||||
|
form.setValue('saleStoreName', '')
|
||||||
|
form.setValue('saleStoreLevel', '')
|
||||||
|
form.setValue('otherSaleStoreId', '')
|
||||||
|
form.setValue('otherSaleStoreName', '')
|
||||||
|
form.setValue('otherSaleStoreLevel', '')
|
||||||
|
//1차점 지웠을때 2차점 자동완성 초기화
|
||||||
|
setOtherSaleStoreList(originOtherSaleStoreList)
|
||||||
|
handleClear()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//2차점 변경 이벤트
|
//2차점 변경 이벤트
|
||||||
const onSelectionChange2 = (key) => {
|
const onSelectionChange2 = (key) => {
|
||||||
if (isObjectNotEmpty(key)) {
|
const planReqNo = form.watch('planReqNo')
|
||||||
setOtherSelOptions(key.saleStoreId)
|
|
||||||
form.setValue('otherSaleStoreId', key.saleStoreId)
|
let delFlg = false
|
||||||
form.setValue('otherSaleStoreName', key.saleStoreName)
|
if (planReqNo !== '') {
|
||||||
form.setValue('otherSaleStoreLevel', key.saleStoreLevel)
|
if (confirm('stuff.detail.confirm.message1')) {
|
||||||
|
delFlg = true
|
||||||
|
} else {
|
||||||
|
delFlg = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (planReqNo !== '') {
|
||||||
|
if (delFlg) {
|
||||||
|
form.setValue('planReqNo', '')
|
||||||
|
if (isObjectNotEmpty(key)) {
|
||||||
|
setOtherSelOptions(key.saleStoreId)
|
||||||
|
form.setValue('otherSaleStoreId', key.saleStoreId)
|
||||||
|
form.setValue('otherSaleStoreName', key.saleStoreName)
|
||||||
|
form.setValue('otherSaleStoreLevel', key.saleStoreLevel)
|
||||||
|
} else {
|
||||||
|
setOtherSelOptions('')
|
||||||
|
form.setValue('otherSaleStoreId', '')
|
||||||
|
form.setValue('otherSaleStoreName', '')
|
||||||
|
form.setValue('otherSaleStoreLevel', '')
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setOtherSelOptions('')
|
if (isObjectNotEmpty(key)) {
|
||||||
form.setValue('otherSaleStoreId', '')
|
setOtherSelOptions(key.saleStoreId)
|
||||||
form.setValue('otherSaleStoreName', '')
|
form.setValue('otherSaleStoreId', key.saleStoreId)
|
||||||
form.setValue('otherSaleStoreLevel', '')
|
form.setValue('otherSaleStoreName', key.saleStoreName)
|
||||||
|
form.setValue('otherSaleStoreLevel', key.saleStoreLevel)
|
||||||
|
} else {
|
||||||
|
setOtherSelOptions('')
|
||||||
|
form.setValue('otherSaleStoreId', '')
|
||||||
|
form.setValue('otherSaleStoreName', '')
|
||||||
|
form.setValue('otherSaleStoreLevel', '')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,8 +397,8 @@ export default function StuffDetail() {
|
|||||||
if (info.saleStoreLevel === '1') {
|
if (info.saleStoreLevel === '1') {
|
||||||
setSelOptions(info.saleStoreId)
|
setSelOptions(info.saleStoreId)
|
||||||
form.setValue('saleStoreId', info.saleStoreId)
|
form.setValue('saleStoreId', info.saleStoreId)
|
||||||
form.setValue('saleStoreName', key.saleStoreName)
|
form.setValue('saleStoreName', info.saleStoreName)
|
||||||
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
form.setValue('saleStoreLevel', info.saleStoreLevel)
|
||||||
} else {
|
} else {
|
||||||
setOtherSelOptions(info.saleStoreId)
|
setOtherSelOptions(info.saleStoreId)
|
||||||
form.setValue('otherSaleStoreId', info.saleStoreId)
|
form.setValue('otherSaleStoreId', info.saleStoreId)
|
||||||
@ -310,40 +412,32 @@ export default function StuffDetail() {
|
|||||||
form.setValue('windSpeed', info.windSpeed)
|
form.setValue('windSpeed', info.windSpeed)
|
||||||
}
|
}
|
||||||
|
|
||||||
//임시저장 저장 버튼 컨트롤
|
//dispCompanyName: '', //담당자
|
||||||
// dispCompanyName: '', //담당자
|
|
||||||
// objectName: '', //물건명
|
|
||||||
// objectNameOmit: '', //경칭선택
|
|
||||||
// saleStoreId: '', //판매점ID
|
|
||||||
// zipNo: '', //우편번호
|
|
||||||
// prefId: '', //도도부현
|
|
||||||
// address: '', //주소
|
|
||||||
// areaId: '', //발전량시뮬레이션지역new
|
|
||||||
// windSpeed: '', //기준풍속
|
|
||||||
// verticalSnowCover: '', //수직적설량
|
|
||||||
// coldRegionFlg: false, //한랭지대책시행
|
|
||||||
// surfaceType: 'Ⅲ・Ⅳ', //면조도구분(Ⅲ・Ⅳ / Ⅱ)
|
|
||||||
// saltAreaFlg: false, //염해지역용아이템사용
|
|
||||||
// installHeight: '', //설치높이
|
|
||||||
// conType : '0' //계약조건(잉여 / 전량)
|
|
||||||
// remarks: '', //메모
|
|
||||||
// tempFlag: 'T', //임시저장(1) 저장(0)
|
|
||||||
const _dispCompanyName = watch('dispCompanyName')
|
const _dispCompanyName = watch('dispCompanyName')
|
||||||
|
//objectName: '', //물건명
|
||||||
const _objectName = watch('objectName')
|
const _objectName = watch('objectName')
|
||||||
|
// objectNameOmit: '', //경칭선택
|
||||||
const _objectNameOmit = watch('objectNameOmit')
|
const _objectNameOmit = watch('objectNameOmit')
|
||||||
|
// saleStoreId: '', //1차 판매점ID
|
||||||
const _saleStoreId = watch('saleStoreId')
|
const _saleStoreId = watch('saleStoreId')
|
||||||
const _saleStoreLevel = watch('saleStoreLevel')
|
// zipNo: '', //우편번호
|
||||||
|
const _zipNo = watch('zipNo')
|
||||||
|
// prefId: '', //도도부현
|
||||||
const _prefId = watch('prefId')
|
const _prefId = watch('prefId')
|
||||||
|
// address: '', //주소
|
||||||
const _address = watch('address')
|
const _address = watch('address')
|
||||||
const _areaId = watch('areaId') //new
|
// areaId: '', //발전량시뮬레이션지역
|
||||||
|
const _areaId = watch('areaId')
|
||||||
|
// windSpeed: '', //기준풍속
|
||||||
const _windSpeed = watch('windSpeed')
|
const _windSpeed = watch('windSpeed')
|
||||||
|
// verticalSnowCover: '', //수직적설량
|
||||||
const _verticalSnowCover = watch('verticalSnowCover')
|
const _verticalSnowCover = watch('verticalSnowCover')
|
||||||
|
// installHeight: '', //설치높이
|
||||||
const _installHeight = watch('installHeight')
|
const _installHeight = watch('installHeight')
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (editMode === 'NEW') {
|
if (editMode === 'NEW') {
|
||||||
const formData = form.getValues()
|
const formData = form.getValues()
|
||||||
// console.log('임시저장폼error체크::::::::::::', formData)
|
|
||||||
let errors = {}
|
let errors = {}
|
||||||
if (!formData.dispCompanyName || formData.dispCompanyName.trim().length === 0) {
|
if (!formData.dispCompanyName || formData.dispCompanyName.trim().length === 0) {
|
||||||
errors.dispCompanyName = true
|
errors.dispCompanyName = true
|
||||||
@ -358,6 +452,10 @@ export default function StuffDetail() {
|
|||||||
errors.saleStoreId = true
|
errors.saleStoreId = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!formData.zipNo) {
|
||||||
|
errors.zipNo = true
|
||||||
|
}
|
||||||
|
|
||||||
if (!formData.prefId) {
|
if (!formData.prefId) {
|
||||||
errors.prefId = true
|
errors.prefId = true
|
||||||
}
|
}
|
||||||
@ -378,19 +476,57 @@ export default function StuffDetail() {
|
|||||||
errors.installHeight = true
|
errors.installHeight = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('임시저장용::', errors)
|
|
||||||
setIsFormValid(Object.keys(errors).length === 0 ? true : false)
|
setIsFormValid(Object.keys(errors).length === 0 ? true : false)
|
||||||
} else {
|
} else {
|
||||||
console.log('상세일때 폼체크')
|
console.log('상세일때 폼체크')
|
||||||
|
const formData = form.getValues()
|
||||||
|
let errors = {}
|
||||||
|
if (!formData.dispCompanyName || formData.dispCompanyName.trim().length === 0) {
|
||||||
|
errors.dispCompanyName = true
|
||||||
|
}
|
||||||
|
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
||||||
|
errors.objectName = true
|
||||||
|
}
|
||||||
|
if (!formData.objectNameOmit) {
|
||||||
|
errors.objectNameOmit = true
|
||||||
|
}
|
||||||
|
if (!formData.saleStoreId) {
|
||||||
|
errors.saleStoreId = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.zipNo) {
|
||||||
|
errors.zipNo = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.prefId) {
|
||||||
|
errors.prefId = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.areaId) {
|
||||||
|
errors.areaId = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.windSpeed) {
|
||||||
|
errors.windSpeed = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.verticalSnowCover) {
|
||||||
|
errors.verticalSnowCover = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.installHeight) {
|
||||||
|
errors.installHeight = true
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('상세 저장용 에러결과?????::', errors)
|
||||||
|
setIsFormValid(Object.keys(errors).length === 0 ? true : false)
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
_dispCompanyName,
|
_dispCompanyName,
|
||||||
_objectName,
|
_objectName,
|
||||||
_objectNameOmit,
|
_objectNameOmit,
|
||||||
_saleStoreId,
|
_saleStoreId,
|
||||||
_saleStoreLevel,
|
_zipNo,
|
||||||
// _otherSaleStoreId,
|
|
||||||
// _otherSaleStoreLevel,
|
|
||||||
_prefId,
|
_prefId,
|
||||||
_address,
|
_address,
|
||||||
_areaId,
|
_areaId,
|
||||||
@ -424,8 +560,6 @@ export default function StuffDetail() {
|
|||||||
// 발전량시뮬레이션 지역 목록
|
// 발전량시뮬레이션 지역 목록
|
||||||
get({ url: `/api/object/prefecture/${prefValue}/list` }).then((res) => {
|
get({ url: `/api/object/prefecture/${prefValue}/list` }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
// form.setValue('areaId', res[0].areaId)
|
|
||||||
// form.setValue('areaName', res[0].prefName)
|
|
||||||
setAreaIdList(res)
|
setAreaIdList(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -439,29 +573,52 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//필수값 다 입력했을때
|
//필수값 다 입력했을때
|
||||||
const onValid = (data, e) => {
|
const onValid = async () => {
|
||||||
const formData = form.getValues()
|
const formData = form.getValues()
|
||||||
console.log('필수값 통과:::', data, formData)
|
console.log('필수값 통과:::', formData)
|
||||||
// console.log('필수값 formData:::', formData)
|
const apiUrl = '/api/object/save-object'
|
||||||
// 수정모드일때는 PUT
|
const params = {
|
||||||
// console.log('필수값 다 있고 저장')
|
saleStoreId: formData.otherSaleStoreId ? formData.otherSaleStoreId : formData.saleStoreId,
|
||||||
// console.log('data::::::', data)
|
saleStoreName: formData.otherSaleStoreName ? formData.otherSaleStoreName : formData.saleStoreName,
|
||||||
// console.log('formData::::', formData)
|
saleStoreLevel: formData.otherSaleStoreLevel ? formData.otherSaleStoreLevel : formData.saleStoreLevel,
|
||||||
// const _dispCompanyName = watch('dispCompanyName')
|
objectStatusId: formData.objectStatusId,
|
||||||
// const _objectStatusId = watch('objectStatusId')
|
objectName: formData.objectName,
|
||||||
// const _objectNameOmit = watch('objectNameOmit')
|
objectNameOmit: formData.objectNameOmit,
|
||||||
// const _zipNo = watch('zipNo')
|
objectNameKana: formData.objectNameKana,
|
||||||
// const _prefId = watch('prefId')
|
zipNo: formData.zipNo,
|
||||||
// const _address = watch('address')
|
prefId: formData.prefId,
|
||||||
// const _coldRegionFlg = watch('coldRegionFlg')
|
prefName: formData.prefName,
|
||||||
// console.log(_dispCompanyName)
|
address: formData.address,
|
||||||
// console.log(_objectStatusId)
|
areaId: formData.areaId,
|
||||||
// console.log(_objectNameOmit)
|
receiveUser: formData.dispCompanyName,
|
||||||
// console.log(_zipNo)
|
installHeight: formData.installHeight,
|
||||||
// console.log(_prefId)
|
windSpeed: formData.windSpeed,
|
||||||
// console.log('prefValue::', prefValue)
|
verticalSnowCover: formData.verticalSnowCover,
|
||||||
// console.log(_address)
|
surfaceType: formData.surfaceType,
|
||||||
// console.log('_coldRegionFlg::', _coldRegionFlg)
|
conType: formData.conType,
|
||||||
|
coldRegionFlg: formData.coldRegionFlg,
|
||||||
|
saltAreaFlg: formData.saltAreaFlg,
|
||||||
|
tempFlg: '0',
|
||||||
|
workNo: null,
|
||||||
|
workName: null,
|
||||||
|
}
|
||||||
|
console.log('params::', params)
|
||||||
|
alert('작업중')
|
||||||
|
return
|
||||||
|
if (editMode === 'NEW') {
|
||||||
|
await promisePost({ url: apiUrl, data: params }).then((res) => {
|
||||||
|
console.log('진짜저장결과::::', pathname, res)
|
||||||
|
|
||||||
|
//상세화면으로 전환
|
||||||
|
//router.push(`${pathname}?objectNo=${res.data.objectNo.toString()}`)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 수정모드일때는 PUT
|
||||||
|
await promisePut({ url: apiUrl, data: params }).then((res) => {
|
||||||
|
console.log('진짜데이터 수정 결과::::::::::', pathname, res)
|
||||||
|
//새로고침???
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//필수값 안넣었을때 임시저장 form required사용시
|
//필수값 안넣었을때 임시저장 form required사용시
|
||||||
@ -474,8 +631,6 @@ export default function StuffDetail() {
|
|||||||
// 임시저장
|
// 임시저장
|
||||||
const onTempSave = async () => {
|
const onTempSave = async () => {
|
||||||
const formData = form.getValues()
|
const formData = form.getValues()
|
||||||
console.log('임시저장누름:::::', formData)
|
|
||||||
return
|
|
||||||
const params = {
|
const params = {
|
||||||
saleStoreId: formData.otherSaleStoreId ? formData.otherSaleStoreId : formData.saleStoreId,
|
saleStoreId: formData.otherSaleStoreId ? formData.otherSaleStoreId : formData.saleStoreId,
|
||||||
saleStoreName: formData.otherSaleStoreName ? formData.otherSaleStoreName : formData.saleStoreName,
|
saleStoreName: formData.otherSaleStoreName ? formData.otherSaleStoreName : formData.saleStoreName,
|
||||||
@ -501,15 +656,17 @@ export default function StuffDetail() {
|
|||||||
workNo: null,
|
workNo: null,
|
||||||
workName: null,
|
workName: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
//1차점 or 2차점 안고르고 임시저장하면
|
//1차점 or 2차점 안고르고 임시저장하면
|
||||||
if (params.saleStoreId == '') {
|
if (params.saleStoreId == '') {
|
||||||
params.saleStoreId = sessionState.storeId
|
params.saleStoreId = sessionState.storeId
|
||||||
params.saleStoreLevel = sessionState.storeLvl
|
params.saleStoreLevel = sessionState.storeLvl
|
||||||
}
|
}
|
||||||
|
alert('작업중')
|
||||||
|
return
|
||||||
await promisePost({ url: '/api/object/save-object', data: params }).then((res) => {
|
await promisePost({ url: '/api/object/save-object', data: params }).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
alert('임시저장 되었습니다. 물건번호를 획득하려면 필수 항목을 모두 입력해 주십시오.')
|
getMessage('stuff.detail.tempSave.message1')
|
||||||
router.push(`${pathname}?objectNo=${res.data.objectNo.toString()}`)
|
router.push(`${pathname}?objectNo=${res.data.objectNo.toString()}`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -576,7 +733,7 @@ export default function StuffDetail() {
|
|||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
{/* 라디오시작 */}
|
{/* 라디오시작 */}
|
||||||
{objectStatusList.map((row, index) => {
|
{objectStatusList.map((row) => {
|
||||||
return (
|
return (
|
||||||
<div className="d-check-radio light mr10" key={`objectStatusId_${row.clCode}`}>
|
<div className="d-check-radio light mr10" key={`objectStatusId_${row.clCode}`}>
|
||||||
<input
|
<input
|
||||||
@ -585,6 +742,8 @@ export default function StuffDetail() {
|
|||||||
value={row.clCode}
|
value={row.clCode}
|
||||||
id={`objectStatus${row.clCode}`}
|
id={`objectStatus${row.clCode}`}
|
||||||
{...register('objectStatusId')}
|
{...register('objectStatusId')}
|
||||||
|
onChange={onRadioChange}
|
||||||
|
checked={row.clCode === selectObjectStatusId}
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`objectStatus${row.clCode}`}>{row.clCodeNm}</label>
|
<label htmlFor={`objectStatus${row.clCode}`}>{row.clCodeNm}</label>
|
||||||
</div>
|
</div>
|
||||||
@ -597,7 +756,7 @@ export default function StuffDetail() {
|
|||||||
<div className="select-wrap" style={{ width: '120px' }}>
|
<div className="select-wrap" style={{ width: '120px' }}>
|
||||||
<Select
|
<Select
|
||||||
{...register('objectNameOmit')}
|
{...register('objectNameOmit')}
|
||||||
id="ng-value-select0"
|
id="long-value-select0"
|
||||||
instanceId="long-value-select0"
|
instanceId="long-value-select0"
|
||||||
className="react-select-custom"
|
className="react-select-custom"
|
||||||
classNamePrefix="custom"
|
classNamePrefix="custom"
|
||||||
@ -782,9 +941,6 @@ export default function StuffDetail() {
|
|||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
{/* <div className="input-wrap mr10">
|
|
||||||
<input type="text" className="input-light" readOnly value={form.watch('windSpeed')} {...register('windSpeed')} />
|
|
||||||
</div> */}
|
|
||||||
{/* 기준풍속sel시작 */}
|
{/* 기준풍속sel시작 */}
|
||||||
<div className="select-wrap mr10" style={{ width: '200px' }}>
|
<div className="select-wrap mr10" style={{ width: '200px' }}>
|
||||||
<Select
|
<Select
|
||||||
@ -819,13 +975,6 @@ export default function StuffDetail() {
|
|||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
{/* <div className="select-wrap mr10" style={{ width: '200px' }}>
|
|
||||||
<select className="select-light" name="verticalSnowCover" {...register('verticalSnowCover')}>
|
|
||||||
<option value="">수직적설량 인풋</option>
|
|
||||||
<option value="30">30</option>
|
|
||||||
<option value="40">40</option>
|
|
||||||
</select>
|
|
||||||
</div> */}
|
|
||||||
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
||||||
<input type="text" className="input-light" value={form.watch('verticalSnowCover')} {...register('verticalSnowCover')} />
|
<input type="text" className="input-light" value={form.watch('verticalSnowCover')} {...register('verticalSnowCover')} />
|
||||||
</div>
|
</div>
|
||||||
@ -905,7 +1054,7 @@ export default function StuffDetail() {
|
|||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button type="submit" className="btn-origin navy mr5">
|
<Button type="submit" className="btn-origin navy mr5">
|
||||||
NEW 화면 저장
|
NEW화면 저장
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<Link href="/management/stuff" scroll={false}>
|
<Link href="/management/stuff" scroll={false}>
|
||||||
@ -935,11 +1084,15 @@ export default function StuffDetail() {
|
|||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
<div className="input-wrap mr5" style={{ width: '200px' }}>
|
<div className="input-wrap mr5" style={{ width: '200px' }}>
|
||||||
<input type="text" className="input-light" readOnly />
|
<input type="text" className="input-light" readOnly value={form.watch('planReqNo')} />
|
||||||
</div>
|
</div>
|
||||||
<Button className="btn-origin grey" onClick={onSearchDesignRequestPopOpen}>
|
{objectNo.substring(0, 1) === 'T' ? (
|
||||||
{getMessage('stuff.planReqPopup.title')}
|
<>
|
||||||
</Button>
|
<Button className="btn-origin grey" onClick={onSearchDesignRequestPopOpen}>
|
||||||
|
{getMessage('stuff.planReqPopup.title')}
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -969,6 +1122,8 @@ export default function StuffDetail() {
|
|||||||
value={row.clCode}
|
value={row.clCode}
|
||||||
id={`objectStatus${row.clCode}`}
|
id={`objectStatus${row.clCode}`}
|
||||||
{...register('objectStatusId')}
|
{...register('objectStatusId')}
|
||||||
|
onChange={onRadioChange}
|
||||||
|
checked={row.clCode === selectObjectStatusId}
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`objectStatus${row.clCode}`}>{row.clCodeNm}</label>
|
<label htmlFor={`objectStatus${row.clCode}`}>{row.clCodeNm}</label>
|
||||||
</div>
|
</div>
|
||||||
@ -981,7 +1136,7 @@ export default function StuffDetail() {
|
|||||||
<div className="select-wrap" style={{ width: '120px' }}>
|
<div className="select-wrap" style={{ width: '120px' }}>
|
||||||
<Select
|
<Select
|
||||||
{...register('objectNameOmit')}
|
{...register('objectNameOmit')}
|
||||||
id="ng-value-select0"
|
id="long-value-select0"
|
||||||
instanceId="long-value-select0"
|
instanceId="long-value-select0"
|
||||||
className="react-select-custom"
|
className="react-select-custom"
|
||||||
classNamePrefix="custom"
|
classNamePrefix="custom"
|
||||||
@ -993,6 +1148,8 @@ export default function StuffDetail() {
|
|||||||
isClearable={true}
|
isClearable={true}
|
||||||
isSearchable={false}
|
isSearchable={false}
|
||||||
value={honorificCodeList.filter(function (option) {
|
value={honorificCodeList.filter(function (option) {
|
||||||
|
console.log('상세 경칭코드결과:::::::::::::::', option.clCode)
|
||||||
|
console.log('상세 셋팅된 경칭코드값:::::::::::::::', selHonorificCode)
|
||||||
return option.clCode === selHonorificCode
|
return option.clCode === selHonorificCode
|
||||||
})}
|
})}
|
||||||
></Select>
|
></Select>
|
||||||
@ -1021,15 +1178,21 @@ export default function StuffDetail() {
|
|||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
{/* <Select
|
<Select
|
||||||
|
id="long-value-select1"
|
||||||
|
instanceId="long-value-select1"
|
||||||
|
className="react-select-custom"
|
||||||
|
classNamePrefix="custom"
|
||||||
|
placeholder="Select"
|
||||||
options={saleStoreList}
|
options={saleStoreList}
|
||||||
value={form.watch('saleStoreId')}
|
|
||||||
onChange={onSelectionChange}
|
onChange={onSelectionChange}
|
||||||
labelField="saleStoreName"
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
valueField="saleStoreId"
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
searchBy="saleStoreName"
|
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||||
clearable={true}
|
value={saleStoreList.filter(function (option) {
|
||||||
></Select> */}
|
return option.saleStoreId === selOptions
|
||||||
|
})}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-wrap" style={{ width: '216px' }}>
|
<div className="input-wrap" style={{ width: '216px' }}>
|
||||||
<input type="text" className="input-light" value={form.watch('saleStoreId')} {...form.register('saleStoreId')} readOnly />
|
<input type="text" className="input-light" value={form.watch('saleStoreId')} {...form.register('saleStoreId')} readOnly />
|
||||||
@ -1037,6 +1200,64 @@ export default function StuffDetail() {
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<div className="flx-box">
|
||||||
|
<div className="title">{getMessage('stuff.detail.otherSaleStoreId')}</div>
|
||||||
|
<div className="tooltips">
|
||||||
|
<span>{getMessage('stuff.detail.tooltip.saleStoreId')}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<div className="flx-box">
|
||||||
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
|
<Select
|
||||||
|
id="long-value-select2"
|
||||||
|
instanceId="long-value-select2"
|
||||||
|
className="react-select-custom"
|
||||||
|
classNamePrefix="custom"
|
||||||
|
placeholder="Select"
|
||||||
|
ref={ref}
|
||||||
|
options={otherSaleStoreList}
|
||||||
|
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}
|
||||||
|
value={otherSaleStoreList.filter(function (option) {
|
||||||
|
return option.saleStoreId === otherSelOptions
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="input-wrap" style={{ width: '216px' }}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="input-light"
|
||||||
|
value={form.watch('otherSaleStoreId')}
|
||||||
|
{...form.register('otherSaleStoreId')}
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
{getMessage('stuff.detail.zipNo')} <span className="important">*</span>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<div className="flx-box">
|
||||||
|
<div className="input-wrap mr5" style={{ width: '200px' }}>
|
||||||
|
<input type="text" className="input-light" disabled value={form.watch('zipNo')} />
|
||||||
|
</div>
|
||||||
|
<Button className="btn-origin grey" onClick={onSearchPostNumberPopOpen}>
|
||||||
|
{getMessage('stuff.detail.btn.addressPop')}
|
||||||
|
</Button>
|
||||||
|
<div className="guide">{getMessage('stuff.detail.btn.addressPop.guide')}</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -454,7 +454,7 @@
|
|||||||
"stuff.gridHeader.address": "商品アドレス",
|
"stuff.gridHeader.address": "商品アドレス",
|
||||||
"stuff.gridHeader.dispCompanyName": "見積もり",
|
"stuff.gridHeader.dispCompanyName": "見積もり",
|
||||||
"stuff.gridHeader.receiveUser": "担当者",
|
"stuff.gridHeader.receiveUser": "担当者",
|
||||||
"stuff.gridHeader.specDate": "仕様確認日",
|
"stuff.gridHeader.specificationConfirmDate": "仕様確認日",
|
||||||
"stuff.gridHeader.createDatetime": "登録日",
|
"stuff.gridHeader.createDatetime": "登録日",
|
||||||
"stuff.message.periodError": "最大1年間閲覧可能.",
|
"stuff.message.periodError": "最大1年間閲覧可能.",
|
||||||
"stuff.addressPopup.title": "郵便番号",
|
"stuff.addressPopup.title": "郵便番号",
|
||||||
@ -495,6 +495,8 @@
|
|||||||
"stuff.detail.conType1": "全量",
|
"stuff.detail.conType1": "全量",
|
||||||
"stuff.detail.remarks": "メモ",
|
"stuff.detail.remarks": "メモ",
|
||||||
"stuff.detail.tooltip.saleStoreId": "販売代理店または販売代理店IDを1文字以上入力してください",
|
"stuff.detail.tooltip.saleStoreId": "販売代理店または販売代理店IDを1文字以上入力してください",
|
||||||
|
"stuff.detail.tempSave.message1": "一時保存されました。商品番号を取得するには、必須項目をすべて入力してください。",
|
||||||
|
"stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?",
|
||||||
"stuff.planReqPopup.popTitle": "設計依頼検索",
|
"stuff.planReqPopup.popTitle": "設計依頼検索",
|
||||||
"stuff.planReqPopup.btn1": "検索",
|
"stuff.planReqPopup.btn1": "検索",
|
||||||
"stuff.planReqPopup.btn2": "初期化",
|
"stuff.planReqPopup.btn2": "初期化",
|
||||||
|
|||||||
@ -459,7 +459,7 @@
|
|||||||
"stuff.gridHeader.address": "물건주소",
|
"stuff.gridHeader.address": "물건주소",
|
||||||
"stuff.gridHeader.dispCompanyName": "견적처",
|
"stuff.gridHeader.dispCompanyName": "견적처",
|
||||||
"stuff.gridHeader.receiveUser": "담당자",
|
"stuff.gridHeader.receiveUser": "담당자",
|
||||||
"stuff.gridHeader.specDate": "사양확인일",
|
"stuff.gridHeader.specificationConfirmDate": "사양확인일",
|
||||||
"stuff.gridHeader.createDatetime": "등록일",
|
"stuff.gridHeader.createDatetime": "등록일",
|
||||||
"stuff.message.periodError": "최대1년 조회 가능합니다.",
|
"stuff.message.periodError": "최대1년 조회 가능합니다.",
|
||||||
"stuff.addressPopup.title": "우편번호",
|
"stuff.addressPopup.title": "우편번호",
|
||||||
@ -500,6 +500,8 @@
|
|||||||
"stuff.detail.conType1": "전량",
|
"stuff.detail.conType1": "전량",
|
||||||
"stuff.detail.remarks": "메모",
|
"stuff.detail.remarks": "메모",
|
||||||
"stuff.detail.tooltip.saleStoreId": "판매대리점 또는 판매대리점ID를 1자 이상 입력하세요",
|
"stuff.detail.tooltip.saleStoreId": "판매대리점 또는 판매대리점ID를 1자 이상 입력하세요",
|
||||||
|
"stuff.detail.tempSave.message1": "임시저장 되었습니다. 물건번호를 획득하려면 필수 항목을 모두 입력해 주십시오.",
|
||||||
|
"stuff.detail.confirm.message1": "판매점 정보를 변경하면, 설계의뢰 문서번호가 삭제됩니다. 변경하시겠습니까?",
|
||||||
"stuff.planReqPopup.popTitle": "설계 요청 검색",
|
"stuff.planReqPopup.popTitle": "설계 요청 검색",
|
||||||
"stuff.planReqPopup.btn1": "검색",
|
"stuff.planReqPopup.btn1": "검색",
|
||||||
"stuff.planReqPopup.btn2": "초기화",
|
"stuff.planReqPopup.btn2": "초기화",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user