| | |
| | | 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 } from 'react'; |
| | | import { useRef, useState, useEffect } from 'react'; |
| | | import { Access, history, useAccess } from 'umi'; |
| | | import AddAndEdit from './components/index'; |
| | | import { getList, updateStatus, deleteBanner, add, Edit } from './service' |
| | | import { getList, regionTree, audit } from './service' |
| | | const Banner = () => { |
| | | |
| | | const actionRef = useRef(); |
| | |
| | | { |
| | | title: '性别', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | dataIndex: 'gender', |
| | | valueEnum: { |
| | | 1: { text: '男' }, |
| | | 0: { text: '女' }, |
| | | } |
| | | }, |
| | | { |
| | | title: '联系电话', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | dataIndex: 'phone' |
| | | }, |
| | | { |
| | | title: '身份证号', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | dataIndex: 'idNumber' |
| | | }, |
| | | { |
| | | title: '所在社区', |
| | | dataIndex: 'name', |
| | | dataIndex: 'community', |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Cascader |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | fieldNames={{ value: 'id', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | ); |
| | | }, |
| | | render: (text, record) => { |
| | | return record.community |
| | | } |
| | | }, |
| | | { |
| | | title: '服务对象', |
| | | dataIndex: 'name' |
| | | dataIndex: 'serviceTarget', |
| | | render: (text, record) => { |
| | | return record.serviceTarget |
| | | } |
| | | }, |
| | | { |
| | | title: '所在党组织', |
| | | dataIndex: 'name' |
| | | dataIndex: 'partyOrganization' |
| | | }, |
| | | { |
| | | title: '申请时间', |
| | | dataIndex: 'status', |
| | | dataIndex: 'createTime', |
| | | hideInSearch: true, |
| | | }, |
| | | { |
| | |
| | | render: (text, record) => { |
| | | return ( |
| | | <Space> |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | {record.auditStatus == 0 && ( |
| | | <> |
| | | <Access accessible={access['/party_member_audit/audit']}> |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | |
| | | > |
| | | 通过 |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | </Access> |
| | | <Access accessible={access['/party_member_audit/audit']}> |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | |
| | | > |
| | | 拒绝 |
| | | </Button> |
| | | {/* </Access> */} |
| | | </Access> |
| | | </> |
| | | )} |
| | | |
| | | </Space > |
| | | ); |
| | | }, |
| | | }, |
| | | ] |
| | | |
| | | useEffect(() => { |
| | | regionTree({}).then(res => { |
| | | setItems(() => res.data) |
| | | }) |
| | | }, []) |
| | | |
| | | return <div> |
| | | <PageContainer title='党员审核' header={{ |
| | |
| | | defaultPageSize: 10, |
| | | }} |
| | | request={(params) => { |
| | | params.auditStatus = 0 |
| | | params.communityId = params.community ? params.community[params.community.length - 1] : '' |
| | | return buildProTableDataSource(getList, params) |
| | | }} |
| | | toolBarRender={false} |
| | |
| | | visible={modalVisible} |
| | | onCancel={() => handleModalVisible(false)} |
| | | onSave={async (fileds) => { |
| | | // const success = await sendRequest(add, fileds); |
| | | // if (success) { |
| | | // handleModalVisible(false); |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | | onUpdate={async (fileds) => { |
| | | // const success = await sendRequest(Edit, fileds); |
| | | // if (success) { |
| | | // handleModalVisible(false); |
| | | // actionRef.current.reload(); |
| | | // } |
| | | const success = await sendRequest(audit, fileds); |
| | | if (success) { |
| | | handleModalVisible(false); |
| | | addViewRef.current.clean() |
| | | actionRef.current.reload(); |
| | | } |
| | | }} |
| | | /> |
| | | </PageContainer> |