This commit is contained in:
linxd
2025-08-05 17:19:09 +08:00
2 changed files with 38 additions and 41 deletions

View File

@ -62,41 +62,40 @@ function findFirstLeafKey(nodes: any[]): string | undefined {
const groupQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => { const groupQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [dataTree, setDataTree] = useState<TreeNode[]>([]); const [dataTree, setDataTree] = useState < TreeNode[] > ([]);
const [treeSelected, setTreeSelected] = useState<string[]>([]); const [treeSelected, setTreeSelected] = useState < string[] > ([]);
const [selectedKeys, setSelectedKeys] = useState<string>(''); const [selectedKeys, setSelectedKeys] = useState < string > ('');
const [DeptId, setDeptId] = useState<string>(''); const [DeptId, setDeptId] = useState < string > ('');
const [data, setData] = useState<Data[]>([]); const [data, setData] = useState < Data[] > ([]);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [treeLoading, setTreeLoading] = useState(false); const [treeLoading, setTreeLoading] = useState(false);
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState < TablePaginationConfig > ({ current: 1, pageSize: 10, total: 0 });
const [viewVisible, setViewVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false);
const [detailVisible, setDetailVisible] = useState(false); const [detailVisible, setDetailVisible] = useState(false);
const [currentRecord, setCurrentRecord] = useState<any>(null); const [currentRecord, setCurrentRecord] = useState < any > (null);
const orgIdStr = sessionStorage.getItem('Userinfo'); const orgIdStr = sessionStorage.getItem('Userinfo');
const currentUser = orgIdStr ? JSON.parse(orgIdStr) : null; const currentUser = orgIdStr ? JSON.parse(orgIdStr) : null;
// 查询 // 查询
const handleSearch = () => { const handleSearch = () => {
setPagination(p => ({ ...p, current: 1 })); setPagination(p => ({ ...p, current: 1 }));
getList(selectedKeys? selectedKeys:currentUser.organizationId); getList(selectedKeys ? selectedKeys : currentUser.organizationId);
}; };
const handleReset = () => { const handleReset = () => {
form.resetFields(); form.resetFields();
setPagination(p => ({ ...p, current: 1 })); setPagination(p => ({ ...p, current: 1 }));
getList(selectedKeys? selectedKeys:currentUser.organizationId); getList(selectedKeys ? selectedKeys : currentUser.organizationId);
}; };
const handleTreeSelect = (keys: React.Key[]) => { const handleTreeSelect = (keys: React.Key[]) => {
const key = keys[0] as string; const key = keys[0] as string;
if(key) { setSelectedKeys(key);
setSelectedKeys(key); setTreeSelected([key]);
setTreeSelected([key]); getList(key);
getList(key);
}
}; };
// 懒加载节点 // 懒加载节点
const onLoadTreeData = async (treeNode: any) => { const onLoadTreeData = async (treeNode: any) => {
console.log(1); console.log(1);
if (treeNode.children && treeNode.children.length > 0) return; if (treeNode.children && treeNode.children.length > 0) return;
setTreeLoading(true); setTreeLoading(true);
try { try {
@ -128,7 +127,7 @@ const groupQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
setLoading(false); setLoading(false);
} }
}; };
const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({}); const [enterpriseTypeMap, setEnterpriseTypeMap] = useState < { [code: string]: string } > ({});
// 初始化 // 初始化
useEffect(() => { useEffect(() => {
getDictList('enterprise_type').then((res: any) => { getDictList('enterprise_type').then((res: any) => {
@ -151,7 +150,7 @@ const groupQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
if (firstLeafKey) { if (firstLeafKey) {
// setSelectedKeys(firstLeafKey); // setSelectedKeys(firstLeafKey);
// setTreeSelected([firstLeafKey]); // setTreeSelected([firstLeafKey]);
getList(currentUser.organizationId); getList(currentUser.organizationId);
} }
} }
@ -227,14 +226,14 @@ const groupQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
width: 80, width: 80,
render: (record: any) => ( render: (record: any) => (
<Space> <Space>
<a onClick={() => { <a onClick={() => {
dispatch({ dispatch({
type: 'globalModal/show', type: 'globalModal/show',
payload: { payload: {
id: record.id, id: record.id,
}, },
}); });
}}></a> }}></a>
{/* <a onClick={() => { setCurrentRecord(record.id); setDetailVisible(true); }}>准入明细</a> */} {/* <a onClick={() => { setCurrentRecord(record.id); setDetailVisible(true); }}>准入明细</a> */}
</Space> </Space>
), ),
@ -264,10 +263,10 @@ const groupQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
<Form.Item style={{ marginLeft: 'auto' }}> <Form.Item style={{ marginLeft: 'auto' }}>
<Button className="buttonOther" type="primary" onClick={() => { <Button className="buttonOther" type="primary" onClick={() => {
const values = form.getFieldsValue(); const values = form.getFieldsValue();
values.orgId = DeptId? DeptId: currentUser.organizationId; values.orgId = DeptId ? DeptId : currentUser.organizationId;
downloadFile('/coscoSupplierBase/getPageQualifiedExport', 'GET', values); downloadFile('/coscoSupplierBase/getPageQualifiedExport', 'GET', values);
// window.open(`${SERVER_BASE}/coscoSupplierBase/getPageQualifiedExport`, '_blank'); // window.open(`${SERVER_BASE}/coscoSupplierBase/getPageQualifiedExport`, '_blank');
}}> }}>

View File

@ -62,37 +62,35 @@ const findFirstLeafKey = (nodes: any[]): string | undefined => {
const PersonQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => { const PersonQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [dataTree, setDataTree] = useState<TreeNode[]>([]); const [dataTree, setDataTree] = useState < TreeNode[] > ([]);
const [treeSelected, setTreeSelected] = useState<string[]>([]); const [treeSelected, setTreeSelected] = useState < string[] > ([]);
const [selectedKeys, setSelectedKeys] = useState<string>(''); const [selectedKeys, setSelectedKeys] = useState < string > ('');
const [DeptId, setDeptId] = useState<string>(''); const [DeptId, setDeptId] = useState < string > ('');
const [data, setData] = useState<Data[]>([]); const [data, setData] = useState < Data[] > ([]);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [treeLoading, setTreeLoading] = useState(false); const [treeLoading, setTreeLoading] = useState(false);
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState < TablePaginationConfig > ({ current: 1, pageSize: 10, total: 0 });
const [viewVisible, setViewVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false);
const [detailVisible, setDetailVisible] = useState(false); const [detailVisible, setDetailVisible] = useState(false);
const [currentRecord, setCurrentRecord] = useState<any>(null); const [currentRecord, setCurrentRecord] = useState < any > (null);
const orgIdStr = sessionStorage.getItem('Userinfo'); const orgIdStr = sessionStorage.getItem('Userinfo');
const currentUser = orgIdStr ? JSON.parse(orgIdStr) : null; const currentUser = orgIdStr ? JSON.parse(orgIdStr) : null;
// 查询 // 查询
const handleSearch = () => { const handleSearch = () => {
setPagination(p => ({ ...p, current: 1 })); setPagination(p => ({ ...p, current: 1 }));
getList(selectedKeys? selectedKeys:currentUser.organizationId); getList(selectedKeys ? selectedKeys : currentUser.organizationId);
}; };
const handleReset = () => { const handleReset = () => {
form.resetFields(); form.resetFields();
setPagination(p => ({ ...p, current: 1 })); setPagination(p => ({ ...p, current: 1 }));
getList(selectedKeys? selectedKeys:currentUser.organizationId); getList(selectedKeys ? selectedKeys : currentUser.organizationId);
}; };
const handleTreeSelect = (keys: React.Key[]) => { const handleTreeSelect = (keys: React.Key[]) => {
const key = keys[0] as string; const key = keys[0] as string;
if (key) { setSelectedKeys(key);
setSelectedKeys(key); setTreeSelected([key]);
setTreeSelected([key]); getList(key);
getList(key);
}
}; };
// 懒加载树节点 // 懒加载树节点
@ -177,8 +175,8 @@ const PersonQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
}, },
{ title: '身份证号', dataIndex: 'idCard', key: 'idCard', align: 'center', ellipsis: true }, { title: '身份证号', dataIndex: 'idCard', key: 'idCard', align: 'center', ellipsis: true },
{ title: '联系电话', dataIndex: 'personPhone', key: 'personPhone', align: 'center', ellipsis: true }, { title: '联系电话', dataIndex: 'personPhone', key: 'personPhone', align: 'center', ellipsis: true },
{ title: '准入单位', dataIndex: 'orgName', key: 'orgName', align: 'center', width: 120, ellipsis: true }, { title: '准入单位', dataIndex: 'orgName', key: 'orgName', align: 'center', width: 120, ellipsis: true },
{ title: '创建人', dataIndex: 'createName', key: 'createName', align: 'center', width: 120, ellipsis: true }, { title: '创建人', dataIndex: 'createName', key: 'createName', align: 'center', width: 120, ellipsis: true },
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime', align: 'center', ellipsis: true }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime', align: 'center', ellipsis: true },
{ {
title: '操作', title: '操作',
@ -226,7 +224,7 @@ const PersonQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
<Button className="buttonOther" type="primary" onClick={() => { <Button className="buttonOther" type="primary" onClick={() => {
const values = form.getFieldsValue(); const values = form.getFieldsValue();
// values.deptId = DeptId; // values.deptId = DeptId;
values.orgId = DeptId? DeptId: currentUser.organizationId; values.orgId = DeptId ? DeptId : currentUser.organizationId;
downloadFile('/coscoSupplierBase/getPagePeExport', 'GET', values); downloadFile('/coscoSupplierBase/getPagePeExport', 'GET', values);
}}> }}>