diff --git a/config/proxy.ts b/config/proxy.ts index db75cf8..20a8009 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -3,8 +3,8 @@ export default { '/api': { // target: 'http://10.242.37.148:18022',// // 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.125:18012',// 测试 + // target: 'http://10.0.0.14:18012',// 李 // target: 'http://10.0.0.46:18030',// 袁 changeOrigin: true, pathRewrite: { '^/api': '' }, diff --git a/src/components/GlobalModal/components/RiskList.tsx b/src/components/GlobalModal/components/RiskList.tsx index c628492..38dbce4 100644 --- a/src/components/GlobalModal/components/RiskList.tsx +++ b/src/components/GlobalModal/components/RiskList.tsx @@ -39,13 +39,13 @@ const RiskList = ({id}:{id:string}) => { ] //合规风险 const [dataList, setDataList] = useState([]) - //加载 - const [loading, setLoading] = useState(false); + //加载 const [loading, setLoading] = useState(false); + //分页 //数据渲染 const getList = async () => { - setLoading(true); + // setLoading(true); try { const { code, data } = await queryRiskInfo({ supplierId: id }); if (code === 200) { @@ -56,7 +56,7 @@ const RiskList = ({id}:{id:string}) => { } catch (error) { message.error(intl.formatMessage({id: 'component.globalModal.apiError'})); } finally { - setLoading(false); + // setLoading(false); } }; //初始化 diff --git a/src/pages/supplier/admission/SupplierEntryReview/index.tsx b/src/pages/supplier/admission/SupplierEntryReview/index.tsx index 1e4454b..6b7a633 100644 --- a/src/pages/supplier/admission/SupplierEntryReview/index.tsx +++ b/src/pages/supplier/admission/SupplierEntryReview/index.tsx @@ -134,7 +134,7 @@ const SupplierEntryReview: React.FC = () => { render: (_: any, record: any) => { return ( <> - {record.categoryNameList.map((item:string) => { + {record.categoryNameList && record.categoryNameList.map((item:string) => { return
{`${item}`}
})} diff --git a/src/pages/supplier/admission/admissionReviewManagement/index.tsx b/src/pages/supplier/admission/admissionReviewManagement/index.tsx index 63e3123..f47b2af 100644 --- a/src/pages/supplier/admission/admissionReviewManagement/index.tsx +++ b/src/pages/supplier/admission/admissionReviewManagement/index.tsx @@ -112,7 +112,7 @@ const CooperateEnterprise: React.FC = () => { render: (_: any, record: any) => { return ( <> - {record.categoryNameList.map((item:string) => { + {record.categoryNameList && record.categoryNameList.map((item:string) => { return
{`${item}`}
})} diff --git a/src/pages/supplier/backend/supplierNews/_mock.ts b/src/pages/supplier/backend/supplierNews/_mock.ts deleted file mode 100644 index c940ee1..0000000 --- a/src/pages/supplier/backend/supplierNews/_mock.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Request, Response } from 'express'; - -export default { - '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/categoryOption': (req: Request, res: Response) => { - res.json({ code: 200, - data: [ - { - value: '1', - label: '1', - }, - { - value: '2', - label: '3', - }, - ], - total: 2, - msg: '操作成功' - }); - }, -}; diff --git a/src/pages/supplier/backend/supplierNews/index.tsx b/src/pages/supplier/backend/supplierNews/index.tsx index 88546e7..ac94362 100644 --- a/src/pages/supplier/backend/supplierNews/index.tsx +++ b/src/pages/supplier/backend/supplierNews/index.tsx @@ -15,8 +15,8 @@ interface Data { } interface CategoryOption { - value: string; - label: string; + code: string; + dicName: string; } const supplierNews: React.FC = () => { @@ -82,21 +82,23 @@ const supplierNews: React.FC = () => { title: '业务类型', dataIndex: 'typeCn', key: 'typeCn', + width: 160, }, { title: '发送时间', dataIndex: 'createTime', key: 'createTime', + width: 200, }, ]; //初始化 useEffect(() => { - // categoryOption().then((res:any) => { - // const { code, data } = res; - // if(code == 200) { - // setCategoryOptions(data) - // } - // }) + getDictList('message_type').then((res:any) => { + const { code, data } = res; + if(code == 200) { + setCategoryOptions(data) + } + }) getExitMge().then((res) => { const { code, data } = res; if (code == 200) { @@ -138,8 +140,8 @@ const supplierNews: React.FC = () => { diff --git a/src/pages/supplier/category/CategoryLibraryManage/index.tsx b/src/pages/supplier/category/CategoryLibraryManage/index.tsx index 91fa61b..f519f9a 100644 --- a/src/pages/supplier/category/CategoryLibraryManage/index.tsx +++ b/src/pages/supplier/category/CategoryLibraryManage/index.tsx @@ -35,7 +35,7 @@ const CategoryLibraryManage: React.FC = () => { // 列表加载 const [loading, setLoading] = useState(false); // 分页 - const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 188 }); + const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); // 新增弹窗 const [addVisible, setAddVisible] = useState(false); diff --git a/src/pages/supplier/category/CategoryLibraryReview/index.tsx b/src/pages/supplier/category/CategoryLibraryReview/index.tsx index b2b7e0f..0cc7bbb 100644 --- a/src/pages/supplier/category/CategoryLibraryReview/index.tsx +++ b/src/pages/supplier/category/CategoryLibraryReview/index.tsx @@ -39,7 +39,7 @@ const CategoryLibraryManage: React.FC = () => { // 列表加载 const [loading, setLoading] = useState(false); // 分页 - const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 188 }); + const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); // const [enterpriseType, setEnterpriseType] = useState(); // 新增弹窗 diff --git a/src/pages/supplier/category/CategoryManage/index.tsx b/src/pages/supplier/category/CategoryManage/index.tsx index fc7727a..2421382 100644 --- a/src/pages/supplier/category/CategoryManage/index.tsx +++ b/src/pages/supplier/category/CategoryManage/index.tsx @@ -1,34 +1,15 @@ import React, { useEffect, useState } from 'react'; -import { Tree, Button, Modal, Form, Input, Select, message, Popconfirm, Spin } from 'antd'; +import { Table, Button, Modal, Form, Input, Select, message, Popconfirm, Spin } from 'antd'; import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons'; import { categoryTree, add, edit, del } from './services'; -interface CategoryNode { - id: string; - categoryName: string; - parentId: string; - type: string; // "0" 分类, "1" 品类 - orderBy: string; - children?: CategoryNode[] | null; -} -interface CategoryFormFields { - id?: string; - categoryName: string; - parentId: string; - type: string; - orderBy: string; -} - -const CategoryManage: React.FC = () => { - const [treeData, setTreeData] = useState([]); +const CategoryManageTable: React.FC = () => { + const [data, setData] = useState([]); const [loading, setLoading] = useState(false); - - // 弹窗相关 const [modalOpen, setModalOpen] = useState(false); const [modalType, setModalType] = useState<'add' | 'edit'>('add'); - const [currentNode, setCurrentNode] = useState(null); - const [form] = Form.useForm(); - const [expandedKeys, setExpandedKeys] = useState([]); + const [currentNode, setCurrentNode] = useState(null); + const [form] = Form.useForm(); // 加载树数据 const fetchTree = async () => { @@ -36,119 +17,97 @@ const CategoryManage: React.FC = () => { const res = await categoryTree(); setLoading(false); if (res.code === 200) { - setTreeData(res.data || []); + setData(res.data || []); } else { message.error(res.message || '加载失败'); } }; - useEffect(() => { - fetchTree(); - }, []); + useEffect(() => { fetchTree(); }, []); - useEffect(() => { - if (treeData && treeData.length) { - const allKeys: React.Key[] = []; - const collectKeys = (nodes: any[]) => { - nodes.forEach(node => { - allKeys.push(node.id); - if (node.children && node.children.length) { - collectKeys(node.children); - } - }); - }; - collectKeys(treeData); - setExpandedKeys(allKeys); - } - }, [treeData]); - -const convertToTreeData = (data?: CategoryNode[]): any[] => - (data || []).map(item => ({ - key: item.id, - title: ( -
- {item.categoryName} - {/* 横线,从名字右 5px 到按钮左 8px */} -
- {/* 按钮组整体贴右 */} - + // 表格字段 + const columns = [ + { + title: '品类名称', + dataIndex: 'categoryName', + key: 'categoryName', + }, + { + title: '类型', + dataIndex: 'type', + key: 'type', + render: (v: string) => (v === '0' ? '分类' : '品类'), + width: 80, + }, + { + title: '排序', + dataIndex: 'orderBy', + key: 'orderBy', + width: 80, + }, + { + title: '操作', + key: 'action', + width: 280, + render: (_:any, record:any) => ( + <> + >增加子级 - {/* 编辑 + handleDelete(item.id)} - disabled={!!(item.children && item.children.length > 0)} + onConfirm={() => handleDelete(record.id)} + disabled={!!(record.children && record.children.length > 0)} > - */} - -
- ), - children: item.children ? convertToTreeData(item.children) : [], - })); + + + ), + }, + ]; - - // 添加/修改提交 + // 提交 const handleOk = async () => { try { const values = await form.validateFields(); - console.log(values); - let res; if (modalType === 'add') { res = await add(values); @@ -165,7 +124,6 @@ const convertToTreeData = (data?: CategoryNode[]): any[] => } catch (err) { } }; - // 删除 const handleDelete = async (id: string) => { const res = await del(id); if (res.code === 200) { @@ -191,25 +149,25 @@ const convertToTreeData = (data?: CategoryNode[]): any[] => }; return ( -
-

