From b2109fdd90aca5238934d7117350c466ec5e417a 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, 24 Jul 2025 11:56:57 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=B1=BB=E5=9E=8B=20?=
=?UTF-8?q?=E5=AD=97=E5=85=B8=E5=9B=9E=E6=98=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../supplier/backend/supplierNews/index.tsx | 15 ++++++++---
.../components/SupplierAddModal.tsx | 24 ++++++++++++-----
.../components/SupplierListModal.tsx | 16 +++++++++--
.../SupplierChangeReviewManage/index.tsx | 14 +++++++++-
.../SupplierRegisterAgent/index.tsx | 15 ++++++++++-
.../groupQualifiedSupplierQuery/index.tsx | 19 ++++++++++---
.../mySupplierInquiry/index.tsx | 18 +++++++++++--
.../registrationQuery/index.tsx | 27 ++++++++++++++-----
src/pages/supplier/supplierMessage/index.tsx | 11 ++++++--
9 files changed, 131 insertions(+), 28 deletions(-)
diff --git a/src/pages/supplier/backend/supplierNews/index.tsx b/src/pages/supplier/backend/supplierNews/index.tsx
index cdf1de6..60290bf 100644
--- a/src/pages/supplier/backend/supplierNews/index.tsx
+++ b/src/pages/supplier/backend/supplierNews/index.tsx
@@ -80,13 +80,14 @@ const supplierNews: React.FC = () => {
dataIndex: 'content',
key: 'content',
ellipsis: true,
-
+
},
{
title: '业务类型',
- dataIndex: 'typeCn',
- key: 'typeCn',
+ dataIndex: 'type',
+ key: 'type',
width: 160,
+ render: (code: string) => typeMap[code] || code
},
{
title: '发送时间',
@@ -95,11 +96,17 @@ const supplierNews: React.FC = () => {
width: 200,
},
];
+ const [typeMap, setTypeMap] = useState<{ [code: string]: string }>({});
//初始化
useEffect(() => {
getDictList('message_type').then((res: any) => {
const { code, data } = res;
if (code == 200) {
+ const map: { [code: string]: string } = {};
+ res.data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setTypeMap(map);
setCategoryOptions(data)
}
})
@@ -167,7 +174,7 @@ const supplierNews: React.FC = () => {
className="custom-table"
columns={columns}
dataSource={data}
- pagination={{...tableProps.pagination, total: pagination.total }}
+ pagination={{ ...tableProps.pagination, total: pagination.total }}
loading={loading}
onChange={(pagination) => getList({ pageNo: pagination.current!, pageSize: pagination.pageSize!, content: '', type: '' })}
style={{ flex: 1, minHeight: 0 }}
diff --git a/src/pages/supplier/category/SupplierEntryManage/components/SupplierAddModal.tsx b/src/pages/supplier/category/SupplierEntryManage/components/SupplierAddModal.tsx
index e99d3c1..92680f3 100644
--- a/src/pages/supplier/category/SupplierEntryManage/components/SupplierAddModal.tsx
+++ b/src/pages/supplier/category/SupplierEntryManage/components/SupplierAddModal.tsx
@@ -4,6 +4,7 @@ import type { ColumnsType } from 'antd/es/table';
import type { UploadFile } from 'antd/es/upload/interface';
import { UploadOutlined } from '@ant-design/icons';
//接口
+import { getDictList } from '@/servers/api/dicts'
import { getSupplierPage, detail, apply, uploadFile } from "../services";
//统一列表分页
import tableProps from '@/utils/tableProps'
@@ -92,9 +93,20 @@ const SupplierAddModal: React.FC<{
if (res.code === 200 && res.data) setCategoryInfo(res.data);
fetchSuppliers(pagination.current, pagination.pageSize, res.data.suppliers || []);
};
+ const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
useEffect(() => {
if (visible) {
+ getDictList('enterprise_type').then((res: any) => {
+ const { code, data } = res;
+ if (code == 200) {
+ const map: { [code: string]: string } = {};
+ data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setEnterpriseTypeMap(map);
+ }
+ })
fetchCategoryInfo();
}
// eslint-disable-next-line
@@ -129,17 +141,17 @@ const SupplierAddModal: React.FC<{
return
}
const values = await form.validateFields();
- if(values.approveType === 'offline') {
+ if (values.approveType === 'offline') {
if (values.attachments.length === 0) {
message.warning('请上传附件');
return
}
- } else if(!values.approveType) {
+ } else if (!values.approveType) {
message.warning('请选择签报');
return
}
//
- if(values.attachments && values.attachments.length > 0) {
+ if (values.attachments && values.attachments.length > 0) {
values.coscoCategoryLibrarAttachments = {
...values.attachments[0].response,
fileUrl: values.attachments[0].response.url,
@@ -150,7 +162,7 @@ const SupplierAddModal: React.FC<{
setSubmitting(true);
try {
apply({ categoryLibraryId: storeId, supplierIds: selectedIds, ...values }).then((res) => {
- if(res.code == 200) {
+ if (res.code == 200) {
message.success('操作成功');
setSelectedIds([]);
onSuccess && onSuccess();
@@ -207,7 +219,7 @@ const SupplierAddModal: React.FC<{
render: (ext: any, record: any) => ({`${record.supplierCategory === 'dvs' ? '境内企业' : '境外企业'}`})
},
{ title: '统一社会信用代码', dataIndex: 'unifiedCode', align: 'center', ellipsis: true },
- { title: '企业类型', dataIndex: 'categoryName', align: 'center', ellipsis: true },
+ { title: '企业类型', dataIndex: 'enterpriseType', align: 'center', ellipsis: true, render: (code: string) => enterpriseTypeMap[code] || code },
{
title: '操作',
@@ -238,7 +250,7 @@ const SupplierAddModal: React.FC<{
visible={visible}
onCancel={onCancel}
footer={[
- ,
+ ,
,
]}
width={820}
diff --git a/src/pages/supplier/category/SupplierEntryManage/components/SupplierListModal.tsx b/src/pages/supplier/category/SupplierEntryManage/components/SupplierListModal.tsx
index 7cf84c7..d1608b5 100644
--- a/src/pages/supplier/category/SupplierEntryManage/components/SupplierListModal.tsx
+++ b/src/pages/supplier/category/SupplierEntryManage/components/SupplierListModal.tsx
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
-import { Modal, Table, Button, Descriptions, Spin } from 'antd';
+import { Modal, Table, Button, Descriptions, Spin } from 'antd';
+import { getDictList } from '@/servers/api/dicts'
import { getSupplierPage, detail } from "../services";
import type { ColumnsType } from 'antd/es/table';
// 供应商类型
@@ -63,9 +64,20 @@ const SupplierListModal: React.FC<{
const res = await detail({ id: storeId });
if (res.code === 200 && res.data) setCategoryInfo(res.data);
};
+ const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
useEffect(() => {
if (visible) {
+ getDictList('enterprise_type').then((res: any) => {
+ const { code, data } = res;
+ if (code == 200) {
+ const map: { [code: string]: string } = {};
+ data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setEnterpriseTypeMap(map);
+ }
+ })
fetchSuppliers(pagination.current, pagination.pageSize);
fetchCategoryInfo();
}
@@ -83,7 +95,7 @@ const SupplierListModal: React.FC<{
{ title: '供应商名称', dataIndex: 'name', align: 'center' },
{ title: '境内/境外', dataIndex: 'region', align: 'center' },
{ title: '统一社会信用代码', dataIndex: 'creditCode', align: 'center' },
- { title: '企业类型', dataIndex: 'enterpriseTypeCn', align: 'center' },
+ { title: '企业类型', dataIndex: 'enterpriseType', align: 'center', render: (code: string) => enterpriseTypeMap[code] || code },
];
return (
diff --git a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx
index 4f707f2..327540b 100644
--- a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx
+++ b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx
@@ -77,8 +77,19 @@ const SupplierChangeReviewManage: React.FC = ({ dispatch }) => {
setLoading(false);
}
};
+ const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
// 初始化
useEffect(() => {
+ getDictList('enterprise_type').then((res: any) => {
+ const { code, data } = res;
+ if (code == 200) {
+ const map: { [code: string]: string } = {};
+ data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setEnterpriseTypeMap(map);
+ }
+ })
getDictList('approve_type').then((res) => {
if (res.code == 200) {
setEnterpriseType(res.data)
@@ -146,9 +157,10 @@ const SupplierChangeReviewManage: React.FC = ({ dispatch }) => {
},
{
title: '企业类型',
- dataIndex: 'enterpriseTypeCn',
+ dataIndex: 'enterpriseType',
align: 'center',
width: 160,
+ render: (code: string) => enterpriseTypeMap[code] || code
},
{
title: '准入时间',
diff --git a/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx b/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx
index cab59e2..1847313 100644
--- a/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx
+++ b/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx
@@ -6,6 +6,7 @@ import type { ColumnsType } from 'antd/es/table';
import SupplierViewModal from './components/SupplierViewModal';
import SupplierExitModal from './components/SupplierExitModal';
//接口
+import { getDictList } from '@/servers/api/dicts'
import { getPageAgent } from './services';
//统一列表分页
import tableProps from '@/utils/tableProps'
@@ -68,9 +69,20 @@ const SupplierRegisterAgent: React.FC = () => {
setLoading(false);
}
};
+ const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
// 首次&依赖刷新
useEffect(() => {
+ getDictList('enterprise_type').then((res: any) => {
+ const { code, data } = res;
+ if (code == 200) {
+ const map: { [code: string]: string } = {};
+ data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setEnterpriseTypeMap(map);
+ }
+ })
fetchData(1, pagination.pageSize);
}, [tabKey]);
@@ -119,10 +131,11 @@ const SupplierRegisterAgent: React.FC = () => {
},
{
title: '企业类型',
- dataIndex: 'enterpriseTypeCn',
+ dataIndex: 'enterpriseType',
align: 'center',
width: 140,
ellipsis: true,
+ render: (code: string) => enterpriseTypeMap[code] || code
},
{
title: '创建单位',
diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx
index 404fae2..d3ac2f0 100644
--- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx
+++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx
@@ -5,6 +5,7 @@ import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
import { connect } from 'umi';
//接口
import { treeData, getPageQualified } from './services';
+import { getDictList } from '@/servers/api/dicts'
//组件
import tableProps from '@/utils/tableProps';
import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect'
@@ -127,9 +128,19 @@ const groupQualifiedSupplierQuery: React.FC = ({ dispatch }) => {
setLoading(false);
}
};
-
+ const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
// 初始化
useEffect(() => {
+ getDictList('enterprise_type').then((res: any) => {
+ const { code, data } = res;
+ if (code == 200) {
+ const map: { [code: string]: string } = {};
+ data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setEnterpriseTypeMap(map);
+ }
+ })
setTreeLoading(true);
treeData({}).then((res) => {
const { code, data } = res;
@@ -195,10 +206,12 @@ const groupQualifiedSupplierQuery: React.FC = ({ dispatch }) => {
},
{
title: '企业类型',
- dataIndex: 'enterpriseTypeCn',
- key: 'enterpriseTypeCn',
+ dataIndex: 'enterpriseType',
+ key: 'enterpriseType',
align: 'center',
+ width: 160,
ellipsis: true,
+ render: (code: string) => enterpriseTypeMap[code] || code
},
{
title: '注册时间',
diff --git a/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx b/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx
index f9bc130..257edf9 100644
--- a/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx
+++ b/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx
@@ -15,6 +15,7 @@ import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect'
//本地服务/接口
import { getPageMy } from './services';
import { downloadFile } from '@/utils/download';
+import { getDictList } from '@/servers/api/dicts'
//统一列表分页
import tableProps from '@/utils/tableProps'
@@ -77,8 +78,20 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => {
setLoading(false);
}
};
+ const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
+
// 初始化
useEffect(() => {
+ getDictList('enterprise_type').then((res: any) => {
+ const { code, data } = res;
+ if (code == 200) {
+ const map: { [code: string]: string } = {};
+ data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setEnterpriseTypeMap(map);
+ }
+ })
getList();
}, []);
@@ -123,10 +136,11 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => {
},
{
title: '企业类型',
- dataIndex: 'enterpriseTypeCn',
- key: 'enterpriseTypeCn',
+ dataIndex: 'enterpriseType',
+ key: 'enterpriseType',
align: 'center',
width: 120,
+ render: (code: string) => enterpriseTypeMap[code] || code
},
{
title: '准入品类',
diff --git a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx
index 5818480..7f9a922 100644
--- a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx
+++ b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
//第三方UI库/组件
-import { Form, Button, Table, Select, Input, Space, Tooltip, message } from 'antd';
+import { Form, Button, Table, Input, Space, Tooltip } from 'antd';
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
//类型定义
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
@@ -13,6 +13,7 @@ import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect'
import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect'
//本地服务/接口
import { getRegisterPage } from './services';
+import { getDictList } from '@/servers/api/dicts'
//统一列表分页
import tableProps from '@/utils/tableProps'
@@ -80,8 +81,20 @@ const RegistrationQuery: React.FC = ({ dispatch }) => {
setLoading(false);
}
};
+ const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
+
//初始化
useEffect(() => {
+ getDictList('enterprise_type').then((res: any) => {
+ const { code, data } = res;
+ if (code == 200) {
+ const map: { [code: string]: string } = {};
+ data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setEnterpriseTypeMap(map);
+ }
+ })
//列表
getList();
}, [])
@@ -127,11 +140,11 @@ const RegistrationQuery: React.FC = ({ dispatch }) => {
},
{
title: '企业类型',
- dataIndex: 'enterpriseTypeCn',
- key: 'enterpriseTypeCn',
+ dataIndex: 'enterpriseType',
+ key: 'enterpriseType',
align: 'center',
width: 160,
-
+ render: (code: string) => enterpriseTypeMap[code] || code
},
{
title: '注册时间',
@@ -160,14 +173,14 @@ const RegistrationQuery: React.FC = ({ dispatch }) => {
render: (record) => (
{
+ onClick={() => {
dispatch({
type: 'globalModal/show',
payload: {
id: record.id,
},
});
- }}
+ }}
>查看
{/* { setCurrentRecord(record.id); setDetailVisible(true); }}
@@ -208,7 +221,7 @@ const RegistrationQuery: React.FC = ({ dispatch }) => {
columns={columns}
dataSource={data}
loading={loading}
- pagination={{...tableProps.pagination, total: pagination.total }}
+ pagination={{ ...tableProps.pagination, total: pagination.total }}
onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)}
style={{ flex: 1, minHeight: 0 }}
scroll={{ y: 'calc(100vh - 350px)' }}
diff --git a/src/pages/supplier/supplierMessage/index.tsx b/src/pages/supplier/supplierMessage/index.tsx
index 42e1ad2..35779fb 100644
--- a/src/pages/supplier/supplierMessage/index.tsx
+++ b/src/pages/supplier/supplierMessage/index.tsx
@@ -27,6 +27,7 @@ const SupplierMessage: React.FC = () => {
const [viewVisible, setViewVisible] = useState(false); // 弹窗显隐
//下拉数据
const [categoryOptions, setCategoryOptions] = useState([]);
+ const [typeMap, setTypeMap] = useState<{ [code: string]: string }>({});
// 获取数据
const getList = async (pageNo = 1, pageSize = 10) => {
@@ -62,6 +63,11 @@ const SupplierMessage: React.FC = () => {
getDictList('message_type').then((res: any) => {
const { code, data } = res;
if (code == 200) {
+ const map: { [code: string]: string } = {};
+ res.data.forEach((item: { code: string, dicName: string }) => {
+ map[item.code] = item.dicName;
+ });
+ setTypeMap(map);
setCategoryOptions(data)
}
})
@@ -87,9 +93,10 @@ const SupplierMessage: React.FC = () => {
},
{
title: '业务类型',
- dataIndex: 'typeCn',
- key: 'typeCn',
+ dataIndex: 'type',
+ key: 'type',
align: 'center',
+ render: (code: string) => typeMap[code] || code
},
{
title: '接收时间',