董国庆
2025-03-17 186bccedbc337c574c5e09327d34c4f660f6db31
management/src/pages/party/audit/index.jsx
@@ -1,10 +1,10 @@
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 { 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, updateStatus, deleteBanner, add, Edit } from './service'
import { getList, regionTree } from './service'
const Banner = () => {
  const actionRef = useRef();
@@ -22,44 +22,50 @@
    {
      title: '性别',
      hideInSearch: true,
      dataIndex: 'name'
      dataIndex: 'gender'
    },
    {
      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,
    },
    {
@@ -68,33 +74,44 @@
      render: (text, record) => {
        return (
          <Space>
            {/* <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> */}
            {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={{
@@ -110,6 +127,8 @@
          defaultPageSize: 10,
        }}
        request={(params) => {
          params.auditStatus = 0
          params.communityId = params.community ? params.community[params.community.length - 1] : ''
          return buildProTableDataSource(getList, params)
        }}
        toolBarRender={false}
@@ -122,6 +141,7 @@
          // const success = await sendRequest(add, fileds);
          // if (success) {
          //   handleModalVisible(false);
          // addViewRef.current.clean()
          //   actionRef.current.reload();
          // }
        }}
@@ -129,6 +149,7 @@
          // const success = await sendRequest(Edit, fileds);
          // if (success) {
          //   handleModalVisible(false);
          // addViewRef.current.clean()
          //   actionRef.current.reload();
          // }
        }}