From 49f302194f6fa099e83d97e630003f805e23efd4 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: Mon, 14 Jul 2025 08:43:22 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9=E5=87=86=E5=85=A5?=
=?UTF-8?q?=E8=AF=84=E5=AE=A1=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=EF=BC=8C?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0token=20=E9=AA=8C=E8=AF=81=E7=99=BD=E5=90=8D?=
=?UTF-8?q?=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app.ts | 10 +-
src/layouts/Header.tsx | 17 +-
.../components/CreateModal.tsx | 14 +-
.../components/CreateModal.tsx | 18 +-
.../admissionReviewManagement/services.ts | 2 +-
.../components/SupplierAddModal.tsx | 213 ------------------
.../components/ViewModal.tsx | 4 +-
.../components/CategoryAddModal.tsx | 167 --------------
.../components/SupplierAddModal.tsx | 161 -------------
.../components/SupplierListModal.tsx | 105 ---------
.../components/SupplierAddModal.tsx | 213 ------------------
.../components/ViewModal.tsx | 4 +-
.../SupplierChangeManage/index.tsx | 32 +--
.../SupplierChangeReviewManage/index.tsx | 2 +-
.../SupplierRegisterAgent/index.tsx | 4 +-
.../components/CreateBlacklistModal.tsx | 5 -
16 files changed, 65 insertions(+), 906 deletions(-)
delete mode 100644 src/pages/supplier/category/CategoryLibraryReview/components/SupplierAddModal.tsx
delete mode 100644 src/pages/supplier/category/CategoryManage/components/CategoryAddModal.tsx
delete mode 100644 src/pages/supplier/category/CategoryManage/components/SupplierAddModal.tsx
delete mode 100644 src/pages/supplier/category/CategoryManage/components/SupplierListModal.tsx
delete mode 100644 src/pages/supplier/category/SupplierEntryReview/components/SupplierAddModal.tsx
diff --git a/src/app.ts b/src/app.ts
index 2727fc2..cdfe58c 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -1,10 +1,10 @@
import { history } from 'umi';
export function onRouteChange({ location }: any) {
-// const token = localStorage.getItem('token');
-// const whiteList = ['/login', '/user/register', '/403', '/404'];
-// if (!token && !whiteList.includes(location.pathname)) {
-// history.replace('/login');
-// }
+ const token = sessionStorage.getItem('token');
+ const whiteList = ['/login', '/user/register', '/403', '/404'];
+ if (!token && !whiteList.includes(location.pathname)) {
+ history.replace('/login');
+ }
}
diff --git a/src/layouts/Header.tsx b/src/layouts/Header.tsx
index 3a5b84e..477c246 100644
--- a/src/layouts/Header.tsx
+++ b/src/layouts/Header.tsx
@@ -1,11 +1,26 @@
-import React from 'react';
+import React, { useEffect, useState } from 'react';
//导入logo图片
import LogoImg from '@/assets/img/logo.png';
//导入菜单组件
import Language from './Language';
import User from './User';
import './layout.less';
+
+
const HeaderComponent: React.FC = () => {
+ // 用 state 保存 userId
+ const [userId, setUserId] = useState(() => sessionStorage.getItem('userId'));
+
+ useEffect(() => {
+ // 定义一个方法用于手动刷新 userId
+ const refreshUserId = () => setUserId(sessionStorage.getItem('userId'));
+ // 登录后你可以手动调用 refreshUserId
+ // 或者监听页面 storage 事件(多窗口/多tab同步)
+ window.addEventListener('storage', refreshUserId);
+ // 页面内操作,比如登录成功后,也可以在登录回调里调用 setUserId
+ return () => window.removeEventListener('storage', refreshUserId);
+ }, []);
+
return (

diff --git a/src/pages/supplier/admission/SupplierCategoryEntry/components/CreateModal.tsx b/src/pages/supplier/admission/SupplierCategoryEntry/components/CreateModal.tsx
index 1d49aa7..eadf8e2 100644
--- a/src/pages/supplier/admission/SupplierCategoryEntry/components/CreateModal.tsx
+++ b/src/pages/supplier/admission/SupplierCategoryEntry/components/CreateModal.tsx
@@ -102,12 +102,14 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
};
//初始化
useEffect(() => {
- categoryTree().then((res) => {
- const { code, data } = res;
- if (code == 200) {
- setCategoriesTreeData(data)
- }
- })
+ if(visible) {
+ categoryTree().then((res) => {
+ const { code, data } = res;
+ if (code == 200) {
+ setCategoriesTreeData(data)
+ }
+ })
+ }
}, [visible, form]);
return (
void; }> = ({ vi
};
//初始化
useEffect(() => {
- categoryTree().then((res) => {
- const { code, data } = res;
- if (code == 200) {
- setCategoriesTreeData(data)
- }
-
- })
- form.setFieldsValue({ method: 'online' });
+ if(visible) {
+ categoryTree().then((res) => {
+ const { code, data } = res;
+ if (code == 200) {
+ setCategoriesTreeData(data)
+ }
+
+ })
+ form.setFieldsValue({ method: 'online' });
+ }
}, [visible, form]);
return (
request.post('/coscoAccessWork/getPage', { data});
+export const getPage = (data: getPageData) => request.post('/coscoAccessWork/getReviewPage', { data});
/**
* 评审修改时用的详情页
*/
diff --git a/src/pages/supplier/category/CategoryLibraryReview/components/SupplierAddModal.tsx b/src/pages/supplier/category/CategoryLibraryReview/components/SupplierAddModal.tsx
deleted file mode 100644
index 32be047..0000000
--- a/src/pages/supplier/category/CategoryLibraryReview/components/SupplierAddModal.tsx
+++ /dev/null
@@ -1,213 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { Modal, Table, Button, Checkbox, Popconfirm, message, Descriptions, Spin } from 'antd';
-import { getSupplierPage, detail, apply } from "../services";
-import type { ColumnsType } from 'antd/es/table';
-// 供应商类型
-interface Supplier {
- id: string;
- name: string;
- region?: string;
- creditCode?: string;
- type?: string;
- inStore?: boolean; // 已入库
-}
-
-// 基本信息类型
-interface CategoryInfo {
- name?: string;
- validDate?: string;
- manager?: string;
- structure?: string;
-}
-
-const SupplierAddModal: React.FC<{
- visible: boolean;
- storeId: string;
- onCancel: () => void;
- onSuccess: () => void;
-}> = ({ visible, storeId, onCancel, onSuccess }) => {
- // 供应商数据
- const [suppliers, setSuppliers] = useState([]);
- // 已勾选的供应商 id
- const [selectedIds, setSelectedIds] = useState([]);
- // 品类库基本信息
- const [categoryInfo, setCategoryInfo] = useState({});
- // loading
- const [loading, setLoading] = useState(false);
-
- // 分页
- const [pagination, setPagination] = useState({
- current: 1,
- pageSize: 10,
- total: 0,
- });
-
- // 拉数据
- const fetchSuppliers = async (page = 1, pageSize = 10) => {
- setLoading(true);
- const res = await getSupplierPage({ basePageRequest: { pageNo: page, pageSize } });
- setLoading(false);
- if (res.code === 200 && res.data) {
- setSuppliers((res.data.records || []).map((s: any) => ({
- ...s,
- inStore: s.inStore ?? false, // 若接口无此字段,可自己加逻辑判断
- })));
- setPagination(p => ({
- ...p,
- total: res.data.total || 0,
- current: res.data.current || page,
- pageSize: res.data.size || pageSize,
- }));
- }
- };
-
- // 拉取基本信息
- const fetchCategoryInfo = async () => {
- if (!storeId) return;
- const res = await detail({ id: storeId });
- if (res.code === 200 && res.data) setCategoryInfo(res.data);
- };
-
- useEffect(() => {
- if (visible) {
- fetchSuppliers(pagination.current, pagination.pageSize);
- fetchCategoryInfo();
- }
- // eslint-disable-next-line
- }, [visible, storeId]);
-
- // 分页变更
- const handleTableChange = (pag: any) => {
- setPagination({ ...pagination, current: pag.current, pageSize: pag.pageSize });
- fetchSuppliers(pag.current, pag.pageSize);
- };
-
- // 选择供应商 checkbox 变化
- const handleSelect = (checked: boolean, id: string) => {
- setSelectedIds(checked
- ? [...selectedIds, id]
- : selectedIds.filter(i => i !== id)
- );
- };
-
- // “移除”操作
- const handleRemove = (id: string) => {
- setSuppliers(suppliers.map(s =>
- s.id === id ? { ...s, inStore: false } : s
- ));
- message.success('移除成功');
- };
-
- // 确认入库
- const handleOk = () => {
- apply({ categoryLibraryId: storeId ,supplierIds: selectedIds })
- setSelectedIds([]);
- onSuccess && onSuccess();
- };
-
- // 列表列
- const columns: ColumnsType = [
- { 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: 'region', align: 'center' },
- { title: '统一社会信用代码', dataIndex: 'creditCode', align: 'center' },
- { title: '供应商分类', dataIndex: 'type', align: 'center' },
- {
- title: '操作',
- align: 'center',
- render: (text: any, record: Supplier) => {
- if (record.inStore) {
- return (
- <>
- 已入库
- handleRemove(record.id)}
- okText="确认"
- cancelText="取消"
- >
-
-
- >
- );
- }
- return (
- handleSelect(e.target.checked, record.id)}
- >
- 选择
-
- );
- }
- }
- ];
-
- return (
- 确认入库,
- ,
- ]}
- width={820}
- bodyStyle={{ padding: 24 }}
- destroyOnClose
- >
- {/* 基本信息区 */}
-
-
-
- {categoryInfo?.name || '-'}
-
-
- {categoryInfo?.validDate || '-'}
-
-
- {categoryInfo?.manager || '-'}
-
-
- {categoryInfo?.structure || '-'}
-
-
-
- {/* 供应商表格 */}
-
- 选择供应商
-
-
- handleTableChange({ current: page, pageSize }),
- }}
- bordered
- />
-
-
- );
-};
-
-export default SupplierAddModal;
diff --git a/src/pages/supplier/category/CategoryLibraryReview/components/ViewModal.tsx b/src/pages/supplier/category/CategoryLibraryReview/components/ViewModal.tsx
index c2dbb83..ce053d2 100644
--- a/src/pages/supplier/category/CategoryLibraryReview/components/ViewModal.tsx
+++ b/src/pages/supplier/category/CategoryLibraryReview/components/ViewModal.tsx
@@ -20,7 +20,7 @@ interface LockNode extends DataNode {
lockType: string;
children?: LockNode[];
}
-const SupplierAddModal: React.FC<{
+const ViewModal: React.FC<{
visible: boolean;
storeId: string;
onCancel: () => void;
@@ -128,4 +128,4 @@ const SupplierAddModal: React.FC<{
);
};
-export default SupplierAddModal;
+export default ViewModal;
diff --git a/src/pages/supplier/category/CategoryManage/components/CategoryAddModal.tsx b/src/pages/supplier/category/CategoryManage/components/CategoryAddModal.tsx
deleted file mode 100644
index f760ae5..0000000
--- a/src/pages/supplier/category/CategoryManage/components/CategoryAddModal.tsx
+++ /dev/null
@@ -1,167 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import { Modal, Form, Input, DatePicker, Button, Tree, Select, message } from 'antd';
-
-const treeData = [
- {
- title: '货物',
- key: 'goods',
- children: [
- { title: '燃油', key: 'fuel' },
- { title: '润滑油', key: 'oil' },
- { title: '船用物料', key: 'marine' },
- ],
- },
- {
- title: '工程',
- key: 'project',
- children: [
- { title: '土建', key: 'civil' },
- { title: '机电', key: 'me' },
- ],
- },
- {
- title: '服务',
- key: 'service',
- children: [
- { title: '运输', key: 'transport' },
- { title: '维修', key: 'maintenance' },
- ],
- },
-];
-
-const regionOptions = [
- { label: '全球', value: 'global' },
- { label: '新加坡', value: 'singapore' },
- { label: '香港', value: 'hongkong' },
-];
-
-interface Props {
- visible: boolean;
- onCancel: () => void;
- onSuccess?: () => void;
-}
-const CategoryAddModal: React.FC = ({ visible, onCancel, onSuccess }) => {
- const [form] = Form.useForm();
- // 受控 checkedKeys
- const [checkedKeys, setCheckedKeys] = useState([]);
- // 切换“选择品类”时,自动清除“区域选择”
- useEffect(() => {
- if (!visible) {
- setCheckedKeys([]);
- form.resetFields();
- }
- }, [visible]);
- // 只能同一级单选
- const handleTreeCheck = (checkedKeysValue: any, info: any) => {
- console.log(checkedKeysValue);
-
- let checked = Array.isArray(checkedKeysValue) ? checkedKeysValue : checkedKeysValue.checked;
- // 记录每个一级key的选中(只保留同级最后一次点击)
- const map: Record = {};
- checked.forEach(k => {
- const parent = treeData.find(node =>
- node.key === k || node.children?.some(c => c.key === k)
- );
- if (parent) map[parent.key] = k;
- });
- const onlyOneEachLevel = Object.values(map);
- console.log(onlyOneEachLevel,'onlyOneEachLevel');
-
-
- setCheckedKeys(onlyOneEachLevel); // 实时刷新
- form.setFieldsValue({ categoryKeys: onlyOneEachLevel });
- };
-
- // 提交校验
- const handleOk = async () => {
- try {
- await form.validateFields();
- message.success('提交成功(模拟)');
- onSuccess && onSuccess();
- onCancel();
- form.resetFields();
- } catch { }
- };
-
- return (
-
- 品类库名称}
- name="storeName"
- rules={[{ required: true, message: '请输入品类库名称' }]}
- >
-
-
- 有效期至}
- name="validTo"
- rules={[{ required: true, message: '请选择有效期' }]}
- >
-
-
- 负责部门}
- name="ownerDept"
- rules={[{ required: true, message: '请输入品类库负责人' }]}
- >
-
-
- 选择品类 }
- name="categoryKeys"
- required
- rules={[ { required: true, message: '请选择品类' },
- ]}
- >
-
-
- (注:同一级品类不可多选)
-
-
- 区域选择(仅燃油品)}
- name="region"
- rules={[{ required: true, message: '请选择区域' }]}
- required
- >
-
-
-
-
-
-
-
-
- );
-};
-
-export default CategoryAddModal;
diff --git a/src/pages/supplier/category/CategoryManage/components/SupplierAddModal.tsx b/src/pages/supplier/category/CategoryManage/components/SupplierAddModal.tsx
deleted file mode 100644
index cc6feb5..0000000
--- a/src/pages/supplier/category/CategoryManage/components/SupplierAddModal.tsx
+++ /dev/null
@@ -1,161 +0,0 @@
-import React, { useState } from 'react';
-import { Modal, Table, Button, Checkbox, Popconfirm, message, Descriptions } from 'antd';
-
-// 示例供应商数据
-const mockSuppliers = [
- {
- id: 1,
- name: '中山市合创展包装材料有限公司',
- region: '境内',
- creditCode: '910000000000000000',
- type: '中央企业',
- inStore: false, // 还没入库
- },
- {
- id: 2,
- name: '深圳市欧阳华斯电源有限公司',
- region: '境内',
- creditCode: '910000000000000000',
- type: '地方国有企业',
- inStore: true, // 已入库
- },
- {
- id: 3,
- name: '广东振兴塑胶机械有限公司',
- region: '境内',
- creditCode: '910000000000000000',
- type: '民营企业',
- inStore: false, // 还没入库
- },
-];
-
-const SupplierAddModal = ({ visible, onCancel, onOk, categoryInfo }) => {
- // 供应商数据(受控)
- const [suppliers, setSuppliers] = useState(mockSuppliers);
- // 已勾选的供应商 id
- const [selectedIds, setSelectedIds] = useState([]);
-
- // 选择供应商 checkbox 变化
- const handleSelect = (checked, id) => {
- setSelectedIds(checked
- ? [...selectedIds, id]
- : selectedIds.filter(i => i !== id)
- );
- };
-
- // “移除”操作
- const handleRemove = (id) => {
- setSuppliers(suppliers.map(s =>
- s.id === id ? { ...s, inStore: false } : s
- ));
- message.success('移除成功');
- };
-
- // 确认入库
- const handleOk = () => {
- // 这里可调接口,演示只做提示
- message.success(`成功入库供应商ID: ${selectedIds.join(', ')}`);
- setSelectedIds([]);
- onOk && onOk();
- };
-
- // 列表列
- const columns = [
- { title: '序号', dataIndex: 'id', align: 'center', width: 60, render: (t, r, i) => i + 1 },
- { title: '供应商名称', dataIndex: 'name', align: 'center' },
- { title: '境内/境外', dataIndex: 'region', align: 'center' },
- { title: '统一社会信用代码', dataIndex: 'creditCode', align: 'center' },
- { title: '供应商分类', dataIndex: 'type', align: 'center' },
- {
- title: '操作',
- align: 'center',
- render: (text, record) => {
- if (record.inStore) {
- return (
- <>
- 已入库
- handleRemove(record.id)}
- okText="确认"
- cancelText="取消"
- >
-
-
- >
- );
- }
- return (
- handleSelect(e.target.checked, record.id)}
- >
- 选择
-
- );
- }
- }
- ];
-
- return (
- 确认入库,
- ,
- ]}
- width={820}
- bodyStyle={{ padding: 24 }}
- destroyOnClose
- >
- {/* 基本信息区 */}
-
-
-
- {categoryInfo?.name || '燃油'}
-
-
- {categoryInfo?.validDate || '2028-03-31'}
-
-
- {categoryInfo?.manager || '李四'}
-
-
- {categoryInfo?.structure || '货物 燃料'}
-
-
-
-
-
- {/* 供应商表格 */}
-
- 选择供应商
-
-
-
-
- );
-};
-
-export default SupplierAddModal;
diff --git a/src/pages/supplier/category/CategoryManage/components/SupplierListModal.tsx b/src/pages/supplier/category/CategoryManage/components/SupplierListModal.tsx
deleted file mode 100644
index fc5c278..0000000
--- a/src/pages/supplier/category/CategoryManage/components/SupplierListModal.tsx
+++ /dev/null
@@ -1,105 +0,0 @@
-import React, { useState } from 'react';
-import { Modal, Table, Button, Checkbox, Popconfirm, message, Descriptions } from 'antd';
-
-// 示例供应商数据
-const mockSuppliers = [
- {
- id: 1,
- name: '中山市合创展包装材料有限公司',
- region: '境内',
- creditCode: '910000000000000000',
- type: '中央企业',
- },
- {
- id: 2,
- name: '深圳市欧阳华斯电源有限公司',
- region: '境内',
- creditCode: '910000000000000000',
- type: '地方国有企业',
- },
- {
- id: 3,
- name: '广东振兴塑胶机械有限公司',
- region: '境内',
- creditCode: '910000000000000000',
- type: '民营企业',
- },
-];
-
-const SupplierListModal = ({ visible, onCancel, onOk, categoryInfo }) => {
- // 供应商数据(受控)
- const [suppliers, setSuppliers] = useState(mockSuppliers);
-
-
-
- // 列表列
- const columns = [
- { title: '序号', dataIndex: 'id', align: 'center', width: 60, render: (t, r, i) => i + 1 },
- { title: '供应商名称', dataIndex: 'name', align: 'center' },
- { title: '境内/境外', dataIndex: 'region', align: 'center' },
- { title: '统一社会信用代码', dataIndex: 'creditCode', align: 'center' },
- { title: '供应商分类', dataIndex: 'type', align: 'center' },
-
- ];
-
- return (
- 关闭,
- ]}
- width={820}
- bodyStyle={{ padding: 24 }}
- destroyOnClose
- >
- {/* 基本信息区 */}
-
-
-
- {categoryInfo?.name || '燃油'}
-
-
- {categoryInfo?.validDate || '2028-03-31'}
-
-
- {categoryInfo?.manager || '李四'}
-
-
- {categoryInfo?.structure || '货物 燃料'}
-
-
-
-
-
- {/* 供应商表格 */}
-
- 选择供应商
-
-
-
-
- );
-};
-
-export default SupplierListModal;
diff --git a/src/pages/supplier/category/SupplierEntryReview/components/SupplierAddModal.tsx b/src/pages/supplier/category/SupplierEntryReview/components/SupplierAddModal.tsx
deleted file mode 100644
index 32be047..0000000
--- a/src/pages/supplier/category/SupplierEntryReview/components/SupplierAddModal.tsx
+++ /dev/null
@@ -1,213 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { Modal, Table, Button, Checkbox, Popconfirm, message, Descriptions, Spin } from 'antd';
-import { getSupplierPage, detail, apply } from "../services";
-import type { ColumnsType } from 'antd/es/table';
-// 供应商类型
-interface Supplier {
- id: string;
- name: string;
- region?: string;
- creditCode?: string;
- type?: string;
- inStore?: boolean; // 已入库
-}
-
-// 基本信息类型
-interface CategoryInfo {
- name?: string;
- validDate?: string;
- manager?: string;
- structure?: string;
-}
-
-const SupplierAddModal: React.FC<{
- visible: boolean;
- storeId: string;
- onCancel: () => void;
- onSuccess: () => void;
-}> = ({ visible, storeId, onCancel, onSuccess }) => {
- // 供应商数据
- const [suppliers, setSuppliers] = useState([]);
- // 已勾选的供应商 id
- const [selectedIds, setSelectedIds] = useState([]);
- // 品类库基本信息
- const [categoryInfo, setCategoryInfo] = useState({});
- // loading
- const [loading, setLoading] = useState(false);
-
- // 分页
- const [pagination, setPagination] = useState({
- current: 1,
- pageSize: 10,
- total: 0,
- });
-
- // 拉数据
- const fetchSuppliers = async (page = 1, pageSize = 10) => {
- setLoading(true);
- const res = await getSupplierPage({ basePageRequest: { pageNo: page, pageSize } });
- setLoading(false);
- if (res.code === 200 && res.data) {
- setSuppliers((res.data.records || []).map((s: any) => ({
- ...s,
- inStore: s.inStore ?? false, // 若接口无此字段,可自己加逻辑判断
- })));
- setPagination(p => ({
- ...p,
- total: res.data.total || 0,
- current: res.data.current || page,
- pageSize: res.data.size || pageSize,
- }));
- }
- };
-
- // 拉取基本信息
- const fetchCategoryInfo = async () => {
- if (!storeId) return;
- const res = await detail({ id: storeId });
- if (res.code === 200 && res.data) setCategoryInfo(res.data);
- };
-
- useEffect(() => {
- if (visible) {
- fetchSuppliers(pagination.current, pagination.pageSize);
- fetchCategoryInfo();
- }
- // eslint-disable-next-line
- }, [visible, storeId]);
-
- // 分页变更
- const handleTableChange = (pag: any) => {
- setPagination({ ...pagination, current: pag.current, pageSize: pag.pageSize });
- fetchSuppliers(pag.current, pag.pageSize);
- };
-
- // 选择供应商 checkbox 变化
- const handleSelect = (checked: boolean, id: string) => {
- setSelectedIds(checked
- ? [...selectedIds, id]
- : selectedIds.filter(i => i !== id)
- );
- };
-
- // “移除”操作
- const handleRemove = (id: string) => {
- setSuppliers(suppliers.map(s =>
- s.id === id ? { ...s, inStore: false } : s
- ));
- message.success('移除成功');
- };
-
- // 确认入库
- const handleOk = () => {
- apply({ categoryLibraryId: storeId ,supplierIds: selectedIds })
- setSelectedIds([]);
- onSuccess && onSuccess();
- };
-
- // 列表列
- const columns: ColumnsType = [
- { 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: 'region', align: 'center' },
- { title: '统一社会信用代码', dataIndex: 'creditCode', align: 'center' },
- { title: '供应商分类', dataIndex: 'type', align: 'center' },
- {
- title: '操作',
- align: 'center',
- render: (text: any, record: Supplier) => {
- if (record.inStore) {
- return (
- <>
- 已入库
- handleRemove(record.id)}
- okText="确认"
- cancelText="取消"
- >
-
-
- >
- );
- }
- return (
- handleSelect(e.target.checked, record.id)}
- >
- 选择
-
- );
- }
- }
- ];
-
- return (
- 确认入库,
- ,
- ]}
- width={820}
- bodyStyle={{ padding: 24 }}
- destroyOnClose
- >
- {/* 基本信息区 */}
-
-
-
- {categoryInfo?.name || '-'}
-
-
- {categoryInfo?.validDate || '-'}
-
-
- {categoryInfo?.manager || '-'}
-
-
- {categoryInfo?.structure || '-'}
-
-
-
- {/* 供应商表格 */}
-
- 选择供应商
-
-
- handleTableChange({ current: page, pageSize }),
- }}
- bordered
- />
-
-
- );
-};
-
-export default SupplierAddModal;
diff --git a/src/pages/supplier/category/SupplierEntryReview/components/ViewModal.tsx b/src/pages/supplier/category/SupplierEntryReview/components/ViewModal.tsx
index bd88699..0e09e27 100644
--- a/src/pages/supplier/category/SupplierEntryReview/components/ViewModal.tsx
+++ b/src/pages/supplier/category/SupplierEntryReview/components/ViewModal.tsx
@@ -40,7 +40,7 @@ interface columns {
supplierCategory: string;
}
-const SupplierAddModal: React.FC<{
+const ViewModal: React.FC<{
visible: boolean;
storeId: string;
onCancel: () => void;
@@ -148,4 +148,4 @@ const SupplierAddModal: React.FC<{
);
};
-export default SupplierAddModal;
+export default ViewModal;
diff --git a/src/pages/supplier/informationManagement/SupplierChangeManage/index.tsx b/src/pages/supplier/informationManagement/SupplierChangeManage/index.tsx
index ae2431c..760e051 100644
--- a/src/pages/supplier/informationManagement/SupplierChangeManage/index.tsx
+++ b/src/pages/supplier/informationManagement/SupplierChangeManage/index.tsx
@@ -1,22 +1,14 @@
import React, { useEffect, useState } from 'react';
import { Table, Form, Input, Select, Button, DatePicker, Tag, Space, message } from 'antd';
import { SearchOutlined, ReloadOutlined } from '@ant-design/icons';
+// 类型定义
+import type { ColumnsType } from 'antd/es/table';
+
import DetailView from './components/DetailView';
import { list } from './services';
const { RangePicker } = DatePicker;
-const statusColorMap = {
- '未开始': 'default',
- '进行中': 'processing',
- '已结束': 'success',
-};
-
-const resultColorMap = {
- '通过': 'success',
- '驳回': 'error',
-};
-
const regionOptions = [
{ label: '请选择', value: '' },
{ label: '境内', value: '境内' },
@@ -34,9 +26,21 @@ const resultOptions = [
{ label: '驳回', value: '驳回' },
];
+interface Columns {
+ name:string;
+ supplierTypeCn:string;
+ enterpriseTypeCn:string;
+ accessTime:string;
+ changeTime:string;
+ status:string;
+ result:string;
+ id:string;
+
+}
+
const SupplierChangeManage: React.FC = () => {
const [form] = Form.useForm();
- const [data, setData] = useState([]);
+ const [data, setData] = useState([]);
const [loading, setLoading] = useState(false);
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
const [detailVisible, setDetailVisible] = useState(false);
@@ -78,7 +82,7 @@ const SupplierChangeManage: React.FC = () => {
fetchData();
};
- const columns = [
+ const columns: ColumnsType = [
{
title: '序号',
dataIndex: 'index',
@@ -94,7 +98,7 @@ const SupplierChangeManage: React.FC = () => {
},
{
title: '境内/境外',
- dataIndex: 'region',
+ dataIndex: 'supplierTypeCn',
align: 'center',
},
{
diff --git a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx
index 90cc5ab..5107bcb 100644
--- a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx
+++ b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx
@@ -144,7 +144,7 @@ const SupplierChangeReviewManage: React.FC = ({ dispatch }) => {
},
{
title: '境内/境外',
- dataIndex: 'supplierType',
+ dataIndex: 'supplierTypeCn',
align: 'center',
width: 160,
},
diff --git a/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx b/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx
index 1b58395..47b5bd0 100644
--- a/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx
+++ b/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx
@@ -1,6 +1,6 @@
-import React, { useRef, useEffect, useState } from 'react';
+import React, { useEffect, useState } from 'react';
import { Table, Form, Input, Button, Row, Col, DatePicker, Tabs, Space, message } from 'antd';
-import { SearchOutlined, DeleteOutlined, PlusOutlined } from '@ant-design/icons';
+import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table';
//组件
import SupplierViewModal from './components/SupplierViewModal';
diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx
index 44cfcc4..eed520c 100644
--- a/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx
+++ b/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx
@@ -22,11 +22,6 @@ interface CreateBlacklistModalProps {
onCancel: () => void;
}
-const DEPT_OPTIONS = [
- { value: "0", label: "黑名单" },
- { value: "1", label: "灰名单" },
-];
-
const CreateBlacklistModal: React.FC = ({
visible,
onOk,