Commit 57d0f452 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 1e5197ce de9438a9
......@@ -73,6 +73,7 @@ const Add = () => {
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [payWayData, setPayWayData] = useState<any>([]);
const [payWay, setPayWay] = useState<number>(1);
const [applyType, setApplyType] = useState<number>(1);
const [dataSource, setDataSource] = useState<any>(_state?.data ?? {});
const [tabelSource, setTabelSource] = useState<any>([]);
const [applyOptions, setApplyOptions] = useState<any>((path === 'funds' || path === 'editFunds') ? [{ label: _state?.data?.applyTypeName, value: _state?.data?.applyType }] : []);
......@@ -653,6 +654,11 @@ const Add = () => {
return current && current < moment().endOf('day');
}
const _handleApplyTypeChange = (value: any) => {
form.setFieldsValue({ applyType: value })
setApplyType(value);
}
useEffect(() => {
if (!_isFunds) {
tabelSource.forEach((item) => {
......@@ -661,6 +667,15 @@ const Add = () => {
}
}, [tabelSource])
useEffect(() => {
if (!_isFunds) {
tabelSource.forEach((item) => {
form.setFieldsValue({ [`applyPayment${item.billNo}_${item.billId}`]: null })
})
}
setTabelSource([]);
}, [applyType])
return (
<>
<PeripheralLayout
......@@ -698,7 +713,7 @@ const Add = () => {
name='applyType'
rules={[{ required: true, message: '请选择请款类型' }]}
>
<Select placeholder={'请选择请款类型'} disabled={!_isAdd} options={applyOptions} />
<Select onChange={_handleApplyTypeChange} placeholder={'请选择请款类型'} disabled={!_isAdd} options={applyOptions} />
</Form.Item>
</Col>
</Row>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment