|
|
@@ -83,118 +83,129 @@ function ZgoodsInfo() {
|
|
|
|
|
|
// 点击的时候校验前置状态和页面权限
|
|
|
const tabArr2Temp = useMemo(() => {
|
|
|
- return [
|
|
|
- {
|
|
|
- id: 336,
|
|
|
- name: '档案管理',
|
|
|
- done: true,
|
|
|
- show: true,
|
|
|
- son: [
|
|
|
- {
|
|
|
- key: '1',
|
|
|
- label: '修改',
|
|
|
- onClick: () => {
|
|
|
- if (info.isEdit === 1) return MessageFu.warning(`当前藏品为 修改中 状态,不可 修改`)
|
|
|
- authorityFu(420, '藏品修改', () => setGoodInfo(info))
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- key: '2',
|
|
|
- label: '注销',
|
|
|
- onClick: () => {
|
|
|
- if ([3, 6].includes(info.status)) {
|
|
|
- authorityFu(430, '藏品注销', () => history.push(`/writeOff_edit/1/null?gId=${id}`))
|
|
|
- } else {
|
|
|
- const txtObj = selectObj['藏品入藏状态'].find(v => v.value === info.status)
|
|
|
- MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '草稿'} 状态,不可 注销`)
|
|
|
+ let arr: any[] = []
|
|
|
+ if ([3, 4, 6, 7].includes(info.status)) {
|
|
|
+ arr = [
|
|
|
+ {
|
|
|
+ id: 336,
|
|
|
+ name: '档案管理',
|
|
|
+ done: true,
|
|
|
+ show: true,
|
|
|
+ son: [
|
|
|
+ {
|
|
|
+ key: '1',
|
|
|
+ label: '修改',
|
|
|
+ onClick: () => {
|
|
|
+ if (info.isEdit === 1) return MessageFu.warning(`当前藏品为 修改中 状态,不可 修改`)
|
|
|
+ authorityFu(420, '藏品修改', () => setGoodInfo(info))
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- id: 337,
|
|
|
- name: '库房管理',
|
|
|
- done: true,
|
|
|
- show: true,
|
|
|
- son: [
|
|
|
- {
|
|
|
- key: '1',
|
|
|
- label: '入库',
|
|
|
- onClick: () => {
|
|
|
- if (!info.siteStatus || info.siteStatus === 1) {
|
|
|
- authorityFu(1010, '藏品入库', () =>
|
|
|
- history.push(`/inStorage_edit/1/null?gId=${id}`)
|
|
|
- )
|
|
|
- } else {
|
|
|
- const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
|
|
|
- MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '草稿'} 状态,不可 入库`)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '2',
|
|
|
+ label: '注销',
|
|
|
+ onClick: () => {
|
|
|
+ if ([3, 6].includes(info.status)) {
|
|
|
+ authorityFu(430, '藏品注销', () =>
|
|
|
+ history.push(`/writeOff_edit/1/null?gId=${id}`)
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ const txtObj = selectObj['藏品入藏状态'].find(v => v.value === info.status)
|
|
|
+ MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '草稿'} 状态,不可 注销`)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- key: '2',
|
|
|
- label: '移库',
|
|
|
- onClick: () => {
|
|
|
- if (info.siteStatus === 3) {
|
|
|
- authorityFu(1020, '藏品移库', () =>
|
|
|
- history.push(`/moveStorage_edit/1/null?gId=${id}`)
|
|
|
- )
|
|
|
- } else {
|
|
|
- const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
|
|
|
- MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '未入库'} 状态,不可 移库`)
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 337,
|
|
|
+ name: '库房管理',
|
|
|
+ done: true,
|
|
|
+ show: true,
|
|
|
+ son: [
|
|
|
+ {
|
|
|
+ key: '1',
|
|
|
+ label: '入库',
|
|
|
+ onClick: () => {
|
|
|
+ if (!info.siteStatus || info.siteStatus === 1) {
|
|
|
+ authorityFu(1010, '藏品入库', () =>
|
|
|
+ history.push(`/inStorage_edit/1/null?gId=${id}`)
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
|
|
|
+ MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '草稿'} 状态,不可 入库`)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- key: '3',
|
|
|
- label: '出库',
|
|
|
- onClick: () => {
|
|
|
- if (info.siteStatus === 3) {
|
|
|
- authorityFu(1030, '藏品出库', () =>
|
|
|
- history.push(`/outStorage_edit/1/null?gId=${id}`)
|
|
|
- )
|
|
|
- } else {
|
|
|
- const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
|
|
|
- MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '未入库'} 状态,不可 出库`)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '2',
|
|
|
+ label: '移库',
|
|
|
+ onClick: () => {
|
|
|
+ if (info.siteStatus === 3) {
|
|
|
+ authorityFu(1020, '藏品移库', () =>
|
|
|
+ history.push(`/moveStorage_edit/1/null?gId=${id}`)
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
|
|
|
+ MessageFu.warning(
|
|
|
+ `当前藏品为 ${txtObj ? txtObj.label : '未入库'} 状态,不可 移库`
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '3',
|
|
|
+ label: '出库',
|
|
|
+ onClick: () => {
|
|
|
+ if (info.siteStatus === 3) {
|
|
|
+ authorityFu(1030, '藏品出库', () =>
|
|
|
+ history.push(`/outStorage_edit/1/null?gId=${id}`)
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
|
|
|
+ MessageFu.warning(
|
|
|
+ `当前藏品为 ${txtObj ? txtObj.label : '未入库'} 状态,不可 出库`
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- id: 338,
|
|
|
- name: '藏品维护',
|
|
|
- done: true,
|
|
|
- show: true,
|
|
|
- son: [
|
|
|
- {
|
|
|
- key: '1',
|
|
|
- label: '鉴定登记',
|
|
|
- onClick: () =>
|
|
|
- authorityFu(230, '藏品鉴定', () => history.push(`/auth_edit/1/null?gId=${id}`))
|
|
|
- },
|
|
|
- {
|
|
|
- key: '2',
|
|
|
- label: '事故登记',
|
|
|
- onClick: () =>
|
|
|
- authorityFu(510, '事故登记', () => history.push(`/accident_edit/1/null?gId=${id}`))
|
|
|
- },
|
|
|
- {
|
|
|
- key: '3',
|
|
|
- label: '现状登记',
|
|
|
- onClick: () =>
|
|
|
- authorityFu(540, '现状登记', () => history.push(`/actuality_edit/1/null?gId=${id}`))
|
|
|
- },
|
|
|
- {
|
|
|
- key: '4',
|
|
|
- label: '修复登记',
|
|
|
- onClick: () =>
|
|
|
- authorityFu(550, '修复登记', () => history.push(`/repair_edit/1/null?gId=${id}`))
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 338,
|
|
|
+ name: '藏品维护',
|
|
|
+ done: true,
|
|
|
+ show: true,
|
|
|
+ son: [
|
|
|
+ {
|
|
|
+ key: '1',
|
|
|
+ label: '鉴定登记',
|
|
|
+ onClick: () =>
|
|
|
+ authorityFu(230, '藏品鉴定', () => history.push(`/auth_edit/1/null?gId=${id}`))
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '2',
|
|
|
+ label: '事故登记',
|
|
|
+ onClick: () =>
|
|
|
+ authorityFu(510, '事故登记', () => history.push(`/accident_edit/1/null?gId=${id}`))
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '3',
|
|
|
+ label: '现状登记',
|
|
|
+ onClick: () =>
|
|
|
+ authorityFu(540, '现状登记', () => history.push(`/actuality_edit/1/null?gId=${id}`))
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '4',
|
|
|
+ label: '修复登记',
|
|
|
+ onClick: () =>
|
|
|
+ authorityFu(550, '修复登记', () => history.push(`/repair_edit/1/null?gId=${id}`))
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+
|
|
|
+ return arr
|
|
|
}, [id, info])
|
|
|
|
|
|
const [tabArr1, setTabArr1] = useState<tabArr1Type[]>([])
|