|
|
|
@ -1,48 +1,150 @@
|
|
|
|
|
import styles from './index.less';
|
|
|
|
|
import {
|
|
|
|
|
InputNumber,
|
|
|
|
|
Input,
|
|
|
|
|
Button,
|
|
|
|
|
Select,
|
|
|
|
|
Row,
|
|
|
|
|
Modal,
|
|
|
|
|
Form,
|
|
|
|
|
message,
|
|
|
|
|
Empty,
|
|
|
|
|
Spin,
|
|
|
|
|
} from 'antd';
|
|
|
|
|
import { Button, Select, Row, Modal, Form, message, Empty, Table } from 'antd';
|
|
|
|
|
import Fetch from '@/utils/fetch';
|
|
|
|
|
import { useEffect, useState, FC, useRef } from 'react';
|
|
|
|
|
import { Link } from 'umi';
|
|
|
|
|
import { downLoadLink } from '@/utils/download';
|
|
|
|
|
import url from '@/utils/url';
|
|
|
|
|
import ReactEcharts from 'echarts-for-react';
|
|
|
|
|
import { ColumnsType } from 'antd/lib/table';
|
|
|
|
|
|
|
|
|
|
interface PageProps {}
|
|
|
|
|
|
|
|
|
|
const Page: FC<PageProps> = () => {
|
|
|
|
|
const [data, setData] = useState<any>([]);
|
|
|
|
|
const [loading, setLoading] = useState<boolean>(true);
|
|
|
|
|
const [total, setTotal] = useState<number>(0);
|
|
|
|
|
const [params, setParams] = useState<any>({
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
getData();
|
|
|
|
|
getData(params);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const getData = async () => {
|
|
|
|
|
const res = await Fetch('/openi/secretKey/statistics', {
|
|
|
|
|
const getData = async (record: any) => {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
const res = await Fetch('/openi/producer/page', {
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: {},
|
|
|
|
|
params: record,
|
|
|
|
|
});
|
|
|
|
|
if (res.result === 'success') {
|
|
|
|
|
setData(res?.data?.[0]);
|
|
|
|
|
setData(res?.data?.[0]?.list);
|
|
|
|
|
setTotal(res?.data?.[0]?.total);
|
|
|
|
|
}
|
|
|
|
|
setLoading(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const columns: ColumnsType<any> = [
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'index',
|
|
|
|
|
render: (text: string, record: any, index: number) =>
|
|
|
|
|
params.pageSize * (params.pageNumber - 1) + index + 1,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '厂商编号',
|
|
|
|
|
dataIndex: 'producerNumber',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '生产厂商全名',
|
|
|
|
|
dataIndex: 'name',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '生产厂商简称',
|
|
|
|
|
dataIndex: 'simpleName',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '生产厂商地址',
|
|
|
|
|
dataIndex: 'address',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '联系人1姓名',
|
|
|
|
|
dataIndex: 'contacts1',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '联系人1电话',
|
|
|
|
|
dataIndex: 'phone1',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '联系人1手机',
|
|
|
|
|
dataIndex: 'tel1',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '联系人2姓名',
|
|
|
|
|
dataIndex: 'contacts2',
|
|
|
|
|
render: (text: string) => text || '--',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '联系人2电话',
|
|
|
|
|
dataIndex: 'phone2',
|
|
|
|
|
render: (text: string) => text || '--',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '联系人2手机',
|
|
|
|
|
dataIndex: 'tel2',
|
|
|
|
|
render: (text: string) => text || '--',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
dataIndex: 'action',
|
|
|
|
|
align: 'center',
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
width: 110,
|
|
|
|
|
render: () => (
|
|
|
|
|
<span>
|
|
|
|
|
<i
|
|
|
|
|
title="修改"
|
|
|
|
|
className={'iconfont icon-xiugaikucundixian ' + styles.action}
|
|
|
|
|
/>
|
|
|
|
|
<i
|
|
|
|
|
title="删除"
|
|
|
|
|
className={'iconfont icon-shanchuzhuangbeixinghao ' + styles.action}
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const handleChangePage = (param: any) => {
|
|
|
|
|
params.pageNumber = param?.current;
|
|
|
|
|
params.pageSize = param?.pageSize;
|
|
|
|
|
setParams({ ...params });
|
|
|
|
|
getData(params);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={styles.page}>
|
|
|
|
|
<div className={styles.title}>
|
|
|
|
|
<span>厂商信息管理资源列表 </span>
|
|
|
|
|
<i onClick={() => getData()} className="iconfont icon-a-shuaxin2" />
|
|
|
|
|
<span>厂商信息管理</span>
|
|
|
|
|
<i
|
|
|
|
|
onClick={() => getData(params)}
|
|
|
|
|
className="iconfont icon-a-shuaxin2"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<Row justify="end" className={styles.btn}>
|
|
|
|
|
<Button icon={<i className="iconfont icon-tianjia" />}>添加厂商</Button>
|
|
|
|
|
{/* <Button icon={<i className='iconfont icon-daorushuju2' />} className='ml10'>导出厂商信息</Button> */}
|
|
|
|
|
</Row>
|
|
|
|
|
<Table
|
|
|
|
|
dataSource={data}
|
|
|
|
|
bordered={false}
|
|
|
|
|
rowKey="id"
|
|
|
|
|
columns={columns}
|
|
|
|
|
scroll={{ x: 1800 }}
|
|
|
|
|
loading={loading}
|
|
|
|
|
className="pr20 pl20"
|
|
|
|
|
onChange={handleChangePage}
|
|
|
|
|
pagination={{
|
|
|
|
|
pageSize: params.per_page,
|
|
|
|
|
total: total,
|
|
|
|
|
current: params.page,
|
|
|
|
|
showQuickJumper: true,
|
|
|
|
|
hideOnSinglePage: true,
|
|
|
|
|
position: ['bottomCenter'],
|
|
|
|
|
// showTotal: total => <span className="mr10">共<span>{total}</span>条数据</span>
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|