处理序号字典

This commit is contained in:
孙景学
2025-07-10 09:31:22 +08:00
parent 1f2986b5ae
commit eefc97e553
26 changed files with 300 additions and 426 deletions

View File

@ -3,8 +3,8 @@ export default {
'/api': { '/api': {
// target: 'http://10.242.37.148:18022',// // target: 'http://10.242.37.148:18022',//
// target: 'http://10.0.0.10:18012',// 茂 // target: 'http://10.0.0.10:18012',// 茂
// target: 'http://10.0.0.125:18012',// 测试 target: 'http://10.0.0.125:18012',// 测试
target: 'http://10.0.0.14:18012',// 李 // target: 'http://10.0.0.14:18012',// 李
// target: 'http://10.0.0.46:18030',// 袁 // target: 'http://10.0.0.46:18030',// 袁
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^/api': '' }, pathRewrite: { '^/api': '' },

View File

@ -39,13 +39,13 @@ const RiskList = ({id}:{id:string}) => {
] ]
//合规风险 //合规风险
const [dataList, setDataList] = useState<data[]>([]) const [dataList, setDataList] = useState<data[]>([])
//加载 //加载 const [loading, setLoading] = useState(false);
const [loading, setLoading] = useState(false);
//分页 //分页
//数据渲染 //数据渲染
const getList = async () => { const getList = async () => {
setLoading(true); // setLoading(true);
try { try {
const { code, data } = await queryRiskInfo({ supplierId: id }); const { code, data } = await queryRiskInfo({ supplierId: id });
if (code === 200) { if (code === 200) {
@ -56,7 +56,7 @@ const RiskList = ({id}:{id:string}) => {
} catch (error) { } catch (error) {
message.error(intl.formatMessage({id: 'component.globalModal.apiError'})); message.error(intl.formatMessage({id: 'component.globalModal.apiError'}));
} finally { } finally {
setLoading(false); // setLoading(false);
} }
}; };
//初始化 //初始化

View File

@ -134,7 +134,7 @@ const SupplierEntryReview: React.FC = () => {
render: (_: any, record: any) => { render: (_: any, record: any) => {
return ( return (
<> <>
{record.categoryNameList.map((item:string) => { {record.categoryNameList && record.categoryNameList.map((item:string) => {
return <div>{`${item}`}</div> return <div>{`${item}`}</div>
})} })}
</> </>

View File

@ -112,7 +112,7 @@ const CooperateEnterprise: React.FC = () => {
render: (_: any, record: any) => { render: (_: any, record: any) => {
return ( return (
<> <>
{record.categoryNameList.map((item:string) => { {record.categoryNameList && record.categoryNameList.map((item:string) => {
return <div>{`${item}`}</div> return <div>{`${item}`}</div>
})} })}
</> </>

View File

@ -1,52 +0,0 @@
import { Request, Response } from 'express';
export default {
'GET /api/system/bank': (req: Request, res: Response) => {
res.json({ code: 200,
data: [
{
id: '1',
interbankNumber: '123456789',
bank: '中国银行',
accountName: '张三',
account: '6228480000000000000',
currency: '人民币',
nation: '中国',
province: '广东省',
city: '广州市',
updateTime: '2024-06-18',
},
{
id: '2',
interbankNumber: '987654321',
bank: '工商银行',
accountName: '李四',
account: '6228480000000000001',
currency: '美元',
nation: '中国',
province: '江苏省',
city: '南京市',
updateTime: '2024-06-17',
},
],
total: 2,
msg: '操作成功'
});
},
'GET /api/system/categoryOption': (req: Request, res: Response) => {
res.json({ code: 200,
data: [
{
value: '1',
label: '1',
},
{
value: '2',
label: '3',
},
],
total: 2,
msg: '操作成功'
});
},
};

View File

@ -15,8 +15,8 @@ interface Data {
} }
interface CategoryOption { interface CategoryOption {
value: string; code: string;
label: string; dicName: string;
} }
const supplierNews: React.FC = () => { const supplierNews: React.FC = () => {
@ -82,21 +82,23 @@ const supplierNews: React.FC = () => {
title: '业务类型', title: '业务类型',
dataIndex: 'typeCn', dataIndex: 'typeCn',
key: 'typeCn', key: 'typeCn',
width: 160,
}, },
{ {
title: '发送时间', title: '发送时间',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime', key: 'createTime',
width: 200,
}, },
]; ];
//初始化 //初始化
useEffect(() => { useEffect(() => {
// categoryOption().then((res:any) => { getDictList('message_type').then((res:any) => {
// const { code, data } = res; const { code, data } = res;
// if(code == 200) { if(code == 200) {
// setCategoryOptions(data) setCategoryOptions(data)
// } }
// }) })
getExitMge().then((res) => { getExitMge().then((res) => {
const { code, data } = res; const { code, data } = res;
if (code == 200) { if (code == 200) {
@ -138,8 +140,8 @@ const supplierNews: React.FC = () => {
<Form.Item name="type" label="业务类型"> <Form.Item name="type" label="业务类型">
<Select placeholder="请选择业务类型" allowClear> <Select placeholder="请选择业务类型" allowClear>
{categoryOptions.map((option) => ( {categoryOptions.map((option) => (
<Select.Option key={option.value} value={option.value}> <Select.Option key={option.code} value={option.code}>
{option.label} {option.dicName}
</Select.Option> </Select.Option>
))} ))}
</Select> </Select>

View File

@ -35,7 +35,7 @@ const CategoryLibraryManage: React.FC = () => {
// 列表加载 // 列表加载
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
// 分页 // 分页
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 188 }); const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
// 新增弹窗 // 新增弹窗
const [addVisible, setAddVisible] = useState(false); const [addVisible, setAddVisible] = useState(false);

View File

@ -39,7 +39,7 @@ const CategoryLibraryManage: React.FC = () => {
// 列表加载 // 列表加载
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
// 分页 // 分页
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 188 }); const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
// //
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 新增弹窗 // 新增弹窗

View File

@ -1,34 +1,15 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Tree, Button, Modal, Form, Input, Select, message, Popconfirm, Spin } from 'antd'; import { Table, Button, Modal, Form, Input, Select, message, Popconfirm, Spin } from 'antd';
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons'; import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
import { categoryTree, add, edit, del } from './services'; import { categoryTree, add, edit, del } from './services';
interface CategoryNode { const CategoryManageTable: React.FC = () => {
id: string; const [data, setData] = useState([]);
categoryName: string;
parentId: string;
type: string; // "0" 分类, "1" 品类
orderBy: string;
children?: CategoryNode[] | null;
}
interface CategoryFormFields {
id?: string;
categoryName: string;
parentId: string;
type: string;
orderBy: string;
}
const CategoryManage: React.FC = () => {
const [treeData, setTreeData] = useState<CategoryNode[]>([]);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
// 弹窗相关
const [modalOpen, setModalOpen] = useState(false); const [modalOpen, setModalOpen] = useState(false);
const [modalType, setModalType] = useState<'add' | 'edit'>('add'); const [modalType, setModalType] = useState<'add' | 'edit'>('add');
const [currentNode, setCurrentNode] = useState<CategoryNode | null>(null); const [currentNode, setCurrentNode] = useState<any>(null);
const [form] = Form.useForm<CategoryFormFields>(); const [form] = Form.useForm();
const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
// 加载树数据 // 加载树数据
const fetchTree = async () => { const fetchTree = async () => {
@ -36,119 +17,97 @@ const CategoryManage: React.FC = () => {
const res = await categoryTree(); const res = await categoryTree();
setLoading(false); setLoading(false);
if (res.code === 200) { if (res.code === 200) {
setTreeData(res.data || []); setData(res.data || []);
} else { } else {
message.error(res.message || '加载失败'); message.error(res.message || '加载失败');
} }
}; };
useEffect(() => { useEffect(() => { fetchTree(); }, []);
fetchTree();
}, []);
useEffect(() => { // 表格字段
if (treeData && treeData.length) { const columns = [
const allKeys: React.Key[] = []; {
const collectKeys = (nodes: any[]) => { title: '品类名称',
nodes.forEach(node => { dataIndex: 'categoryName',
allKeys.push(node.id); key: 'categoryName',
if (node.children && node.children.length) { },
collectKeys(node.children); {
} title: '类型',
}); dataIndex: 'type',
}; key: 'type',
collectKeys(treeData); render: (v: string) => (v === '0' ? '分类' : '品类'),
setExpandedKeys(allKeys); width: 80,
} },
}, [treeData]); {
title: '排序',
const convertToTreeData = (data?: CategoryNode[]): any[] => dataIndex: 'orderBy',
(data || []).map(item => ({ key: 'orderBy',
key: item.id, width: 80,
title: ( },
<div {
style={{ title: '操作',
display: 'flex', key: 'action',
alignItems: 'center', width: 280,
minWidth: 600, render: (_:any, record:any) => (
}} <>
>
<span style={{ flexShrink: 0, fontWeight: 500 }}>{item.categoryName}</span>
{/* 横线,从名字右 5px 到按钮左 8px */}
<div
style={{
flex: 1,
height: 0,
borderBottom: '1px dashed #e5e5e5',
margin: '0 8px 0 5px',
}}
/>
{/* 按钮组整体贴右 */}
<span style={{ flexShrink: 0, display: 'flex', gap: 4 }}>
<Button <Button
size="small" size="small"
icon={<PlusOutlined />}
type="link" type="link"
disabled={item.type === '1'} icon={<PlusOutlined />}
onClick={e => { disabled={record.type === '1'}
e.stopPropagation(); onClick={() => {
setModalType('add'); setModalType('add');
setCurrentNode(item); setCurrentNode(record);
form.resetFields(); form.resetFields();
form.setFieldsValue({ form.setFieldsValue({
categoryName: '', categoryName: '',
parentId: item.id, parentId: record.id,
type: '1', type: '1',
orderBy: '', orderBy: '',
}); });
setModalOpen(true); setModalOpen(true);
}} }}
></Button> ></Button>
<Button <Button
size="small" size="small"
icon={<EditOutlined />}
type="link" type="link"
onClick={e => { icon={<EditOutlined />}
e.stopPropagation(); onClick={() => {
setModalType('edit'); setModalType('edit');
setCurrentNode(item); setCurrentNode(record);
form.setFieldsValue({ form.setFieldsValue({
id: item.id, id: record.id,
categoryName: item.categoryName, categoryName: record.categoryName,
parentId: item.parentId, parentId: record.parentId,
type: item.type, type: record.type,
orderBy: item.orderBy, orderBy: record.orderBy,
}); });
setModalOpen(true); setModalOpen(true);
}} }}
></Button> ></Button>
{/* <Popconfirm <Popconfirm
title="确定要删除该节点吗?" title="确定要删除该节点吗?"
onConfirm={() => handleDelete(item.id)} onConfirm={() => handleDelete(record.id)}
disabled={!!(item.children && item.children.length > 0)} disabled={!!(record.children && record.children.length > 0)}
> >
<Button <Button
size="small" size="small"
danger danger
icon={<DeleteOutlined />}
type="link" type="link"
disabled={!!(item.children && item.children.length > 0)} icon={<DeleteOutlined />}
onClick={e => e.stopPropagation()} disabled={!!(record.children && record.children.length > 0)}
></Button> ></Button>
</Popconfirm> */} </Popconfirm>
</span> </>
</div> ),
), },
children: item.children ? convertToTreeData(item.children) : [], ];
}));
// 提交
// 添加/修改提交
const handleOk = async () => { const handleOk = async () => {
try { try {
const values = await form.validateFields(); const values = await form.validateFields();
console.log(values);
let res; let res;
if (modalType === 'add') { if (modalType === 'add') {
res = await add(values); res = await add(values);
@ -165,7 +124,6 @@ const convertToTreeData = (data?: CategoryNode[]): any[] =>
} catch (err) { } } catch (err) { }
}; };
// 删除
const handleDelete = async (id: string) => { const handleDelete = async (id: string) => {
const res = await del(id); const res = await del(id);
if (res.code === 200) { if (res.code === 200) {
@ -191,25 +149,25 @@ const convertToTreeData = (data?: CategoryNode[]): any[] =>
}; };
return ( return (
<div style={{ padding: 24 }}> <div style={{ padding: 0 }}>
<h2></h2>
<Button <Button
type="primary" type="primary"
style={{ marginBottom: 16 }} style={{ marginBottom: 10 }}
onClick={handleAddRoot} onClick={handleAddRoot}
> >
</Button> </Button>
<Spin spinning={loading}> <Spin spinning={loading}>
<Tree <Table
treeData={convertToTreeData(treeData)} columns={columns}
expandedKeys={expandedKeys} dataSource={data}
onExpand={keys => setExpandedKeys(keys as React.Key[])} rowKey="id"
style={{ background: '#fff', padding: 16, borderRadius: 6 }} pagination={false}
expandable={{
childrenColumnName: 'children',
}}
/> />
</Spin> </Spin>
{/* 弹窗 */}
<Modal <Modal
visible={modalOpen} visible={modalOpen}
title={modalType === 'add' ? '新增品类' : '修改品类'} title={modalType === 'add' ? '新增品类' : '修改品类'}
@ -256,4 +214,4 @@ const convertToTreeData = (data?: CategoryNode[]): any[] =>
); );
}; };
export default CategoryManage; export default CategoryManageTable;

View File

@ -35,7 +35,7 @@ const SupplierEntryManage: React.FC = () => {
// 列表加载 // 列表加载
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
// 分页 // 分页
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 188 }); const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
// 新增弹窗 // 新增弹窗
const [addVisible, setAddVisible] = useState(false); const [addVisible, setAddVisible] = useState(false);

View File

@ -1,104 +0,0 @@
import { Request, Response } from 'express';
// 代码中会兼容本地 service mock 以及部署站点的静态数据
export default {
'GET /api/supplier/getSupplierChangeList': (req: Request, res: Response) => {
res.send({
code: 200,
msg: 'success',
data: [
{
id: 1,
name: '中山市合创展包装材料有限公司',
region: '境内',
supplierType: '中央企业',
accessTime: '2025-03-03 09:30',
changeTime: '2025-03-03 09:30',
status: '未开始',
result: '',
},
],
total: 10
});
},
'GET /api/supplier/list': (req: Request, res: Response) => {
res.send({
code: 200,
msg: 'success',
data: [
{
id: 1,
name: '中山市合创展包装材料有限公司',
region: '境内',
supplierType: '中央企业',
accessTime: '2025-03-03 09:30',
changeTime: '2025-03-03 09:30',
status: '未开始',
result: '',
},
],
total: 10
});
},
'GET /api/system/getPage': (req: Request, res: Response) => {
res.json({
code: 200,
data: [
{
deptName: '供应商名称变更',
categoryName: '2024-05-20 13:22:11',
createTime: '集团采购部',
exitTime: '已通过',
exitReason: '2024-05-21 09:10:31',
},
{
deptName: '法人代表变更',
categoryName: '2024-05-18 08:30:55',
createTime: '分公司审核部',
exitTime: '审核中',
exitReason: '',
},
],
total: 2,
msg: '操作成功'
});
},
'GET /api/system/getSupplierChangeDetail': (req: Request, res: Response) => {
res.json({
"code": 200,
"msg": "success",
"data": {
baseInfo: [
{ label: '供应商名称', value: 'xxx' },
{ label: '境内/境外', value: '境内' },
{ label: '准入单位', value: 'xxxx' },
{ label: '准入部门', value: '采购部' },
],
changeInfo: [
{ label: '供应商名称-变更前', value: 'xxxx' },
{ label: '供应商名称-变更后', value: 'xxxx' },
],
"supplierName": "中山市合创展包装材料有限公司",
"accessUnit": "中远海运(青岛)有限公司",
"region": "境内",
"accessDept": "采购部",
"beforeName": "中山市合创展包装材料有限公司",
"afterName": "中山市合创展包装有限公司",
"qualifications": [
{
"type": "CMMI资质",
"name": "CMMI资质",
"level": "高级",
"number": "546464",
"org": "XX机构",
"issueDate": "2024-09-08",
"validDate": "2028-09-10",
"file": "https://dummyimage.com/40x30/1890ff/fff.png&text=附件"
}
]
}
}
);
},
};

View File

@ -1,11 +1,15 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Table, Form, Input, Select, Button, DatePicker, Tag, Space, message } from 'antd'; import { Table, Form, Input, Select, Button, DatePicker, Tooltip } from 'antd';
import { SearchOutlined, ReloadOutlined } from '@ant-design/icons'; import { SearchOutlined, ReloadOutlined } from '@ant-design/icons';
//详情
import DetailView from './components/DetailView'; import DetailView from './components/DetailView';
//接口
import { getPage } from './services'; import { getPage } from './services';
import type { ColumnsType } from 'antd/es/table'; import type { ColumnsType } from 'antd/es/table';
//字典
import { getDictList } from '@/servers/api/dicts' import { getDictList } from '@/servers/api/dicts'
//umi 相关
import { connect } from 'umi';
import moment from 'moment'; import moment from 'moment';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
@ -32,30 +36,39 @@ interface Dict {
dicName: string; dicName: string;
code: string; code: string;
} }
interface Props {
const SupplierChangeReviewManage: React.FC = () => { dispatch: any;
}
const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
//搜索
const [form] = Form.useForm(); const [form] = Form.useForm();
//渲染数据
const [data, setData] = useState<Columns[]>([]); const [data, setData] = useState<Columns[]>([]);
//列表加载
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
//分页
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
//审批记录弹窗
const [detailVisible, setDetailVisible] = useState(false); const [detailVisible, setDetailVisible] = useState(false);
//审批记录弹窗 传入id
const [currentDetailId, setCurrentDetailId] = useState<string | null>(null); const [currentDetailId, setCurrentDetailId] = useState<string | null>(null);
//列表数据 //列表数据
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 获取表格数据 // 获取表格数据
const fetchData = async (params = {}) => { const fetchData = async (params = {}) => {
setLoading(true); setLoading(true);
try { try {
const values = form.getFieldsValue(); const values = form.getFieldsValue();
const { supplierName, changeTime, supplierType, approveStatus } = values; const { changeTime } = values;
const startTime = changeTime ? moment(changeTime[0]).format('YYYY-MM-DD') : ''; const startTime = changeTime ? moment(changeTime[0]).format('YYYY-MM-DD') : '';
const endTime = changeTime ? moment(changeTime[1]).format('YYYY-MM-DD') : ''; const endTime = changeTime ? moment(changeTime[1]).format('YYYY-MM-DD') : '';
const { code, data, message } = await getPage({ const { code, data, message } = await getPage({
pageNo: pagination.current, pageNo: pagination.current,
pageSize: pagination.pageSize, pageSize: pagination.pageSize,
supplierName, startTime, endTime, supplierType, approveStatus, startTime,
endTime,
...values
}); });
if (code === 200) { if (code === 200) {
setData(data.records); setData(data.records);
@ -67,7 +80,7 @@ const SupplierChangeReviewManage: React.FC = () => {
setLoading(false); setLoading(false);
} }
}; };
// 初始化
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -93,6 +106,7 @@ const SupplierChangeReviewManage: React.FC = () => {
setCurrentDetailId(record.id); setCurrentDetailId(record.id);
setDetailVisible(true); setDetailVisible(true);
}; };
// 关闭弹窗
const handleDetailClose = () => { const handleDetailClose = () => {
setDetailVisible(false); setDetailVisible(false);
setCurrentDetailId(null); setCurrentDetailId(null);
@ -110,6 +124,21 @@ const SupplierChangeReviewManage: React.FC = () => {
dataIndex: 'supplierName', dataIndex: 'supplierName',
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
render: (dom, record) =>
<Tooltip title={record.supplierName}>
<a
onClick={() => {
dispatch({
type: 'globalModal/show',
payload: {
id: record.id,
},
});
}}
>
{record.supplierName}
</a>
</Tooltip>,
}, },
{ {
title: '境内/境外', title: '境内/境外',
@ -131,6 +160,7 @@ const SupplierChangeReviewManage: React.FC = () => {
title: '提交变更时间', title: '提交变更时间',
dataIndex: 'changeTime', dataIndex: 'changeTime',
align: 'center', align: 'center',
ellipsis: true,
}, },
{ {
title: '审批状态', title: '审批状态',
@ -202,4 +232,4 @@ const SupplierChangeReviewManage: React.FC = () => {
); );
}; };
export default SupplierChangeReviewManage; export default connect()(SupplierChangeReviewManage);

View File

@ -17,14 +17,17 @@ const CategoryAddModal: React.FC<Props> = ({ visible, onCancel }) => {
const [submitting, setSubmitting] = useState(false); const [submitting, setSubmitting] = useState(false);
useEffect(() => { useEffect(() => {
if (!visible) setValue([]); if(visible) {
//tree数据 //tree数据
treeData().then((res) => { treeData().then((res) => {
const { code, data } = res; const { code, data } = res;
if (code == 200) { if (code == 200) {
setDataTree(data) setDataTree(data)
} }
}) })
} else {
setValue([]);
}
}, [visible]); }, [visible]);
// 提交方法 // 提交方法

View File

@ -8,7 +8,7 @@ import { useIntl } from 'umi';
//本地服务/接口 //本地服务/接口
import { getCategoryPage } from '../services'; import { getCategoryPage } from '../services';
//本地组件 //本地组件
import CategoryAddModal from './CategoryAddModal'; // import CategoryAddModal from './CategoryAddModal';
interface Data { interface Data {
id: number; id: number;
@ -78,7 +78,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
dataIndex: "index", dataIndex: "index",
key: "index", key: "index",
align: "center", align: "center",
render: (_: any, __: any, idx: number) => idx + 1, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
width: 60, width: 60,
}, },
{ {
@ -143,7 +143,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
<Form.Item> <Form.Item>
<Button onClick={handleReset}></Button> <Button onClick={handleReset}></Button>
</Form.Item> </Form.Item>
<Form.Item> {/* <Form.Item>
<Button <Button
type="primary" type="primary"
style={{ background: "#52a8ff", borderColor: "#52a8ff" }} style={{ background: "#52a8ff", borderColor: "#52a8ff" }}
@ -151,7 +151,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
> >
新增品类 新增品类
</Button> </Button>
</Form.Item> </Form.Item> */}
</Form> </Form>
{/* 表格内容 */} {/* 表格内容 */}
<Table <Table
@ -162,12 +162,12 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
pagination={pagination} pagination={pagination}
onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)} onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)}
/> />
{/* 新增品类弹窗 */} {/* 新增品类弹窗
<CategoryAddModal <CategoryAddModal
visible={addModalVisible} visible={addModalVisible}
onCancel={() => setAddModalVisible(false)} onCancel={() => setAddModalVisible(false)}
// onOk={...} // 根据你的业务需要加 // onOk={...} // 根据你的业务需要加
/> />*/}
</Modal> </Modal>
); );
}; };

View File

@ -1,15 +1,16 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
//第三方UI库/组件 //第三方UI库/组件
import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, message } from 'antd'; import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, Tooltip } from 'antd';
import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons'; import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons';
//类型定义 //类型定义
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
//umi 相关 //umi 相关
import { connect } from 'umi';
//本地组件、弹窗、业务逻辑 //本地组件、弹窗、业务逻辑
import SupplierViewModal from './components/SupplierViewModal'; import SupplierViewModal from './components/SupplierViewModal';
import SupplierDetailModal from './components/SupplierDetailModal'; import SupplierDetailModal from './components/SupplierDetailModal';
//本地服务/接口 //本地服务/接口
import { treeData, systemDict, getPageQualified } from './services'; import { treeData, getPageQualified } from './services';
const { Option } = Select; const { Option } = Select;
//下拉数据接口 //下拉数据接口
@ -23,8 +24,10 @@ interface Data {
regTime: string; regTime: string;
status: string; status: string;
} }
interface Props {
const groupQualifiedSupplierQuery: React.FC = () => { dispatch: any;
}
const groupQualifiedSupplierQuery: React.FC<Props> = ({dispatch}) => {
//搜搜表单 //搜搜表单
const [form] = Form.useForm(); const [form] = Form.useForm();
// 树数据 // 树数据
@ -38,7 +41,7 @@ const groupQualifiedSupplierQuery: React.FC = () => {
//列表加载 //列表加载
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
//分页 //分页
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 188 }); const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
//查看是否显示状态 //查看是否显示状态
const [viewVisible, setViewVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false);
//准入明细是否显示状态 //准入明细是否显示状态
@ -79,7 +82,8 @@ const groupQualifiedSupplierQuery: React.FC = () => {
const getList = async (treeId: string, pageNo: number = 1, pageSize: number = 10) => { const getList = async (treeId: string, pageNo: number = 1, pageSize: number = 10) => {
setLoading(true); setLoading(true);
try { try {
const { code, data, message } = await getPageQualified({ pageNo, pageSize, treeId }); const values = form.getFieldsValue();
const { code, data, message } = await getPageQualified({ pageNo, pageSize, treeId, ...values });
if (code === 200) { if (code === 200) {
setData(data.records); setData(data.records);
setPagination({ current: pageNo, pageSize, total: data.total }); setPagination({ current: pageNo, pageSize, total: data.total });
@ -102,26 +106,24 @@ const groupQualifiedSupplierQuery: React.FC = () => {
// 初始化时选中树第一个叶子节点,并请求右表 // 初始化时选中树第一个叶子节点,并请求右表
useEffect(() => { useEffect(() => {
// 境内/境外 下拉 // 境内/境外 下拉
systemDict('regionOptions').then((res) => { setRegionOptions([
const { code, data } = res; { label: '境内企业', value: 'dvs' },
if (code == 200) { { label: '境外企业', value: 'ovs' },
setRegionOptions(data) ])
} // // 集采类别 下拉
}); // systemDict('categoryOptions').then((res) => {
// 集采类别 下拉 // const { code, data } = res;
systemDict('categoryOptions').then((res) => { // if (code == 200) {
const { code, data } = res; // setCategoryOptions(data)
if (code == 200) { // }
setCategoryOptions(data) // });
} // // 集采库 下拉
}); // systemDict('storeOptions').then((res) => {
// 集采库 下拉 // const { code, data } = res;
systemDict('storeOptions').then((res) => { // if (code == 200) {
const { code, data } = res; // setStoreOptions(data)
if (code == 200) { // }
setStoreOptions(data) // });
}
});
//tree数据 //tree数据
treeData().then((res) => { treeData().then((res) => {
const { code, data } = res; const { code, data } = res;
@ -145,14 +147,29 @@ const groupQualifiedSupplierQuery: React.FC = () => {
key: 'index', key: 'index',
align: 'center', align: 'center',
width: 60, width: 60,
render: (_: any, __: any, idx: number) => idx + 1, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
}, },
{ {
title: '供应商名称', title: '供应商名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
align: 'center', align: 'left',
ellipsis: true, ellipsis: true,
render: (dom, record) =>
<Tooltip title={record.name}>
<a
onClick={() => {
dispatch({
type: 'globalModal/show',
payload: {
id: record.id,
},
});
}}
>
{record.name}
</a>
</Tooltip>,
}, },
{ {
title: '统一社会信用代码/税号', title: '统一社会信用代码/税号',
@ -170,8 +187,8 @@ const groupQualifiedSupplierQuery: React.FC = () => {
}, },
{ {
title: '企业类型', title: '企业类型',
dataIndex: 'type', dataIndex: 'enterpriseTypeCn',
key: 'type', key: 'enterpriseTypeCn',
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
}, },
@ -236,9 +253,9 @@ const groupQualifiedSupplierQuery: React.FC = () => {
style={{ marginBottom: 12, }} style={{ marginBottom: 12, }}
> >
<Form.Item name="name" label="供应商名称"> <Form.Item name="name" label="供应商名称">
<Input placeholder="请输入供应商名称关键字" style={{ width: 180 }} /> <Input placeholder="请输入供应商名称关键字" style={{ width: 180 }} maxLength={50} />
</Form.Item> </Form.Item>
<Form.Item name="category" label="集采类别"> {/* <Form.Item name="category" label="集采类别">
<Select style={{ width: 150 }} allowClear> <Select style={{ width: 150 }} allowClear>
{categoryOptions.map(opt => ( {categoryOptions.map(opt => (
<Option key={opt.value} value={opt.value}>{opt.label}</Option> <Option key={opt.value} value={opt.value}>{opt.label}</Option>
@ -251,24 +268,24 @@ const groupQualifiedSupplierQuery: React.FC = () => {
<Option key={opt.value} value={opt.value}>{opt.label}</Option> <Option key={opt.value} value={opt.value}>{opt.label}</Option>
))} ))}
</Select> </Select>
</Form.Item> </Form.Item> */}
<Form.Item name="region" label="境内/境外"> <Form.Item name="supplierType" label="境内/境外">
<Select style={{ width: 130 }} allowClear> <Select style={{ width: 130 }} allowClear placeholder="请选择境内/境外" >
{regionOptions.map(opt => ( {regionOptions.map(opt => (
<Option key={opt.value} value={opt.value}>{opt.label}</Option> <Option key={opt.value} value={opt.value}>{opt.label}</Option>
))} ))}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginRight: 8 }} onClick={handleExport}>
</Button>
<Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}> <Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}>
</Button> </Button>
<Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}> <Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}>
</Button> </Button>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginLeft: 8 }} onClick={handleExport}>
</Button>
</Form.Item> </Form.Item>
</Form> </Form>
{/* 表格 */} {/* 表格 */}
@ -299,4 +316,4 @@ const groupQualifiedSupplierQuery: React.FC = () => {
); );
}; };
export default groupQualifiedSupplierQuery; export default connect()(groupQualifiedSupplierQuery);

View File

@ -92,6 +92,7 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
// 准入状态下拉 // 准入状态下拉
setStoreOptions([ setStoreOptions([
{ label: '未准入', value: '0' },
{ label: '已准入', value: '1' }, { label: '已准入', value: '1' },
{ label: '退出', value: '2' }, { label: '退出', value: '2' },
]) ])
@ -207,15 +208,15 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginRight: 8 }} onClick={handleExport}>
</Button>
<Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}> <Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}>
</Button> </Button>
<Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}> <Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}>
</Button> </Button>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginLeft: 8 }} onClick={handleExport}>
</Button>
</Form.Item> </Form.Item>
</Form> </Form>
{/* 表格 */} {/* 表格 */}

View File

@ -8,7 +8,7 @@ import { useIntl } from 'umi';
//本地服务/接口 //本地服务/接口
import { getCategoryPage } from '../services'; import { getCategoryPage } from '../services';
//本地组件 //本地组件
import CategoryAddModal from './CategoryAddModal'; // import CategoryAddModal from './CategoryAddModal';
interface Data { interface Data {
id: number; id: number;
@ -78,7 +78,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
dataIndex: "index", dataIndex: "index",
key: "index", key: "index",
align: "center", align: "center",
render: (_: any, __: any, idx: number) => idx + 1, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
width: 60, width: 60,
}, },
{ {
@ -139,7 +139,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
<Form.Item> <Form.Item>
<Button onClick={handleReset}></Button> <Button onClick={handleReset}></Button>
</Form.Item> </Form.Item>
<Form.Item> {/* <Form.Item>
<Button <Button
type="primary" type="primary"
style={{ background: "#52a8ff", borderColor: "#52a8ff" }} style={{ background: "#52a8ff", borderColor: "#52a8ff" }}
@ -147,7 +147,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
> >
新增品类 新增品类
</Button> </Button>
</Form.Item> </Form.Item> */}
</Form> </Form>
{/* 表格内容 */} {/* 表格内容 */}
<Table <Table
@ -158,12 +158,12 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
pagination={pagination} pagination={pagination}
onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)} onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)}
/> />
{/* 新增品类弹窗 */} {/* 新增品类弹窗
<CategoryAddModal <CategoryAddModal
visible={addModalVisible} visible={addModalVisible}
onCancel={() => setAddModalVisible(false)} onCancel={() => setAddModalVisible(false)}
// onOk={...} // 根据你的业务需要加 // onOk={...} // 根据你的业务需要加
/> /> */}
</Modal> </Modal>
); );
}; };

View File

@ -1,17 +1,17 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
//第三方UI库/组件 //第三方UI库/组件
import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, message } from 'antd'; import { Form, Button, Table , Input, Tree, Row, Col, Space, Tooltip } from 'antd';
import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons'; import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons';
//类型定义 //类型定义
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
//umi 相关 //umi 相关
import { connect } from 'umi';
//本地组件、弹窗、业务逻辑 //本地组件、弹窗、业务逻辑
import SupplierViewModal from './components/SupplierViewModal'; import SupplierViewModal from './components/SupplierViewModal';
import SupplierDetailModal from './components/SupplierDetailModal'; import SupplierDetailModal from './components/SupplierDetailModal';
//本地服务/接口 //本地服务/接口
import { treeData, systemDict, getPagePe } from './services'; import { treeData, systemDict, getPagePe } from './services';
const { Option } = Select;
//下拉数据接口 //下拉数据接口
type OptionType = { label: string; value: string }; type OptionType = { label: string; value: string };
// 列表数据接口 // 列表数据接口
@ -20,11 +20,14 @@ interface Data {
name: string; name: string;
region: string; region: string;
supplierType: string; supplierType: string;
personName: string;
regTime: string; regTime: string;
status: string; status: string;
} }
interface Props {
const personQualifiedSupplierQuery: React.FC = () => { dispatch: any;
}
const personQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
//搜搜表单 //搜搜表单
const [form] = Form.useForm(); const [form] = Form.useForm();
// 树数据 // 树数据
@ -146,7 +149,7 @@ const personQualifiedSupplierQuery: React.FC = () => {
key: 'index', key: 'index',
align: 'center', align: 'center',
width: 60, width: 60,
render: (_: any, __: any, idx: number) => idx + 1, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
}, },
{ {
title: '姓名', title: '姓名',
@ -154,6 +157,21 @@ const personQualifiedSupplierQuery: React.FC = () => {
key: 'personName', key: 'personName',
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
render: (dom, record) =>
<Tooltip title={record.personName}>
<a
onClick={() => {
dispatch({
type: 'globalModal/show',
payload: {
id: record.id,
},
});
}}
>
{record.personName}
</a>
</Tooltip>,
}, },
{ {
title: '身份证号', title: '身份证号',
@ -250,15 +268,15 @@ const personQualifiedSupplierQuery: React.FC = () => {
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginRight: 8 }} onClick={handleExport}>
</Button>
<Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}> <Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}>
</Button> </Button>
<Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}> <Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}>
</Button> </Button>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginLeft: 8 }} onClick={handleExport}>
</Button>
</Form.Item> </Form.Item>
</Form> </Form>
{/* 表格 */} {/* 表格 */}
@ -289,4 +307,4 @@ const personQualifiedSupplierQuery: React.FC = () => {
); );
}; };
export default personQualifiedSupplierQuery; export default connect()(personQualifiedSupplierQuery);

View File

@ -94,7 +94,7 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
//状态 下拉 //状态 下拉
setStatusOptions([ setStatusOptions([
{ label: '未准入', value: '0' }, { label: '未准入', value: '0' },
{ label: '已准', value: '1' }, { label: '已准', value: '1' },
{ label: '退出', value: '2' }, { label: '退出', value: '2' },
]) ])
//列表 //列表

View File

@ -7,7 +7,7 @@ import { getDictList } from '@/servers/api/dicts'
import { getPage, submit, restoreSubmit } from './services' import { getPage, submit, restoreSubmit } from './services'
interface Columns { interface Columns {
themeName: string; themeName: string;
unitName: string; unitName: string;
@ -24,18 +24,18 @@ const blacklistManage: React.FC = () => {
const [data, setData] = useState<Columns[]>([]); const [data, setData] = useState<Columns[]>([]);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 查询接口 // 查询接口
const getList = async (pageNo = 1, pageSize = 10) => { const getList = async (pageNo = 1, pageSize = 10) => {
setLoading(true); setLoading(true);
// 可传查询条件 // 可传查询条件
const values = form.getFieldsValue(); const values = form.getFieldsValue();
const { exitTheme, time, deptId, approveStatus } = values; const { exitTheme, time, deptId, approveStatus } = values;
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : ''; const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : ''; const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize } , exitTheme, deptId, approveStatus, startTime, endTime }); const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize }, exitTheme, deptId, approveStatus, startTime, endTime });
if (code === 200) { if (code === 200) {
setData(data.records); setData(data.records);
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total })); setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
@ -84,11 +84,11 @@ const blacklistManage: React.FC = () => {
}; };
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
getList(); getList();
}, []); }, []);
@ -99,7 +99,7 @@ const blacklistManage: React.FC = () => {
key: "index", key: "index",
align: "center", align: "center",
width: 60, width: 60,
render: (_: any, __: any, idx: number) => idx + 1, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
}, },
{ title: "申请主题", dataIndex: "themeName", key: "themeName", align: "center" }, { title: "申请主题", dataIndex: "themeName", key: "themeName", align: "center" },
{ title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center" }, { title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center" },
@ -132,21 +132,21 @@ const blacklistManage: React.FC = () => {
{/* 查询表单 */} {/* 查询表单 */}
<Form form={form} layout="inline" style={{ marginBottom: 12 }}> <Form form={form} layout="inline" style={{ marginBottom: 12 }}>
<Form.Item name="exitTheme" label="申请主题"> <Form.Item name="exitTheme" label="申请主题">
<Input placeholder="请输入供应商名称关键字" style={{ width: 150 }} allowClear maxLength={50} /> <Input placeholder="请输入供应商名称关键字" style={{ width: 150 }} allowClear maxLength={50} />
</Form.Item> </Form.Item>
<Form.Item name="deptId" label="发起单位"> <Form.Item name="deptId" label="发起单位">
</Form.Item> </Form.Item>
<Form.Item name="approveStatus" label="审批记录状态"> <Form.Item name="approveStatus" label="审批记录状态">
<Select style={{ width: 150 }} placeholder="请选择审批记录状态" allowClear> <Select style={{ width: 150 }} placeholder="请选择审批记录状态" allowClear>
{enterpriseType?.map(item => ( {enterpriseType?.map(item => (
<Select.Option key={item.code} value={item.code}>{item.dicName}</Select.Option> <Select.Option key={item.code} value={item.code}>{item.dicName}</Select.Option>
))} ))}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item name="time" label="发起时间"> <Form.Item name="time" label="发起时间">
<DatePicker.RangePicker style={{ width: 220 }} allowClear /> <DatePicker.RangePicker style={{ width: 220 }} allowClear />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" icon={<SearchOutlined />} onClick={handleSearch}></Button> <Button type="primary" icon={<SearchOutlined />} onClick={handleSearch}></Button>
<Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}></Button> <Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}></Button>

