From 7049687456885189fc9d99d70e8e1d876ac1a570 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, 10 Jul 2025 15:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=88=97=E8=A1=A8=E4=B8=8E?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/proxy.ts | 1 + src/baseStyle.less | 112 ++++- src/pages/login/login.tsx | 1 + .../admission/SupplierCategoryEntry/index.tsx | 128 +++--- .../SupplierCategoryEntryReview/index.tsx | 125 +++--- .../admission/SupplierEntryReview/index.tsx | 103 ++--- .../admission/admissionManagement/index.tsx | 121 +++--- .../admissionReviewManagement/index.tsx | 152 ++++--- .../backend/changeProgressInquiry/index.tsx | 122 +++--- .../backend/cooperateEnterprise/index.tsx | 83 ++-- .../supplier/backend/supplierNews/index.tsx | 87 ++-- .../category/CategoryLibraryManage/index.tsx | 98 ++--- .../category/CategoryLibraryReview/index.tsx | 127 +++--- .../category/CategoryManage/index.tsx | 4 +- .../category/SupplierEntryManage/index.tsx | 90 ++-- .../category/SupplierEntryReview/index.tsx | 133 +++--- .../SupplierChangeReviewManage/index.tsx | 106 +++-- .../SupplierRegisterAgent/index.tsx | 98 ++--- .../groupQualifiedSupplierQuery/index.tsx | 147 ++++--- .../groupQualifiedSupplierQuery/services.ts | 44 -- .../mySupplierInquiry/index.tsx | 119 +++--- .../personQualifiedSupplierQuery/index.tsx | 151 +++---- .../registrationQuery/_mock.ts | 392 ------------------ .../registrationQuery/index.tsx | 125 +++--- .../registrationQuery/services.ts | 11 - .../blacklistAudit/index.tsx | 89 ++-- .../blacklistManage/index.tsx | 102 ++--- .../supplierExit/supplierExitAudit/index.tsx | 90 ++-- .../supplierExit/supplierExitManage/index.tsx | 98 +++-- src/pages/supplier/supplierMessage/index.tsx | 69 +-- src/utils/componentStyle.less | 2 +- src/utils/request.ts | 6 +- src/utils/tableProps.tsx | 36 ++ 33 files changed, 1525 insertions(+), 1647 deletions(-) delete mode 100644 src/pages/supplier/informationRetrieval/registrationQuery/_mock.ts create mode 100644 src/utils/tableProps.tsx diff --git a/config/proxy.ts b/config/proxy.ts index 20a8009..b2818a1 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -5,6 +5,7 @@ export default { // target: 'http://10.0.0.10:18012',// 茂 target: 'http://10.0.0.125:18012',// 测试 // target: 'http://10.0.0.14:18012',// 李 + // target: 'http://10.0.0.14:18030',// 李 // target: 'http://10.0.0.46:18030',// 袁 changeOrigin: true, pathRewrite: { '^/api': '' }, diff --git a/src/baseStyle.less b/src/baseStyle.less index e6bf7f9..23a7045 100644 --- a/src/baseStyle.less +++ b/src/baseStyle.less @@ -5,6 +5,13 @@ @main-text-color-2: #666; @main-danger-color: rgb(214, 0, 14); +//表单 重置 搜搜与其他 +@form-submit-color: #004f8e; +@form-reset-color: #d7000f; +@form-other-color: #fff; +@form-color: #fff; + + @layout-background: #666; @layout-header-background: #666; @menu-list-bg: #666; @@ -88,8 +95,111 @@ } } } -} + //重置 + .buttonReset { + background-color: @form-reset-color; + border: 1px solid @form-reset-color; + border-radius: 4px; + color: @form-color; + } + //搜索 + .buttonSubmit { + background-color: @form-submit-color; + border: 1px solid @form-submit-color; + border-radius: 4px; + color: @form-color; + } + //其它按钮 + .buttonOther { + background-color: @form-other-color; + border: 1px solid #999; + border-radius: 4px; + color: #333; + } + //功能按钮 + .buttonFunctionBlock { + background-color: @form-other-color; + border: 1px solid @form-submit-color; + border-radius: 4px; + color: @form-submit-color; + } +} +.common-container.on { + background: none; + padding: 0; + //左侧树 + .treeBlock { + position: relative; + width: 280px; + background: #fff; + height: calc(100vh - 240px); + transition: width 0.3s; + + &.collapsed { + width: 0; + min-width: 0; + overflow: visible; + .dataTree { display: none; } + .shrinkBlock { + right: -30px; + top: 50%; + margin-top: -20px; + .btn { + margin: 0; + } + } + } + + .dataTree { + width: 280px; + height: 100%; + padding: 20px 10px; + overflow-x: auto; + overflow-y: auto; + box-sizing: border-box; + white-space: nowrap; + } + + .shrinkBlock { + position: absolute; + top: 50%; + right: -30px; + width: 30px; + height: 100px; + margin-top: -50px; + z-index: 100; + + .btn { + width: 30px; + background-color: @form-submit-color; + border: 1px solid @form-submit-color; + border-radius: 4px; + color: @form-color; + text-align: center; + padding: 2px 0; + font-size: 14px; + cursor: pointer; + } + } + + .expandOnly { + top: 50%; + right: -30px; + height: auto; + margin-top: -50px; + } + } + + .rightMain { + transition: width 0.3s; + width: calc(100% - 310px); + height: calc(100vh - 240px); + background-color: #fff; + padding: 0 24px; + } + +} // .ant-layout-header { diff --git a/src/pages/login/login.tsx b/src/pages/login/login.tsx index 2978070..735fe8b 100644 --- a/src/pages/login/login.tsx +++ b/src/pages/login/login.tsx @@ -35,6 +35,7 @@ const LoginPage: React.FC = () => { if (loginRes.code === 200) { sessionStorage.setItem('token', loginRes.data.token); sessionStorage.setItem('currentUser', JSON.stringify(loginRes.data)); + sessionStorage.setItem('userId', loginRes.data.supplierUser.userId); message.success('登录成功'); history.push('/index'); } else { diff --git a/src/pages/supplier/admission/SupplierCategoryEntry/index.tsx b/src/pages/supplier/admission/SupplierCategoryEntry/index.tsx index a79c405..a73c0b0 100644 --- a/src/pages/supplier/admission/SupplierCategoryEntry/index.tsx +++ b/src/pages/supplier/admission/SupplierCategoryEntry/index.tsx @@ -1,14 +1,16 @@ import React, { useState, useEffect } from 'react'; import { Form, Select, Button, Table, Space, Modal, message } from 'antd'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //查看弹窗 import ViewModal from './components/ViewModal'; //发起准入 弹窗 import CreateModal from './components/CreateModal'; import CategorySelector from '@/components/CategorySelector'; - +//接口 import { getPage, startApprove } from './services' - +//统一列表分页 +import tableProps from '@/utils/tableProps' const { Option } = Select; interface Data { @@ -58,6 +60,13 @@ const SupplierCategoryEntry: React.FC = () => { const values = form.getFieldsValue(); getList(values, 1, 10); }; + // 重置 + const handleReset = () => { + form.resetFields() + const values = form.getFieldsValue(); + getList(values, 1, 10); + }; + const handleApproval = (accessWorkId: string) => { Modal.confirm({ title: '是否确认发起审批?', @@ -76,14 +85,15 @@ const SupplierCategoryEntry: React.FC = () => { { title: '序号', dataIndex: 'index', - render: (_: any, __: any, index: number) => index + 1, + width: 60, + render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, - { title: '准入工作', dataIndex: 'accessWorkName' }, - { title: '准入单位', dataIndex: 'deptId' }, - { title: '准入部门', dataIndex: 'deptId' }, - { title: '准入方式', dataIndex: 'accessTypeText' }, - { title: '申请时间', dataIndex: 'createTime' }, - { title: '状态', dataIndex: 'approveStatusText' }, + { title: '准入工作', ellipsis: true, dataIndex: 'accessWorkName' }, + { title: '准入单位', ellipsis: true, dataIndex: 'deptId' }, + { title: '准入部门', ellipsis: true, dataIndex: 'deptId' }, + { title: '准入方式', ellipsis: true, dataIndex: 'accessTypeText' }, + { title: '申请时间', dataIndex: 'createTime', width: 180 }, + { title: '状态', ellipsis: true, dataIndex: 'approveStatusText' }, { title: '操作', width: 140, @@ -102,54 +112,62 @@ const SupplierCategoryEntry: React.FC = () => { return ( <> -
- - - - - - - - - - - - - - - - - + + + + + + + + +
+ + { const values = form.getFieldsValue(); - getList(values, 1, 10); - } }>重置 - - -
- + getList(values, pagination.current!, pagination.pageSize!) + }} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + />
-
{ - const values = form.getFieldsValue(); - getList(values, pagination.current!, pagination.pageSize!) - }} - /> {/* 弹窗区 */} diff --git a/src/pages/supplier/admission/SupplierCategoryEntryReview/index.tsx b/src/pages/supplier/admission/SupplierCategoryEntryReview/index.tsx index a8bafd7..db40f34 100644 --- a/src/pages/supplier/admission/SupplierCategoryEntryReview/index.tsx +++ b/src/pages/supplier/admission/SupplierCategoryEntryReview/index.tsx @@ -1,12 +1,14 @@ import React, { useState, useEffect } from 'react'; -import { Form, Select, Button, Table, Space, Modal, message } from 'antd'; +import { Form, Select, Button, Table, Space } from 'antd'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //查看弹窗 import ViewModal from './components/ViewModal'; import CategorySelector from '@/components/CategorySelector'; - +//接口 import { getPage } from './services' - +//统一列表分页 +import tableProps from '@/utils/tableProps' const { Option } = Select; interface Data { @@ -29,7 +31,7 @@ const SupplierCategoryEntryReview: React.FC = () => { //列表加载 const [loading, setLoading] = useState(false); // 列表方法 - const getList = async (values: any = {},pageNo: number = 1, pageSize: number = 10) => { + const getList = async (values: any = {}, pageNo: number = 1, pageSize: number = 10) => { setLoading(true); try { const { code, data } = await getPage({ ...values, pageNo, pageSize }); @@ -56,19 +58,26 @@ const SupplierCategoryEntryReview: React.FC = () => { const values = form.getFieldsValue(); getList(values, 1, 10); }; + // 重置 + const handleReset = () => { + form.resetFields() + const values = form.getFieldsValue(); + getList(values, 1, 10); + }; //列表头部数据 const columns: ColumnsType = [ { title: '序号', dataIndex: 'index', - render: (_: any, __: any, index: number) => index + 1, + width: 60, + render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, - { title: '准入工作', dataIndex: 'accessWorkName' }, - { title: '准入单位', dataIndex: 'deptId' }, - { title: '准入部门', dataIndex: 'deptId' }, - { title: '准入方式', dataIndex: 'accessTypeText' }, - { title: '申请时间', dataIndex: 'createTime' }, - { title: '状态', dataIndex: 'approveStatusText' }, + { title: '准入工作', dataIndex: 'accessWorkName', ellipsis: true }, + { title: '准入单位', dataIndex: 'deptId', ellipsis: true }, + { title: '准入部门', dataIndex: 'deptId', ellipsis: true }, + { title: '准入方式', dataIndex: 'accessTypeText', width: 120 }, + { title: '申请时间', dataIndex: 'createTime', width: 180 }, + { title: '状态', dataIndex: 'approveStatusText', width: 120 }, { title: '操作', width: 80, @@ -82,51 +91,57 @@ const SupplierCategoryEntryReview: React.FC = () => { return ( <> -
- - - - - - - - - - - - - - - - - + + + + + + + +
{ const values = form.getFieldsValue(); - getList(values, 1, 10); - }}>重置 - - -
{ - const values = form.getFieldsValue(); - getList(values, pagination.current!, pagination.pageSize!) - }} - /> + getList(values, pagination.current!, pagination.pageSize!) + }} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + {/* 弹窗区 */} diff --git a/src/pages/supplier/admission/SupplierEntryReview/index.tsx b/src/pages/supplier/admission/SupplierEntryReview/index.tsx index 6b7a633..4aaf921 100644 --- a/src/pages/supplier/admission/SupplierEntryReview/index.tsx +++ b/src/pages/supplier/admission/SupplierEntryReview/index.tsx @@ -1,9 +1,14 @@ import React, { useEffect, useState } from 'react'; -import { Table, Form, Select, Button, Tag, message, Space } from 'antd'; -import { SearchOutlined, ReloadOutlined } from '@ant-design/icons'; -import { getApprovePage } from './services'; +import { Table, Form, Select, Button, message, Space } from 'antd'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; import type { ColumnsType } from 'antd/es/table'; +//接口 +import { getApprovePage } from './services'; +//组件 import ViewModal from './components/ViewModal'; +//统一列表分页 +import tableProps from '@/utils/tableProps' + const { Option } = Select; interface SupplierEntryReviewRecord { id: string; @@ -106,7 +111,7 @@ const SupplierEntryReview: React.FC = () => { { title: '序号', dataIndex: 'index', - width: 48, + width: 60, align: 'center', render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, @@ -134,7 +139,7 @@ const SupplierEntryReview: React.FC = () => { render: (_: any, record: any) => { return ( <> - {record.categoryNameList && record.categoryNameList.map((item:string) => { + {record.categoryNameList && record.categoryNameList.map((item: string) => { return
{`${item}`}
})} @@ -143,15 +148,17 @@ const SupplierEntryReview: React.FC = () => { }, { title: '开始时间', - dataIndex: 'startTime', + dataIndex: 'createTime', align: 'center', ellipsis: true, + width: 180, }, { title: '结束时间', - dataIndex: 'endTime', + dataIndex: 'lastUpdateTime', align: 'center', ellipsis: true, + width: 180, }, { title: '流程状态', @@ -177,55 +184,55 @@ const SupplierEntryReview: React.FC = () => { }, ]; return ( -
-
- - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + +
{ const values = form.getFieldsValue(); getList(values, 1, 10); }; + // 重置 + const handleReset = () => { + form.resetFields() + const values = form.getFieldsValue(); + getList(values, 1, 10); + }; + const handleApproval = (id: string) => { Modal.confirm({ title: '是否确认发起审批?', @@ -82,10 +92,10 @@ const AccessManagement: React.FC = () => { render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, { title: '准入工作', ellipsis: true, dataIndex: 'accessWorkName' }, - { title: '准入单位', ellipsis: true,dataIndex: 'deptId' }, - { title: '准入部门', ellipsis: true,dataIndex: 'deptId' }, - { title: '准入方式', ellipsis: true,dataIndex: 'accessTypeText' }, - { title: '申请时间', ellipsis: true,dataIndex: 'createTime' }, + { title: '准入单位', ellipsis: true, dataIndex: 'deptId' }, + { title: '准入部门', ellipsis: true, dataIndex: 'deptId' }, + { title: '准入方式', ellipsis: true, dataIndex: 'accessTypeText' }, + { title: '申请时间', ellipsis: true, dataIndex: 'createTime' }, { title: '状态', dataIndex: 'reviewStatusText' }, { title: '操作', @@ -111,54 +121,63 @@ const AccessManagement: React.FC = () => { return ( <> -
- - - - - - - - - - - - - - - - - + + + + + + + + + + + +
{ const values = form.getFieldsValue(); - getList(values, 1, 10); - }}>重置 - - -
- + getList(values, pagination.current!, pagination.pageSize!) + }} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + />
-
{ - const values = form.getFieldsValue(); - getList(values, pagination.current!, pagination.pageSize!) - }} - /> {/* 弹窗区 */} diff --git a/src/pages/supplier/admission/admissionReviewManagement/index.tsx b/src/pages/supplier/admission/admissionReviewManagement/index.tsx index f47b2af..bb4d80d 100644 --- a/src/pages/supplier/admission/admissionReviewManagement/index.tsx +++ b/src/pages/supplier/admission/admissionReviewManagement/index.tsx @@ -1,13 +1,16 @@ import React, { useEffect, useState } from "react"; -import { useIntl } from 'umi'; +import { useIntl } from 'umi'; import { Form, Button, Table, Space, Input } from 'antd'; import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; -import { SearchOutlined } from '@ant-design/icons'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; +//接口 import { getPage } from './services'; //查看评审结果 弹窗 import ResultModal from './components/ResultModal'; import GroupLeaderModal from './components/GroupLeaderModal'; import ViewModal from './components/ViewModal'; +//统一列表分页 +import tableProps from '@/utils/tableProps' interface Data { deptName: string; @@ -18,7 +21,7 @@ interface Data { } interface ModalInfo { - type: 'teamMembers' | 'groupLeader' | 'view' | null; + type: 'teamMembers' | 'groupLeader' | 'view' | null; visible: boolean; record: Data | null; view: boolean; @@ -30,27 +33,27 @@ const CooperateEnterprise: React.FC = () => { const [data, setData] = useState([]); const [loading, setLoading] = useState(false); const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); - const [modalInfo, setModalInfo] = useState({ type: null, visible: false, record: null, view:false }); + const [modalInfo, setModalInfo] = useState({ type: null, visible: false, record: null, view: false }); - const openModal = (type: 'teamMembers' | 'groupLeader' | 'view', record: Data, view = false ) => { + const openModal = (type: 'teamMembers' | 'groupLeader' | 'view', record: Data, view = false) => { setModalInfo({ type, visible: true, record, view }); }; //提交关闭审核 const closeModal = () => { - setModalInfo({ type: null, visible: false, record: null, view:false }); + setModalInfo({ type: null, visible: false, record: null, view: false }); }; //提交审核 const submitModal = () => { closeModal(); handleReset(); }; - + // 列表数据 - const getList = async (params: { pageNo: number; pageSize: number;}) => { + const getList = async (params: { pageNo: number; pageSize: number; }) => { setLoading(true); - try { + try { const values = searchForm.getFieldsValue(); - const { code, data } = await getPage({...params, ...values}); + const { code, data } = await getPage({ ...params, ...values }); if (code === 200) { setData(data.records); setPagination({ current: params.pageNo, pageSize: params.pageSize, total: data.total }); @@ -64,7 +67,7 @@ const CooperateEnterprise: React.FC = () => { const handleReset = () => { searchForm.resetFields(); - getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10 }); + getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10 }); }; const handleSearch = () => { @@ -75,7 +78,7 @@ const CooperateEnterprise: React.FC = () => { }; useEffect(() => { - getList({ pageNo: 1, pageSize: 10 }); + getList({ pageNo: 1, pageSize: 10 }); }, []); const columns: ColumnsType = [ @@ -83,7 +86,7 @@ const CooperateEnterprise: React.FC = () => { title: '序号', dataIndex: 'index', key: 'index', - width: 80, + width: 60, align: 'center', render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, @@ -98,21 +101,24 @@ const CooperateEnterprise: React.FC = () => { dataIndex: 'deptId', key: 'deptId', ellipsis: true, + width: 180, }, { title: '准入部门', dataIndex: 'deptId', key: 'deptId', ellipsis: true, + width: 180, }, { title: '准入品类', dataIndex: 'categoryNameList', align: 'center', + width: 160, render: (_: any, record: any) => { return ( <> - {record.categoryNameList && record.categoryNameList.map((item:string) => { + {record.categoryNameList && record.categoryNameList.map((item: string) => { return
{`${item}`}
})} @@ -124,12 +130,14 @@ const CooperateEnterprise: React.FC = () => { dataIndex: 'accessTypeText', key: 'accessTypeText', ellipsis: true, + width: 160, }, { title: '评审时间', dataIndex: 'createTime', key: 'createTime', ellipsis: true, + width: 180, }, { title: '评审状态', @@ -148,77 +156,83 @@ const CooperateEnterprise: React.FC = () => { (['2'].includes(record.reviewStatus) && record.isLeader === '1') ); // 进行中1 、未开始0 弹出组员组件 否则弹出组长组件 - const type = ['0', '1'].includes(record.reviewStatus)? 'teamMembers': 'groupLeader'; + const type = ['0', '1'].includes(record.reviewStatus) ? 'teamMembers' : 'groupLeader'; //评审结果 结果汇总中2 弹出组员组件, 已完成3弹出组长组件 - const isLeader = (record.reviewStatus === '2' && record.isLeader === '0')? 'teamMembers': - (record.reviewStatus === '3' && record.isLeader === '1')? 'groupLeader':''; - return ( - - {showAudit && openModal(type, record)}>评审} - openModal('view', record)}>查看 - { isLeader != '' && openModal(isLeader, record, true)}>评审结果} - - ) - + const isLeader = (record.reviewStatus === '2' && record.isLeader === '0') ? 'teamMembers' : + (record.reviewStatus === '3' && record.isLeader === '1') ? 'groupLeader' : ''; + return ( + + {showAudit && openModal(type, record)}>评审} + openModal('view', record)}>查看 + {isLeader != '' && openModal(isLeader, record, true)}>评审结果} + + ) + }, }, ]; return ( <> -
- - - - - - - - - - -
getList({ pageNo: pagination.current!, pageSize: pagination.pageSize! })} - /> - { modalInfo.type && modalInfo.type === 'teamMembers' && ( - +
+
+ + + + + + + + + + +
+
getList({ pageNo: pagination.current!, pageSize: pagination.pageSize! })} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + + {modalInfo.type && modalInfo.type === 'teamMembers' && ( + )} - { modalInfo.type && modalInfo.type === 'groupLeader' && ( - )} - { modalInfo.type && modalInfo.type === 'view' && ( + {modalInfo.type && modalInfo.type === 'view' && ( )} - + ); }; diff --git a/src/pages/supplier/backend/changeProgressInquiry/index.tsx b/src/pages/supplier/backend/changeProgressInquiry/index.tsx index b5a4d76..59da18a 100644 --- a/src/pages/supplier/backend/changeProgressInquiry/index.tsx +++ b/src/pages/supplier/backend/changeProgressInquiry/index.tsx @@ -2,12 +2,16 @@ import React, { useEffect, useState } from "react"; import { useIntl } from 'umi'; import { Form, Button, Table, Select, DatePicker, Input } from 'antd'; import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; -import { SearchOutlined } from '@ant-design/icons'; -import { getSupplierChangePage } from './services'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; +//时间转换 import moment from 'moment'; -import DetailView from './components/DetailView'; +//查看组件 +import DetailView from './components/DetailView'; +//字典与接口 +import { getSupplierChangePage } from './services'; import { getDictList } from '@/servers/api/dicts' - +//统一列表分页 +import tableProps from '@/utils/tableProps' interface Data { deptName: string; categoryName: string; @@ -87,7 +91,7 @@ const CooperateEnterprise: React.FC = () => { //重置 const handleReset = () => { searchForm.resetFields(); - getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10 }); + getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10 }); }; //搜索 const handleSearch = () => { @@ -113,7 +117,7 @@ const CooperateEnterprise: React.FC = () => { const { changeDesc, createTime, deptNames, enterpriseType } = values; const startTime = createTime ? moment(createTime[0]).format('YYYY-MM-DD') : ''; const endTime = createTime ? moment(createTime[1]).format('YYYY-MM-DD') : ''; - const { code , data } = await getSupplierChangePage({...params, changeDesc, deptNames, enterpriseType,startTime,endTime}); + const { code, data } = await getSupplierChangePage({ ...params, changeDesc, deptNames, enterpriseType, startTime, endTime }); if (code === 200) { setData(data.records); setPagination({ current: params.pageNo, pageSize: params.pageSize, total: data.total }); @@ -127,7 +131,7 @@ const CooperateEnterprise: React.FC = () => { //初始化 useEffect(() => { getDictList('approve_type').then((res) => { - if(res.code == 200) { + if (res.code == 200) { setEnterpriseType(res.data) } }) @@ -137,55 +141,61 @@ const CooperateEnterprise: React.FC = () => { return ( <> -
- - - - - - - - - - - - - - - - - - - -
getList({ pageNo: pagination.current!, pageSize: pagination.pageSize! })} - /> - +
+
+
+ + + + + + + + + + + + + + + + + + + +
+
getList({ pageNo: pagination.current!, pageSize: pagination.pageSize! })} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + + ); }; diff --git a/src/pages/supplier/backend/cooperateEnterprise/index.tsx b/src/pages/supplier/backend/cooperateEnterprise/index.tsx index 27c04e7..f062219 100644 --- a/src/pages/supplier/backend/cooperateEnterprise/index.tsx +++ b/src/pages/supplier/backend/cooperateEnterprise/index.tsx @@ -1,11 +1,14 @@ import React, { useEffect, useState } from "react"; import { useIntl } from 'umi'; -import { Form, Button, Table, Select, DatePicker, TreeSelect } from 'antd'; +import { Form, Button, Table, DatePicker } from 'antd'; import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; -import { SearchOutlined } from '@ant-design/icons'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; +//接口 import { getCategoryPage } from './services'; +//组件 import CategorySelector from '@/components/CategorySelector'; - +//统一列表分页 +import tableProps from '@/utils/tableProps' import moment from 'moment'; @@ -38,7 +41,7 @@ const CooperateEnterprise: React.FC = () => { const startTime = createTime ? moment(createTime[0]).format('YYYY-MM-DD') : ''; const endTime = createTime ? moment(createTime[1]).format('YYYY-MM-DD') : ''; - const { code, data } = await getCategoryPage({...params, categoryId, deptId, startTime, endTime }); + const { code, data } = await getCategoryPage({ ...params, categoryId, deptId, startTime, endTime }); if (code === 200) { setData(data.records); setPagination({ current: params.pageNo, pageSize: params.pageSize, total: data.total }); @@ -116,39 +119,45 @@ const CooperateEnterprise: React.FC = () => { ]; return ( <> -
- - {/* */} - - - - - - - - - - - - - - -
getList({ pageNo: pagination.current!, pageSize: pagination.pageSize! })} - /> +
+
+
+ + {/* */} + + + + + + + + + + + + + + +
+
getList({ pageNo: pagination.current!, pageSize: pagination.pageSize! })} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + ); }; diff --git a/src/pages/supplier/backend/supplierNews/index.tsx b/src/pages/supplier/backend/supplierNews/index.tsx index ac94362..0b3f09d 100644 --- a/src/pages/supplier/backend/supplierNews/index.tsx +++ b/src/pages/supplier/backend/supplierNews/index.tsx @@ -2,9 +2,12 @@ import React, { useEffect, useState } from "react"; import { useIntl } from 'umi'; import { Form, Button, Table, Select, Input, Modal } from 'antd'; import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; -import { SearchOutlined } from '@ant-design/icons'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; +//字典与接口 import { page, getExitMge } from './services'; import { getDictList } from '@/servers/api/dicts' +//统一列表分页 +import tableProps from '@/utils/tableProps' interface Data { deptName: string; @@ -93,9 +96,9 @@ const supplierNews: React.FC = () => { ]; //初始化 useEffect(() => { - getDictList('message_type').then((res:any) => { + getDictList('message_type').then((res: any) => { const { code, data } = res; - if(code == 200) { + if (code == 200) { setCategoryOptions(data) } }) @@ -128,42 +131,48 @@ const supplierNews: React.FC = () => { return ( <> - - - - - - - - - - - - - - -
getList({ pageNo: pagination.current!, pageSize: pagination.pageSize!, content: '', type: '' })} - /> +
+
+
+ + + + + + + + + + + + + +
+
getList({ pageNo: pagination.current!, pageSize: pagination.pageSize!, content: '', type: '' })} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + ); }; diff --git a/src/pages/supplier/category/CategoryLibraryManage/index.tsx b/src/pages/supplier/category/CategoryLibraryManage/index.tsx index f519f9a..8626839 100644 --- a/src/pages/supplier/category/CategoryLibraryManage/index.tsx +++ b/src/pages/supplier/category/CategoryLibraryManage/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; // antd 组件 import { Form, Button, Table, Select, Input } from 'antd'; -import { SearchOutlined, ReloadOutlined, PlusOutlined } from '@ant-design/icons'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; // 类型定义 import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; // umi 相关 @@ -10,9 +10,10 @@ import CategoryAddModal from './components/CategoryAddModal'; import SupplierAddModal from './components/SupplierAddModal'; import SupplierListModal from './components/SupplierListModal'; import LockManagerModal from './components/LockManagerModal'; -// mock服务 +//接口 import { getPage } from './services'; - +//统一列表分页 +import tableProps from '@/utils/tableProps' const { Option } = Select; // 列表数据接口 @@ -51,7 +52,7 @@ const CategoryLibraryManage: React.FC = () => { setLoading(true); try { // mock 请求 - const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize },...form.getFieldsValue() }); + const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize }, ...form.getFieldsValue() }); if (code === 200) { setData(data.records); setPagination({ ...pagination, current: pageNo, pageSize, total: data.total }); @@ -168,7 +169,7 @@ const CategoryLibraryManage: React.FC = () => { 解锁/锁定 )} - + ), }, @@ -176,49 +177,52 @@ const CategoryLibraryManage: React.FC = () => { return ( <> - {/* 查询区 */} - - - - - - - - - - - - - - - - {/* 表格 */} -
getList(page, pageSize), - }} - /> +
+
+
+ + + + + + + + + + + + + + + + + +
+
{ + getList( pagination.current!, pagination.pageSize!) + }} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + {/* 新增品类库弹窗 */} { return ( <> - {/* 查询区 */} -
- - - - - - +
+
+ + + + + + + - - - + + + - - - + + + + + + + + + - - - - - - - - - {/* 表格 */} -
getList(page, pageSize), - }} - /> + + + + + +
{ + getList(pagination.current!, pagination.pageSize!) + }} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + + /> + {/* 新增品类库弹窗 */} { }; return ( -
+
- - - {/* - - */} - - {/* 表格 */} -
getList(page, pageSize), - }} - /> +
+
+
+ + + + + + + + + + + + + + +
+
{ + getList(pagination.current!, pagination.pageSize!) + }} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + {/* 新增品类库弹窗 */} { const getList = async (pageNo: number = 1, pageSize: number = 10) => { setLoading(true); try { - const values = form.getFieldsValue(); - const { name, deptNames, timeRange, approveStatus } = values; - const startTime = timeRange ? moment(timeRange[0]).format('YYYY-MM-DD') : ''; - const endTime = timeRange ? moment(timeRange[1]).format('YYYY-MM-DD') : ''; - const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize }, name, startTime, endTime, deptNames, approveStatus }); + const values = form.getFieldsValue(); + const { name, deptNames, timeRange, approveStatus } = values; + const startTime = timeRange ? moment(timeRange[0]).format('YYYY-MM-DD') : ''; + const endTime = timeRange ? moment(timeRange[1]).format('YYYY-MM-DD') : ''; + const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize }, name, startTime, endTime, deptNames, approveStatus }); if (code === 200) { setData(data.records); setPagination({ ...pagination, current: pageNo, pageSize, total: data.total }); @@ -142,7 +145,7 @@ const CategoryLibraryManage: React.FC = () => { align: 'center', ellipsis: true, }, - + { title: '操作', key: 'option', @@ -170,66 +173,64 @@ const CategoryLibraryManage: React.FC = () => { return ( <> - {/* 查询区 */} -
- - - - - - +
+
+ + + + + + + - - - + + + - - - - - - - - {/* - - */} - - {/* 表格 */} -
getList(page, pageSize), - }} - /> + + + + + + + + + + + + +
{ + getList(pagination.current!, pagination.pageSize!) + }} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + {/* 新增品类库弹窗 */} = ({ dispatch }) => { { title: '序号', dataIndex: 'index', - width: 48, + width: 60, align: 'center', render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, { title: '供应商名称', dataIndex: 'supplierName', - align: 'center', + align: 'left', ellipsis: true, render: (dom, record) => @@ -144,33 +146,39 @@ const SupplierChangeReviewManage: React.FC = ({ dispatch }) => { title: '境内/境外', dataIndex: 'supplierType', align: 'center', + width: 160, }, { title: '供应商分类', dataIndex: 'enterpriseTypeCn', align: 'center', + width: 160, }, { title: '准入时间', dataIndex: 'updateTime', align: 'center', ellipsis: true, + width: 180, }, { title: '提交变更时间', dataIndex: 'changeTime', align: 'center', ellipsis: true, + width: 180, }, { title: '审批状态', dataIndex: 'approveStatusText', align: 'center', + width: 160, }, { title: '操作', key: 'action', align: 'center', + width: 160, render: (_: any, record: any) => ( - - - - {/* 数据表格 */} -
setPagination({ ...pagination, current }), - }} - /> + + + + + + + {enterpriseType?.map(item => ( + {item.dicName} + ))} + + + + + + + + + + + + + + + + {/* 数据表格 */} +
setPagination({ ...pagination })} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + {/* 审批记录弹窗 */} { const [tabKey, setTabKey] = useState('dvs'); //查看是否显示状态 const [viewVisible, setViewVisible] = useState(false); - //查看 参数传递 - const [currentRecord, setCurrentRecord] = useState(''); + //查看 参数传递 + const [currentRecord, setCurrentRecord] = useState(''); // 新增与修改 - const [exitModalVisible, setExitModalVisible] = useState(false); - const [exitId, setExitId] = useState(''); - + const [exitModalVisible, setExitModalVisible] = useState(false); + const [exitId, setExitId] = useState(''); + // 查询数据 const fetchData = async (page = 1, pageSize = 10) => { setLoading(true); @@ -39,7 +42,7 @@ const SupplierRegisterAgent: React.FC = () => { let params: any = { pageNo: page, pageSize, - supplierType: tabKey , + supplierType: tabKey, }; if (keyword) params.keyword = keyword; if (dateRange && dateRange.length === 2) { @@ -67,7 +70,6 @@ const SupplierRegisterAgent: React.FC = () => { // 首次&依赖刷新 useEffect(() => { fetchData(1, pagination.pageSize); - // eslint-disable-next-line }, [tabKey]); // 查询 @@ -85,7 +87,7 @@ const SupplierRegisterAgent: React.FC = () => { }; // 列 - const columns: ColumnsType = [ + const columns: ColumnsType = [ { title: '序号', dataIndex: 'index', @@ -96,14 +98,9 @@ const SupplierRegisterAgent: React.FC = () => { { title: '供应商名称', dataIndex: 'name', - align: 'center', + align: 'left', ellipsis: true, }, - // { - // title: '供应商类型', - // dataIndex: 'supplierType', - // align: 'center', - // }, { title: '创建单位', dataIndex: 'unit', @@ -119,44 +116,45 @@ const SupplierRegisterAgent: React.FC = () => { title: '创建时间', dataIndex: 'createTime', align: 'center', - // sorter 由接口决定是否支持 + width: 180, }, { title: '操作', align: 'center', + width: 120, render: (_: any, record: any) => ( { setCurrentRecord(record.id); setViewVisible(true); }}>查看 - {/* { - setExitId(record.id); - setExitModalVisible(true); - }}>编辑 */} ), }, ]; return ( -
- {/* 查询区 */} -
- -
- - - - - - - - - - - - - - - +
+
+
+ + + + + + + + + + + + + +
@@ -166,7 +164,7 @@ const SupplierRegisterAgent: React.FC = () => { - + {/* 表格 */} @@ -175,14 +173,10 @@ const SupplierRegisterAgent: React.FC = () => { dataSource={data} rowKey="id" loading={loading} - pagination={{ - current: pagination.current, - pageSize: pagination.pageSize, - total: pagination.total, - showQuickJumper: true, - showSizeChanger: true, - onChange: (current, pageSize) => handleTableChange({ current, pageSize }), - }} + pagination={{ ...tableProps.pagination, total: pagination.total }} + onChange={(current, pageSize) => handleTableChange({ current, pageSize })} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} /> {/* 查看组件 */} = ({dispatch}) => { +const groupQualifiedSupplierQuery: React.FC = ({ dispatch }) => { //搜搜表单 const [form] = Form.useForm(); // 树数据 @@ -106,10 +108,10 @@ const groupQualifiedSupplierQuery: React.FC = ({dispatch}) => { // 初始化时选中树第一个叶子节点,并请求右表 useEffect(() => { // 境内/境外 下拉 - setRegionOptions([ - { label: '境内企业', value: 'dvs' }, - { label: '境外企业', value: 'ovs' }, - ]) + setRegionOptions([ + { label: '境内企业', value: 'dvs' }, + { label: '境外企业', value: 'ovs' }, + ]) // // 集采类别 下拉 // systemDict('categoryOptions').then((res) => { // const { code, data } = res; @@ -155,9 +157,9 @@ const groupQualifiedSupplierQuery: React.FC = ({dispatch}) => { key: 'name', align: 'left', ellipsis: true, - render: (dom, record) => + render: (dom, record) => - { dispatch({ type: 'globalModal/show', @@ -218,44 +220,20 @@ const groupQualifiedSupplierQuery: React.FC = ({dispatch}) => { ), }, ]; - + const [collapsed, setCollapsed] = useState(false); return ( <> -
- - {/* 左侧树 */} -
-
- {dataTree.length > 0 && ( - - )} - -
- - {/* 右侧主体 */} -
- {/* 查询表单 */} -
- - - - {/* +
+
+ + + + + {/* */} - - - - - - - - - - {/* 表格 */} + + + + + + + + + + + + + + +
+
+
+ + {!collapsed && ( + <> +
+ {dataTree.length > 0 && ( + + )} +
+
+
setCollapsed(true)}>
+
+ + )} + {collapsed && ( +
+
setCollapsed(false)}>
+
+ )} +
+ +
getList(selectedKeys, pagination.current!, pagination.pageSize!)} /> - - + + {/* 查看组件 */} request.post('/coscoSu - - - - - - - - - - - - - - - -// 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' }); } -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/mySupplierInquiry/index.tsx b/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx index e6e8db6..7534b12 100644 --- a/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx +++ b/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; //第三方UI库/组件 -import { Form, Button, Table, Select, Input, Space, message, Tooltip } from 'antd'; -import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons'; +import { Form, Button, Table, Select, Input, Space, Tooltip } from 'antd'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; //类型定义 import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //umi 相关 @@ -12,6 +12,8 @@ import SupplierDetailModal from './components/SupplierDetailModal'; import CategorySelector from '@/components/CategorySelector'; //本地服务/接口 import { getPageMy } from './services'; +//统一列表分页 +import tableProps from '@/utils/tableProps' const { Option } = Select; //下拉数据接口 @@ -48,7 +50,7 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => { // 准入状态 const [storeOptions, setStoreOptions] = useState([]); // 导出 - const handleExport = async () => { + const handleExport = async () => { window.open( `${SERVER_BASE}/coscoSupplierBase/getPageMyExport`, '_blank', @@ -114,10 +116,10 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => { title: '供应商名称', dataIndex: 'name', key: 'name', - align: 'center', - render: (dom, record) => + ellipsis: true, + render: (dom, record) => - { dispatch({ type: 'globalModal/show', @@ -136,12 +138,14 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => { dataIndex: 'supplierTypeCn', key: 'supplierTypeCn', align: 'center', + width: 160, }, { title: '企业类型', dataIndex: 'enterpriseTypeCn', key: 'enterpriseTypeCn', align: 'center', + width: 120, }, { title: '准入品类', @@ -154,17 +158,20 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => { dataIndex: 'updateTime', key: 'updateTime', align: 'center', + width: 180, }, { title: '准入状态', dataIndex: 'accessStatusCn', key: 'accessStatusCn', align: 'center', + width: 140, }, { title: '操作', key: 'option', align: 'center', + width: 160, render: (record: any) => ( = ({ dispatch }) => { return ( <> -
- - - - - - - - - - - - - - - - - - - {/* 表格 */} -
getList(pagination.current!, pagination.pageSize!)} - /> +
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+
getList(pagination.current!, pagination.pageSize!)} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + {/* 查看组件 */} = ({ dispatch }) => { record={currentRecord} onCancel={() => setDetailVisible(false)} /> + ); }; diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx index 221b638..939cb4a 100644 --- a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx @@ -1,16 +1,18 @@ import React, { useEffect, useState } from "react"; //第三方UI库/组件 -import { Form, Button, Table , Input, Tree, Row, Col, Space, Tooltip } from 'antd'; -import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons'; +import { Form, Button, Table, Input, Tree, Space, Tooltip } from 'antd'; +import { SearchOutlined, DeleteOutlined, DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons'; //类型定义 import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //umi 相关 -import { connect } from 'umi'; +import { connect } from 'umi'; //本地组件、弹窗、业务逻辑 import SupplierViewModal from './components/SupplierViewModal'; import SupplierDetailModal from './components/SupplierDetailModal'; //本地服务/接口 -import { treeData, systemDict, getPagePe } from './services'; +import { treeData, getPagePe } from './services'; +//统一列表分页 +import tableProps from '@/utils/tableProps' //下拉数据接口 type OptionType = { label: string; value: string }; @@ -105,27 +107,6 @@ const personQualifiedSupplierQuery: React.FC = ({ dispatch }) => { }; // 初始化时选中树第一个叶子节点,并请求右表 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; @@ -157,9 +138,9 @@ const personQualifiedSupplierQuery: React.FC = ({ dispatch }) => { key: 'personName', align: 'center', ellipsis: true, - render: (dom, record) => + render: (dom, record) => - { dispatch({ type: 'globalModal/show', @@ -225,72 +206,78 @@ const personQualifiedSupplierQuery: React.FC = ({ dispatch }) => { ), }, ]; - + const [collapsed, setCollapsed] = useState(false); return ( <> -
- - {/* 左侧树 */} -
-
- {dataTree.length > 0 && ( - - )} - -
- - {/* 右侧主体 */} -
- {/* 查询表单 */} -
- - - +
+
+ + + + - - - - - - - - - - - {/* 表格 */} + + + + + + + + + + + + + +
+
+
+ {!collapsed && ( + <> +
+ {dataTree.length > 0 && ( + + )} +
+
+
setCollapsed(true)}>
+
+ + )} + {collapsed && ( +
+
setCollapsed(false)}>
+
+ )} +
+
getList(selectedKeys, pagination.current!, pagination.pageSize!)} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} /> - - + + + {/* 查看组件 */} { - res.json({ - code: 200, - data: mockData, - msg: '操作成功' - }); - }, - // - 'GET /api/system/qualifications': (req: Request, res: Response) => { - res.json({ code: 200, - data: mockQualificationData, - total: 2, - msg: '操作成功' - }); - }, - // - 'GET /api/system/invoice': (req: Request, res: Response) => { - res.json({ code: 200, - data: dataInvoiceInfo, - total: 2, - msg: '操作成功' - }); - }, - // - 'GET /api/system/bank': (req: Request, res: Response) => { - res.json({ code: 200, - data: [ - { - id: '1', - interbankNumber: '123456789', - bank: '中国银行', - accountName: '张三', - account: '6228480000000000000', - currency: '人民币', - nation: '中国', - province: '广东省', - city: '广州市', - updateTime: '2024-06-18', - }, - { - id: '2', - interbankNumber: '987654321', - bank: '工商银行', - accountName: '李四', - account: '6228480000000000001', - currency: '美元', - nation: '中国', - province: '江苏省', - city: '南京市', - updateTime: '2024-06-17', - }, - ], - total: 2, - msg: '操作成功' - }); - }, - // - 'GET /api/system/tianyancha': (req: Request, res: Response) => { - res.json({ code: 200, - data: [ - { - key: '1', - base: '京', - name: '北京科技有限公司', - legalPersonName: '张三', - legalPersonType: '1', - regNumber: '110108123456789', - industry: '信息技术', - companyOrgType: '有限责任公司', - regLocation: '北京市海淀区中关村', - estiblishTime: '2010-06-15', - fromTime: '2010-06-16', - toTime: '2025-06-15', - businessScope: '软件开发、技术咨询', - approvedTime: '2010-06-10', - regStatus: '存续', - regCapital: '5000万元', - regInstitute: '北京市工商局', - orgNumber: '1234567890', - creditCode: '91110108MA01A12345', - property3: 'Beijing Tech Co., Ltd.', - updatetime: '2025-06-15', - companyId: '1001', - taxNumber: '110108123456789', - email: 'contact@bjtech.com', - website: 'http://www.bjtech.com', - phoneNumber: '010-12345678', - lastUpdateTime: '2025-06-15 10:00:00', - }, - { - key: '2', - base: '沪', - name: '上海电子商务有限公司', - legalPersonName: '李四', - legalPersonType: '1', - regNumber: '310101987654321', - industry: '电子商务', - companyOrgType: '股份有限公司', - regLocation: '上海市浦东新区', - estiblishTime: '2015-03-20', - fromTime: '2015-03-21', - toTime: '2030-03-20', - businessScope: '电子商务平台运营、广告设计', - approvedTime: '2015-03-15', - regStatus: '存续', - regCapital: '1亿元', - regInstitute: '上海市工商局', - orgNumber: '0987654321', - creditCode: '91310101MA1AB23456', - property3: 'Shanghai E-commerce Co., Ltd.', - updatetime: '2025-06-15', - companyId: '1002', - taxNumber: '310101987654321', - email: 'info@shcommerce.com', - website: 'http://www.shcommerce.com', - phoneNumber: '021-87654321', - lastUpdateTime: '2025-06-15 09:30:00', - }, - ], - total: 2, - msg: '操作成功' }); - }, - // - 'GET /api/system/regionDict': (req: Request, res: Response) => { - res.json({ code: 200, - data: [ - { label: '境内', value: '境内' }, - { label: '境外', value: '境外' }, - ], - total: 2, - msg: '操作成功' }); - }, - 'GET /api/system/status': (req: Request, res: Response) => { - res.json({ code: 200, - data: [ - { label: '已准入', value: '已准入' }, - { label: '未准入', value: '未准入' }, - { label: '已驳回', value: '已驳回' }, - { label: '已退出', value: '已退出' }, - ], - total: 2, - msg: '操作成功' }); - }, - 'GET /api/system/list': (req: Request, res: Response) => { - res.json({ code: 200, - data: [ - { id: 1, name: '中山市合创展包装材料有限公司', region: '境内', supplierType: '中央企业', regTime: '2025-03-03', status: '已准入' }, - { id: 2, name: '深圳市欧阳华斯电源有限公司', region: '境内', supplierType: '民营企业', regTime: '2023-10-26', status: '已准入' }, - { id: 3, name: '广东振兴塑胶机械有限公司', region: '境内', supplierType: '中央企业', regTime: '2023-10-18', status: '已驳回' }, - { id: 4, name: '上海硕建建筑技术工程有限公司', region: '境内', supplierType: '民营企业', regTime: '2023-09-12', status: '已退出' }, - { id: 5, name: '中山市合创展包装材料有限公司', region: '境内', supplierType: '中央企业', regTime: '2023-08-30', status: '未准入' }, - { id: 6, name: '深圳市欧阳华斯电源有限公司', region: '境内', supplierType: '民营企业', regTime: '2023-07-31', status: '未准入' }, - { id: 7, name: '广东振兴塑胶机械有限公司', region: '境内', supplierType: '中央企业', regTime: '2023-07-25', status: '未准入' }, - { id: 8, name: '上海硕建建筑技术工程有限公司', region: '境内', supplierType: '民营企业', regTime: '2023-07-17', status: '未准入' }, - { id: 9, name: '广东振兴塑胶机械有限公司', region: '境内', supplierType: '中央企业', regTime: '2023-07-11', status: '未准入' }, - { id: 10, name: '上海硕建建筑技术工程有限公司', region: '境内', supplierType: '民营企业', regTime: '2023-07-10', status: '未准入' }, - ], - total: 10, - 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: '操作成功' }); - }, - - 'GET /api/500': (req: Request, res: Response) => { - res.status(500).send({ - timestamp: 1513932555104, - status: 500, - error: 'error', - message: 'error', - path: '/base/category/list', - }); - }, - - -}; diff --git a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx index e854512..d37dfbf 100644 --- a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; //第三方UI库/组件 import { Form, Button, Table, Select, Input, Space, Tooltip, message } from 'antd'; -import { SearchOutlined } from '@ant-design/icons'; +import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; //类型定义 import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //umi 相关 @@ -11,6 +11,8 @@ import SupplierViewModal from './components/SupplierViewModal'; import SupplierDetailModal from './components/SupplierDetailModal'; //本地服务/接口 import { getRegisterPage } from './services'; +//统一列表分页 +import tableProps from '@/utils/tableProps' // 列表数据接口 interface Data { @@ -77,7 +79,7 @@ const RegistrationQuery: React.FC = ({ dispatch }) => { setData(data.records); setPagination({ current: pageNo, pageSize, total: data.total }); } else { - message.error(message) + message.error(message) } } finally { setLoading(false); @@ -116,9 +118,9 @@ const RegistrationQuery: React.FC = ({ dispatch }) => { key: 'name', align: 'left', ellipsis: true, - render: (dom, record) => + render: (dom, record) => - { dispatch({ type: 'globalModal/show', @@ -137,13 +139,15 @@ const RegistrationQuery: React.FC = ({ dispatch }) => { dataIndex: 'supplierTypeCn', key: 'supplierTypeCn', align: 'center', + width: 160, }, { title: '供应商分类', dataIndex: 'enterpriseTypeCn', key: 'enterpriseTypeCn', align: 'center', - + width: 160, + }, { title: '注册时间', @@ -151,11 +155,13 @@ const RegistrationQuery: React.FC = ({ dispatch }) => { key: 'createTime', align: 'center', ellipsis: true, + width: 180, }, { title: '状态', dataIndex: 'accessStatusCn', key: 'accessStatusCn', + width: 160, align: 'center', render: (val: string) => = ({ dispatch }) => { title: '操作', key: 'option', align: 'center', + width: 160, render: (record) => ( = ({ dispatch }) => { ]; return ( <> - {/* 查询区 */} -
- - - - - - - - - - - - - - - - - {/* 列表 */} -
getList(pagination.current!, pagination.pageSize!)} - /> - {/* 查看组件 */} - setViewVisible(false)} - /> - {/* 准入明细组件 */} - setDetailVisible(false)} - /> +
+
+
+ + + + + + + + + + + + + + + + +
+
getList(pagination.current!, pagination.pageSize!)} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + {/* 查看组件 */} + setViewVisible(false)} + /> + {/* 准入明细组件 */} + setDetailVisible(false)} + /> + ); }; diff --git a/src/pages/supplier/informationRetrieval/registrationQuery/services.ts b/src/pages/supplier/informationRetrieval/registrationQuery/services.ts index bcf014f..28ffe63 100644 --- a/src/pages/supplier/informationRetrieval/registrationQuery/services.ts +++ b/src/pages/supplier/informationRetrieval/registrationQuery/services.ts @@ -1,8 +1,5 @@ import request from '@/utils/request'; - - - interface getRegisterPage { pageNo: number; pageSize: number; @@ -19,11 +16,3 @@ interface getCategoryPage { } export const getCategoryPage = (data: getCategoryPage) => request.post('/coscoSupplierBase/getCategoryPage', { data }); - - -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/supplierBlacklist/blacklistAudit/index.tsx b/src/pages/supplier/supplierBlacklist/blacklistAudit/index.tsx index df16256..6d1bb52 100644 --- a/src/pages/supplier/supplierBlacklist/blacklistAudit/index.tsx +++ b/src/pages/supplier/supplierBlacklist/blacklistAudit/index.tsx @@ -1,12 +1,13 @@ import React, { useEffect, useState } from "react"; import { Form, Button, Table, Select, Input, DatePicker, Modal, message } from "antd"; -import { SearchOutlined, ReloadOutlined, PlusOutlined } from "@ant-design/icons"; +import { SearchOutlined, DeleteOutlined } from "@ant-design/icons"; import type { ColumnsType } from 'antd/es/table'; import moment from 'moment'; +//接口 import { getDictList } from '@/servers/api/dicts' import { getPage, submit, restoreSubmit } from './services' - - +//统一列表分页 +import tableProps from '@/utils/tableProps' interface Columns { themeName: string; @@ -101,15 +102,16 @@ const blacklistManage: React.FC = () => { width: 60, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, - { title: "申请主题", dataIndex: "themeName", key: "themeName", align: "center" }, + { title: "申请主题", dataIndex: "themeName", key: "themeName", align: "left", ellipsis: true }, { title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center" }, { title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center" }, - { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center" }, + { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 }, { title: "审批记录状态", dataIndex: "approveStatusName", key: "approveStatusName", align: "center" }, { title: "操作", key: "option", align: "center", + width: 180, render: (record: any) => { const showSubmit = record.approveStatus; const showRestoreSubmi = record.restoreApproveStatus; @@ -129,47 +131,48 @@ const blacklistManage: React.FC = () => { return ( <> - {/* 查询表单 */} -
- - - - - - - - +
+
+ + + + + + + + + - - - - - - - - - {/* 顶部按钮区 */} + + + - {/* 表格 */} -
`共${total}条`, - }} - onChange={handleTableChange} - bordered - /> + + + + + + + + +
+ ); diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx index 4bd0d7f..795ca21 100644 --- a/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx +++ b/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from "react"; -import { Form, Button, Table, Select, Input, DatePicker, Space, message } from "antd"; -import { SearchOutlined, ReloadOutlined, PlusOutlined } from "@ant-design/icons"; +import { Form, Button, Table, Select, Input, DatePicker } from "antd"; +import { SearchOutlined, DeleteOutlined } from "@ant-design/icons"; import type { ColumnsType } from 'antd/es/table'; //组件 import ViewBlacklistModal from './components/ViewBlacklistModal'; @@ -9,7 +9,8 @@ import moment from 'moment'; //字典与接口 import { getDictList } from '@/servers/api/dicts' import { getPage } from './services' - +//统一列表分页 +import tableProps from '@/utils/tableProps' interface Columns { themeName: string; @@ -95,10 +96,10 @@ const blacklistManage: React.FC = () => { width: 60, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, - { title: "申请主题", dataIndex: "exitTheme", key: "exitTheme", align: "center" }, + { title: "申请主题", dataIndex: "exitTheme", key: "exitTheme", align: "left" }, { title: "发起单位", dataIndex: "deptId", key: "deptId", align: "center" }, { title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center" }, - { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center" }, + { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 }, { title: "审批记录状态", dataIndex: "approveStatusText", key: "approveStatusText", align: "center" }, { title: "操作", @@ -119,51 +120,56 @@ const blacklistManage: React.FC = () => { return ( <> - {/* 查询表单 */} -
- - - - - - - - +
+
+ + + + + + + + + - - - - - - - - - {/* 顶部按钮区 */} -
- + + + + + + + + + + + + + + + + + + +
+
- {/* 表格 */} -
`共${total}条`, - }} - onChange={handleTableChange} - bordered - /> - setCreateVisible(false)} onOk={() => setCreateVisible(false)} /> { width: 60, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, - { title: "申请主题", dataIndex: "exitTheme", key: "exitTheme", align: "center" }, + { title: "申请主题", dataIndex: "exitTheme", key: "exitTheme", align: "left", ellipsis: true }, { title: "发起单位", dataIndex: "deptId", key: "deptId", align: "center" }, { title: "发起部门", dataIndex: "deptId", key: "deptId", align: "center" }, - { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center" }, + { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 }, { title: "审批记录状态", dataIndex: "approveStatusText", key: "approveStatusText", align: "center" }, { title: "操作", @@ -111,45 +116,48 @@ const supplierExitAudit: React.FC = () => { return ( <> +
+
+
+ + + + + + + + - {/* 查询表单 */} - - - - - - - - - + + + - - - - - - - - - {/* 表格 */} -
`共${total}条`, - }} - onChange={handleTableChange} - /> + + + + + + + + +
+ setCreateVisible(false)} onOk={handleSelectOk} /> { return ( <> +
+
+
+ + + + + + + + - {/* 查询表单 */} - - - - - - - - - + + + - - - - - - - - - {/* 顶部按钮区 */} -
- + + + + + + + + + + + + +
+ +
- {/* 表格 */} -
`共${total}条`, - }} - onChange={handleTableChange} - /> - setCreateVisible(false)} onOk={handleSelectOk} /> { //查看信息与组件 const [viewRecord, setViewRecord] = useState(null); // 当前查看的消息 const [viewVisible, setViewVisible] = useState(false); // 弹窗显隐 - //下拉数据 + //下拉数据 const [categoryOptions, setCategoryOptions] = useState([]); // 获取数据 @@ -122,35 +124,42 @@ const SupplierMessage: React.FC = () => { return ( <> -
- - - - - - - - - - - -
+
+
+
+ + + + + + + + + + + + + + +
+
+ { // 获取 token - const token = localStorage.getItem('token'); + const token = sessionStorage.getItem('token'); + const userId = sessionStorage.getItem('userId'); return { url, options: { ...options, headers: { ...(options.headers || {}), - ...(token ? { Authorization: `Bearer ${token}` } : {}), // 标准写法,或根据你后端需求调整key名 + ...(token ? { Authorization: `Bearer ${token}` } : {}), + ...(userId ? { Mall3Check: `${userId}` } : {}), }, }, }; diff --git a/src/utils/tableProps.tsx b/src/utils/tableProps.tsx new file mode 100644 index 0000000..977efe2 --- /dev/null +++ b/src/utils/tableProps.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import type { TablePaginationConfig, TableProps as AntdTableProps } from 'antd'; +import LeftIcon from '@/assets/arrow-left.svg'; +import RightIcon from '@/assets/arrow-right.svg'; + +type TableProps = { + pagination: TablePaginationConfig; +}; + +const itemRender = (page: number, type: string, originalElement: React.ReactNode) => { + if (type === 'prev') { + return prev; + } + if (type === 'next') { + return next; + } + return originalElement; +}; + +const tableProps: TableProps = { + pagination: { + position: ['bottomLeft'], + defaultPageSize: 10, + showQuickJumper: true, + showSizeChanger: true, + showTotal: (total) => `共 ${total} 条`, + size: 'default', + locale: { + jump_to: '前往', + }, + className: 'pagination-container', + itemRender, // 自定义分页按钮 + }, +}; + +export default tableProps;