물건상세 버튼 노출 조건 수정
This commit is contained in:
parent
0bd76a3fcc
commit
4ede2bb12d
@ -350,6 +350,10 @@ export default function StuffDetail() {
|
||||
if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
|
||||
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
||||
setShowButton('none')
|
||||
} else {
|
||||
if (session.storeId !== res?.data?.createUser) {
|
||||
setShowButton('none')
|
||||
}
|
||||
}
|
||||
if (isObjectNotEmpty(res.data)) {
|
||||
let surfaceTypeValue
|
||||
@ -358,7 +362,7 @@ export default function StuffDetail() {
|
||||
} else if (res.data.surfaceType === 'Ⅱ') {
|
||||
surfaceTypeValue = '2'
|
||||
}
|
||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue, firstFlag: 'Y' })
|
||||
} else {
|
||||
setManagementState({})
|
||||
swalFire({
|
||||
@ -1403,6 +1407,7 @@ export default function StuffDetail() {
|
||||
// 수정모드일때는 PUT
|
||||
await promisePut({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
console.log('수정::::::::::::', params)
|
||||
setIsGlobalLoading(true)
|
||||
|
||||
if (res.status === 201) {
|
||||
@ -1413,8 +1418,6 @@ export default function StuffDetail() {
|
||||
type: 'alert',
|
||||
confirmFn: () => {
|
||||
callDetailApi(objectNo)
|
||||
// setManagementState({ ...managementState, params })
|
||||
// router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -1426,48 +1429,22 @@ export default function StuffDetail() {
|
||||
}
|
||||
}
|
||||
|
||||
const callDetailApi = (objectNo) => {
|
||||
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||
if (res.status === 200) {
|
||||
const callDetailApi = async (objectNo) => {
|
||||
await promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||
if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
|
||||
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
||||
setShowButton('none')
|
||||
} else {
|
||||
if (session.storeId !== res?.data?.createUser) {
|
||||
setShowButton('none')
|
||||
}
|
||||
if (isObjectNotEmpty(res.data)) {
|
||||
}
|
||||
let surfaceTypeValue
|
||||
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
||||
surfaceTypeValue = '3'
|
||||
} else if (res.data.surfaceType === 'Ⅱ') {
|
||||
} else {
|
||||
surfaceTypeValue = '2'
|
||||
}
|
||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||
} else {
|
||||
setManagementState({})
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.header.notExistObjectNo'),
|
||||
type: 'alert',
|
||||
confirmFn: () => {
|
||||
router.push('/management/stuff', { scroll: false })
|
||||
},
|
||||
})
|
||||
}
|
||||
if (isNotEmptyArray(res.data.planList)) {
|
||||
setPlanGridProps({ ...planGridProps, planGridData: res.data.planList })
|
||||
} else {
|
||||
setPlanGridProps({ ...planGridProps, planGridData: [] })
|
||||
}
|
||||
} else {
|
||||
setManagementState({})
|
||||
setPlanGridProps({ ...planGridProps, planGridData: [] })
|
||||
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.header.notExistObjectNo'),
|
||||
type: 'alert',
|
||||
confirmFn: () => {
|
||||
router.push('/management/stuff', { scroll: false })
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -1679,7 +1656,6 @@ export default function StuffDetail() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{(editMode === 'NEW' && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user