View File

@ -61,6 +61,7 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
supplierIds: string[], supplierIds: string[],
} = { } = {
...values, ...values,
backlistType: '0',
supplierIds: suppliers.map((item) => item.supplierId), supplierIds: suppliers.map((item) => item.supplierId),
} }
const res = await blacklist(payload); const res = await blacklist(payload);
@ -137,7 +138,7 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
layout="horizontal" layout="horizontal"
> >
<Form.Item {/* <Form.Item
label="黑名单类型" label="黑名单类型"
name="backlistType" name="backlistType"
rules={[{ required: true, message: '请选择黑名单类型' }]} rules={[{ required: true, message: '请选择黑名单类型' }]}
@ -147,7 +148,7 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
<Option key={opt.value} value={opt.value}>{opt.label}</Option> <Option key={opt.value} value={opt.value}>{opt.label}</Option>
))} ))}
</Select> </Select>
</Form.Item> </Form.Item> */}
<Form.Item <Form.Item
label="时限类型" label="时限类型"

View File

@ -114,9 +114,7 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
></Checkbox> ></Checkbox>
) )
}, },
{ title: "供应商名称", dataIndex: "supplierName" }, { title: "供应商名称", dataIndex: "supplierName", ellipsis: true },
{ title: "准入单位", dataIndex: "deptId" },
{ title: "准入部门", dataIndex: "deptId" },
{ title: "准入品类", dataIndex: "categoryName" } { title: "准入品类", dataIndex: "categoryName" }
]; ];
@ -142,9 +140,7 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
></Checkbox> ></Checkbox>
) )
}, },
{ title: "供应商名称", dataIndex: "supplierName" }, { title: "供应商名称", dataIndex: "supplierName", ellipsis: true },
{ title: "准入单位", dataIndex: "deptId" },
{ title: "准入部门", dataIndex: "deptId" },
{ title: "准入品类", dataIndex: "categoryName" } { title: "准入品类", dataIndex: "categoryName" }
]; ];

