From 1f2986b5ae6ea3730f3af3bc86ea048cf79b480f 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: Wed, 9 Jul 2025 16:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=8E=E9=9B=86=E5=9B=A2?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/router.config.ts | 6 + src/components/CompanyInfo/index.tsx | 4 +- src/locales/en-US/menu.ts | 1 + src/locales/zh-CN/menu.ts | 1 + .../components/SupplierSelector.tsx | 1 + .../components/SupplierSelector.tsx | 1 + .../SupplierChangeReviewManage/index.tsx | 1 + .../components/SupplierDetailModal.tsx | 32 +- .../components/SupplierViewModal.tsx | 2 +- .../groupQualifiedSupplierQuery/index.tsx | 27 +- .../groupQualifiedSupplierQuery/services.ts | 71 +++-- .../mySupplierInquiry/index.tsx | 2 +- .../personQualifiedSupplierQuery/_mock.ts | 84 +++++ .../components/CategoryAddModal.tsx | 98 ++++++ .../components/SupplierDetailModal.tsx | 171 ++++++++++ .../components/SupplierViewModal.tsx | 21 ++ .../personQualifiedSupplierQuery/index.tsx | 292 ++++++++++++++++++ .../personQualifiedSupplierQuery/services.ts | 62 ++++ .../registrationQuery/index.tsx | 1 + 19 files changed, 826 insertions(+), 52 deletions(-) create mode 100644 src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/_mock.ts create mode 100644 src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/CategoryAddModal.tsx create mode 100644 src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierDetailModal.tsx create mode 100644 src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierViewModal.tsx create mode 100644 src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx create mode 100644 src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/services.ts diff --git a/config/router.config.ts b/config/router.config.ts index 8ea7382..78ba667 100644 --- a/config/router.config.ts +++ b/config/router.config.ts @@ -330,6 +330,12 @@ export default [ icon: 'icon-hezha', component: '@/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index', }, + { + path: '/informationRetrieval/personQualifiedSupplierQuery', + name: 'personQualifiedSupplierQuery', + icon: 'icon-xinxijiansuobeifen', + component: '@/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index', + }, { path: '/informationRetrieval/mySupplierInquiry', name: 'mySupplierInquiry', diff --git a/src/components/CompanyInfo/index.tsx b/src/components/CompanyInfo/index.tsx index 192a531..8628c2f 100644 --- a/src/components/CompanyInfo/index.tsx +++ b/src/components/CompanyInfo/index.tsx @@ -43,7 +43,7 @@ const CompanyInfo: React.FC = (props) => { - ) : ( + ) : subTab ?( <> @@ -64,6 +64,8 @@ const CompanyInfo: React.FC = (props) => { + ):( +
)} diff --git a/src/locales/en-US/menu.ts b/src/locales/en-US/menu.ts index 4e13482..0b4126a 100644 --- a/src/locales/en-US/menu.ts +++ b/src/locales/en-US/menu.ts @@ -54,6 +54,7 @@ export default { 'menu.informationRetrieval': 'Supplier Information Retrieval', 'menu.registrationQuery': 'Registered supplier inquiry', 'menu.groupQualifiedSupplierQuery': 'Group Qualified Supplier Query', + 'menu.personQualifiedSupplierQuery': 'Group Qualified Supplier Query', 'menu.mySupplierInquiry': 'My supplier inquiry', 'menu.admission': 'Supplier Admission', 'menu.admissionManagement': 'Supplier Admission Management', diff --git a/src/locales/zh-CN/menu.ts b/src/locales/zh-CN/menu.ts index cbe33a5..95912d6 100644 --- a/src/locales/zh-CN/menu.ts +++ b/src/locales/zh-CN/menu.ts @@ -55,6 +55,7 @@ export default { 'menu.informationRetrieval': '供应商信息检索', 'menu.registrationQuery': '注册供应商查询', 'menu.groupQualifiedSupplierQuery': '集团合格供应商查询', + 'menu.personQualifiedSupplierQuery': '个人合格供应商查询', 'menu.mySupplierInquiry': '我的供应商查询', 'menu.admission': '供应商准入', 'menu.admissionManagement': '供应商准入管理', diff --git a/src/pages/supplier/admission/SupplierCategoryEntry/components/SupplierSelector.tsx b/src/pages/supplier/admission/SupplierCategoryEntry/components/SupplierSelector.tsx index 3d65d15..456f6a8 100644 --- a/src/pages/supplier/admission/SupplierCategoryEntry/components/SupplierSelector.tsx +++ b/src/pages/supplier/admission/SupplierCategoryEntry/components/SupplierSelector.tsx @@ -63,6 +63,7 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel setRegionOptions([ { label: '境内企业', value: 'dvs' }, { label: '境外企业', value: 'ovs' }, + { label: '个人', value: 'pe' }, ]) const values = form.getFieldsValue(); getTableList(values,1 , 10) diff --git a/src/pages/supplier/admission/admissionManagement/components/SupplierSelector.tsx b/src/pages/supplier/admission/admissionManagement/components/SupplierSelector.tsx index 06d1353..3c6c4b5 100644 --- a/src/pages/supplier/admission/admissionManagement/components/SupplierSelector.tsx +++ b/src/pages/supplier/admission/admissionManagement/components/SupplierSelector.tsx @@ -62,6 +62,7 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel setRegionOptions([ { label: '境内企业', value: 'dvs' }, { label: '境外企业', value: 'ovs' }, + { label: '个人', value: 'pe' }, ]) const values = form.getFieldsValue(); getTableList(values,1 , 10) diff --git a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx index d980ade..9686094 100644 --- a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx +++ b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx @@ -13,6 +13,7 @@ const { RangePicker } = DatePicker; const regionOptions = [ { label: '境内企业', value: 'dvs' }, { label: '境外企业', value: 'ovs' }, + { label: '个人', value: 'pe' }, ]; interface Columns { diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx index f91fffb..95a787e 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx @@ -6,7 +6,7 @@ import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //umi 相关 import { useIntl } from 'umi'; //本地服务/接口 -import { supplierDetail } from '../services'; +import { getCategoryPage } from '../services'; //本地组件 import CategoryAddModal from './CategoryAddModal'; @@ -23,10 +23,10 @@ interface Data { interface SupplierAccessDetailModalProps { visible: boolean; onCancel: () => void; - record?: any; // 你可以定义具体类型 + record?: string; } //主体 -const SupplierAccessDetailModal: React.FC = ({ visible, onCancel, record, }) => { +const SupplierAccessDetailModal: React.FC = ({ visible, onCancel, record }) => { //双语 const intl = useIntl(); //查询表单 @@ -51,15 +51,15 @@ const SupplierAccessDetailModal: React.FC = ({ v getList(); }; //列表方法 - const getList = async (page: number = 1, pageSize: number = 10) => { + const getList = async (pageNo: number = 1, pageSize: number = 10) => { setLoading(true); try { - const { code, data, msg, total } = await supplierDetail({ page, pageSize }); + const { code, data, message } = await getCategoryPage({ pageNo, pageSize, supplierId: record }); if (code === 200) { - setData(data); - setPagination({ current: page, pageSize, total }); + setData(data.records); + setPagination({ current: pageNo, pageSize, total: data.total }); } else { - message.error(msg) + message.error(message) } } finally { setLoading(false); @@ -67,8 +67,10 @@ const SupplierAccessDetailModal: React.FC = ({ v }; //初始化 useEffect(() => { - getList(); - }, []) + if(visible) { + getList(); + } + }, [visible]) // 列表头部数据 const columns:ColumnsType = [ { @@ -92,8 +94,8 @@ const SupplierAccessDetailModal: React.FC = ({ v }, { title: "准入品类", - dataIndex: "category", - key: "category", + dataIndex: "categoryNames", + key: "categoryNames", align: "center", }, { @@ -108,12 +110,6 @@ const SupplierAccessDetailModal: React.FC = ({ v key: "exitTime", align: "center", }, - { - title: "进入灰名单时间", - dataIndex: "grayTime", - key: "grayTime", - align: "center", - }, { title: "进入黑名单时间", dataIndex: "blackTime", diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierViewModal.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierViewModal.tsx index 0bff06d..dba9719 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierViewModal.tsx +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierViewModal.tsx @@ -13,7 +13,7 @@ interface SupplierViewModalProps { const SupplierViewModal: React.FC = ({ visible, onCancel, record }) => { return ( - + ); }; diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx index 34fc2a7..d1e4265 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx @@ -53,7 +53,10 @@ const groupQualifiedSupplierQuery: React.FC = () => { const [storeOptions, setStoreOptions] = useState([]); // 导出 const handleExport = () => { - message.success('导出成功(此处为前端示例,实际应调接口)'); + window.open( + `${SERVER_BASE}/coscoSupplierBase/getPageQualifiedExport`, + '_blank', + ); }; // 查询 const handleSearch = () => { @@ -149,44 +152,50 @@ const groupQualifiedSupplierQuery: React.FC = () => { dataIndex: 'name', key: 'name', align: 'center', + ellipsis: true, }, { title: '统一社会信用代码/税号', - dataIndex: 'code', - key: 'code', + dataIndex: 'socialCreditCode', + key: 'socialCreditCode', align: 'center', + ellipsis: true, }, { title: '境内/境外', - dataIndex: 'region', - key: 'region', + dataIndex: 'supplierTypeCn', + key: 'supplierTypeCn', align: 'center', + ellipsis: true, }, { title: '企业类型', dataIndex: 'type', key: 'type', align: 'center', + ellipsis: true, }, { title: '注册时间', - dataIndex: 'regTime', - key: 'regTime', + dataIndex: 'createTime', + key: 'createTime', align: 'center', + ellipsis: true, }, { title: '操作', key: 'option', align: 'center', + width: 140, render: (record: any) => ( { setCurrentRecord(record); setViewVisible(true); }} + onClick={() => { setCurrentRecord(record.id); setViewVisible(true); }} >查看 { setCurrentRecord(record); setDetailVisible(true); }} + onClick={() => { setCurrentRecord(record.id); setDetailVisible(true); }} >准入明细 ), diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/services.ts b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/services.ts index 5fcdd14..c386003 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/services.ts +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/services.ts @@ -11,30 +11,57 @@ interface getPageQualified { export const getPageQualified = (data: getPageQualified) => request.post('/coscoSupplierBase/getPageQualified', { data }); -export interface ListParams { - page: number; + + + +interface getCategoryPage { + pageNo: number; pageSize: number; - treeId?: string; - tmpToken?: string; -} -export async function list(params:ListParams) { - return request('/api/system/library', { - method: 'GET', - params - }); -} -export interface supplierDetailParams { - page: number; - pageSize: number; - captcha?: string; - tmpToken?: string; -} -export async function supplierDetail(params:supplierDetailParams) { - return request(`/api/system/supplierDetail`, { - method: 'GET', - params - }); + supplierId?: string; } +export const getCategoryPage = (data: getCategoryPage) => request.post('/coscoSupplierBase/getCategoryPage', { data }); + + + + + + + + + + + + + + + + + + +// export interface ListParams { +// page: number; +// pageSize: number; +// treeId?: string; +// tmpToken?: string; +// } +// export async function list(params:ListParams) { +// return request('/api/system/library', { +// method: 'GET', +// params +// }); +// } +// export interface supplierDetailParams { +// page: number; +// pageSize: number; +// captcha?: string; +// tmpToken?: string; +// } +// export async function supplierDetail(params:supplierDetailParams) { +// return request(`/system/supplierDetail`, { +// method: 'GET', +// params +// }); +// } export async function treeData() { return request('/api/system/treeData', { method: 'GET' diff --git a/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx b/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx index 44f1f0f..f114ae9 100644 --- a/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx +++ b/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx @@ -49,7 +49,6 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => { const [storeOptions, setStoreOptions] = useState([]); // 导出 const handleExport = async () => { - // const res = await getPageMyExport(); window.open( `${SERVER_BASE}/coscoSupplierBase/getPageMyExport`, '_blank', @@ -88,6 +87,7 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => { setRegionOptions([ { label: '境内企业', value: 'dvs' }, { label: '境外企业', value: 'ovs' }, + { label: '个人', value: 'pe' }, ]) // 准入状态下拉 diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/_mock.ts b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/_mock.ts new file mode 100644 index 0000000..0903604 --- /dev/null +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/_mock.ts @@ -0,0 +1,84 @@ +import { Request, Response } from 'express'; +export default { + + 'GET /api/system/list': (req: Request, res: Response) => { + res.json({ + code: 200, + data: [ + + ], + total: 2, + msg: '操作成功' + }); + }, + 'GET /api/system/treeData': (req: Request, res: Response) => { + res.json({ + code: 200, + data: [ { + title: '中国远洋海运集团集团总部', + key: 'head', + children: [ + { + title: '集采', + key: 'collection', + children: [ + { title: '镇江分公司', key: 'zhenjiang' }, + { title: '浦东分公司', key: 'pudong' }, + ], + }, + ], + },], + total: 2, + msg: '操作成功' + }); + }, + + 'GET /api/system/regionOptions': (req: Request, res: Response) => { + res.json({ + code: 200, + data: [ + { label: '境内', value: '境内' }, + { label: '境外', value: '境外' }, + ], + total: 2, + msg: '操作成功' + }); + }, + + 'GET /api/system/categoryOptions': (req: Request, res: Response) => { + res.json({ + code: 200, + data: [ + { label: '原材料', value: '原材料' }, + { label: '配件', value: '配件' }, + { label: '燃油', value: '燃油' }, + ], + total: 2, + msg: '操作成功' + }); + }, + 'GET /api/system/storeOptions': (req: Request, res: Response) => { + res.json({ + code: 200, + data: [ + { label: '库1', value: '库1' }, + { label: '库2', value: '库2' }, + ], + total: 2, + msg: '操作成功' + }); + }, + +'GET /api/system/supplierDetail': (req: Request, res: Response) => { + res.json({ code: 200, + data: [ + { id: 1, unit: "中国远洋海运集团", category: "燃油", accessTime: "2025-01-05", exitTime: "2025-01-05", grayTime: "2024-01-01~2025-01-02", blackTime: "" }, + { id: 2, unit: "中国远洋海运集团", category: "配件", accessTime: "2025-01-05", exitTime: "", grayTime: "", blackTime: "" }, + { id: 3, unit: "中远海运(天津)有限公司", category: "天然气", accessTime: "2025-03-05", exitTime: "", grayTime: "", blackTime: "" }, + { id: 4, unit: "中远海运(青岛)有限公司", category: "天然气", accessTime: "2025-03-09", exitTime: "", grayTime: "", blackTime: "" }, + ], + total: 10, + msg: '操作成功' }); + }, + +}; diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/CategoryAddModal.tsx b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/CategoryAddModal.tsx new file mode 100644 index 0000000..109373c --- /dev/null +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/CategoryAddModal.tsx @@ -0,0 +1,98 @@ +import React, { useState, useEffect } from 'react'; +import { Modal, TreeSelect, Button, message } from 'antd'; +//本地服务/接口 +import { treeData } from '../services'; + + +interface Props { + visible: boolean; + onCancel: () => void; +} + +const CategoryAddModal: React.FC = ({ visible, onCancel }) => { + const [value, setValue] = useState([]); + // 树数据 + const [dataTree, setDataTree] = useState([]); + + const [submitting, setSubmitting] = useState(false); + + useEffect(() => { + if (!visible) setValue([]); + //tree数据 + treeData().then((res) => { + const { code, data } = res; + if (code == 200) { + setDataTree(data) + } + }) + }, [visible]); + + // 提交方法 + const handleOk = async () => { + if (value.length === 0) { + message.warning('请选择品类'); + return; + } + setSubmitting(true); + try { + // TODO: 替换为你自己的接口调用 + // const res = await addCategory({ categoryIds: value }); + // 假设接口成功 + // if (res.code === 200) { + // message.success('新增品类成功'); + // onCancel(); + // } else { + // message.error(res.msg || '操作失败'); + // } + // 示例(去掉上面的注释用你自己的接口) + setTimeout(() => { + message.success('新增品类成功'); + setSubmitting(false); + onCancel(); + }, 800); + } catch (e) { + message.error('提交失败'); + setSubmitting(false); + } + }; + + return ( + + + + + } + width={600} + destroyOnClose + bodyStyle={{ minHeight: 300 }} + > + + (node.title as string).toLowerCase().includes(input.toLowerCase()) + } + onChange={setValue} + dropdownStyle={{ maxHeight: 350, overflow: 'auto' }} + /> + + ); +}; + +export default CategoryAddModal; diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierDetailModal.tsx b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierDetailModal.tsx new file mode 100644 index 0000000..7ff9dcf --- /dev/null +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierDetailModal.tsx @@ -0,0 +1,171 @@ +import React, { useState, useEffect } from "react"; +//第三方UI库/组件 +import { Modal, Form, Input, Button, Table, message, Tooltip } from "antd"; +//类型定义 +import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; +//umi 相关 +import { useIntl } from 'umi'; +//本地服务/接口 +import { getCategoryPage } from '../services'; +//本地组件 +import CategoryAddModal from './CategoryAddModal'; + +interface Data { + id: number; + unit: string; + category: string; + accessTime: string; + exitTime?: string; + grayTime?: string; + blackTime?: string; +} +//主体接口 +interface SupplierAccessDetailModalProps { + visible: boolean; + onCancel: () => void; + record?: string; +} +//主体 +const SupplierAccessDetailModal: React.FC = ({ visible, onCancel, record }) => { + //双语 + const intl = useIntl(); + //查询表单 + const [form] = Form.useForm(); + //列表渲染数据 + const [data, setData] = useState([]); + //列表加载 + const [loading, setLoading] = useState(false); + //列表分页 + const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0, }); + //品类弹窗状态 + const [addModalVisible, setAddModalVisible] = useState(false); + // 搜索 + const handleSearch = () => { + setPagination({ ...pagination, current: 1 }); + getList(); + }; + // 重置 + const handleReset = () => { + form.resetFields(); + setPagination({ ...pagination, current: 1 }); + getList(); + }; + //列表方法 + const getList = async (pageNo: number = 1, pageSize: number = 10) => { + setLoading(true); + try { + const { code, data, message } = await getCategoryPage({ pageNo, pageSize, supplierId: record }); + if (code === 200) { + setData(data.records); + setPagination({ current: pageNo, pageSize, total: data.total }); + } else { + message.error(message) + } + } finally { + setLoading(false); + } + }; + //初始化 + useEffect(() => { + if(visible) { + getList(); + } + }, [visible]) + // 列表头部数据 + const columns:ColumnsType = [ + { + title: "序号", + dataIndex: "index", + key: "index", + align: "center", + render: (_: any, __: any, idx: number) => idx + 1, + width: 60, + }, + { + title: "准入单位", + dataIndex: "deptId", + key: "deptId", + align: "left", + ellipsis: true, + }, + { + title: "准入品类", + dataIndex: "categoryNames", + key: "categoryNames", + align: "center", + }, + { + title: "准入时间", + dataIndex: "accessTime", + key: "accessTime", + align: "center", + }, + { + title: "退出时间", + dataIndex: "exitTime", + key: "exitTime", + align: "center", + }, + { + title: "进入黑名单时间", + dataIndex: "blackTime", + key: "blackTime", + align: "center", + }, + ]; + return ( + + {/* 查询栏 */} +
+ + + + + + + + + + + + +
+ {/* 表格内容 */} + getList(pagination.current!, pagination.pageSize!)} + /> + {/* 新增品类弹窗 */} + setAddModalVisible(false)} + // onOk={...} // 根据你的业务需要加 + /> + + ); +}; + +export default SupplierAccessDetailModal; diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierViewModal.tsx b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierViewModal.tsx new file mode 100644 index 0000000..dba9719 --- /dev/null +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierViewModal.tsx @@ -0,0 +1,21 @@ +import React from "react"; +//第三方UI库/组件 +import { Modal } from "antd"; +//本地组件、业务逻辑 +import CompanyInfo from '@/components/CompanyInfo'; +//主体接口 +interface SupplierViewModalProps { + visible: boolean; + onCancel: () => void; + record?: any; +} +// 查看主体 +const SupplierViewModal: React.FC = ({ visible, onCancel, record }) => { + return ( + + + + ); +}; + +export default SupplierViewModal; diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx new file mode 100644 index 0000000..55b6eef --- /dev/null +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx @@ -0,0 +1,292 @@ +import React, { useEffect, useState } from "react"; +//第三方UI库/组件 +import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, message } from 'antd'; +import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons'; +//类型定义 +import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; +//umi 相关 +//本地组件、弹窗、业务逻辑 +import SupplierViewModal from './components/SupplierViewModal'; +import SupplierDetailModal from './components/SupplierDetailModal'; +//本地服务/接口 +import { treeData, systemDict, getPagePe } from './services'; + +const { Option } = Select; +//下拉数据接口 +type OptionType = { label: string; value: string }; +// 列表数据接口 +interface Data { + id: number; + name: string; + region: string; + supplierType: string; + regTime: string; + status: string; +} + +const personQualifiedSupplierQuery: React.FC = () => { + //搜搜表单 + const [form] = Form.useForm(); + // 树数据 + const [dataTree, setDataTree] = useState([]); + //默认选中树 + const [treeSelected, setTreeSelected] = useState([]); + //当前树key + const [selectedKeys, setSelectedKeys] = useState(''); + //列表数据 + const [data, setData] = useState([]); + //列表加载 + const [loading, setLoading] = useState(false); + //分页 + const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); + //查看是否显示状态 + const [viewVisible, setViewVisible] = useState(false); + //准入明细是否显示状态 + const [detailVisible, setDetailVisible] = useState(false); + //查看、准入明细 参数传递 + const [currentRecord, setCurrentRecord] = useState(null); + // 境内/境外下拉数据 + const [regionOptions, setRegionOptions] = useState([]); + //集采类别 + const [categoryOptions, setCategoryOptions] = useState([]); + //集采库 + const [storeOptions, setStoreOptions] = useState([]); + // 导出 + const handleExport = () => { + window.open( + `${SERVER_BASE}/coscoSupplierBase/getPagePeExport`, + '_blank', + ); + }; + // 查询 + const handleSearch = () => { + setPagination({ ...pagination, current: 1 }); + getList(selectedKeys); + }; + // 重置 + const handleReset = () => { + form.resetFields(); + setPagination({ ...pagination, current: 1 }); + getList(selectedKeys); + }; + // 点击树节点请求右表 + const handleTreeSelect = (keys: React.Key[]) => { + const key = keys[0] as string; + setSelectedKeys(key); + getList(key) + }; + //列表方法 + const getList = async (treeId: string, pageNo: number = 1, pageSize: number = 10) => { + setLoading(true); + try { + const values = form.getFieldsValue(); + const { code, data, message } = await getPagePe({ pageNo, pageSize, treeId, ...values }); + if (code === 200) { + setData(data.records); + setPagination({ current: pageNo, pageSize, total: data.total }); + } else { + message.error(message) + } + } finally { + setLoading(false); + } + }; + // 辅助递归找第一个叶子 key(一般最下层为叶子) + const findFirstLeafKey = (nodes: any[]): string | undefined => { + for (const node of nodes) { + if (!node.children || node.children.length === 0) return node.key; + const found = findFirstLeafKey(node.children); + if (found) return found; + } + return undefined; + }; + // 初始化时选中树第一个叶子节点,并请求右表 + useEffect(() => { + // 境内/境外 下拉 + systemDict('regionOptions').then((res) => { + const { code, data } = res; + if (code == 200) { + setRegionOptions(data) + } + }); + // 集采类别 下拉 + systemDict('categoryOptions').then((res) => { + const { code, data } = res; + if (code == 200) { + setCategoryOptions(data) + } + }); + // 集采库 下拉 + systemDict('storeOptions').then((res) => { + const { code, data } = res; + if (code == 200) { + setStoreOptions(data) + } + }); + //tree数据 + treeData().then((res) => { + const { code, data } = res; + if (code == 200) { + setDataTree(data) + const key = findFirstLeafKey(data); + if (key) { + setSelectedKeys(key); + setTreeSelected([key]) + getList(key) + } + } + }) + }, []); + + + const columns: ColumnsType = [ + { + title: '序号', + dataIndex: 'index', + key: 'index', + align: 'center', + width: 60, + render: (_: any, __: any, idx: number) => idx + 1, + }, + { + title: '姓名', + dataIndex: 'personName', + key: 'personName', + align: 'center', + ellipsis: true, + }, + { + title: '身份证号', + dataIndex: 'idCard', + key: 'idCard', + align: 'center', + ellipsis: true, + }, + { + title: '联系电话', + dataIndex: 'personPhone', + key: 'personPhone', + align: 'center', + ellipsis: true, + }, + { + title: '准入单位', + dataIndex: 'type', + key: 'type', + align: 'center', + }, + { + title: '创建部门', + dataIndex: 'regTime', + key: 'regTime', + align: 'center', + }, + { + title: '创建时间', + dataIndex: 'createTime', + key: 'createTime', + align: 'center', + ellipsis: true, + }, + { + title: '操作', + key: 'option', + align: 'center', + width: 140, + render: (record: any) => ( + + { setCurrentRecord(record.id); setViewVisible(true); }} + >查看 + { setCurrentRecord(record.id); setDetailVisible(true); }} + >准入明细 + + ), + }, + ]; + + return ( + <> +
+ + {/* 左侧树 */} +
+
+ {dataTree.length > 0 && ( + + )} + +
+ + {/* 右侧主体 */} + + {/* 查询表单 */} + + + + + + + + + + + + + + + + {/* 表格 */} +
getList(selectedKeys, pagination.current!, pagination.pageSize!)} + /> + + + + {/* 查看组件 */} + setViewVisible(false)} + /> + {/* 准入明细组件 */} + setDetailVisible(false)} + /> + + ); +}; + +export default personQualifiedSupplierQuery; diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/services.ts b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/services.ts new file mode 100644 index 0000000..45d9b99 --- /dev/null +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/services.ts @@ -0,0 +1,62 @@ +import request from '@/utils/request'; + + + + +interface getPagePe { + pageNo: number; + pageSize: number; + treeId?: string; +} +export const getPagePe = (data: getPagePe) => request.post('/coscoSupplierBase/getPagePe', { data }); + +interface getCategoryPage { + pageNo: number; + pageSize: number; + supplierId?: string; +} +export const getCategoryPage = (data: getCategoryPage) => request.post('/coscoSupplierBase/getCategoryPage', { data }); + + + + + + + + + + +export interface ListParams { + page: number; + pageSize: number; + treeId?: string; + tmpToken?: string; +} +export async function list(params:ListParams) { + return request('/api/system/library', { + method: 'GET', + params + }); +} +export interface supplierDetailParams { + page: number; + pageSize: number; + captcha?: string; + tmpToken?: string; +} +export async function supplierDetail(params:supplierDetailParams) { + return request(`/api/system/supplierDetail`, { + method: 'GET', + params + }); +} +export async function treeData() { + return request('/api/system/treeData', { + method: 'GET' + }); +} +export async function systemDict(dict:String) { + return request(`/api/system/${dict}`, { + method: 'GET' + }); +} \ No newline at end of file diff --git a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx index 460cfff..83ebec1 100644 --- a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx @@ -89,6 +89,7 @@ const RegistrationQuery: React.FC = ({ dispatch }) => { setRegionOptions([ { label: '境内企业', value: 'dvs' }, { label: '境外企业', value: 'ovs' }, + { label: '个人', value: 'pe' }, ]) //状态 下拉 setStatusOptions([