Commit d8272dd2 authored by 卢均锐's avatar 卢均锐

feat: 业务请款选择会员逻辑填充

parent 13b4fa4c
import React, { useRef, useState } from 'react';
import { Drawer, Button } from 'antd';
import { Drawer, Button, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { createFormActions } from '@formily/antd'
// import { getSettleAccountsBusinessReconciliationToReconciliationList } from '@/services/SettleV2Api'
import { postMemberManageLowerProviderPage } from '@/services/MemberV2Api'
import Submit from '@/components/NiceForm/components/Submit'
import NiceForm from '@/components/NiceForm'
import { getIntl } from 'umi';
......@@ -11,18 +11,21 @@ import { getIntl } from 'umi';
interface MemberDrawerProps {
visible: boolean,
onClose?: () => void,
onOk?: (record: any) => void
}
const intl = getIntl();
const formActions = createFormActions();
const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) => {
const { visible, onClose } = props;
const { visible, onClose, onOk } = props;
const ref = useRef<any>({})
const [selectedRow, setSelectedRow] = useState<any>({})
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const loadingTableData = async (params) => {
const _params = { ...params }
const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params)
const { data } = await postMemberManageLowerProviderPage(_params)
message.destroy();
return data;
}
......@@ -32,24 +35,25 @@ const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) =>
dataIndex: 'memberId',
}, {
title: '会员名称',
key: 'memberName',
dataIndex: 'memberName',
key: 'name',
dataIndex: 'name',
}, {
title: '会员类型',
key: 'memberType',
dataIndex: 'memberType',
key: 'memberTypeName',
dataIndex: 'memberTypeName',
}, {
title: '会员角色',
key: 'memberRole',
dataIndex: 'memberRole',
key: 'roleName',
dataIndex: 'roleName',
}, {
title: '会员等级',
key: 'memberLevel',
dataIndex: 'memberLevel',
key: 'levelTag',
dataIndex: 'levelTag',
}];
const handleSelectChange = (record, selected, selectedRow, nativeEvent) => {
setSelectedRowKeys([record.id]);
setSelectedRow(record)
};
......@@ -66,7 +70,7 @@ const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) =>
<Button onClick={onClose} style={{ marginRight: 8 }}>
{intl.formatMessage({ id: 'balance.quxiao' })}
</Button>
<Button onClick={onClose} type="primary">
<Button onClick={() => { onOk?.(selectedRow) }} type="primary">
{'确定'}
</Button>
</div>
......@@ -74,7 +78,7 @@ const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) =>
>
<StandardTable
keepAlive={false}
// fetchTableData={params => loadingTableData(params)}
fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="id"
......@@ -102,6 +106,7 @@ const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) =>
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入会员名称',
advanced: false,
align: 'flex-start',
},
},
......
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