물건상세 버튼 노출 조건 수정
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') {
|
if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
|
||||||
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
||||||
setShowButton('none')
|
setShowButton('none')
|
||||||
|
} else {
|
||||||
|
if (session.storeId !== res?.data?.createUser) {
|
||||||
|
setShowButton('none')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (isObjectNotEmpty(res.data)) {
|
if (isObjectNotEmpty(res.data)) {
|
||||||
let surfaceTypeValue
|
let surfaceTypeValue
|
||||||
@ -358,7 +362,7 @@ export default function StuffDetail() {
|
|||||||
} else if (res.data.surfaceType === 'Ⅱ') {
|
} else if (res.data.surfaceType === 'Ⅱ') {
|
||||||
surfaceTypeValue = '2'
|
surfaceTypeValue = '2'
|
||||||
}
|
}
|
||||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue, firstFlag: 'Y' })
|
||||||
} else {
|
} else {
|
||||||
setManagementState({})
|
setManagementState({})
|
||||||
swalFire({
|
swalFire({
|
||||||
@ -1403,6 +1407,7 @@ export default function StuffDetail() {
|
|||||||
// 수정모드일때는 PUT
|
// 수정모드일때는 PUT
|
||||||
await promisePut({ url: apiUrl, data: params })
|
await promisePut({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log('수정::::::::::::', params)
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
|
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
@ -1413,8 +1418,6 @@ export default function StuffDetail() {
|
|||||||
type: 'alert',
|
type: 'alert',
|
||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
callDetailApi(objectNo)
|
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) => {
|
const callDetailApi = async (objectNo) => {
|
||||||
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
await promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
|
||||||
if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
|
setShowButton('none')
|
||||||
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
} else {
|
||||||
|
if (session.storeId !== res?.data?.createUser) {
|
||||||
setShowButton('none')
|
setShowButton('none')
|
||||||
}
|
}
|
||||||
if (isObjectNotEmpty(res.data)) {
|
|
||||||
let surfaceTypeValue
|
|
||||||
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
|
||||||
surfaceTypeValue = '3'
|
|
||||||
} else if (res.data.surfaceType === 'Ⅱ') {
|
|
||||||
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 })
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
let surfaceTypeValue
|
||||||
|
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
||||||
|
surfaceTypeValue = '3'
|
||||||
|
} else {
|
||||||
|
surfaceTypeValue = '2'
|
||||||
|
}
|
||||||
|
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1679,7 +1656,6 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(editMode === 'NEW' && (
|
{(editMode === 'NEW' && (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user