带录入
This commit is contained in:
@ -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>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user