View File

@ -2,9 +2,11 @@ import React, { useEffect, useState } from "react";
import { Form, Button, Table, Select, Input, DatePicker, Space, message } from "antd"; import { Form, Button, Table, Select, Input, DatePicker, Space, message } from "antd";
import { SearchOutlined, ReloadOutlined, PlusOutlined } from "@ant-design/icons"; import { SearchOutlined, ReloadOutlined, PlusOutlined } from "@ant-design/icons";
import type { ColumnsType } from 'antd/es/table'; import type { ColumnsType } from 'antd/es/table';
//组件
import ViewBlacklistModal from './components/ViewBlacklistModal'; import ViewBlacklistModal from './components/ViewBlacklistModal';
import CreateBlacklistModal from './components/CreateBlacklistModal' import CreateBlacklistModal from './components/CreateBlacklistModal'
import moment from 'moment'; import moment from 'moment';
//字典与接口
import { getDictList } from '@/servers/api/dicts' import { getDictList } from '@/servers/api/dicts'
import { getPage } from './services' import { getPage } from './services'
@ -21,13 +23,21 @@ interface Dict {
code: string; code: string;
} }
const blacklistManage: React.FC = () => { const blacklistManage: React.FC = () => {
//搜索
const [form] = Form.useForm(); const [form] = Form.useForm();
// 渲染列表数据
const [data, setData] = useState<Columns[]>([]); const [data, setData] = useState<Columns[]>([]);
//列表加载
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
//列表分页
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
//发起申请组件
const [createVisible, setCreateVisible] = useState(false); const [createVisible, setCreateVisible] = useState(false);
//查看组件
const [viewVisible, setViewVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false);
// 组件传递ID
const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null); const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null);
//字典下拉
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 查询接口 // 查询接口

