|
@@ -3,7 +3,7 @@ import styles from './index.module.scss'
|
|
|
import { GoodsType } from '../Zother/SonGoodsList/data'
|
|
import { GoodsType } from '../Zother/SonGoodsList/data'
|
|
|
import { API_getGoodsInfo } from '@/store/action/Cledger/C1ledger'
|
|
import { API_getGoodsInfo } from '@/store/action/Cledger/C1ledger'
|
|
|
import { useParams } from 'react-router-dom'
|
|
import { useParams } from 'react-router-dom'
|
|
|
-import { resTagFu } from '@/utils/dataChange'
|
|
|
|
|
|
|
+import { resTagFu, selectObj } from '@/utils/dataChange'
|
|
|
import { Button, Dropdown, Tag } from 'antd'
|
|
import { Button, Dropdown, Tag } from 'antd'
|
|
|
import { useSelector } from 'react-redux'
|
|
import { useSelector } from 'react-redux'
|
|
|
import { RootState } from '@/store'
|
|
import { RootState } from '@/store'
|
|
@@ -16,6 +16,7 @@ import GItab2 from './GItab2'
|
|
|
import GItab3 from './GItab3'
|
|
import GItab3 from './GItab3'
|
|
|
import GItab4 from './GItab4'
|
|
import GItab4 from './GItab4'
|
|
|
import GItab5 from './GItab5'
|
|
import GItab5 from './GItab5'
|
|
|
|
|
+import { MessageFu } from '@/utils/message'
|
|
|
|
|
|
|
|
type tabArr1Type = {
|
|
type tabArr1Type = {
|
|
|
id: number
|
|
id: number
|
|
@@ -50,7 +51,7 @@ function ZgoodsInfo() {
|
|
|
]
|
|
]
|
|
|
}, [info])
|
|
}, [info])
|
|
|
|
|
|
|
|
- // 待完善sg 点击的时候校验前置状态,待确定
|
|
|
|
|
|
|
+ // 点击的时候校验前置状态和页面权限
|
|
|
const tabArr2Temp = useMemo(() => {
|
|
const tabArr2Temp = useMemo(() => {
|
|
|
return [
|
|
return [
|
|
|
{
|
|
{
|
|
@@ -62,14 +63,22 @@ function ZgoodsInfo() {
|
|
|
{
|
|
{
|
|
|
key: '1',
|
|
key: '1',
|
|
|
label: '修改',
|
|
label: '修改',
|
|
|
- onClick: () =>
|
|
|
|
|
|
|
+ onClick: () => {
|
|
|
|
|
+ if (info.isEdit === 1) return MessageFu.warning(`当前藏品为 修改中 状态,不可 修改`)
|
|
|
authorityFu(420, '藏品修改', () => history.push(`/edit_edit/1/null?gId=${id}`))
|
|
authorityFu(420, '藏品修改', () => history.push(`/edit_edit/1/null?gId=${id}`))
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
key: '2',
|
|
key: '2',
|
|
|
label: '注销',
|
|
label: '注销',
|
|
|
- onClick: () =>
|
|
|
|
|
- authorityFu(430, '藏品注销', () => history.push(`/writeOff_edit/1/null?gId=${id}`))
|
|
|
|
|
|
|
+ onClick: () => {
|
|
|
|
|
+ if ([3, 6].includes(info.status)) {
|
|
|
|
|
+ authorityFu(430, '藏品注销', () => history.push(`/writeOff_edit/1/null?gId=${id}`))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const txt = Reflect.get(selectObj['藏品入藏状态'], info.status) || '草稿'
|
|
|
|
|
+ MessageFu.warning(`当前藏品为 ${txt} 状态,不可 注销`)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
@@ -82,22 +91,44 @@ function ZgoodsInfo() {
|
|
|
{
|
|
{
|
|
|
key: '1',
|
|
key: '1',
|
|
|
label: '入库',
|
|
label: '入库',
|
|
|
- onClick: () =>
|
|
|
|
|
- authorityFu(1010, '藏品入库', () => history.push(`/inStorage_edit/1/null?gId=${id}`))
|
|
|
|
|
|
|
+ onClick: () => {
|
|
|
|
|
+ if (!info.siteStatus || info.siteStatus === 1) {
|
|
|
|
|
+ authorityFu(1010, '藏品入库', () =>
|
|
|
|
|
+ history.push(`/inStorage_edit/1/null?gId=${id}`)
|
|
|
|
|
+ )
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const txt = Reflect.get(selectObj['藏品库存状态'], info.siteStatus) || '草稿'
|
|
|
|
|
+ MessageFu.warning(`当前藏品为 ${txt} 状态,不可 入库`)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
key: '2',
|
|
key: '2',
|
|
|
label: '移库',
|
|
label: '移库',
|
|
|
- onClick: () =>
|
|
|
|
|
- authorityFu(1020, '藏品移库', () =>
|
|
|
|
|
- history.push(`/moveStorage_edit/1/null?gId=${id}`)
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ onClick: () => {
|
|
|
|
|
+ if (info.siteStatus === 3) {
|
|
|
|
|
+ authorityFu(1020, '藏品移库', () =>
|
|
|
|
|
+ history.push(`/moveStorage_edit/1/null?gId=${id}`)
|
|
|
|
|
+ )
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const txt = Reflect.get(selectObj['藏品库存状态'], info.siteStatus) || '草稿'
|
|
|
|
|
+ MessageFu.warning(`当前藏品为 ${txt} 状态,不可 移库`)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
key: '3',
|
|
key: '3',
|
|
|
label: '出库',
|
|
label: '出库',
|
|
|
- onClick: () =>
|
|
|
|
|
- authorityFu(1030, '藏品出库', () => history.push(`/outStorage_edit/1/null?gId=${id}`))
|
|
|
|
|
|
|
+ onClick: () => {
|
|
|
|
|
+ if (info.siteStatus === 3) {
|
|
|
|
|
+ authorityFu(1030, '藏品出库', () =>
|
|
|
|
|
+ history.push(`/outStorage_edit/1/null?gId=${id}`)
|
|
|
|
|
+ )
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const txt = Reflect.get(selectObj['藏品库存状态'], info.siteStatus) || '草稿'
|
|
|
|
|
+ MessageFu.warning(`当前藏品为 ${txt} 状态,不可 出库`)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
@@ -134,7 +165,7 @@ function ZgoodsInfo() {
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
- }, [id])
|
|
|
|
|
|
|
+ }, [id, info])
|
|
|
|
|
|
|
|
const [tabArr1, setTabArr1] = useState<tabArr1Type[]>([])
|
|
const [tabArr1, setTabArr1] = useState<tabArr1Type[]>([])
|
|
|
const [loding, setLoding] = useState(false)
|
|
const [loding, setLoding] = useState(false)
|
|
@@ -211,7 +242,7 @@ function ZgoodsInfo() {
|
|
|
))}
|
|
))}
|
|
|
</div>
|
|
</div>
|
|
|
{/* 已删除状态隐藏右侧抽屉按钮 */}
|
|
{/* 已删除状态隐藏右侧抽屉按钮 */}
|
|
|
- {info.status === 8 ? (
|
|
|
|
|
|
|
+ {!info.status || [8, 0].includes(info.status) ? (
|
|
|
<div></div>
|
|
<div></div>
|
|
|
) : (
|
|
) : (
|
|
|
<div>
|
|
<div>
|