品类管理

+
- setExpandedKeys(keys as React.Key[])} - style={{ background: '#fff', padding: 16, borderRadius: 6 }} + - - {/* 弹窗 */} ); }; -export default CategoryManage; +export default CategoryManageTable; diff --git a/src/pages/supplier/category/SupplierEntryManage/index.tsx b/src/pages/supplier/category/SupplierEntryManage/index.tsx index c178fc8..8bfafb0 100644 --- a/src/pages/supplier/category/SupplierEntryManage/index.tsx +++ b/src/pages/supplier/category/SupplierEntryManage/index.tsx @@ -35,7 +35,7 @@ const SupplierEntryManage: React.FC = () => { // 列表加载 const [loading, setLoading] = useState(false); // 分页 - const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 188 }); + const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); // 新增弹窗 const [addVisible, setAddVisible] = useState(false); diff --git a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/_mock.ts b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/_mock.ts deleted file mode 100644 index 4535259..0000000 --- a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/_mock.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Request, Response } from 'express'; - -// 代码中会兼容本地 service mock 以及部署站点的静态数据 -export default { - 'GET /api/supplier/getSupplierChangeList': (req: Request, res: Response) => { - res.send({ - code: 200, - msg: 'success', - data: [ - { - id: 1, - name: '中山市合创展包装材料有限公司', - region: '境内', - supplierType: '中央企业', - accessTime: '2025-03-03 09:30', - changeTime: '2025-03-03 09:30', - status: '未开始', - result: '', - }, - ], - total: 10 - }); - }, - 'GET /api/supplier/list': (req: Request, res: Response) => { - res.send({ - code: 200, - msg: 'success', - data: [ - { - id: 1, - name: '中山市合创展包装材料有限公司', - region: '境内', - supplierType: '中央企业', - accessTime: '2025-03-03 09:30', - changeTime: '2025-03-03 09:30', - status: '未开始', - result: '', - }, - ], - total: 10 - }); - }, - 'GET /api/system/getPage': (req: Request, res: Response) => { - res.json({ - code: 200, - data: [ - { - deptName: '供应商名称变更', - categoryName: '2024-05-20 13:22:11', - createTime: '集团采购部', - exitTime: '已通过', - exitReason: '2024-05-21 09:10:31', - }, - { - deptName: '法人代表变更', - categoryName: '2024-05-18 08:30:55', - createTime: '分公司审核部', - exitTime: '审核中', - exitReason: '', - }, - ], - total: 2, - msg: '操作成功' - }); - }, - - 'GET /api/system/getSupplierChangeDetail': (req: Request, res: Response) => { - res.json({ - "code": 200, - "msg": "success", - "data": { - baseInfo: [ - { label: '供应商名称', value: 'xxx' }, - { label: '境内/境外', value: '境内' }, - { label: '准入单位', value: 'xxxx' }, - { label: '准入部门', value: '采购部' }, - ], - changeInfo: [ - { label: '供应商名称-变更前', value: 'xxxx' }, - { label: '供应商名称-变更后', value: 'xxxx' }, - ], - "supplierName": "中山市合创展包装材料有限公司", - "accessUnit": "中远海运(青岛)有限公司", - "region": "境内", - "accessDept": "采购部", - "beforeName": "中山市合创展包装材料有限公司", - "afterName": "中山市合创展包装有限公司", - "qualifications": [ - { - "type": "CMMI资质", - "name": "CMMI资质", - "level": "高级", - "number": "546464", - "org": "XX机构", - "issueDate": "2024-09-08", - "validDate": "2028-09-10", - "file": "https://dummyimage.com/40x30/1890ff/fff.png&text=附件" - } - ] - } - } - ); - }, -}; diff --git a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx index 9686094..47e557d 100644 --- a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx +++ b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/index.tsx @@ -1,11 +1,15 @@ import React, { useEffect, useState } from 'react'; -import { Table, Form, Input, Select, Button, DatePicker, Tag, Space, message } from 'antd'; +import { Table, Form, Input, Select, Button, DatePicker, Tooltip } from 'antd'; import { SearchOutlined, ReloadOutlined } from '@ant-design/icons'; +//详情 import DetailView from './components/DetailView'; +//接口 import { getPage } from './services'; import type { ColumnsType } from 'antd/es/table'; +//字典 import { getDictList } from '@/servers/api/dicts' - +//umi 相关 +import { connect } from 'umi'; import moment from 'moment'; const { RangePicker } = DatePicker; @@ -32,30 +36,39 @@ interface Dict { dicName: string; code: string; } - -const SupplierChangeReviewManage: React.FC = () => { +interface Props { + dispatch: any; +} +const SupplierChangeReviewManage: React.FC = ({ dispatch }) => { + //搜索 const [form] = Form.useForm(); + //渲染数据 const [data, setData] = useState([]); + //列表加载 const [loading, setLoading] = useState(false); + //分页 const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); + //审批记录弹窗 const [detailVisible, setDetailVisible] = useState(false); + //审批记录弹窗 传入id const [currentDetailId, setCurrentDetailId] = useState(null); //列表数据 const [enterpriseType, setEnterpriseType] = useState(); - // 获取表格数据 const fetchData = async (params = {}) => { setLoading(true); try { const values = form.getFieldsValue(); - const { supplierName, changeTime, supplierType, approveStatus } = values; + const { changeTime } = values; const startTime = changeTime ? moment(changeTime[0]).format('YYYY-MM-DD') : ''; const endTime = changeTime ? moment(changeTime[1]).format('YYYY-MM-DD') : ''; - + const { code, data, message } = await getPage({ pageNo: pagination.current, pageSize: pagination.pageSize, - supplierName, startTime, endTime, supplierType, approveStatus, + startTime, + endTime, + ...values }); if (code === 200) { setData(data.records); @@ -67,7 +80,7 @@ const SupplierChangeReviewManage: React.FC = () => { setLoading(false); } }; - + // 初始化 useEffect(() => { getDictList('approve_type').then((res) => { if (res.code == 200) { @@ -93,6 +106,7 @@ const SupplierChangeReviewManage: React.FC = () => { setCurrentDetailId(record.id); setDetailVisible(true); }; + // 关闭弹窗 const handleDetailClose = () => { setDetailVisible(false); setCurrentDetailId(null); @@ -110,6 +124,21 @@ const SupplierChangeReviewManage: React.FC = () => { dataIndex: 'supplierName', align: 'center', ellipsis: true, + render: (dom, record) => + + { + dispatch({ + type: 'globalModal/show', + payload: { + id: record.id, + }, + }); + }} + > + {record.supplierName} + + , }, { title: '境内/境外', @@ -131,6 +160,7 @@ const SupplierChangeReviewManage: React.FC = () => { title: '提交变更时间', dataIndex: 'changeTime', align: 'center', + ellipsis: true, }, { title: '审批状态', @@ -202,4 +232,4 @@ const SupplierChangeReviewManage: React.FC = () => { ); }; -export default SupplierChangeReviewManage; +export default connect()(SupplierChangeReviewManage); diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/CategoryAddModal.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/CategoryAddModal.tsx index 109373c..7d55015 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/CategoryAddModal.tsx +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/CategoryAddModal.tsx @@ -17,14 +17,17 @@ const CategoryAddModal: React.FC = ({ visible, onCancel }) => { const [submitting, setSubmitting] = useState(false); useEffect(() => { - if (!visible) setValue([]); - //tree数据 - treeData().then((res) => { - const { code, data } = res; - if (code == 200) { - setDataTree(data) - } - }) + if(visible) { + //tree数据 + treeData().then((res) => { + const { code, data } = res; + if (code == 200) { + setDataTree(data) + } + }) + } else { + setValue([]); + } }, [visible]); // 提交方法 diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx index 95a787e..5b521fc 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx @@ -8,7 +8,7 @@ import { useIntl } from 'umi'; //本地服务/接口 import { getCategoryPage } from '../services'; //本地组件 -import CategoryAddModal from './CategoryAddModal'; +// import CategoryAddModal from './CategoryAddModal'; interface Data { id: number; @@ -78,7 +78,7 @@ const SupplierAccessDetailModal: React.FC = ({ v dataIndex: "index", key: "index", align: "center", - render: (_: any, __: any, idx: number) => idx + 1, + render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, width: 60, }, { @@ -143,7 +143,7 @@ const SupplierAccessDetailModal: React.FC = ({ v - + {/* - + */} {/* 表格内容 */}
= ({ v pagination={pagination} onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)} /> - {/* 新增品类弹窗 */} + {/* 新增品类弹窗 setAddModalVisible(false)} // onOk={...} // 根据你的业务需要加 - /> + />*/} ); }; diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx index d1e4265..9abdc14 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx @@ -1,15 +1,16 @@ import React, { useEffect, useState } from "react"; //第三方UI库/组件 -import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, message } from 'antd'; +import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, Tooltip } from 'antd'; import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons'; //类型定义 import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //umi 相关 +import { connect } from 'umi'; //本地组件、弹窗、业务逻辑 import SupplierViewModal from './components/SupplierViewModal'; import SupplierDetailModal from './components/SupplierDetailModal'; //本地服务/接口 -import { treeData, systemDict, getPageQualified } from './services'; +import { treeData, getPageQualified } from './services'; const { Option } = Select; //下拉数据接口 @@ -23,8 +24,10 @@ interface Data { regTime: string; status: string; } - -const groupQualifiedSupplierQuery: React.FC = () => { +interface Props { + dispatch: any; +} +const groupQualifiedSupplierQuery: React.FC = ({dispatch}) => { //搜搜表单 const [form] = Form.useForm(); // 树数据 @@ -38,7 +41,7 @@ const groupQualifiedSupplierQuery: React.FC = () => { //列表加载 const [loading, setLoading] = useState(false); //分页 - const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 188 }); + const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); //查看是否显示状态 const [viewVisible, setViewVisible] = useState(false); //准入明细是否显示状态 @@ -79,7 +82,8 @@ const groupQualifiedSupplierQuery: React.FC = () => { const getList = async (treeId: string, pageNo: number = 1, pageSize: number = 10) => { setLoading(true); try { - const { code, data, message } = await getPageQualified({ pageNo, pageSize, treeId }); + const values = form.getFieldsValue(); + const { code, data, message } = await getPageQualified({ pageNo, pageSize, treeId, ...values }); if (code === 200) { setData(data.records); setPagination({ current: pageNo, pageSize, total: data.total }); @@ -102,26 +106,24 @@ const groupQualifiedSupplierQuery: React.FC = () => { // 初始化时选中树第一个叶子节点,并请求右表 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) - } - }); + setRegionOptions([ + { label: '境内企业', value: 'dvs' }, + { label: '境外企业', value: 'ovs' }, + ]) + // // 集采类别 下拉 + // 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; @@ -145,14 +147,29 @@ const groupQualifiedSupplierQuery: React.FC = () => { key: 'index', align: 'center', width: 60, - render: (_: any, __: any, idx: number) => idx + 1, + render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, { title: '供应商名称', dataIndex: 'name', key: 'name', - align: 'center', + align: 'left', ellipsis: true, + render: (dom, record) => + + { + dispatch({ + type: 'globalModal/show', + payload: { + id: record.id, + }, + }); + }} + > + {record.name} + + , }, { title: '统一社会信用代码/税号', @@ -170,8 +187,8 @@ const groupQualifiedSupplierQuery: React.FC = () => { }, { title: '企业类型', - dataIndex: 'type', - key: 'type', + dataIndex: 'enterpriseTypeCn', + key: 'enterpriseTypeCn', align: 'center', ellipsis: true, }, @@ -236,9 +253,9 @@ const groupQualifiedSupplierQuery: React.FC = () => { style={{ marginBottom: 12, }} > - + - + {/* - - - {regionOptions.map(opt => ( ))} - + {/* 表格 */} @@ -299,4 +316,4 @@ const groupQualifiedSupplierQuery: React.FC = () => { ); }; -export default groupQualifiedSupplierQuery; +export default connect()(groupQualifiedSupplierQuery); diff --git a/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx b/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx index f114ae9..e6e8db6 100644 --- a/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx +++ b/src/pages/supplier/informationRetrieval/mySupplierInquiry/index.tsx @@ -92,6 +92,7 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => { // 准入状态下拉 setStoreOptions([ + { label: '未准入', value: '0' }, { label: '已准入', value: '1' }, { label: '退出', value: '2' }, ]) @@ -207,15 +208,15 @@ const mySupplierInquiry: React.FC = ({ dispatch }) => { - + {/* 表格 */} diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierDetailModal.tsx b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierDetailModal.tsx index 7ff9dcf..c54f68b 100644 --- a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierDetailModal.tsx +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/components/SupplierDetailModal.tsx @@ -8,7 +8,7 @@ import { useIntl } from 'umi'; //本地服务/接口 import { getCategoryPage } from '../services'; //本地组件 -import CategoryAddModal from './CategoryAddModal'; +// import CategoryAddModal from './CategoryAddModal'; interface Data { id: number; @@ -78,7 +78,7 @@ const SupplierAccessDetailModal: React.FC = ({ v dataIndex: "index", key: "index", align: "center", - render: (_: any, __: any, idx: number) => idx + 1, + render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, width: 60, }, { @@ -139,7 +139,7 @@ const SupplierAccessDetailModal: React.FC = ({ v - + {/* - + */} {/* 表格内容 */}
= ({ v pagination={pagination} onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)} /> - {/* 新增品类弹窗 */} + {/* 新增品类弹窗 setAddModalVisible(false)} // onOk={...} // 根据你的业务需要加 - /> + /> */} ); }; diff --git a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx index 55b6eef..221b638 100644 --- a/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/personQualifiedSupplierQuery/index.tsx @@ -1,17 +1,17 @@ import React, { useEffect, useState } from "react"; //第三方UI库/组件 -import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, message } from 'antd'; +import { Form, Button, Table , Input, Tree, Row, Col, Space, Tooltip } from 'antd'; import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons'; //类型定义 import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //umi 相关 +import { connect } from '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 }; // 列表数据接口 @@ -20,11 +20,14 @@ interface Data { name: string; region: string; supplierType: string; + personName: string; regTime: string; status: string; } - -const personQualifiedSupplierQuery: React.FC = () => { +interface Props { + dispatch: any; +} +const personQualifiedSupplierQuery: React.FC = ({ dispatch }) => { //搜搜表单 const [form] = Form.useForm(); // 树数据 @@ -146,7 +149,7 @@ const personQualifiedSupplierQuery: React.FC = () => { key: 'index', align: 'center', width: 60, - render: (_: any, __: any, idx: number) => idx + 1, + render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, { title: '姓名', @@ -154,6 +157,21 @@ const personQualifiedSupplierQuery: React.FC = () => { key: 'personName', align: 'center', ellipsis: true, + render: (dom, record) => + + { + dispatch({ + type: 'globalModal/show', + payload: { + id: record.id, + }, + }); + }} + > + {record.personName} + + , }, { title: '身份证号', @@ -250,15 +268,15 @@ const personQualifiedSupplierQuery: React.FC = () => { - + {/* 表格 */} @@ -289,4 +307,4 @@ const personQualifiedSupplierQuery: React.FC = () => { ); }; -export default personQualifiedSupplierQuery; +export default connect()(personQualifiedSupplierQuery); diff --git a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx index 83ebec1..e854512 100644 --- a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx @@ -94,7 +94,7 @@ const RegistrationQuery: React.FC = ({ dispatch }) => { //状态 下拉 setStatusOptions([ { label: '未准入', value: '0' }, - { label: '已准', value: '1' }, + { label: '已准入', value: '1' }, { label: '退出', value: '2' }, ]) //列表 diff --git a/src/pages/supplier/supplierBlacklist/blacklistAudit/index.tsx b/src/pages/supplier/supplierBlacklist/blacklistAudit/index.tsx index da87447..df16256 100644 --- a/src/pages/supplier/supplierBlacklist/blacklistAudit/index.tsx +++ b/src/pages/supplier/supplierBlacklist/blacklistAudit/index.tsx @@ -7,7 +7,7 @@ import { getDictList } from '@/servers/api/dicts' import { getPage, submit, restoreSubmit } from './services' - + interface Columns { themeName: string; unitName: string; @@ -24,18 +24,18 @@ const blacklistManage: React.FC = () => { const [data, setData] = useState([]); const [loading, setLoading] = useState(false); const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); - const [enterpriseType, setEnterpriseType] = useState(); + const [enterpriseType, setEnterpriseType] = useState(); // 查询接口 const getList = async (pageNo = 1, pageSize = 10) => { setLoading(true); // 可传查询条件 - const values = form.getFieldsValue(); - const { exitTheme, time, deptId, approveStatus } = values; - const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : ''; - const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : ''; - const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize } , exitTheme, deptId, approveStatus, startTime, endTime }); - + const values = form.getFieldsValue(); + const { exitTheme, time, deptId, approveStatus } = values; + const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : ''; + const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : ''; + const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize }, exitTheme, deptId, approveStatus, startTime, endTime }); + if (code === 200) { setData(data.records); setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total })); @@ -84,11 +84,11 @@ const blacklistManage: React.FC = () => { }; useEffect(() => { - getDictList('approve_type').then((res) => { - if (res.code == 200) { - setEnterpriseType(res.data) - } - }) + getDictList('approve_type').then((res) => { + if (res.code == 200) { + setEnterpriseType(res.data) + } + }) getList(); }, []); @@ -99,7 +99,7 @@ const blacklistManage: React.FC = () => { key: "index", align: "center", width: 60, - render: (_: any, __: any, idx: number) => idx + 1, + render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, { title: "申请主题", dataIndex: "themeName", key: "themeName", align: "center" }, { title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center" }, @@ -132,21 +132,21 @@ const blacklistManage: React.FC = () => { {/* 查询表单 */}
- - - - - - - - - - - + + + + + + + + + + + diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx index 4707472..44cfcc4 100644 --- a/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx +++ b/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx @@ -61,6 +61,7 @@ const CreateBlacklistModal: React.FC = ({ supplierIds: string[], } = { ...values, + backlistType: '0', supplierIds: suppliers.map((item) => item.supplierId), } const res = await blacklist(payload); @@ -137,7 +138,7 @@ const CreateBlacklistModal: React.FC = ({ layout="horizontal" > - = ({ ))} - + */} = ({ >选择 ) }, - { title: "供应商名称", dataIndex: "supplierName" }, - { title: "准入单位", dataIndex: "deptId" }, - { title: "准入部门", dataIndex: "deptId" }, + { title: "供应商名称", dataIndex: "supplierName", ellipsis: true }, { title: "准入品类", dataIndex: "categoryName" } ]; @@ -142,9 +140,7 @@ const SupplierSelectModal: React.FC = ({ >选择 ) }, - { title: "供应商名称", dataIndex: "supplierName" }, - { title: "准入单位", dataIndex: "deptId" }, - { title: "准入部门", dataIndex: "deptId" }, + { title: "供应商名称", dataIndex: "supplierName", ellipsis: true }, { title: "准入品类", dataIndex: "categoryName" } ]; diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx index cabd196..4bd0d7f 100644 --- a/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx +++ b/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx @@ -2,9 +2,11 @@ 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 type { ColumnsType } from 'antd/es/table'; +//组件 import ViewBlacklistModal from './components/ViewBlacklistModal'; import CreateBlacklistModal from './components/CreateBlacklistModal' import moment from 'moment'; +//字典与接口 import { getDictList } from '@/servers/api/dicts' import { getPage } from './services' @@ -21,13 +23,21 @@ interface Dict { code: string; } const blacklistManage: React.FC = () => { + //搜索 const [form] = Form.useForm(); + // 渲染列表数据 const [data, setData] = useState([]); + //列表加载 const [loading, setLoading] = useState(false); + //列表分页 const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); + //发起申请组件 const [createVisible, setCreateVisible] = useState(false); + //查看组件 const [viewVisible, setViewVisible] = useState(false); + // 组件传递ID const [selectedRecordId, setSelectedRecordId] = useState(null); + //字典下拉 const [enterpriseType, setEnterpriseType] = useState(); // 查询接口 diff --git a/src/pages/supplier/supplierExit/supplierExitAudit/index.tsx b/src/pages/supplier/supplierExit/supplierExitAudit/index.tsx index 6382516..35044e7 100644 --- a/src/pages/supplier/supplierExit/supplierExitAudit/index.tsx +++ b/src/pages/supplier/supplierExit/supplierExitAudit/index.tsx @@ -13,7 +13,7 @@ interface ExitRecord { createTime: string; // 发起时间 accessType: string; // 审批记录状态 } - + interface Dict { dicName: string; code: string; @@ -27,18 +27,18 @@ const supplierExitAudit: React.FC = () => { const [createVisible, setCreateVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false); const [selectedRecordId, setSelectedRecordId] = useState(null); - const [enterpriseType, setEnterpriseType] = useState(); - + const [enterpriseType, setEnterpriseType] = useState(); + // 查询接口 const getList = async (pageNo = 1, pageSize = 10) => { setLoading(true); // 可传查询条件 form.getFieldsValue() const values = form.getFieldsValue(); - const { exitTheme, time, deptId, approveStatus } = values; - const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : ''; - const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : ''; - - const { code, data } = await getPage({ pageNo, pageSize, exitTheme, deptId, approveStatus, startTime, endTime }); + const { exitTheme, time, deptId, approveStatus } = values; + const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : ''; + const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : ''; + + const { code, data } = await getPage({ pageNo, pageSize, exitTheme, deptId, approveStatus, startTime, endTime }); if (code === 200) { setData(data.records); setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total })); @@ -71,10 +71,10 @@ const supplierExitAudit: React.FC = () => { }; useEffect(() => { getDictList('approve_type').then((res) => { - if (res.code == 200) { - setEnterpriseType(res.data) - } - }) + if (res.code == 200) { + setEnterpriseType(res.data) + } + }) getList(); }, []); @@ -148,7 +148,6 @@ const supplierExitAudit: React.FC = () => { showTotal: total => `共${total}条`, }} onChange={handleTableChange} - bordered /> setCreateVisible(false)} onOk={handleSelectOk} /> diff --git a/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx b/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx index 2a0dfb4..d2298fe 100644 --- a/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx +++ b/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx @@ -115,8 +115,6 @@ const SupplierSelectModal: React.FC = ({ ) }, { title: "供应商名称", dataIndex: "supplierName" }, - { title: "准入单位", dataIndex: "deptId" }, - { title: "准入部门", dataIndex: "deptId" }, { title: "准入品类", dataIndex: "categoryName" } ]; @@ -143,8 +141,6 @@ const SupplierSelectModal: React.FC = ({ ) }, { title: "供应商名称", dataIndex: "supplierName" }, - { title: "准入单位", dataIndex: "deptId" }, - { title: "准入部门", dataIndex: "deptId" }, { title: "准入品类", dataIndex: "categoryName" } ]; diff --git a/src/pages/supplier/supplierExit/supplierExitManage/index.tsx b/src/pages/supplier/supplierExit/supplierExitManage/index.tsx index 336f4a6..beef7f7 100644 --- a/src/pages/supplier/supplierExit/supplierExitManage/index.tsx +++ b/src/pages/supplier/supplierExit/supplierExitManage/index.tsx @@ -154,7 +154,6 @@ const supplierExitManage: React.FC = () => { showTotal: total => `共${total}条`, }} onChange={handleTableChange} - bordered /> setCreateVisible(false)} onOk={handleSelectOk} />