供应商名称点击弹出问题
This commit is contained in:
@ -4,6 +4,7 @@ import SupplierRegisterInfo from '@/components/GlobalModal/components/SupplierRe
|
|||||||
import AccessCategoryTable from '@/components/GlobalModal/components/AccessCategoryTable';
|
import AccessCategoryTable from '@/components/GlobalModal/components/AccessCategoryTable';
|
||||||
import TianyanchaInfo from '@/components/GlobalModal/components/TianyanchaInfo';
|
import TianyanchaInfo from '@/components/GlobalModal/components/TianyanchaInfo';
|
||||||
import RiskList from '@/components/GlobalModal/components/RiskList';
|
import RiskList from '@/components/GlobalModal/components/RiskList';
|
||||||
|
import ContactsInfo from '@/components/GlobalModal/components/ContactsInfo';
|
||||||
import { coscoSupplierBase } from '@/components/GlobalModal/services';
|
import { coscoSupplierBase } from '@/components/GlobalModal/services';
|
||||||
import { useIntl } from 'umi';
|
import { useIntl } from 'umi';
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ interface SupplierDetailProps {
|
|||||||
|
|
||||||
const SupplierDetail: React.FC<SupplierDetailProps> = ({ supplierId }) => {
|
const SupplierDetail: React.FC<SupplierDetailProps> = ({ supplierId }) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [modalType, setModalType] = useState<'register' | 'category' | 'tianyancha' | 'risk'>('register');
|
const [modalType, setModalType] = useState<'register' | 'category' | 'tianyancha' | 'risk' | 'contactsInfo'>('register');
|
||||||
const [registerInfo, setRegisterInfo] = useState<any>(null);
|
const [registerInfo, setRegisterInfo] = useState<any>(null);
|
||||||
|
|
||||||
// 获取供应商信息
|
// 获取供应商信息
|
||||||
@ -46,6 +47,9 @@ const SupplierDetail: React.FC<SupplierDetailProps> = ({ supplierId }) => {
|
|||||||
if (modalType === 'risk') {
|
if (modalType === 'risk') {
|
||||||
return supplierId ? <RiskList id={supplierId} /> : null;
|
return supplierId ? <RiskList id={supplierId} /> : null;
|
||||||
}
|
}
|
||||||
|
if (modalType === 'contactsInfo') {
|
||||||
|
return supplierId ? <ContactsInfo id={supplierId} /> : null;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -69,6 +73,7 @@ const SupplierDetail: React.FC<SupplierDetailProps> = ({ supplierId }) => {
|
|||||||
<Button type={modalType === 'category' ? 'primary' : 'default'} onClick={() => handleSwitch('category')}>{intl.formatMessage({ id: 'component.globalModal.category' })}</Button>
|
<Button type={modalType === 'category' ? 'primary' : 'default'} onClick={() => handleSwitch('category')}>{intl.formatMessage({ id: 'component.globalModal.category' })}</Button>
|
||||||
<Button type={modalType === 'tianyancha' ? 'primary' : 'default'} onClick={() => handleSwitch('tianyancha')}>{intl.formatMessage({ id: 'component.globalModal.tianyancha' })}</Button>
|
<Button type={modalType === 'tianyancha' ? 'primary' : 'default'} onClick={() => handleSwitch('tianyancha')}>{intl.formatMessage({ id: 'component.globalModal.tianyancha' })}</Button>
|
||||||
<Button type={modalType === 'risk' ? 'primary' : 'default'} onClick={() => handleSwitch('risk')}>{intl.formatMessage({ id: 'component.globalModal.ComplianceRisk' })}</Button>
|
<Button type={modalType === 'risk' ? 'primary' : 'default'} onClick={() => handleSwitch('risk')}>{intl.formatMessage({ id: 'component.globalModal.ComplianceRisk' })}</Button>
|
||||||
|
<Button type={modalType === 'contactsInfo' ? 'primary' : 'default'} onClick={() => handleSwitch('contactsInfo')}>{ '联系人' }</Button>
|
||||||
</Space>
|
</Space>
|
||||||
<div style={{ height: '600px', overflowY: 'auto' }}>
|
<div style={{ height: '600px', overflowY: 'auto' }}>
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Modal, Descriptions } from 'antd';
|
import { Modal, Descriptions } from 'antd';
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
import { coscoAccessWorkCategory } from '../services'
|
import { coscoAccessWorkCategory } from '../services'
|
||||||
|
|
||||||
@ -32,6 +33,8 @@ const ViewModal: React.FC<{
|
|||||||
}> = ({ visible, record = {}, onCancel }) => {
|
}> = ({ visible, record = {}, onCancel }) => {
|
||||||
//渲染数据
|
//渲染数据
|
||||||
const [data, setData] = useState<Data | null>(null);
|
const [data, setData] = useState<Data | null>(null);
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (record.id) {
|
if (record.id) {
|
||||||
@ -52,7 +55,7 @@ const ViewModal: React.FC<{
|
|||||||
<Descriptions.Item label="准入供应商">
|
<Descriptions.Item label="准入供应商">
|
||||||
{data.coscoAccessSupplierList.map((item) => {
|
{data.coscoAccessSupplierList.map((item) => {
|
||||||
return (
|
return (
|
||||||
<div style={{ margin: '5px' }}>{item.supplierName}</div>
|
<div style={{ margin: '5px', color: '#004f8e', cursor: 'pointer' }} onClick={() => supplierDetailModal?.(item.supplierId)} >{item.supplierName}</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Modal, Descriptions } from 'antd';
|
import { Modal, Descriptions } from 'antd';
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
import { coscoAccessWorkCategory } from '../services'
|
import { coscoAccessWorkCategory } from '../services'
|
||||||
|
|
||||||
@ -32,6 +33,8 @@ const ViewModal: React.FC<{
|
|||||||
}> = ({ visible, record = {}, onCancel }) => {
|
}> = ({ visible, record = {}, onCancel }) => {
|
||||||
//渲染数据
|
//渲染数据
|
||||||
const [data, setData] = useState<Data | null>(null);
|
const [data, setData] = useState<Data | null>(null);
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (record.id) {
|
if (record.id) {
|
||||||
@ -52,7 +55,7 @@ const ViewModal: React.FC<{
|
|||||||
<Descriptions.Item label="准入供应商">
|
<Descriptions.Item label="准入供应商">
|
||||||
{data.coscoAccessSupplierList.map((item) => {
|
{data.coscoAccessSupplierList.map((item) => {
|
||||||
return (
|
return (
|
||||||
<div style={{ margin: '5px' }}>{item.supplierName}</div>
|
<div style={{ margin: '5px', color: '#004f8e', cursor: 'pointer' }} onClick={() => supplierDetailModal?.(item.supplierId)} >{item.supplierName}</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Modal, Descriptions } from 'antd';
|
import { Modal, Descriptions } from 'antd';
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
import { coscoAccessWork } from '../services'
|
import { coscoAccessWork } from '../services'
|
||||||
|
|
||||||
@ -47,6 +48,7 @@ const ViewModal: React.FC<{
|
|||||||
}> = ({ visible, record = {}, onCancel }) => {
|
}> = ({ visible, record = {}, onCancel }) => {
|
||||||
//渲染数据
|
//渲染数据
|
||||||
const [data, setData] = useState<Data | null>(null);
|
const [data, setData] = useState<Data | null>(null);
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
//初始化
|
//初始化
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (record) {
|
if (record) {
|
||||||
@ -67,7 +69,7 @@ const ViewModal: React.FC<{
|
|||||||
<Descriptions.Item label="准入供应商">
|
<Descriptions.Item label="准入供应商">
|
||||||
{data.coscoAccessSupplierList.map((item) => {
|
{data.coscoAccessSupplierList.map((item) => {
|
||||||
return (
|
return (
|
||||||
<div style={{ margin: '5px' }}>{item.supplierName}</div>
|
<div style={{ margin: '5px', color: '#004f8e', cursor: 'pointer' }} onClick={() => supplierDetailModal?.(item.supplierId)} >{item.supplierName}</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Table, Form, Select, Button, message, Space } from 'antd';
|
import { Table, Form, Select, Button, message, Space, Tooltip } from 'antd';
|
||||||
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
//接口
|
//接口
|
||||||
@ -146,14 +146,21 @@ const SupplierEntryReview: React.FC = () => {
|
|||||||
dataIndex: 'categoryNameList',
|
dataIndex: 'categoryNameList',
|
||||||
width: 120,
|
width: 120,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (_: any, record: any) => {
|
render: (value: { item: string }[] = []) => {
|
||||||
|
if (!value || value.length === 0) return '-';
|
||||||
|
if (value.length === 1) {
|
||||||
|
return <span>{value[0].item}</span>;
|
||||||
|
}
|
||||||
|
// 多于1条
|
||||||
|
const allNames = value.map(item => item).join('、');
|
||||||
return (
|
return (
|
||||||
<>
|
<Tooltip title={allNames} overlayStyle={{ zIndex: 1200 }}>
|
||||||
{record.categoryNameList && record.categoryNameList.map((item: string) => {
|
<span>
|
||||||
return <div>{`${item}`}</div>
|
{value[0]}
|
||||||
})}
|
<span>等</span>
|
||||||
</>
|
</span>
|
||||||
)
|
</Tooltip>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Modal, Descriptions } from 'antd';
|
import { Modal, Descriptions } from 'antd';
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
import { coscoAccessWork } from '../services'
|
import { coscoAccessWork } from '../services'
|
||||||
|
|
||||||
@ -47,6 +48,8 @@ const ViewModal: React.FC<{
|
|||||||
}> = ({ visible, record = {}, onCancel }) => {
|
}> = ({ visible, record = {}, onCancel }) => {
|
||||||
//渲染数据
|
//渲染数据
|
||||||
const [data, setData] = useState<Data | null>(null);
|
const [data, setData] = useState<Data | null>(null);
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (record.id) {
|
if (record.id) {
|
||||||
@ -67,7 +70,8 @@ const ViewModal: React.FC<{
|
|||||||
<Descriptions.Item label="准入供应商">
|
<Descriptions.Item label="准入供应商">
|
||||||
{data.coscoAccessSupplierList.map((item) => {
|
{data.coscoAccessSupplierList.map((item) => {
|
||||||
return (
|
return (
|
||||||
<div style={{ margin: '5px' }}>{item.supplierName}</div>
|
<div style={{ margin: '5px', color: '#004f8e', cursor: 'pointer' }} onClick={() => supplierDetailModal?.(item.supplierId)} >{item.supplierName}</div>
|
||||||
|
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|||||||
import { Modal, Descriptions } from 'antd';
|
import { Modal, Descriptions } from 'antd';
|
||||||
|
|
||||||
import { coscoAccessWork } from '../services'
|
import { coscoAccessWork } from '../services'
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
//数据接口
|
//数据接口
|
||||||
interface Data {
|
interface Data {
|
||||||
@ -47,6 +48,7 @@ const ViewModal: React.FC<{
|
|||||||
}> = ({ visible, record = {}, onCancel }) => {
|
}> = ({ visible, record = {}, onCancel }) => {
|
||||||
//渲染数据
|
//渲染数据
|
||||||
const [data, setData] = useState<Data | null>(null);
|
const [data, setData] = useState<Data | null>(null);
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
//初始化
|
//初始化
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (record.id) {
|
if (record.id) {
|
||||||
@ -65,11 +67,13 @@ const ViewModal: React.FC<{
|
|||||||
<Descriptions bordered column={1} labelStyle={{ width: 160 }}>
|
<Descriptions bordered column={1} labelStyle={{ width: 160 }}>
|
||||||
<Descriptions.Item label="准入部门" >{data.coscoAccessWork.deptName}</Descriptions.Item>
|
<Descriptions.Item label="准入部门" >{data.coscoAccessWork.deptName}</Descriptions.Item>
|
||||||
<Descriptions.Item label="准入供应商">
|
<Descriptions.Item label="准入供应商">
|
||||||
|
|
||||||
{data.coscoAccessSupplierList.map((item) => {
|
{data.coscoAccessSupplierList.map((item) => {
|
||||||
return (
|
return (
|
||||||
<div style={{ margin: '5px' }}>{item.supplierName}</div>
|
<div style={{ margin: '5px', color: '#004f8e', cursor: 'pointer' }} onClick={() => supplierDetailModal?.(item.supplierId)} >{item.supplierName}</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
|
||||||
{data.coscoAccessWork.accessType === 'scattered' && (
|
{data.coscoAccessWork.accessType === 'scattered' && (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useIntl } from 'umi';
|
import { useIntl } from 'umi';
|
||||||
import { Form, Button, Table, Space, Input } from 'antd';
|
import { Form, Button, Table, Space, Input, Tooltip } from 'antd';
|
||||||
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
||||||
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||||
//接口
|
//接口
|
||||||
@ -117,14 +117,21 @@ const CooperateEnterprise: React.FC = () => {
|
|||||||
dataIndex: 'categoryNameList',
|
dataIndex: 'categoryNameList',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 160,
|
width: 160,
|
||||||
render: (_: any, record: Data) => {
|
render: (value: { item: string }[] = []) => {
|
||||||
|
if (!value || value.length === 0) return '-';
|
||||||
|
if (value.length === 1) {
|
||||||
|
return <span>{value[0].item}</span>;
|
||||||
|
}
|
||||||
|
// 多于1条
|
||||||
|
const allNames = value.map(item => item).join('、');
|
||||||
return (
|
return (
|
||||||
<>
|
<Tooltip title={allNames} overlayStyle={{ zIndex: 1200 }}>
|
||||||
{record.categoryNameList && record.categoryNameList.map((item: string) => {
|
<span>
|
||||||
return <div>{`${item}`}</div>
|
{value[0]}
|
||||||
})}
|
<span>等</span>
|
||||||
</>
|
</span>
|
||||||
)
|
</Tooltip>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Modal, Table, Button, Descriptions, Spin } from 'antd';
|
import { Modal, Table, Button, Descriptions, Spin, Tooltip } from 'antd';
|
||||||
import { getSupplierPage, detail } from "../services";
|
import { getSupplierPage, detail } from "../services";
|
||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
// 供应商类型
|
// 供应商类型
|
||||||
interface Supplier {
|
interface Supplier {
|
||||||
id: string;
|
id: string;
|
||||||
@ -41,6 +43,8 @@ const SupplierListModal: React.FC<{
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
|
|
||||||
|
|
||||||
// 拉数据
|
// 拉数据
|
||||||
const fetchSuppliers = async (page = 1, pageSize = 10) => {
|
const fetchSuppliers = async (page = 1, pageSize = 10) => {
|
||||||
@ -85,7 +89,18 @@ const SupplierListModal: React.FC<{
|
|||||||
// 列表列
|
// 列表列
|
||||||
const columns: ColumnsType<Supplier> = [
|
const columns: ColumnsType<Supplier> = [
|
||||||
{ title: '序号', dataIndex: 'id', align: 'center', width: 60, render: (t: any, r: any, i: number) => (pagination.current - 1) * pagination.pageSize + i + 1 },
|
{ title: '序号', dataIndex: 'id', align: 'center', width: 60, render: (t: any, r: any, i: number) => (pagination.current - 1) * pagination.pageSize + i + 1 },
|
||||||
{ title: '供应商名称', dataIndex: 'name', align: 'center' },
|
{
|
||||||
|
title: "供应商名称", dataIndex: "name", align: "left",
|
||||||
|
width: 360,
|
||||||
|
ellipsis: true,
|
||||||
|
render: (dom, record) => {
|
||||||
|
return (
|
||||||
|
<Tooltip title={record.name} overlayStyle={{ zIndex: 1200 }}>
|
||||||
|
<a onClick={() => supplierDetailModal?.(record.id)}>{record.name || ''}</a>
|
||||||
|
</Tooltip>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
{ title: '境内/境外', dataIndex: 'supplierCategory', align: 'center', render: (r: any,) => (<span>{`${r.supplierCategory === 'dvs'? '境内企业':'境外企业'}`}</span>) },
|
{ title: '境内/境外', dataIndex: 'supplierCategory', align: 'center', render: (r: any,) => (<span>{`${r.supplierCategory === 'dvs'? '境内企业':'境外企业'}`}</span>) },
|
||||||
{ title: '统一社会信用代码', dataIndex: 'unifiedSocialCreditCode', align: 'center' },
|
{ title: '统一社会信用代码', dataIndex: 'unifiedSocialCreditCode', align: 'center' },
|
||||||
];
|
];
|
||||||
|
@ -139,6 +139,7 @@ const CategoryLibraryManage: React.FC = () => {
|
|||||||
title: '库内供应商数量',
|
title: '库内供应商数量',
|
||||||
dataIndex: 'snumber',
|
dataIndex: 'snumber',
|
||||||
key: 'snumber',
|
key: 'snumber',
|
||||||
|
width: 200,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (val: number, record: any) => (
|
render: (val: number, record: any) => (
|
||||||
<a
|
<a
|
||||||
|
@ -191,7 +191,7 @@ const SupplierAddModal: React.FC<{
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (dom, record) => {
|
render: (dom, record) => {
|
||||||
return (
|
return (
|
||||||
<Tooltip>
|
<Tooltip title={record.name} overlayStyle={{ zIndex: 1200 }}>
|
||||||
<a onClick={() => supplierDetailModal?.(record.id)}>{record.name || ''}</a>
|
<a onClick={() => supplierDetailModal?.(record.id)}>{record.name || ''}</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)
|
)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Modal, Button, Descriptions, Tree, Table } from 'antd';
|
import { Modal, Button, Descriptions, Tooltip, Table } from 'antd';
|
||||||
import { detail, treeList } from "../services";
|
import { detail, treeList } from "../services";
|
||||||
import type { DataNode } from 'antd/es/tree';
|
import type { DataNode } from 'antd/es/tree';
|
||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
// 基本信息类型
|
// 基本信息类型
|
||||||
interface CategoryInfo {
|
interface CategoryInfo {
|
||||||
@ -36,6 +37,7 @@ interface LockNode extends DataNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface columns {
|
interface columns {
|
||||||
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
supplierCategory: string;
|
supplierCategory: string;
|
||||||
}
|
}
|
||||||
@ -51,6 +53,8 @@ const ViewModal: React.FC<{
|
|||||||
const [treeData, setTreeData] = useState<LockNode[]>([]);
|
const [treeData, setTreeData] = useState<LockNode[]>([]);
|
||||||
const [expandedKeys, setExpandedKeys] = useState<string[]>([]);
|
const [expandedKeys, setExpandedKeys] = useState<string[]>([]);
|
||||||
const [autoExpandParent, setAutoExpandParent] = useState(true);
|
const [autoExpandParent, setAutoExpandParent] = useState(true);
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
|
|
||||||
// 拉取基本信息
|
// 拉取基本信息
|
||||||
const fetchCategoryInfo = async () => {
|
const fetchCategoryInfo = async () => {
|
||||||
if (!storeId) return;
|
if (!storeId) return;
|
||||||
@ -82,17 +86,28 @@ const ViewModal: React.FC<{
|
|||||||
}
|
}
|
||||||
}, [visible, storeId]);
|
}, [visible, storeId]);
|
||||||
const columns: ColumnsType<columns> = [
|
const columns: ColumnsType<columns> = [
|
||||||
{ title: '供应商名称', dataIndex: 'name', align: 'center' },
|
{
|
||||||
|
title: "供应商名称", dataIndex: "name", align: "left",
|
||||||
|
width: 360,
|
||||||
|
ellipsis: true,
|
||||||
|
render: (dom, record) => {
|
||||||
|
return (
|
||||||
|
<Tooltip title={record.name} overlayStyle={{ zIndex: 1200 }}>
|
||||||
|
<a onClick={() => supplierDetailModal?.(record.id)}>{record.name || ''}</a>
|
||||||
|
</Tooltip>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '境内/境外', dataIndex: 'supplierCategory', align: 'center',
|
title: '境内/境外', dataIndex: 'supplierCategory', align: 'center',
|
||||||
render: (record: any) => {
|
render: (record: any) => {
|
||||||
const supplierCategoryType = record.supplierCategory === 'dvs' ? '境内企业' : record.supplierCategory === 'pe' ? '个人':'境外企业'
|
const supplierCategoryType = record.supplierCategory === 'dvs' ? '境内企业' : record.supplierCategory === 'pe' ? '个人' : '境外企业'
|
||||||
return (
|
return (
|
||||||
<span>{supplierCategoryType}</span>
|
<span>{supplierCategoryType}</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '供应商类型', dataIndex: '', align: 'center' },
|
{ title: '企业类型', dataIndex: '', align: 'center' },
|
||||||
]
|
]
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Modal, Button, Table, Descriptions, Spin, message } from "antd";
|
import { Modal, Button, Table, Descriptions, Spin, message, Tooltip } from "antd";
|
||||||
import {viewBlacklist } from "../services"; // 假设的接口
|
import {viewBlacklist } from "../services"; // 假设的接口
|
||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
interface Supplier {
|
interface Supplier {
|
||||||
id: number; // 作为 rowKey 用于唯一标识
|
id: number; // 作为 rowKey 用于唯一标识
|
||||||
@ -34,6 +35,7 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [detail, setDetail] = useState<DetailData | null>(null);
|
const [detail, setDetail] = useState<DetailData | null>(null);
|
||||||
const [suppliers, setSuppliers] = useState<Supplier[]>([]);
|
const [suppliers, setSuppliers] = useState<Supplier[]>([]);
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@ -64,12 +66,30 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
|||||||
}, [visible, recordId]);
|
}, [visible, recordId]);
|
||||||
|
|
||||||
const columns:ColumnsType<Supplier> = [
|
const columns:ColumnsType<Supplier> = [
|
||||||
{ title: "供应商名称", dataIndex: "supplierName", align: "center" },
|
{
|
||||||
|
title: "供应商名称", dataIndex: "supplierName", align: "left",
|
||||||
|
width: 200,
|
||||||
|
ellipsis: true,
|
||||||
|
render: (dom, record) => {
|
||||||
|
return (
|
||||||
|
<Tooltip title={record.supplierName} overlayStyle={{ zIndex: 1200 }}>
|
||||||
|
<a onClick={() => supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}</a>
|
||||||
|
</Tooltip>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
{ title: "准入部门", dataIndex: "deptName", align: "center" },
|
{ title: "准入部门", dataIndex: "deptName", align: "center" },
|
||||||
{ title: "准入时间", dataIndex: "evaluateTime", align: "center" },
|
{ title: "准入时间", dataIndex: "evaluateTime", align: "center" },
|
||||||
{ title: "准入品类", dataIndex: "categoryName", align: "center" },
|
{ title: "准入品类", dataIndex: "categoryName", align: "center", width: 180,
|
||||||
// { title: "最近一次评价", dataIndex: "lastEval", align: "center" },
|
ellipsis: true,
|
||||||
// { title: "评价时间", dataIndex: "lastEvalDate", align: "center" },
|
render: (dom, record) => {
|
||||||
|
return (
|
||||||
|
<Tooltip title={record.categoryName} overlayStyle={{ zIndex: 1200 }}>
|
||||||
|
{record.categoryName}
|
||||||
|
</Tooltip>
|
||||||
|
)
|
||||||
|
} },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -85,7 +85,7 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (dom, record) => {
|
render: (dom, record) => {
|
||||||
return (
|
return (
|
||||||
<Tooltip>
|
<Tooltip title={record.supplierName} overlayStyle={{ zIndex: 1200 }}>
|
||||||
<a onClick={() => supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}</a>
|
<a onClick={() => supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)
|
)
|
||||||
|
@ -124,7 +124,7 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (_: any, record: Supplier) => {
|
render: (_: any, record: Supplier) => {
|
||||||
return (
|
return (
|
||||||
<Tooltip>
|
<Tooltip title={record.supplierName} overlayStyle={{ zIndex: 1200 }}>
|
||||||
<a onClick={() => supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}</a>
|
<a onClick={() => supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)
|
)
|
||||||
|
@ -85,7 +85,7 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (dom, record) => {
|
render: (dom, record) => {
|
||||||
return (
|
return (
|
||||||
<Tooltip>
|
<Tooltip title={record.supplierName} overlayStyle={{ zIndex: 1200 }}>
|
||||||
<a onClick={() => supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}</a>
|
<a onClick={() => supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user