diff --git a/src/pages/supplier/ViewReviewPage/GlobalModal/components/TianyanchaInfo.tsx b/src/pages/supplier/ViewReviewPage/GlobalModal/components/TianyanchaInfo.tsx index 338ddf3..ba8649d 100644 --- a/src/pages/supplier/ViewReviewPage/GlobalModal/components/TianyanchaInfo.tsx +++ b/src/pages/supplier/ViewReviewPage/GlobalModal/components/TianyanchaInfo.tsx @@ -1,7 +1,6 @@ import React, { useState, useEffect } from 'react'; import { Descriptions, Button, message } from 'antd'; import type { ColumnsType } from 'antd/es/table'; -import type { IntlShape } from 'react-intl'; import { getQuery, getQueryAndUpdate } from '../services'; import { useIntl } from 'umi'; diff --git a/src/pages/supplier/ViewReviewPage/components/BlacklistApproval.tsx b/src/pages/supplier/ViewReviewPage/components/BlacklistApproval.tsx new file mode 100644 index 0000000..29b0696 --- /dev/null +++ b/src/pages/supplier/ViewReviewPage/components/BlacklistApproval.tsx @@ -0,0 +1,145 @@ +import React, { useEffect, useState } from "react"; +import { Table, Descriptions, Spin, message, Tooltip } from "antd"; +import { viewBlacklist } from "../services"; +import type { ColumnsType } from 'antd/es/table'; +import { getDictList } from '@/servers/api/dicts'; +import GlobalModal from '../GlobalModal/index' + + +interface Supplier { + id: number; // 作为 rowKey 用于唯一标识 + supplierName: string; // 供应商名称 + unit: string; // 准入部门 + accessTime: string; // 准入时间 + categoryName: string; // 准入品类 + lastEval: string; // 最近一次评价 + lastEvalDate: string; // 评价时间 + supplierId: string; + categoryId: string; +} +interface DetailData { + deptName: string; + timelimitType: string; + blacklistReason: string; +} + +interface ViewBlacklistModalProps { + visible: boolean; + record: any; // 用于查询详情数据 +} + +const ViewBlacklistModal: React.FC = ({ + visible, + record = {}, +}) => { + const [loading, setLoading] = useState(false); + const [detail, setDetail] = useState(null); + const [suppliers, setSuppliers] = useState([]); + const [timelimitMap, setTimelimitMap] = useState<{ [code: string]: string }>({}); + const [visibleGlobalModal, setVisibleGlobalModal] = useState(false); + const [id, setId] = useState(''); + + const fetchData = async () => { + setLoading(true); + try { + const { code, data } = await viewBlacklist(record.id) + if (code == 200) { + setDetail(data); + } else { + message.error("获取详情失败"); + } + + if (code == 200) { + setSuppliers(data.supplierList || []); + } else { + message.error("获取供应商列表失败"); + } + } catch (error) { + message.error("获取数据异常"); + } finally { + setLoading(false); + } + }; + + useEffect(() => { + if (visible && record) { + getDictList('blacklist_deadline').then((res) => { + const { code, data } = res; + if (code == 200) { + const map: { [code: string]: string } = {}; + data.forEach((item: { code: string, dicName: string }) => { + map[item.code] = item.dicName; + }); + setTimelimitMap(map); + } + }) + fetchData(); + } + }, [visible, record]); + + const columns: ColumnsType = [ + { + title: "供应商名称", dataIndex: "supplierName", align: "left", + width: 200, + ellipsis: true, + render: (dom, record) => { + return ( + + { + setId(record.supplierId) + setVisibleGlobalModal(true) + }} + > + {record.supplierName} + + + ) + } + }, + + // { title: "准入部门", dataIndex: "deptName", align: "center" }, + // { title: "准入时间", dataIndex: "evaluateTime", align: "center" }, + { title: "统一社会信用代码/税号", dataIndex: "unifiedCode", align: "center" }, + { + title: "准入品类", dataIndex: "categoryName", align: "center", width: 180, + ellipsis: true, + render: (dom, record) => { + return ( + + {record.categoryName} + + ) + } + }, + ]; + + return ( +
+ + + + {detail && ( + + {timelimitMap[detail.timelimitType] || '' } + {detail.blacklistReason} + + )} + + setVisibleGlobalModal(false)} /> + + ); +}; + +export default ViewBlacklistModal; diff --git a/src/pages/supplier/ViewReviewPage/components/CategoryLibraryApproval.tsx b/src/pages/supplier/ViewReviewPage/components/CategoryLibraryApproval.tsx new file mode 100644 index 0000000..efa436a --- /dev/null +++ b/src/pages/supplier/ViewReviewPage/components/CategoryLibraryApproval.tsx @@ -0,0 +1,90 @@ +import React, { useEffect, useState } from 'react'; +import { Descriptions } from 'antd'; +import { detail } from "../services"; +import { getDictList } from '@/servers/api/dicts' + +// 基本信息类型 +interface CategoryInfo { + name?: string; + validDate?: string; + manager?: string; + structure?: string; + termOfValidity?: string; + deptId?: string; + applyOrgName?: string; + orgName?: string; + deptName?: string; + categoryName?: string; + area?: string; +} + +const ViewModal: React.FC<{ + visible: boolean; + record: any; +}> = ({ visible, record={} }) => { + // 已勾选的供应商 id + // 品类库基本信息 + const [categoryInfo, setCategoryInfo] = useState({}); + const [areaMap, setAreaMap] = useState<{ [code: string]: string }>({}); + // 拉取基本信息 + const fetchCategoryInfo = async () => { + if (!record) return; + const res = await detail({ id: record.id }); + if (res.code === 200 && res.data) setCategoryInfo(res.data); + }; + useEffect(() => { + if (visible) { + getDictList('area').then(res => { + if (res.code === 200) { + const map: { [code: string]: string } = {}; + res.data.forEach((item: { code: string, dicName: string }) => { + map[item.code] = item.dicName; + }); + setAreaMap(map); + } + }); + fetchCategoryInfo(); + } + }, [visible, record]); + + return ( +
+ {/* 基本信息区 */} +
+ + + {categoryInfo?.name || '-'} + + + {categoryInfo?.termOfValidity || '-'} + + + {categoryInfo?.applyOrgName || '-'} + + + {categoryInfo?.orgName || '-'} + + + {categoryInfo?.deptName || '-'} + + + {categoryInfo?.area ? areaMap[categoryInfo.area] || categoryInfo?.area : '-'} + + + + + {categoryInfo?.categoryName || '-'} + + +
+
+ ); +}; + +export default ViewModal; diff --git a/src/pages/supplier/ViewReviewPage/components/CategoryLibrarySupplierApproval.tsx b/src/pages/supplier/ViewReviewPage/components/CategoryLibrarySupplierApproval.tsx new file mode 100644 index 0000000..60707ba --- /dev/null +++ b/src/pages/supplier/ViewReviewPage/components/CategoryLibrarySupplierApproval.tsx @@ -0,0 +1,157 @@ +import React, { useEffect, useState } from 'react'; +import { Descriptions, Tooltip, Table } from 'antd'; +import { applyDetail } from "../services"; +import type { DataNode } from 'antd/es/tree'; +import type { ColumnsType } from 'antd/es/table'; +import { getDictList } from '@/servers/api/dicts' +import GlobalModal from '../GlobalModal/index' + +// 基本信息类型 +interface CategoryInfo { + name?: string; + validDate?: string; + manager?: string; + structure?: string; + termOfValidity?: string; + categoryName?: string; + deptName?: string; + deptId?: string; + area?: string; + applyTime?: string; + coscoCategoryLibrarySupplierVos?: coscoCategoryLibrarySupplierVos[]; +} +interface coscoCategoryLibrarySupplierVos { + area: string; + id: string; + name: string; + selected: boolean; + supplierCategory: string; + unifiedSocialCreditCode: string; +} +interface LockNode extends DataNode { + key: string; + title: string; + categoryLibraryId: string; + categoryId: string; + lockType: string; + children?: LockNode[]; +} + +interface columns { + id: string; + name: string; + supplierCategory: string; +} + +const ViewModal: React.FC<{ + visible: boolean; + record: any; +}> = ({ visible, record={} }) => { + const [categoryInfo, setCategoryInfo] = useState({}); + const [areaMap, setAreaMap] = useState<{ [code: string]: string }>({}); + const [visibleGlobalModal, setVisibleGlobalModal] = useState(false); + const [id, setId] = useState(''); + // 拉取基本信息 + const fetchCategoryInfo = async () => { + if (!record) return; + const res = await applyDetail({ id: record.id }); + if (res.code === 200 && res.data) setCategoryInfo(res.data); + + }; + const formatData = (list: any[]): LockNode[] => { + return list.map(item => ({ + key: item.categoryId, + title: item.categoryName, + categoryId: item.categoryId, + categoryLibraryId: item.categoryLibraryId, + lockType: item.lockType ? item.lockType : '0', + children: item.categoryList ? formatData(item.categoryList) : [], + })); + }; + useEffect(() => { + if (visible) { + getDictList('area').then(res => { + if (res.code === 200) { + const map: { [code: string]: string } = {}; + res.data.forEach((item: { code: string, dicName: string }) => { + map[item.code] = item.dicName; + }); + setAreaMap(map); + } + }); + fetchCategoryInfo(); + } + }, [visible, record]); + const columns: ColumnsType = [ + { + title: "供应商名称", dataIndex: "name", align: "left", + width: 360, + ellipsis: true, + render: (dom, record) => { + return ( + + { + setId(record.id) + setVisibleGlobalModal(true) + }} + > + {record.name} + + + ) + } + }, + { + title: '境内/境外', dataIndex: 'supplierCategory', align: 'center', + render: (record: any) => { + const supplierCategoryType = record.supplierCategory === 'dvs' ? '境内企业' : record.supplierCategory === 'pe' ? '个人' : '境外企业' + return ( + {supplierCategoryType} + ) + } + }, + { title: '统一社会信用代码/税号', dataIndex: 'unifiedSocialCreditCode', align: 'center' }, + ] + return ( +
+ {/* 基本信息区 */} +
+ + + {categoryInfo?.name || '-'} + + + {categoryInfo?.applyTime || '-'} + + + + {categoryInfo?.area ? areaMap[categoryInfo.area] || categoryInfo?.area : '-'} + + + + {categoryInfo?.categoryName || '-'} + + +
+ {/*申请入库供应商 */} +
+ setVisibleGlobalModal(false)} /> + + ); +}; + +export default ViewModal; diff --git a/src/pages/supplier/ViewReviewPage/components/EvaluationApproval.tsx b/src/pages/supplier/ViewReviewPage/components/EvaluationApproval.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/supplier/ViewReviewPage/components/ExitApproval.tsx b/src/pages/supplier/ViewReviewPage/components/ExitApproval.tsx new file mode 100644 index 0000000..edc08fe --- /dev/null +++ b/src/pages/supplier/ViewReviewPage/components/ExitApproval.tsx @@ -0,0 +1,145 @@ +import React, { useEffect, useState } from "react"; +import { Button, Table, Form, Input, Tooltip, DatePicker } from "antd"; +import type { ColumnsType } from 'antd/es/table'; +import { SearchOutlined, DeleteOutlined } from "@ant-design/icons"; +//umi 相关 +import { connect } from 'umi'; +import moment from 'moment'; +//接口 +import { getExitInfoPage } from "../services"; +import GlobalModal from '../GlobalModal/index' + +//统一列表分页 +import tableProps from '@/utils/tableProps' +interface Supplier { + id: string; // 作为 rowKey 用于唯一标识 + supplierName: string; // 供应商名称 + unit: string; // 准入部门 + accessTime: string; // 准入时间 + categoryName: string; // 准入品类 + lastEval: string; // 最近一次评价 + lastEvalDate: string; // 评价时间 + supplierId: string; + categoryId: string; +} + +interface ViewBlacklistModalProps { + visible: boolean; + record: any; // 用于查询详情数据 +} + +const ViewBlacklistModal: React.FC = ({ + visible, + record={}, +}) => { + const [loading, setLoading] = useState(false); + + const [form] = Form.useForm(); + const [data, setData] = useState([]); + const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); + + const [visibleGlobalModal, setVisibleGlobalModal] = useState(false); + const [id, setId] = useState(''); + // 查询接口 + const getList = async (pageNo = 1, pageSize = 10) => { + setLoading(true); + // 可传查询条件 form.getFieldsValue() + + const values = form.getFieldsValue(); + const { time } = 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 getExitInfoPage({ supplierexitId: record.id, pageNo, pageSize, ...values, startTime, endTime }); + if (code === 200) { + setData(data.records); + setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total })); + } + setLoading(false); + }; + + // 查询 + const handleSearch = () => { + setPagination({ ...pagination, current: 1 }); + getList(1, pagination.pageSize); + }; + // 重置 + const handleReset = () => { + form.resetFields(); + setPagination({ ...pagination, current: 1 }); + getList(1, pagination.pageSize); + }; + + useEffect(() => { + if (visible && record) { + getList(); + } + }, [visible, record]); + + const columns: ColumnsType = [ + { + title: "供应商名称", dataIndex: "supplierName", align: "left", + width: 360, + ellipsis: true, + render: (dom, record) => { + return ( + + { + setId(record.supplierId) + setVisibleGlobalModal(true) + }} + > + {record.supplierName} + + + ) + } + }, + { title: "发起单位", dataIndex: "orgName", align: "center", ellipsis: true, width: 160 }, + { title: "发起部门", dataIndex: "deptName", align: "center", ellipsis: true, width: 160 }, + { title: "退出品类", dataIndex: "categoryName", align: "center", ellipsis: true, width: 160 }, + { title: "退出时间", dataIndex: "createTime", align: "center", width: 180 }, + ]; + + return ( +
+
+
+ + + + + + + + + + + + + + +
+ +
{ + getList(pagination.current, pagination.pageSize); + }} + style={{ flex: 1, minHeight: 'calc(100vh - 350px)' }} + scroll={{ y: 'calc(100vh - 350px)' }} + /> + setVisibleGlobalModal(false)} /> + + + ); +}; + +export default connect()(ViewBlacklistModal); diff --git a/src/pages/supplier/ViewReviewPage/components/ResultModal.tsx b/src/pages/supplier/ViewReviewPage/components/ResultModal.tsx index e7018e1..518774f 100644 --- a/src/pages/supplier/ViewReviewPage/components/ResultModal.tsx +++ b/src/pages/supplier/ViewReviewPage/components/ResultModal.tsx @@ -7,7 +7,6 @@ import GlobalModal from '../GlobalModal/index' interface ResultModalProps { visible: boolean; record?: { id?: string;[key: string]: any } | null; - onCancel: () => void; dispatch: any; } @@ -44,8 +43,6 @@ const RemarkViewModal: React.FC<{ const ResultModal: React.FC = ({ visible, record, - onCancel, - dispatch }) => { const [loading, setLoading] = useState(false); const [suppliers, setSuppliers] = useState([]); @@ -227,7 +224,7 @@ const ResultModal: React.FC = ({ return ( - {groupSummaryResult[sup.supplierId] === '0' ? '合格' : '不合格'} + {groupSummaryResult[sup.supplierId] === '0' ? '合格' : groupSummaryResult[sup.supplierId] === '1'? '不合格': ''} ) @@ -237,7 +234,6 @@ const ResultModal: React.FC = ({ return (
-

查看评审结果

= ({ visible, record = {} }) => { + //渲染数据 + const [data, setData] = useState(null); + const [loading, setLoading] = useState(false); + const [visibleGlobalModal, setVisibleGlobalModal] = useState(false); + const [id, setId] = useState(''); + + //初始化 + useEffect(() => { + console.log(record, visible); + + if (visible && record?.id) { + setLoading(true); + coscoAccessWork(record.id) + .then((res) => { + const { code, data } = res; + if (code == 200) { + setData(data); + } + }) + .finally(() => setLoading(false)); + } else { + setData(null); + } + }, [visible, record]); + + return ( +
+ + {data && ( + + + {data.coscoAccessSupplierList.map((item) => { + return ( + { + setId(item.supplierId) + setVisibleGlobalModal(true) + }} + > + {item.supplierName} + + ) + })} + + {data.coscoAccessWork.orgName} + + {data.coscoAccessCategoryList.map((item) => { + return ( +
{item.categoryPathName}
+ ) + })} +
+ + {data.coscoAccessCategoryList.map((item) => { + return ( +
{item.categoryPathName}
+ ) + })} +
+ {data.coscoAccessWork.orgName} + {data.coscoAccessWork.deptName} + {data.coscoAccessWork.deptName} + {data.coscoAccessWork.deptName} +
+ )} +
+ setVisibleGlobalModal(false)} /> +
+ ); +}; + +export default ViewModal; \ No newline at end of file diff --git a/src/pages/supplier/ViewReviewPage/components/SupplierInfoChangeApproval.tsx b/src/pages/supplier/ViewReviewPage/components/SupplierInfoChangeApproval.tsx new file mode 100644 index 0000000..6acd649 --- /dev/null +++ b/src/pages/supplier/ViewReviewPage/components/SupplierInfoChangeApproval.tsx @@ -0,0 +1,91 @@ +import React, { useEffect, useState } from 'react'; +import { Spin, Descriptions } from 'antd'; +import { supplierChangeApplyById } from '../services'; + + +interface InfoItem { + fieldAnnotation?: string; + newValue?: string; + oldValue?: string; + title?: string; + changeDesc?: string; + supplierName?: string; + approveStatusText?: string; + coscoSupplierChangeHistoryList?: []; +} +interface DetailData { + fieldAnnotation?: string; + title?: string; + changeDesc?: string; + supplierName?: string; + approveStatusText?: string; + coscoSupplierChangeHistoryList: InfoItem[]; +} +interface DetailViewProps { + visible: boolean; + record: any; +} + +const supplierInfoChangeApproval: React.FC = ({ visible, record={} }) => { + + const [loading, setLoading] = useState(false); + const [detailData, setDetailData] = useState(null); + + useEffect(() => { + if (visible && record) { + setLoading(true); + supplierChangeApplyById(record.id) + .then(res => { + if (res.code === 200) { + setDetailData(res.data); + } + }) + .finally(() => setLoading(false)); + } + if (!visible) setDetailData(null); + }, [visible, record]); + + + + // 把info数组两两合并成一行显示 + function renderInfoTable(infoArr: InfoItem[]) { + const rows = []; + for (let i = 0; i < infoArr.length; i++) { + rows.push( + <> + {infoArr[i].oldValue} + {infoArr[i].newValue} + + ); + } + return ( + + {rows} + + ); + } + + return ( +
+ + {detailData && ( +
+ {/* 基本信息 */} + + {detailData?.title} + {detailData?.changeDesc} + {/* {detailData?.coscoSupplierChangeHistoryList && ( + {detailData?.changeDesc} + ) } */} + + {/* 变更内容 */} +
变更内容:
+ {renderInfoTable(detailData.coscoSupplierChangeHistoryList)} +
+ )} +
+
+ ); +}; + +export default supplierInfoChangeApproval; diff --git a/src/pages/supplier/ViewReviewPage/components/ViewModal.tsx b/src/pages/supplier/ViewReviewPage/components/ViewModal.tsx index 6cd87b7..07bdc07 100644 --- a/src/pages/supplier/ViewReviewPage/components/ViewModal.tsx +++ b/src/pages/supplier/ViewReviewPage/components/ViewModal.tsx @@ -1,6 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { Modal, Descriptions, Spin } from 'antd'; -import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; +import { Descriptions, Spin } from 'antd'; import GlobalModal from '../GlobalModal/index' import { coscoAccessWork } from '../services' @@ -46,19 +45,17 @@ interface coscoAccessWorks { const ViewModal: React.FC<{ visible: boolean; record?: any; - onCancel: () => void; -}> = ({ visible, record = {}, onCancel }) => { +}> = ({ visible, record = {} }) => { //渲染数据 - const [data, setData] = useState < Data | null > (null); - const supplierDetailModal = useSupplierDetailModal(); + const [data, setData] = useState(null); const [loading, setLoading] = useState(false); const [visibleGlobalModal, setVisibleGlobalModal] = useState(false); const [id, setId] = useState(''); //初始化 useEffect(() => { - console.log(record,visible); - + console.log(record, visible); + if (visible && record?.id) { setLoading(true); coscoAccessWork(record.id) @@ -76,30 +73,33 @@ const ViewModal: React.FC<{ return (
-

查看详情

{data && ( - {data.coscoAccessWork.orgName} - {data.coscoAccessWork.deptName} + {/* {data.coscoAccessWork.orgName} + {data.coscoAccessWork.deptName} */} {data.coscoAccessSupplierList.map((item) => { return ( - { - setId(item.supplierId) - setVisibleGlobalModal(true) - }} - > - {item.supplierName} - - //
supplierDetailModal?.(item.supplierId)} >{item.supplierName}
- + { + setId(item.supplierId) + setVisibleGlobalModal(true) + }} + > + {item.supplierName} + ) })}
- - {data.coscoAccessWork.accessType === 'scattered' && ( + + {data.coscoAccessCategoryList.map((item) => { + return ( +
{item.categoryPathName}
+ ) + })} +
+ {/* {data.coscoAccessWork.accessType === 'scattered' && ( <> {data.coscoAccessCategoryList.map((item) => { @@ -113,8 +113,8 @@ const ViewModal: React.FC<{ {data.coscoAccessWorkAttachments.fileName} - )} - {data.coscoAccessWork.accessType === 'offline' && ( + )} */} + {/* {data.coscoAccessWork.accessType === 'offline' && ( <> {data.coscoAccessCategoryList.map((item) => { @@ -127,10 +127,10 @@ const ViewModal: React.FC<{ {data.coscoAccessWorkAttachments.fileName} - )} + )} */} - {data.coscoAccessWork.accessType === 'online' && ( + {/* {data.coscoAccessWork.accessType === 'online' && ( <> {data.coscoAccessCategoryList.map((item) => { @@ -150,12 +150,12 @@ const ViewModal: React.FC<{ {data.coscoAccessWork.approveStatusText} - )} + )} */}
)}
- setVisibleGlobalModal(false)} /> + setVisibleGlobalModal(false)} />
); }; diff --git a/src/pages/supplier/ViewReviewPage/index.tsx b/src/pages/supplier/ViewReviewPage/index.tsx index c1ade39..cb712ff 100644 --- a/src/pages/supplier/ViewReviewPage/index.tsx +++ b/src/pages/supplier/ViewReviewPage/index.tsx @@ -1,10 +1,16 @@ -// ViewReviewPage.tsx import React, { useState, useEffect } from 'react'; import ResultModal from './components/ResultModal'; import ViewModal from './components/ViewModal'; +import BlacklistApproval from './components/BlacklistApproval'; +import ExitApproval from './components/ExitApproval'; +import CategoryLibraryApproval from './components/CategoryLibraryApproval'; +import CategoryLibrarySupplierApproval from './components/CategoryLibrarySupplierApproval'; +import SupplierCategoryAccessApproval from './components/SupplierCategoryAccessApproval'; +import SupplierInfoChangeApproval from './components/SupplierInfoChangeApproval'; import { refreshDictCache } from '@/servers/api/login'; import { encryptWithRsa } from '@/utils/encryptWithRsa'; + const ViewReviewPage: React.FC = () => { const [modalVisible, setModalVisible] = useState(false); const [modalRecord, setModalRecord] = useState<{ id: string } | null>(null); @@ -14,20 +20,17 @@ const ViewReviewPage: React.FC = () => { const params = new URLSearchParams(window.location.search); const base64 = params.get('code'); if (!base64) return; - + const b64 = base64.replace(/-/g, '+').replace(/_/g, '/'); try { // 解码 - const decodedStr = atob(base64); - const p2 = new URLSearchParams(decodedStr); - + const decodedStr = atob(b64); + const query = /%[0-9A-F]{2}/i.test(decodedStr) ? decodeURIComponent(decodedStr) : decodedStr; + const p2 = new URLSearchParams(query); const id = p2.get('id') ?? ''; const code = p2.get('code') ?? ''; const userId = p2.get('userId') ?? ''; - if (!id) return; - setType(code); // code 现在一定是 string - // 初始化字典 if (!sessionStorage.getItem('dict')) { refreshDictCache().then((res) => { @@ -36,12 +39,10 @@ const ViewReviewPage: React.FC = () => { } }); } - // 只有在 userId 存在时再加密保存 if (userId) { sessionStorage.setItem('userId', encryptWithRsa(userId)); } - setModalRecord({ id }); setModalVisible(true); } catch (err) { @@ -63,21 +64,85 @@ const ViewReviewPage: React.FC = () => { return (
- {/* 供应商准入审批, 供应商品类准入审批 */} - {['supplierAccessApproval', 'supplierCategoryAccessApproval'].includes(type) && ( + {/* 供应商准入审批 */} + {['supplierAccessApproval'].includes(type) && ( <> setModalVisible(false)} /> setModalVisible(false)} /> )} + {/* 供应商品类准入审批 */} + {['supplierCategoryAccessApproval'].includes(type) && ( + <> + + + )} + {/* 供应商信息变更审批*/} + {['supplierInfoChangeApproval'].includes(type) && ( + <> + + + )} + {/* 黑名单审批*/} + {['blacklistApproval'].includes(type) && ( + <> + + + )} + {/* 退出审批 ----*/} + {['exitApproval'].includes(type) && ( + <> + + + )} + {/* 品类库审批 */} + {['categoryLibraryApproval'].includes(type) && ( + <> + + + )} + {/* 品类库供应商入库审批 */} + {['categoryLibrarySupplierApproval'].includes(type) && ( + <> + + + )} + {/* 评价审批 */} + {['evaluationApproval'].includes(type) && ( + <> + {/* */} + + )} + + +
); }; diff --git a/src/pages/supplier/ViewReviewPage/services.ts b/src/pages/supplier/ViewReviewPage/services.ts index a9d1dd3..de29ad8 100644 --- a/src/pages/supplier/ViewReviewPage/services.ts +++ b/src/pages/supplier/ViewReviewPage/services.ts @@ -36,54 +36,50 @@ export const coscoSupplierBase = (data: coscoSupplierBaseData) => request.post(' /** * 未准入的供应商分页列表查询 */ -interface addInterface { - categoryIds: string[]; - coscoAccessItems: CoscoAccessItem[]; - coscoAccessUserls: CoscoAccessUserl[]; - coscoAccessWork: CoscoAccessWork; - supplierIds: string[]; - [property: string]: any; -} +// interface addInterface { +// categoryIds: string[]; +// coscoAccessItems: CoscoAccessItem[]; +// coscoAccessUserls: CoscoAccessUserl[]; +// coscoAccessWork: CoscoAccessWork; +// supplierIds: string[]; +// [property: string]: any; +// } -interface CoscoAccessItem { - itemName: string; - reviewBy: string[]; - [property: string]: any; -} +// interface CoscoAccessItem { +// itemName: string; +// reviewBy: string[]; +// [property: string]: any; +// } -interface CoscoAccessUserl { - deptId: string; - isLeader: number; - userId: string; - [property: string]: any; -} +// interface CoscoAccessUserl { +// deptId: string; +// isLeader: number; +// userId: string; +// [property: string]: any; +// } -interface CoscoAccessWork { - accessType: string; - accessWorkName: string; - deptId: string; - endTime: string; - startTime: string; - [property: string]: any; -} -export const add = (data: addInterface) => request.post('/coscoAccessWork/add', { data }); +// interface CoscoAccessWork { +// accessType: string; +// accessWorkName: string; +// deptId: string; +// endTime: string; +// startTime: string; +// [property: string]: any; +// } +// export const add = (data: addInterface) => request.post('/coscoAccessWork/add', { data }); + + +// interface getUserPage { +// basePageRequest: basePageRequest; +// userId: string; +// } +// interface basePageRequest { +// pageNo: number; +// pageSize: number; +// } - - - - -interface getUserPage { - basePageRequest: basePageRequest; - userId: string; -} -interface basePageRequest { - pageNo: number; - pageSize: number; -} - - -export const getUserPage = (data: getUserPage) => request.post('/v1/sysuser/getPageByUserCompany', { data }); +// export const getUserPage = (data: getUserPage) => request.post('/v1/sysuser/getPageByUserCompany', { data }); /** * 品类选择查询树 @@ -94,33 +90,49 @@ export const categoryTree = () => request.get('/cosco/category/categoryTree'); */ export const coscoAccessWork = (id: string) => request.get(`/coscoAccessWork/${id}`); -/** - * 上传文件 - * @param file 上传的文件对象 - * @returns 上传结果 - */ -export const uploadFile = async (file: File) => { - const formData = new FormData(); - formData.append('file', file); - - return request('/fileConfig/files/upload', { - method: 'POST', - data: formData, - - }); -}; - /** * 发起审批 */ -interface startApproveData { - id: string; -} -export const startApprove = (params: startApproveData) => request.get(`/coscoAccessWork/startApprove`, { params }); +export const startApprove = (params: { id:string }) => request.get(`/coscoAccessWork/startApprove`, { params }); /** * 查看评审结果 */ -export const reviewInfoData = (params: startApproveData) => request.get(`/coscoAccessWork/reviewInfoData`, { params }); +export const reviewInfoData = (params: { id:string }) => request.get(`/coscoAccessWork/reviewInfoData`, { params }); +/** + * 变更 + */ +export const supplierChangeApplyById = (id: string) => request.get(`/coscoSupplierChangeApply/supplierChangeApplyById/${id}` ); +/** + * 黑名单 + */ +export const viewBlacklist = (id: string) => request.get(`/black/blacklist/${id}`); +/** + * 退出 + */ +interface getExitInfoPageData { + pageNo: number; + pageSize: number; + supplierexitId?: string; + deptId?: string; + accessType?: string; + reviewStatus?: string; + approveStatus?: string; + categoryId?: string; + exitTheme?: string; + startTime?: string; + endTime?: string; +} +export const getExitInfoPage = (data: getExitInfoPageData) => request.post('/coscoSupplierexit/getExitInfoPage', { data }); +/** + * 品类库审批 + */ +export const detail = (params: { id:string }) => request.get(`/cosco/library/detail`, { params }); + +/** + * 品类库入库审批 + */ +export const applyDetail = (params: { id:string }) => request.get(`/cosco/apply/${params.id}`); + export const supplierChangeApprove = (data: { id:string; approveStatus:string }) => request.post('/synchronous/receiveApprove', { data }); \ No newline at end of file diff --git a/src/pages/supplier/admission/admissionManagement/components/ResultModal.tsx b/src/pages/supplier/admission/admissionManagement/components/ResultModal.tsx index 387e03b..6fc03b8 100644 --- a/src/pages/supplier/admission/admissionManagement/components/ResultModal.tsx +++ b/src/pages/supplier/admission/admissionManagement/components/ResultModal.tsx @@ -229,7 +229,7 @@ const ResultModal: React.FC = ({ return ( - {groupSummaryResult[sup.supplierId] === '0' ? '合格' : '不合格'} + {groupSummaryResult[sup.supplierId] === '0' ? '合格' : groupSummaryResult[sup.supplierId] === '1'? '不合格': ''} ) diff --git a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/components/DetailView.tsx b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/components/DetailView.tsx index e1eb1b4..cea2c6f 100644 --- a/src/pages/supplier/informationManagement/SupplierChangeReviewManage/components/DetailView.tsx +++ b/src/pages/supplier/informationManagement/SupplierChangeReviewManage/components/DetailView.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Modal, Table, Spin, Descriptions } from 'antd'; +import { Modal, Spin, Descriptions } from 'antd'; import { supplierChangeApplyById } from '../services'; @@ -97,17 +97,4 @@ const DetailView: React.FC = ({ visible, onClose, detailId }) = ); }; -const tdStyleTitle: React.CSSProperties = { - background: '#fafafa', - fontWeight: 700, - width: 130, - padding: 8, - border: '1px solid #f0f0f0', -}; -const tdStyle: React.CSSProperties = { - background: '#fff', - padding: 8, - border: '1px solid #f0f0f0', -}; - export default DetailView; diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx index 5b521fc..d7e93bf 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/components/SupplierDetailModal.tsx @@ -1,10 +1,10 @@ import React, { useState, useEffect } from "react"; //第三方UI库/组件 -import { Modal, Form, Input, Button, Table, message, Tooltip } from "antd"; +import { Modal, Form, Input, Button, Table, Tooltip } from "antd"; //类型定义 import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'; //umi 相关 -import { useIntl } from 'umi'; +// import { useIntl } from 'umi'; //本地服务/接口 import { getCategoryPage } from '../services'; //本地组件 @@ -28,7 +28,7 @@ interface SupplierAccessDetailModalProps { //主体 const SupplierAccessDetailModal: React.FC = ({ visible, onCancel, record }) => { //双语 - const intl = useIntl(); + // const intl = useIntl(); //查询表单 const [form] = Form.useForm(); //列表渲染数据 @@ -38,7 +38,7 @@ const SupplierAccessDetailModal: React.FC = ({ v //列表分页 const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0, }); //品类弹窗状态 - const [addModalVisible, setAddModalVisible] = useState(false); + // const [addModalVisible, setAddModalVisible] = useState(false); // 搜索 const handleSearch = () => { setPagination({ ...pagination, current: 1 });