View File

@ -13,7 +13,7 @@ interface ExitRecord {
createTime: string; // 发起时间 createTime: string; // 发起时间
accessType: string; // 审批记录状态 accessType: string; // 审批记录状态
} }
interface Dict { interface Dict {
dicName: string; dicName: string;
code: string; code: string;
@ -27,18 +27,18 @@ const supplierExitAudit: React.FC = () => {
const [createVisible, setCreateVisible] = useState(false); const [createVisible, setCreateVisible] = useState(false);
const [viewVisible, setViewVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false);
const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null); const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null);
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 查询接口 // 查询接口
const getList = async (pageNo = 1, pageSize = 10) => { const getList = async (pageNo = 1, pageSize = 10) => {
setLoading(true); setLoading(true);
// 可传查询条件 form.getFieldsValue() // 可传查询条件 form.getFieldsValue()
const values = form.getFieldsValue(); const values = form.getFieldsValue();
const { exitTheme, time, deptId, approveStatus } = values; const { exitTheme, time, deptId, approveStatus } = values;
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : ''; const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : ''; const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
const { code, data } = await getPage({ pageNo, pageSize, exitTheme, deptId, approveStatus, startTime, endTime }); const { code, data } = await getPage({ pageNo, pageSize, exitTheme, deptId, approveStatus, startTime, endTime });
if (code === 200) { if (code === 200) {
setData(data.records); setData(data.records);
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total })); setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
@ -71,10 +71,10 @@ const supplierExitAudit: React.FC = () => {
}; };
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
getList(); getList();
}, []); }, []);
@ -148,7 +148,6 @@ const supplierExitAudit: React.FC = () => {
showTotal: total => `${total}`, showTotal: total => `${total}`,
}} }}
onChange={handleTableChange} onChange={handleTableChange}
bordered
/> />
<CreateBlacklistModal visible={createVisible} onCancel={() => setCreateVisible(false)} onOk={handleSelectOk} /> <CreateBlacklistModal visible={createVisible} onCancel={() => setCreateVisible(false)} onOk={handleSelectOk} />

