Files
fe_supplier_frontend/src/pages/supplierAnnualManage/supplierAnnualTaskManage/components/Detail/SupplierInfo.tsx

76 lines
1.9 KiB
TypeScript
Raw Normal View History

2025-06-27 19:55:19 +08:00
import React from 'react';
import { Card, Table, Button, message } from 'antd';
import styles from '../../supplierAnnualTaskManageDetail.less';
interface SupplierInfoProps {
2025-06-30 09:43:28 +08:00
taskData: supplierAnnualTaskManage.TaskDetailData;
2025-06-27 19:55:19 +08:00
onViewEvaluators: (supplier: any) => void;
}
const SupplierInfo: React.FC<SupplierInfoProps> = ({ taskData, onViewEvaluators }) => {
// 查看供应商评价人员
2025-06-30 09:43:28 +08:00
const handleViewSupplierEvaluators = (record: supplierAnnualTaskManage.TaskDetailData) => {
if (record.userList && record.userList.length > 0) {
2025-06-27 19:55:19 +08:00
onViewEvaluators({
...record,
2025-06-30 09:43:28 +08:00
userList: record.userList,
2025-06-27 19:55:19 +08:00
});
} else {
2025-06-30 09:43:28 +08:00
message.error('未找到该供应商的年审人员信息');
2025-06-27 19:55:19 +08:00
}
};
const columns = [
{
title: '序号',
dataIndex: 'index',
key: 'index',
render: (_: any, __: any, index: number) => index + 1,
width: 80,
},
{
title: '供应商名称',
dataIndex: 'supplierName',
key: 'supplierName',
},
{
title: '部门',
dataIndex: 'deptName',
key: 'deptName',
},
{
title: '品类',
dataIndex: 'categoryName',
key: 'categoryName',
render: (text: string) => text || '--',
},
{
title: '操作',
key: 'action',
render: (record: any) => (
2025-06-30 09:43:28 +08:00
<Button type="link" onClick={() => handleViewSupplierEvaluators(record)}>
2025-06-27 19:55:19 +08:00
</Button>
),
},
];
if (!taskData || !taskData.blackSupplierVos || taskData.blackSupplierVos.length === 0) {
return <div className={styles.emptyData}></div>;
}
return (
<Card className={styles.detailCard}>
<Table
columns={columns}
dataSource={taskData.blackSupplierVos}
rowKey="supplierId"
pagination={false}
className={styles.tableContainer}
/>
</Card>
);
};
export default SupplierInfo;