|
@@ -11,7 +11,8 @@ import { mapDataAll3 } from '@/pages/C1User/AddUser/city'
|
|
|
import UpXlsx from '@/components/UpXlsx'
|
|
|
import AddCamera from '@/pages/A1Camera/AddCamera'
|
|
|
import dayjs from 'dayjs'
|
|
|
-import { TopTypeType } from '../data'
|
|
|
+import { A2AtopTypeArr, A2AtopTypeObj, TopTypeType } from '../data'
|
|
|
+import { A2AListCamerasType } from '@/types'
|
|
|
|
|
|
type Props = {
|
|
|
topType: TopTypeType
|
|
@@ -20,17 +21,10 @@ type Props = {
|
|
|
upTableFu: () => void
|
|
|
addTableFu: () => void
|
|
|
}
|
|
|
-export type TableListType = {
|
|
|
- cameraSn: string
|
|
|
- cameraType: string
|
|
|
- remark: string
|
|
|
- id: number
|
|
|
- idxx: string
|
|
|
-}
|
|
|
|
|
|
function AddBusiness({ topType, openInfo, closeFu, upTableFu, addTableFu }: Props) {
|
|
|
// 表格数据
|
|
|
- const [tableList, setTableList] = useState<TableListType[]>([])
|
|
|
+ const [tableList, setTableList] = useState<A2AListCamerasType[]>([])
|
|
|
|
|
|
// 点击表格里面新增的数据
|
|
|
const [tableAdd, setTableAdd] = useState<A1addType>({ id: 0, txt: '' })
|
|
@@ -55,12 +49,12 @@ function AddBusiness({ topType, openInfo, closeFu, upTableFu, addTableFu }: Prop
|
|
|
return [
|
|
|
{
|
|
|
title: '相机类型',
|
|
|
- render: (item: TableListType) =>
|
|
|
+ render: (item: A2AListCamerasType) =>
|
|
|
item.cameraType ? (item.cameraType === 'KK' ? '看看' : '看见') : '(空)'
|
|
|
},
|
|
|
{
|
|
|
title: 'SN码',
|
|
|
- render: (item: TableListType) => (
|
|
|
+ render: (item: A2AListCamerasType) => (
|
|
|
<>
|
|
|
{item.cameraSn}
|
|
|
{item.id ? (
|
|
@@ -76,11 +70,11 @@ function AddBusiness({ topType, openInfo, closeFu, upTableFu, addTableFu }: Prop
|
|
|
},
|
|
|
{
|
|
|
title: '备注',
|
|
|
- render: (item: TableListType) => item.remark || '(空)'
|
|
|
+ render: (item: A2AListCamerasType) => item.remark || '(空)'
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
- render: (item: TableListType) => (
|
|
|
+ render: (item: A2AListCamerasType) => (
|
|
|
<MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.idxx)} />
|
|
|
)
|
|
|
}
|
|
@@ -195,6 +189,11 @@ function AddBusiness({ topType, openInfo, closeFu, upTableFu, addTableFu }: Prop
|
|
|
// 上传xlsx 的ref
|
|
|
const upXlsxRef = useRef<any>(null)
|
|
|
|
|
|
+ // 第二个信息标题
|
|
|
+ const tit2 = useMemo(() => {
|
|
|
+ return Reflect.get(A2AtopTypeObj, topType)
|
|
|
+ }, [topType])
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.AddBusiness}>
|
|
|
<div className='A2AaddMain'>
|
|
@@ -235,16 +234,18 @@ function AddBusiness({ topType, openInfo, closeFu, upTableFu, addTableFu }: Prop
|
|
|
</div>
|
|
|
|
|
|
<Form.Item
|
|
|
- label='租凭日期'
|
|
|
+ label={`${A2AtopTypeArr.find(v => v.key === topType)?.name}日期`}
|
|
|
name='dateStart'
|
|
|
rules={[{ required: true, message: '请选择日期!' }]}
|
|
|
>
|
|
|
<DatePicker placeholder='请选择日期' />
|
|
|
</Form.Item>
|
|
|
|
|
|
- <Form.Item label='预计归还日期' name='dateEnd'>
|
|
|
- <DatePicker placeholder='请选择日期' />
|
|
|
- </Form.Item>
|
|
|
+ {['ZL'].includes(topType) ? (
|
|
|
+ <Form.Item label='预计归还日期' name='dateEnd'>
|
|
|
+ <DatePicker placeholder='请选择日期' />
|
|
|
+ </Form.Item>
|
|
|
+ ) : null}
|
|
|
|
|
|
<div className='formBox'>
|
|
|
<div className='formBoxLL'>备注:</div>
|
|
@@ -260,10 +261,10 @@ function AddBusiness({ topType, openInfo, closeFu, upTableFu, addTableFu }: Prop
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div className='A2Atit'>租凭方信息</div>
|
|
|
+ <div className='A2Atit'>{tit2}信息</div>
|
|
|
|
|
|
<Form.Item
|
|
|
- label='租赁方名称'
|
|
|
+ label={`${tit2}名称`}
|
|
|
name='zlName'
|
|
|
rules={[{ required: true, message: '请输入内容!' }]}
|
|
|
getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
|