pyt
2025-03-17 956d1d6e32b3c7a8c40101a42a2855fb5c22bc63
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, audit } from './service'
const Banner = () => {
  const actionRef = useRef();
@@ -22,44 +22,54 @@
    {
      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,
    },
    {
@@ -68,33 +78,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['/party_member_audit/audit']}>
                <Button
                  type="link"
                  onClick={() => {
                    addViewRef.current.refreshData({ type: 'sure', id: record.id });
                    handleModalVisible(true);
                  }}
                >
                  通过
                </Button>
                </Access>
                <Access accessible={access['/party_member_audit/audit']}>
                <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 +131,8 @@
          defaultPageSize: 10,
        }}
        request={(params) => {
          params.auditStatus = 0
          params.communityId = params.community ? params.community[params.community.length - 1] : ''
          return buildProTableDataSource(getList, params)
        }}
        toolBarRender={false}
@@ -119,18 +142,12 @@
        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>