|
@@ -1,7 +1,7 @@
|
|
|
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
|
import styles from './index.module.scss'
|
|
|
import { useParams } from 'react-router-dom'
|
|
|
-import { A2AListCamerasType, A2AListType } from '@/types'
|
|
|
+import { A2AListCamerasType, A2AListType, A2BListType } from '@/types'
|
|
|
import { A2A_APIgetInfo, A2A_APIremove } from '@/store/action/A2Abusiness'
|
|
|
import { MessageFu } from '@/utils/message'
|
|
|
import history from '@/utils/history'
|
|
@@ -12,8 +12,10 @@ import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
import LookTxt from '../components/LookTxt'
|
|
|
import LookTxt2 from '../components/LookTxt2'
|
|
|
import LookTable from '../components/LookTable'
|
|
|
-import { lookTable2 } from '../components/LookTable/tableData'
|
|
|
+import { lookTable2, lookTable3 } from '../components/LookTable/tableData'
|
|
|
import AddBusiness from '@/pages/A2Abusiness/AddBusiness'
|
|
|
+import { A2BaddType } from '@/pages/A2Blogistics/data'
|
|
|
+import AddLogistics from '@/pages/A2Blogistics/AddLogistics'
|
|
|
|
|
|
type Props = {
|
|
|
pageTit: string
|
|
@@ -42,9 +44,18 @@ function A2Index({ pageTit }: Props) {
|
|
|
|
|
|
const rtfDesc = data.rtfDesc || '{"isSection":"true","txtArr":[{"txt":"<p></p>"}]}'
|
|
|
const rtfDescObj = JSON.parse(rtfDesc)
|
|
|
+
|
|
|
+ let logistics: any[] = data.logistics || []
|
|
|
+ logistics = logistics.map(v => ({
|
|
|
+ ...v,
|
|
|
+ RKDate: v.type === 'RK' ? v.dateStart : '/',
|
|
|
+ CKDate: v.type === 'CK' ? v.dateStart : '/'
|
|
|
+ }))
|
|
|
+
|
|
|
setInfo({
|
|
|
...data,
|
|
|
cameras: data.cameras || [],
|
|
|
+ logistics: logistics,
|
|
|
files: data.files || [],
|
|
|
rtf: refObj,
|
|
|
rtfDesc: rtfDescObj
|
|
@@ -76,6 +87,9 @@ function A2Index({ pageTit }: Props) {
|
|
|
return Reflect.get(A2AtopTypeObj, info.type)
|
|
|
}, [info.type])
|
|
|
|
|
|
+ // 点击编辑
|
|
|
+ const [logAddInfo, setLogAddInfo] = useState<A2BaddType>({ id: 0, txt: '', type: '' })
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.A2LookIndex}>
|
|
|
<div className='pageTitle'>{pageTit}</div>
|
|
@@ -123,19 +137,51 @@ function A2Index({ pageTit }: Props) {
|
|
|
}
|
|
|
]}
|
|
|
/>
|
|
|
+ <br />
|
|
|
|
|
|
- {/* 待完善 */}
|
|
|
{['ZL', 'XS', 'BX', 'WX'].includes(info.type) ? (
|
|
|
<div className='lookTit'>
|
|
|
<div>物流订单</div>
|
|
|
<div>
|
|
|
{['ZL', 'XS', 'WX'].includes(info.type) ? (
|
|
|
- <Button type='primary'>新增出库</Button>
|
|
|
+ <Button
|
|
|
+ type='primary'
|
|
|
+ onClick={() => setLogAddInfo({ id: -1, txt: '新增', type: 'CK' })}
|
|
|
+ >
|
|
|
+ 新增出库
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+ {['ZL', 'BX'].includes(info.type) ? (
|
|
|
+ <Button
|
|
|
+ type='primary'
|
|
|
+ onClick={() => setLogAddInfo({ id: -1, txt: '新增', type: 'RK' })}
|
|
|
+ >
|
|
|
+ 新增入库
|
|
|
+ </Button>
|
|
|
) : null}
|
|
|
- {['ZL', 'BX'].includes(info.type) ? <Button type='primary'>新增入库</Button> : null}
|
|
|
</div>
|
|
|
</div>
|
|
|
) : null}
|
|
|
+
|
|
|
+ <LookTable
|
|
|
+ list={info.logistics}
|
|
|
+ columnsTemp={lookTable3}
|
|
|
+ isNull='/'
|
|
|
+ lastBtn={[
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ render: (item: A2BListType) => (
|
|
|
+ <Button
|
|
|
+ size='small'
|
|
|
+ type='text'
|
|
|
+ onClick={() => history.push(`/lookLog/${item.id}`)}
|
|
|
+ >
|
|
|
+ 查看
|
|
|
+ </Button>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ />
|
|
|
</div>
|
|
|
) : null}
|
|
|
|
|
@@ -153,6 +199,21 @@ function A2Index({ pageTit }: Props) {
|
|
|
</div>
|
|
|
</div>
|
|
|
) : null}
|
|
|
+
|
|
|
+ {/* 物流订单 点击 新增出库 新增入库 出来的页面 */}
|
|
|
+ {logAddInfo.id ? (
|
|
|
+ <div className='lookIndexBoxAdd'>
|
|
|
+ <div>
|
|
|
+ <AddLogistics
|
|
|
+ openInfo={logAddInfo}
|
|
|
+ closeFu={() => setLogAddInfo({ id: 0, txt: '', type: '' })}
|
|
|
+ upTableFu={() => {}}
|
|
|
+ addTableFu={() => getInfoFu(urlId)}
|
|
|
+ orderNumTemp={info.num}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
</div>
|
|
|
)
|
|
|
}
|