|
@@ -11,6 +11,8 @@ import { voucherCenterTableC } from '@/utils/tableData'
|
|
|
import { Button, message } from 'antd'
|
|
import { Button, message } from 'antd'
|
|
|
import tabLeftArr from '@/pages/Layout/data'
|
|
import tabLeftArr from '@/pages/Layout/data'
|
|
|
import { downloadFileByUrl } from '@/utils'
|
|
import { downloadFileByUrl } from '@/utils'
|
|
|
|
|
+import { authorityFu } from '@/utils/authority'
|
|
|
|
|
+import { MessageFu } from '@/utils/message'
|
|
|
|
|
|
|
|
function A4proof() {
|
|
function A4proof() {
|
|
|
const tableInfo = useSelector((state: RootState) => state.A4proof.tableInfo)
|
|
const tableInfo = useSelector((state: RootState) => state.A4proof.tableInfo)
|
|
@@ -89,8 +91,10 @@ function A4proof() {
|
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
|
|
// 点击各种操作按钮
|
|
// 点击各种操作按钮
|
|
|
- const tableBtnFu = useCallback((id: number, key: string) => {
|
|
|
|
|
- history.push(`/proof_edit/${key}/${id}`)
|
|
|
|
|
|
|
+ const btnFu = useCallback((pageKey: '3' | '4', obj: any, id: number) => {
|
|
|
|
|
+ if (obj) {
|
|
|
|
|
+ authorityFu(obj.id, obj.name, () => history.push(`${obj.path}_edit/${pageKey}/${id}`))
|
|
|
|
|
+ } else MessageFu.warning('业务类型错误')
|
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
|
|
const staBtn = useMemo(() => {
|
|
const staBtn = useMemo(() => {
|
|
@@ -163,23 +167,27 @@ function A4proof() {
|
|
|
return [
|
|
return [
|
|
|
{
|
|
{
|
|
|
title: '操作',
|
|
title: '操作',
|
|
|
- render: (item: any) => (
|
|
|
|
|
- <>
|
|
|
|
|
- <Button size='small' type='text' onClick={() => tableBtnFu(item.moduleId, '4')}>
|
|
|
|
|
- 查看
|
|
|
|
|
- </Button>
|
|
|
|
|
- <Button
|
|
|
|
|
- size='small'
|
|
|
|
|
- type='text'
|
|
|
|
|
- onClick={() => downloadFileByUrl(item.filePath, item.fileName)}
|
|
|
|
|
- >
|
|
|
|
|
- 下载
|
|
|
|
|
- </Button>
|
|
|
|
|
- </>
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ render: (item: any) => {
|
|
|
|
|
+ const obj = list.find(v => v.value === item.moduleName)
|
|
|
|
|
+ console.log('obj', obj)
|
|
|
|
|
+ return (
|
|
|
|
|
+ <>
|
|
|
|
|
+ <Button size='small' type='text' onClick={() => btnFu('4', obj, item.moduleId)}>
|
|
|
|
|
+ 查看
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ <Button
|
|
|
|
|
+ size='small'
|
|
|
|
|
+ type='text'
|
|
|
|
|
+ onClick={() => downloadFileByUrl(item.filePath, item.fileName)}
|
|
|
|
|
+ >
|
|
|
|
|
+ 下载
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ </>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
- }, [tableBtnFu])
|
|
|
|
|
|
|
+ }, [btnFu, list])
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className={styles.A4proof}>
|
|
<div className={styles.A4proof}>
|