From e848721f3a4bc95774e5d93754cfbf4956d1c4de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=99=E6=99=AF=E5=AD=A6?=
<5412262+sun_jing_xue@user.noreply.gitee.com>
Date: Thu, 17 Jul 2025 11:47:38 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E9=80=80=E5=87=BA?=
=?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=BC=B9=E7=AA=97/=E9=BB=91=E5=90=8D?=
=?UTF-8?q?=E5=8D=95=E7=94=B3=E8=AF=B7=E4=B8=8E=E4=BE=9B=E5=BA=94=E5=95=86?=
=?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=BC=B9=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/AccessCategoryTable.tsx | 20 ++-------
.../SupplierDetailModalContext.tsx | 2 +-
.../backend/cooperateEnterprise/index.tsx | 20 ++-------
.../components/CreateBlacklistModal.tsx | 31 +++++++------
.../components/SupplierSelectModal.tsx | 38 +++++++---------
.../blacklistManage/index.tsx | 2 -
.../components/ViewBlacklistModal.tsx | 27 ++++++++----
.../components/CreateBlacklistModal.tsx | 2 -
.../components/SupplierSelectModal.tsx | 44 ++++++++++---------
.../components/ViewBlacklistModal.tsx | 3 +-
10 files changed, 85 insertions(+), 104 deletions(-)
diff --git a/src/components/GlobalModal/components/AccessCategoryTable.tsx b/src/components/GlobalModal/components/AccessCategoryTable.tsx
index 9f9db2d..2608874 100644
--- a/src/components/GlobalModal/components/AccessCategoryTable.tsx
+++ b/src/components/GlobalModal/components/AccessCategoryTable.tsx
@@ -9,25 +9,13 @@ const AccessCategoryTable = ({id}:{id:string}) => {
const columns = [
{
title: '准入单位',
- dataIndex: 'deptId',
- key: 'deptId',
+ dataIndex: 'deptName',
+ key: 'deptName',
},
{
title: '准入品类',
- dataIndex: 'categoryNames',
- key: 'categoryNames',
- render: (_: any, record: any) => {
- console.log(record.categoryNames);
- const arr = record.categoryNames ? record.categoryNames.split(',') : [];
-
- return arr.length
- ? arr.map((item: string, idx: number) => (
-
- {item}
-
- ))
- : '';
- },
+ dataIndex: 'categoryName',
+ key: 'categoryName',
},
{
title: '准入时间',
diff --git a/src/components/SupplierDetailModalContext/SupplierDetailModalContext.tsx b/src/components/SupplierDetailModalContext/SupplierDetailModalContext.tsx
index 5c2eb57..dbb5c1b 100644
--- a/src/components/SupplierDetailModalContext/SupplierDetailModalContext.tsx
+++ b/src/components/SupplierDetailModalContext/SupplierDetailModalContext.tsx
@@ -18,7 +18,7 @@ export const SupplierDetailModalProvider = ({ children }: { children: React.Reac
return (
{children}
- setVisible(false)} footer={null} width="90%" title={
+ setVisible(false)} footer={null} width="90%" title={
{intl.formatMessage({ id: 'component.globalModal.title' })}
diff --git a/src/pages/supplier/backend/cooperateEnterprise/index.tsx b/src/pages/supplier/backend/cooperateEnterprise/index.tsx
index 3da0e77..431b546 100644
--- a/src/pages/supplier/backend/cooperateEnterprise/index.tsx
+++ b/src/pages/supplier/backend/cooperateEnterprise/index.tsx
@@ -80,25 +80,13 @@ const CooperateEnterprise: React.FC = () => {
},
{
title: '准入单位',
- dataIndex: 'deptId',
- key: 'deptId',
+ dataIndex: 'deptName',
+ key: 'deptName',
},
{
title: '准入品类',
- dataIndex: 'categoryNames',
- key: 'categoryNames',
- render: (_: any, record: any) => {
- console.log(record.categoryNames);
- const arr = record.categoryNames ? record.categoryNames.split(',') : [];
-
- return arr.length
- ? arr.map((item: string, idx: number) => (
-
- {item}
-
- ))
- : '';
- },
+ dataIndex: 'categoryName',
+ key: 'categoryName',
},
{
title: '准入时间',
diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx
index 3abf48d..ad4cdcd 100644
--- a/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx
+++ b/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx
@@ -1,19 +1,25 @@
import React, { useEffect , useState } from "react";
import { Modal, Button, Select, Input, Table, message, Form, Tooltip } from "antd";
-import SupplierSelectModal from "./SupplierSelectModal";
-import { blacklist, getAllList } from "../services";
import type { ColumnsType } from 'antd/es/table';
+//组件
+import SupplierSelectModal from "./SupplierSelectModal";
+import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
+//接口
+import { blacklist, getAllList } from "../services";
+
+
const { Option } = Select;
interface Supplier {
- id: number; // 作为 rowKey 用于唯一标识
+ id: string; // 作为 rowKey 用于唯一标识
supplierName: string; // 供应商名称
unit: string; // 准入部门
accessTime: string; // 准入时间
categoryName: string; // 准入品类
- lastEval: string; // 最近一次评价
- lastEvalDate: string; // 评价时间
supplierId: string;
categoryId: string;
+ supplierType: string;
+ nameEn: string;
+ name: string;
}
interface CreateBlacklistModalProps {
@@ -27,12 +33,13 @@ const CreateBlacklistModal: React.FC = ({
onOk,
onCancel,
}) => {
+ const [form] = Form.useForm();
const [selectVisible, setSelectVisible] = useState(false);
const [suppliers, setSuppliers] = useState([]);
const [timelimitOption, setTimelimitOption] = useState([]);
- const [form] = Form.useForm();
+ const supplierDetailModal = useSupplierDetailModal();
- const removeSupplier = (id: number) => {
+ const removeSupplier = (id: string) => {
setSuppliers(suppliers.filter((s) => s.id !== id));
};
@@ -79,25 +86,21 @@ const CreateBlacklistModal: React.FC = ({
setTimelimitOption(data)
}
})
-
-
setSuppliers([]);
form.resetFields();
}
}, [visible]);
const columns: ColumnsType = [
- { title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: any) => {
+ { title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: Supplier) => {
const name = record.supplierType === "ovs"? record.nameEn : record.name;
return(
- {name}
+ supplierDetailModal?.(record.id)}>{name}
)
} },
{ title: "准入部门", dataIndex: "unit", align: "center" },
- { title: "准入时间", dataIndex: "accessTime", align: "center", render: () => "2023-04-20 13:00" },
+ { title: "准入时间", dataIndex: "accessTime", align: "center" },
{ title: "准入品类", dataIndex: "categoryName", align: "center" },
- { title: "最近一次评价", dataIndex: "lastEval", align: "center" },
- { title: "评价时间", dataIndex: "lastEvalDate", align: "center" },
{
title: "操作",
dataIndex: "option",
diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/components/SupplierSelectModal.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/components/SupplierSelectModal.tsx
index ae3a228..b95ab1a 100644
--- a/src/pages/supplier/supplierBlacklist/blacklistManage/components/SupplierSelectModal.tsx
+++ b/src/pages/supplier/supplierBlacklist/blacklistManage/components/SupplierSelectModal.tsx
@@ -1,23 +1,24 @@
import React, { useEffect, useState } from "react";
import {
- Modal, Table, Button, Checkbox, Row, Col, Input, Select, Form, Space, message, Tooltip
+ Modal, Table, Button, Checkbox, Row, Col, Input, Form, Space, message, Tooltip
} from "antd";
+//接口
import { getSupplierCategoryPage } from '../services';
+//组件
import CategorySelector from '@/components/CategorySelector';
-const { Option } = Select;
+import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
interface Supplier {
- id: number;
+ id: string;
supplierId: string;
categoryId: string;
supplierName: string;
-
unit: string; // 准入部门
accessTime: string; // 准入时间
categoryName: string; // 准入品类
- lastEval: string; // 最近一次评价
- lastEvalDate: string; // 评价时间
-
+ supplierType: string;
+ nameEn: string;
+ name: string;
}
interface SupplierSelectModalProps {
@@ -35,12 +36,13 @@ const SupplierSelectModal: React.FC = ({
onCancel,
}) => {
const [form] = Form.useForm();
- const [leftSelected, setLeftSelected] = useState([]);
- const [rightSelected, setRightSelected] = useState([]);
+ const [leftSelected, setLeftSelected] = useState([]);
+ const [rightSelected, setRightSelected] = useState([]);
const [rightData, setRightData] = useState([]);
const [data, setData] = useState([]);
const [pagination, setPagination] = useState({ current: 1, pageSize: 5, total: 0 });
const [loading, setLoading] = useState(false);
+ const supplierDetailModal = useSupplierDetailModal();
useEffect(() => {
if (visible) {
@@ -114,11 +116,11 @@ const SupplierSelectModal: React.FC = ({
>
)
},
- { title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: any) => {
+ { title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: Supplier) => {
const name = record.supplierType === "ovs"? record.nameEn : record.name;
return(
- {name}
+ supplierDetailModal?.(record.id)}>{name}
)
} },
{ title: "准入品类", dataIndex: "categoryName", ellipsis: true, width: 100, render: (_: any, record: any) => {
@@ -179,22 +181,12 @@ const SupplierSelectModal: React.FC = ({
bodyStyle={{ padding: 24 }}
>
-
-
-
-
@@ -205,7 +197,7 @@ const SupplierSelectModal: React.FC = ({
- 备选供应商
+ 备选供应商
= ({
- 已选供应商
+ 已选供应商
{
))}
-
-
} onClick={handleSearch} >
搜索
diff --git a/src/pages/supplier/supplierExit/supplierExitAudit/components/ViewBlacklistModal.tsx b/src/pages/supplier/supplierExit/supplierExitAudit/components/ViewBlacklistModal.tsx
index 7862db4..33e451a 100644
--- a/src/pages/supplier/supplierExit/supplierExitAudit/components/ViewBlacklistModal.tsx
+++ b/src/pages/supplier/supplierExit/supplierExitAudit/components/ViewBlacklistModal.tsx
@@ -1,7 +1,8 @@
import React, { useEffect, useState } from "react";
-import { Modal, Button, Table, Descriptions, Spin, message } from "antd";
-import {coscoSupplierexit } from "../services"; // 假设的接口
+import { Modal, Button, Table, Descriptions, Spin, message, Tooltip } from "antd";
+import {coscoSupplierexit } from "../services";
import type { ColumnsType } from 'antd/es/table';
+import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
interface Supplier {
id: number; // 作为 rowKey 用于唯一标识
@@ -35,7 +36,7 @@ const ViewBlacklistModal: React.FC = ({
const [loading, setLoading] = useState(false);
const [detail, setDetail] = useState(null);
const [suppliers, setSuppliers] = useState([]);
-
+ const supplierDetailModal = useSupplierDetailModal();
const fetchData = async () => {
setLoading(true);
try {
@@ -65,12 +66,20 @@ const ViewBlacklistModal: React.FC = ({
}, [visible, recordId]);
const columns:ColumnsType = [
- { title: "供应商名称", dataIndex: "supplierName", align: "center" },
- { title: "准入部门", dataIndex: "deptId", align: "center" },
- // { title: "准入时间", dataIndex: "accessTime", align: "center" },
- { title: "退出品类", dataIndex: "categoryName", align: "center" },
- // { title: "最近一次评价", dataIndex: "lastEval", align: "center" },
- // { title: "评价时间", dataIndex: "lastEvalDate", align: "center" },
+ {
+ title: "供应商名称", dataIndex: "supplierName", align: "left",
+ width: 360,
+ ellipsis: true,
+ render: (dom, record) => {
+ return (
+
+ supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}
+
+ )
+ }
+ },
+ { title: "准入部门", dataIndex: "deptId", align: "center", width: 160 },
+ { title: "退出品类", dataIndex: "categoryName", align: "center", width: 160 },
];
return (
diff --git a/src/pages/supplier/supplierExit/supplierExitManage/components/CreateBlacklistModal.tsx b/src/pages/supplier/supplierExit/supplierExitManage/components/CreateBlacklistModal.tsx
index fc6155c..45cdcb5 100644
--- a/src/pages/supplier/supplierExit/supplierExitManage/components/CreateBlacklistModal.tsx
+++ b/src/pages/supplier/supplierExit/supplierExitManage/components/CreateBlacklistModal.tsx
@@ -98,8 +98,6 @@ const CreateBlacklistModal: React.FC = ({
{ title: "准入部门", dataIndex: "deptId", align: "center" },
{ title: "准入时间", dataIndex: "createTime", align: "center" },
{ title: "准入品类", dataIndex: "categoryName", align: "center" },
- { title: "最近一次评价", dataIndex: "lastEval", align: "center" },
- { title: "评价时间", dataIndex: "lastEvalDate", align: "center" },
{
title: "操作",
dataIndex: "option",
diff --git a/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx b/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx
index 6008d69..ac15ad2 100644
--- a/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx
+++ b/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx
@@ -1,24 +1,22 @@
import React, { useEffect, useState } from "react";
import {
- Modal, Table, Button, Checkbox, Row, Col, Input, Select, Form, Space, message
+ Modal, Table, Button, Checkbox, Row, Col, Input, Tooltip, Form, Space, message
} from "antd";
import { RightOutlined, LeftOutlined } from '@ant-design/icons';
+import type { ColumnsType } from 'antd/es/table';
+//接口
import { getSupplierCategoryPage } from '../services';
+//组件
import CategorySelector from '@/components/CategorySelector';
-const { Option } = Select;
+import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
+
interface Supplier {
id: number;
supplierId: string;
categoryId: string;
supplierName: string;
-
- unit: string; // 准入部门
- accessTime: string; // 准入时间
categoryName: string; // 准入品类
- lastEval: string; // 最近一次评价
- lastEvalDate: string; // 评价时间
-
}
interface SupplierSelectModalProps {
@@ -42,6 +40,7 @@ const SupplierSelectModal: React.FC = ({
const [data, setData] = useState([]);
const [pagination, setPagination] = useState({ current: 1, pageSize: 5, total: 0 });
const [loading, setLoading] = useState(false);
+ const supplierDetailModal = useSupplierDetailModal();
useEffect(() => {
if (visible) {
@@ -93,7 +92,7 @@ const SupplierSelectModal: React.FC = ({
onOk(rightData);
};
- const columns = [
+ const columns: ColumnsType = [
{
title: 0}
@@ -115,8 +114,19 @@ const SupplierSelectModal: React.FC = ({
>
)
},
- { title: "供应商名称", dataIndex: "supplierName" },
- { title: "准入品类", dataIndex: "categoryName" }
+ {
+ title: "供应商名称", dataIndex: "supplierName", align: "left",
+ width: 200,
+ ellipsis: true,
+ render: (_: any, record: Supplier) => {
+ return (
+
+ supplierDetailModal?.(record.supplierId)}>{record.supplierName || ''}
+
+ )
+ }
+ },
+ { title: "准入品类", dataIndex: "categoryName", width: 120 }
];
const rightColumns = [
@@ -141,8 +151,8 @@ const SupplierSelectModal: React.FC = ({
>
)
},
- { title: "供应商名称", dataIndex: "supplierName" },
- { title: "准入品类", dataIndex: "categoryName" }
+ { title: "供应商名称", dataIndex: "supplierName", width: 200 },
+ { title: "准入品类", dataIndex: "categoryName", width: 120 }
];
return (
@@ -161,13 +171,7 @@ const SupplierSelectModal: React.FC = ({
-
-
-
+
diff --git a/src/pages/supplier/supplierExit/supplierExitManage/components/ViewBlacklistModal.tsx b/src/pages/supplier/supplierExit/supplierExitManage/components/ViewBlacklistModal.tsx
index c949dda..38affe7 100644
--- a/src/pages/supplier/supplierExit/supplierExitManage/components/ViewBlacklistModal.tsx
+++ b/src/pages/supplier/supplierExit/supplierExitManage/components/ViewBlacklistModal.tsx
@@ -4,8 +4,9 @@ import type { ColumnsType } from 'antd/es/table';
//umi 相关
import { connect } from 'umi';
//接口
-import { coscoSupplierexit } from "../services"; // 假设的接口
+import { coscoSupplierexit } from "../services";
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
+
interface Supplier {
id: string; // 作为 rowKey 用于唯一标识
supplierName: string; // 供应商名称