带录入

This commit is contained in:
孙景学
2025-07-04 10:15:56 +08:00
parent 87baa97ae1
commit 6325c023be
11 changed files with 108 additions and 1963 deletions

View File

@ -4,6 +4,9 @@ import { SearchOutlined, ReloadOutlined, PlusOutlined } from '@ant-design/icons'
import { getPageAgent } from './services';
import type { ColumnsType } from 'antd/es/table';
import SupplierViewModal from './components/SupplierViewModal';
import SupplierExitModal from './components/SupplierExitModal';
const { RangePicker } = DatePicker;
const { TabPane } = Tabs;
interface Columns {
@ -24,6 +27,10 @@ const SupplierRegisterAgent: React.FC = () => {
const [viewVisible, setViewVisible] = useState(false);
//查看 参数传递
const [currentRecord, setCurrentRecord] = useState('');
// 新增与修改
const [exitModalVisible, setExitModalVisible] = useState(false);
const [exitId, setExitId] = useState('');
// 查询数据
const fetchData = async (page = 1, pageSize = 10) => {
setLoading(true);
@ -120,7 +127,10 @@ const SupplierRegisterAgent: React.FC = () => {
render: (_: any, record: any) => (
<Space>
<a onClick={() => { setCurrentRecord(record.id); setViewVisible(true); }}></a>
<a onClick={() => message.info(`编辑:${record.name}`)}></a>
{/* <a onClick={() => {
setExitId(record.id);
setExitModalVisible(true);
}}>编辑</a> */}
</Space>
),
},
@ -155,7 +165,7 @@ const SupplierRegisterAgent: React.FC = () => {
</Tabs>
</Col>
<Col>
<Button type="primary" icon={<PlusOutlined />}></Button>
<Button type="primary" icon={<PlusOutlined />} onClick={() => { setExitModalVisible(true) }} ></Button>
</Col>
</Row>
{/* 表格 */}
@ -179,6 +189,11 @@ const SupplierRegisterAgent: React.FC = () => {
record={currentRecord}
onCancel={() => setViewVisible(false)}
/>
<SupplierExitModal
visible={exitModalVisible}
exitId={exitId}
onOk={() => setExitModalVisible(false)}
/>
</div>
);
};