部门与退出
This commit is contained in:
56
src/components/AccessDepartmentSelect/index.tsx
Normal file
56
src/components/AccessDepartmentSelect/index.tsx
Normal file
@ -0,0 +1,56 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Select } from 'antd';
|
||||
import { queryUserOrgAll } from './services'
|
||||
|
||||
export interface AccessDepartmentSelectProps {
|
||||
value?: string | number;
|
||||
onChange?: (value: string | number) => void;
|
||||
options?: { label: string; value: string | number }[];
|
||||
placeholder?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
interface Dict {
|
||||
orgName: string;
|
||||
orgId: string;
|
||||
}
|
||||
|
||||
|
||||
const AccessDepartmentSelect: React.FC<AccessDepartmentSelectProps> = ({
|
||||
value,
|
||||
onChange,
|
||||
placeholder = '请选择准入部门',
|
||||
disabled = false,
|
||||
}) => {
|
||||
|
||||
//部门
|
||||
const [userOrgAll, setUserOrgAll] = useState<Dict[]>();
|
||||
useEffect(() => {
|
||||
queryUserOrgAll().then((res) => {
|
||||
const { code, data } = res;
|
||||
if (code == 200) {
|
||||
setUserOrgAll(data)
|
||||
}
|
||||
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Select
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
placeholder={placeholder}
|
||||
disabled={disabled}
|
||||
allowClear
|
||||
style={{ width: '100%' }}
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
>
|
||||
{userOrgAll?.map(item => (
|
||||
<Select.Option key={item.orgId} value={item.orgId}>{item.orgName}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
);
|
||||
};
|
||||
|
||||
export default AccessDepartmentSelect;
|
30
src/components/AccessDepartmentSelect/services.ts
Normal file
30
src/components/AccessDepartmentSelect/services.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
export const queryUserOrgAll = () => request.get(`/org/queryUserOrgAll`);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@ const InvoiceTab: React.FC<InvoiceTabProps> = (props) => {
|
||||
|
||||
const columns: ColumnsType<InvoiceInfo> = [
|
||||
{ title: 'page.workbench.invoice.index', dataIndex: 'index', width: 80, key: 'index', render: (_: any, __: any, index: number) => index + 1 },
|
||||
{ title: 'page.workbench.invoice.taxpayerType', dataIndex: 'taxpayerType', ellipsis: true },
|
||||
{ title: 'page.workbench.invoice.taxpayerType', dataIndex: 'taxpayerTypeCn', ellipsis: true },
|
||||
{ title: 'page.workbench.invoice.taxpayerCode', dataIndex: 'taxpayerCode', ellipsis: true },
|
||||
{ title: 'page.workbench.invoice.head', dataIndex: 'head', ellipsis: true },
|
||||
{ title: 'page.workbench.invoice.address', dataIndex: 'address', ellipsis: true },
|
||||
|
Reference in New Issue
Block a user