import { PageContainer, ProTable } from '@ant-design/pro-components';
|
import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils';
|
import { Button, message, Space, Cascader } from 'antd';
|
import { useRef, useState, useEffect } from 'react';
|
import { Access, history, useAccess } from 'umi';
|
import AddAndEdit from './components/index';
|
import { getList, regionTree } from './service'
|
const Banner = () => {
|
|
const actionRef = useRef();
|
const access = useAccess();
|
const addViewRef = useRef();
|
const [modalVisible, handleModalVisible] = useState(false);
|
|
const [items, setItems] = useState([]);
|
|
const columns = [
|
{
|
title: '姓名',
|
dataIndex: 'name'
|
},
|
{
|
title: '性别',
|
hideInSearch: true,
|
dataIndex: 'gender'
|
},
|
{
|
title: '联系电话',
|
hideInSearch: true,
|
dataIndex: 'phone'
|
},
|
{
|
title: '身份证号',
|
hideInSearch: true,
|
dataIndex: 'idNumber'
|
},
|
{
|
title: '所在社区',
|
dataIndex: 'community',
|
renderFormItem: () => {
|
return (
|
<Cascader
|
options={items}
|
fieldNames={{ value: 'id', label: 'name' }}
|
placeholder="请选择"
|
displayRender={(label) => label[label.length - 1]}
|
changeOnSelect={true}
|
/>
|
);
|
},
|
render: (text, record) => {
|
return record.community
|
}
|
},
|
{
|
title: '服务对象',
|
dataIndex: 'serviceTarget',
|
render: (text, record) => {
|
return record.serviceTarget
|
}
|
},
|
{
|
title: '所在党组织',
|
dataIndex: 'partyOrganization'
|
},
|
{
|
title: '申请时间',
|
dataIndex: 'createTime',
|
hideInSearch: true,
|
},
|
{
|
title: '操作',
|
hideInSearch: true,
|
render: (text, record) => {
|
return (
|
<Space>
|
{record.auditStatus == 0 && (
|
<>
|
{/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */}
|
<Button
|
type="link"
|
onClick={() => {
|
addViewRef.current.refreshData({ type: 'sure', id: record.id });
|
handleModalVisible(true);
|
}}
|
>
|
通过
|
</Button>
|
{/* </Access> */}
|
{/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */}
|
<Button
|
type="link"
|
onClick={() => {
|
addViewRef.current.refreshData({ type: 'refuse', id: record.id });
|
handleModalVisible(true);
|
}}
|
>
|
拒绝
|
</Button>
|
{/* </Access> */}
|
</>
|
)}
|
|
</Space >
|
);
|
},
|
},
|
]
|
|
useEffect(() => {
|
regionTree({}).then(res => {
|
setItems(() => res.data)
|
})
|
}, [])
|
|
return <div>
|
<PageContainer title='党员审核' header={{
|
breadcrumb: {},
|
}}>
|
<ProTable
|
rowKey='id'
|
actionRef={actionRef}
|
columns={columns}
|
pagination={{
|
showSizeChanger: true,
|
showQuickJumper: true,
|
defaultPageSize: 10,
|
}}
|
request={(params) => {
|
params.auditStatus = 0
|
params.communityId = params.community ? params.community[params.community.length - 1] : ''
|
return buildProTableDataSource(getList, params)
|
}}
|
toolBarRender={false}
|
/>
|
<AddAndEdit
|
ref={addViewRef}
|
visible={modalVisible}
|
onCancel={() => handleModalVisible(false)}
|
onSave={async (fileds) => {
|
// const success = await sendRequest(add, fileds);
|
// if (success) {
|
// handleModalVisible(false);
|
// addViewRef.current.clean()
|
// actionRef.current.reload();
|
// }
|
}}
|
onUpdate={async (fileds) => {
|
// const success = await sendRequest(Edit, fileds);
|
// if (success) {
|
// handleModalVisible(false);
|
// addViewRef.current.clean()
|
// actionRef.current.reload();
|
// }
|
}}
|
/>
|
</PageContainer>
|
</div>;
|
};
|
|
export default Banner;
|