Commit 17f2dae8 authored by 卢均锐's avatar 卢均锐

feat: 业务请款增加组件

parent 7991e464
import React, { useRef, useState } from 'react';
import { Drawer, Button } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
// import { getSettleAccountsBusinessReconciliationToReconciliationList } from '@/services/SettleV2Api'
import Submit from '@/components/NiceForm/components/Submit'
import NiceForm from '@/components/NiceForm'
import { getIntl } from 'umi';
interface ContractDrawerProps {
visible: boolean,
onClose?: () => void,
}
const intl = getIntl();
const formActions = createFormActions();
const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProps) => {
const { visible, onClose } = props;
const ref = useRef<any>({})
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const loadingTableData = async (params) => {
const _params = { ...params }
const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params)
return data;
}
const columns: ColumnType<any>[] = [{
title: '合同编号',
key: 'memberId',
dataIndex: 'memberId',
}, {
title: '合同摘要',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '合同生效时间',
key: 'memberType',
dataIndex: 'memberType',
}, {
title: '合同失效时间',
key: 'memberRole',
dataIndex: 'memberRole',
}, {
title: '合同金额',
key: 'memberLevel',
dataIndex: 'memberLevel',
}, {
title: '合同剩余金额',
key: 'memberLevel',
dataIndex: 'memberLevel',
}];
const handleSelectChange = (record, selected, selectedRow, nativeEvent) => {
setSelectedRowKeys([record.id]);
};
return (
<Drawer
title={'选择采购合同'}
placement={'right'}
onClose={onClose}
visible={visible}
key={'right'}
width={'50%'}
footer={
<div style={{ textAlign: 'right' }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>
{intl.formatMessage({ id: 'balance.quxiao' })}
</Button>
<Button onClick={onClose} type="primary">
{'确定'}
</Button>
</div>
}
>
<StandardTable
keepAlive={false}
// fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="id"
rowSelection={{
type: 'radio',
selectedRowKeys: selectedRowKeys,
onSelect: handleSelectChange,
}}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
)
}}
schema={{
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
"x-component-props": {
grid: true
},
properties: {
memberName: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入会员名称',
align: 'flex-start',
},
},
}
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
justifyContent: 'flex-end'
},
colStyle: {
marginRight: 16,
},
},
properties: {
"applyAbstract": {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({ id: 'balance.qingshuruqingkuandanzhaiyao' }),
allowClear: true,
}
},
"[expectPayTimeStart,expectPayTimeEnd]": {
type: 'string',
"x-component": "daterange",
"x-component-props": {
placeholder: [intl.formatMessage({ id: 'balance.yujifukuankaishishijian' }), intl.formatMessage({ id: 'balance.yujifukuanjieshushijian' })],
allowClear: true,
}
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: intl.formatMessage({ id: 'balance.chaxun' }),
},
},
},
}
}
}}
components={{
Submit,
}}
/>
}
/>
</Drawer>
);
}
export default ContractDrawer;
import React, { useRef, useState } from 'react';
import { Drawer, Button } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
// import { getSettleAccountsBusinessReconciliationToReconciliationList } from '@/services/SettleV2Api'
import Submit from '@/components/NiceForm/components/Submit'
import NiceForm from '@/components/NiceForm'
import { getIntl } from 'umi';
interface RequestFundsDrawerProps {
visible: boolean,
onClose?: () => void,
}
const intl = getIntl();
const formActions = createFormActions();
const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFundsDrawerProps) => {
const { visible, onClose } = props;
const ref = useRef<any>({})
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const loadingTableData = async (params) => {
const _params = { ...params }
const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params)
return data;
}
const columns: ColumnType<any>[] = [{
title: '单据号',
key: 'memberId',
dataIndex: 'memberId',
}, {
title: '单据摘要',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '单据类型',
key: 'memberType',
dataIndex: 'memberType',
}, {
title: '单据时间',
key: 'memberRole',
dataIndex: 'memberRole',
}, {
title: '单据状态',
key: 'memberLevel',
dataIndex: 'memberLevel',
}, {
title: '单据金额',
key: 'memberLevel',
dataIndex: 'memberLevel',
}, {
title: '已付款',
key: 'memberLevel',
dataIndex: 'memberLevel',
}, {
title: '已请款待付款',
key: 'memberLevel',
dataIndex: 'memberLevel',
}, {
title: '待请款',
key: 'memberLevel',
dataIndex: 'memberLevel',
}];
const handleSelectChange = (record, selected, selectedRow, nativeEvent) => {
setSelectedRowKeys([record.id]);
};
return (
<Drawer
title={'选择待请款单据'}
placement={'right'}
onClose={onClose}
visible={visible}
key={'right'}
width={'50%'}
footer={
<div style={{ textAlign: 'right' }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>
{intl.formatMessage({ id: 'balance.quxiao' })}
</Button>
<Button onClick={onClose} type="primary">
{'确定'}
</Button>
</div>
}
>
<StandardTable
keepAlive={false}
// fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="id"
rowSelection={{
type: 'radio',
selectedRowKeys: selectedRowKeys,
onSelect: handleSelectChange,
}}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
FORM_FILTER_PATH,
)
}}
schema={{
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
"x-component-props": {
grid: true
},
properties: {
memberName: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入单据号',
align: 'flex-start',
},
},
}
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
justifyContent: 'flex-end'
},
colStyle: {
marginRight: 16,
},
},
properties: {
"applyAbstract": {
type: 'string',
'x-component-props': {
placeholder: '请输入单据摘要',
allowClear: true,
}
},
"[expectPayTimeStart,expectPayTimeEnd]": {
type: 'string',
"x-component": "daterange",
"x-component-props": {
placeholder: [intl.formatMessage({ id: 'balance.yujifukuankaishishijian' }), intl.formatMessage({ id: 'balance.yujifukuanjieshushijian' })],
allowClear: true,
}
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: intl.formatMessage({ id: 'balance.chaxun' }),
},
},
},
}
}
}}
components={{
Submit,
}}
/>
}
/>
</Drawer>
);
}
export default RequestFundsDrawer;
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