index.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React, { useMemo } from 'react'
  2. import styles from './index.module.scss'
  3. import MyTable from '@/components/MyTable'
  4. import { D4tableC } from '@/utils/tableData'
  5. import { Button } from 'antd'
  6. import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
  7. type Props = {
  8. list: FourTableType[]
  9. }
  10. function D6impRelation({ list }: Props) {
  11. const tableLastBtn2 = useMemo(() => {
  12. return [
  13. {
  14. title: '操作',
  15. render: (item: any) => {
  16. return (
  17. <Button
  18. size='small'
  19. type='text'
  20. onClick={() => {
  21. window.open(`/#/impStor_edit/4/${item.id}`, '_blank')
  22. }}
  23. >
  24. 查看
  25. </Button>
  26. )
  27. }
  28. }
  29. ]
  30. }, [])
  31. return (
  32. <div className={styles.D6impRelation} hidden={list.length === 0}>
  33. <div className='D6RTit'>相关入库单</div>
  34. <MyTable list={list} columnsTemp={D4tableC} lastBtn={tableLastBtn2} pagingInfo={false} />
  35. </div>
  36. )
  37. }
  38. const MemoD6impRelation = React.memo(D6impRelation)
  39. export default MemoD6impRelation