更新部分功能

This commit is contained in:
孙景学
2025-07-03 10:24:33 +08:00
parent cf8e9d0820
commit e15c97d741
26 changed files with 199 additions and 114 deletions

View File

@ -2,9 +2,17 @@ import React, { useRef, useEffect, useState } from 'react';
import { Table, Form, Input, Button, Row, Col, DatePicker, Tabs, Space, message } from 'antd';
import { SearchOutlined, ReloadOutlined, PlusOutlined } from '@ant-design/icons';
import { getPageAgent } from './services';
import type { ColumnsType } from 'antd/es/table';
import SupplierViewModal from './components/SupplierViewModal';
const { RangePicker } = DatePicker;
const { TabPane } = Tabs;
interface Columns {
name: string;
enterpriseType: string;
deptId: string;
createTime: string;
id: string;
}
const SupplierRegisterAgent: React.FC = () => {
const [form] = Form.useForm();
@ -12,7 +20,10 @@ const SupplierRegisterAgent: React.FC = () => {
const [loading, setLoading] = useState(false);
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
const [tabKey, setTabKey] = useState('dvs');
//查看是否显示状态
const [viewVisible, setViewVisible] = useState(false);
//查看 参数传递
const [currentRecord, setCurrentRecord] = useState('');
// 查询数据
const fetchData = async (page = 1, pageSize = 10) => {
setLoading(true);
@ -67,7 +78,7 @@ const SupplierRegisterAgent: React.FC = () => {
};
// 列
const columns = [
const columns: ColumnsType<Columns> = [
{
title: '序号',
dataIndex: 'index',
@ -108,7 +119,7 @@ const SupplierRegisterAgent: React.FC = () => {
align: 'center',
render: (_: any, record: any) => (
<Space>
<a onClick={() => message.info(`查看:${record.name}`)}></a>
<a onClick={() => { setCurrentRecord(record.id); setViewVisible(true); }}></a>
<a onClick={() => message.info(`编辑:${record.name}`)}></a>
</Space>
),
@ -161,7 +172,12 @@ const SupplierRegisterAgent: React.FC = () => {
showSizeChanger: true,
onChange: (current, pageSize) => handleTableChange({ current, pageSize }),
}}
bordered
/>
{/* 查看组件 */}
<SupplierViewModal
visible={viewVisible}
record={currentRecord}
onCancel={() => setViewVisible(false)}
/>
</div>
);