View File

@ -115,8 +115,6 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
) )
}, },
{ title: "供应商名称", dataIndex: "supplierName" }, { title: "供应商名称", dataIndex: "supplierName" },
{ title: "准入单位", dataIndex: "deptId" },
{ title: "准入部门", dataIndex: "deptId" },
{ title: "准入品类", dataIndex: "categoryName" } { title: "准入品类", dataIndex: "categoryName" }
]; ];
@ -143,8 +141,6 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
) )
}, },
{ title: "供应商名称", dataIndex: "supplierName" }, { title: "供应商名称", dataIndex: "supplierName" },
{ title: "准入单位", dataIndex: "deptId" },
{ title: "准入部门", dataIndex: "deptId" },
{ title: "准入品类", dataIndex: "categoryName" } { title: "准入品类", dataIndex: "categoryName" }
]; ];

View File

@ -154,7 +154,6 @@ const supplierExitManage: React.FC = () => {
showTotal: total => `${total}`, showTotal: total => `${total}`,
}} }}
onChange={handleTableChange} onChange={handleTableChange}
bordered
/> />
<CreateBlacklistModal visible={createVisible} onCancel={() => setCreateVisible(false)} onOk={handleSelectOk} /> <CreateBlacklistModal visible={createVisible} onCancel={() => setCreateVisible(false)} onOk={handleSelectOk} />