登录 个人 与 零星采购
This commit is contained in:
@ -254,7 +254,9 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
label={intl.formatMessage({ id: 'component.globalModal.otherAttachmentLabel' })}
|
||||
labelStyle={{ width: '200px' }}
|
||||
>
|
||||
<a href={registerInfo.coscoSupplierSurveyAttachments[1].fileUrl} target="_blank" rel="noreferrer">{intl.formatMessage({id: 'component.globalModal.viewAttachment'})}</a>
|
||||
{ registerInfo.coscoSupplierSurveyAttachments[0].fileUrl && (
|
||||
<a href={registerInfo.coscoSupplierSurveyAttachments[0].fileUrl} target="_blank" rel="noreferrer">{intl.formatMessage({id: 'component.globalModal.viewAttachment'})}</a>
|
||||
)}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</>
|
||||
|
@ -1,11 +1,12 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { connect, useIntl } from 'umi';
|
||||
import { Modal, Button, Space, Tag } from 'antd';
|
||||
import { coscoSupplierBase } from './services'
|
||||
import { Modal, Button, Space, Descriptions } from 'antd';
|
||||
import { coscoSupplierBase } from './services'
|
||||
import SupplierRegisterInfo from './components/SupplierRegisterInfo';
|
||||
import AccessCategoryTable from './components/AccessCategoryTable';
|
||||
import TianyanchaInfo from './components/TianyanchaInfo';
|
||||
import RiskList from './components/RiskList';
|
||||
|
||||
// 弹出主体
|
||||
const GlobalModal = ({ visible, id, dispatch }: any) => {
|
||||
const intl = useIntl();
|
||||
@ -14,14 +15,10 @@ const GlobalModal = ({ visible, id, dispatch }: any) => {
|
||||
const [modalType, setModalType] = useState<'register' | 'category' | 'tianyancha' | 'risk'>('register');
|
||||
//供应商信息数据
|
||||
const [registerInfo, setRegisterInfo] = useState<any>(null);
|
||||
//黑名单显示状态
|
||||
const isBlacklisted = true;
|
||||
//灰名单显示状态
|
||||
const isGreylisted = true;
|
||||
//获取供应商信息
|
||||
const fetchRegisterInfo = () => {
|
||||
//供应商信息
|
||||
|
||||
|
||||
coscoSupplierBase(id).then((res) => {
|
||||
let { code, data } = res;
|
||||
if (code == 200) {
|
||||
@ -35,7 +32,7 @@ const GlobalModal = ({ visible, id, dispatch }: any) => {
|
||||
};
|
||||
// 渲染页面 供应商信息 准入品类/品类库 天眼查工商信息 合规风险列表 页面标签
|
||||
const renderContent = () => {
|
||||
if (modalType === 'register') {
|
||||
if (modalType === 'register' && registerInfo?.coscoSupplierBase) {
|
||||
//供应商页面
|
||||
return <SupplierRegisterInfo registerInfo={registerInfo} />;
|
||||
}
|
||||
@ -55,11 +52,9 @@ const GlobalModal = ({ visible, id, dispatch }: any) => {
|
||||
};
|
||||
// 初始化
|
||||
useEffect(() => {
|
||||
|
||||
if (visible) {
|
||||
setModalType('register');
|
||||
fetchRegisterInfo();
|
||||
coscoSupplierBase(id)
|
||||
}
|
||||
}, [visible, id]);
|
||||
return (
|
||||
@ -67,29 +62,55 @@ const GlobalModal = ({ visible, id, dispatch }: any) => {
|
||||
visible={visible}
|
||||
zIndex={1100}
|
||||
width="90%"
|
||||
onCancel={() => dispatch({ type: 'globalModal/hide' })}
|
||||
onCancel={() => {
|
||||
setRegisterInfo(null); // ← 清空数据
|
||||
dispatch({ type: 'globalModal/hide' });
|
||||
}}
|
||||
footer={null}
|
||||
title={
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-start', alignItems: 'center' }}>
|
||||
<span>{intl.formatMessage({id: 'component.globalModal.title' })}</span>
|
||||
{/* <span style={{ marginLeft: '10px' }}>
|
||||
{isBlacklisted && <Tag color="red">{intl.formatMessage({id: 'component.globalModal.blacklist' })}</Tag>}
|
||||
{isGreylisted && <Tag color="gray">{intl.formatMessage({id: 'component.globalModal.GreyList' })}</Tag>}
|
||||
</span> */}
|
||||
<span>{intl.formatMessage({ id: 'component.globalModal.title' })}</span>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div>
|
||||
<Space style={{ marginBottom: 16 }}>
|
||||
<Button type={modalType === 'register' ? 'primary' : 'default'} onClick={() => handleSwitch('register')}>{intl.formatMessage({id: 'component.globalModal.register' })}</Button>
|
||||
<Button type={modalType === 'category' ? 'primary' : 'default'} onClick={() => handleSwitch('category')}>{intl.formatMessage({id: 'component.globalModal.category' })}</Button>
|
||||
<Button type={modalType === 'tianyancha' ? 'primary' : 'default'} onClick={() => handleSwitch('tianyancha')}>{intl.formatMessage({id: 'component.globalModal.tianyancha' })}</Button>
|
||||
<Button type={modalType === 'risk' ? 'primary' : 'default'} onClick={() => handleSwitch('risk')}>{intl.formatMessage({id: 'component.globalModal.ComplianceRisk' })}</Button>
|
||||
</Space>
|
||||
<div style={{ height: '600px', overflowY: 'auto' }}>
|
||||
{renderContent()}
|
||||
</div>
|
||||
</div>
|
||||
{(registerInfo?.coscoSupplierBase.supplierType !== 'pe' && registerInfo ) ?
|
||||
(
|
||||
<div>
|
||||
<Space style={{ marginBottom: 16 }}>
|
||||
<Button type={modalType === 'register' ? 'primary' : 'default'} onClick={() => handleSwitch('register')}>{intl.formatMessage({ id: 'component.globalModal.register' })}</Button>
|
||||
<Button type={modalType === 'category' ? 'primary' : 'default'} onClick={() => handleSwitch('category')}>{intl.formatMessage({ id: 'component.globalModal.category' })}</Button>
|
||||
<Button type={modalType === 'tianyancha' ? 'primary' : 'default'} onClick={() => handleSwitch('tianyancha')}>{intl.formatMessage({ id: 'component.globalModal.tianyancha' })}</Button>
|
||||
<Button type={modalType === 'risk' ? 'primary' : 'default'} onClick={() => handleSwitch('risk')}>{intl.formatMessage({ id: 'component.globalModal.ComplianceRisk' })}</Button>
|
||||
</Space>
|
||||
<div style={{ height: '600px', overflowY: 'auto' }}>
|
||||
{renderContent()}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<Descriptions bordered column={3} style={{ marginBottom: 24 }} title={intl.formatMessage({ id: 'component.globalModal.supplierRegisterInfo' })}>
|
||||
<Descriptions.Item label="姓名" labelStyle={{ width: '140px' }}>
|
||||
<span>{registerInfo?.coscoSupplierBase.personName}</span>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="身份证号" labelStyle={{ width: '140px' }}>
|
||||
<span>{registerInfo?.coscoSupplierBase.idCard}</span>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="联系电话" labelStyle={{ width: '140px' }}>
|
||||
<span>{registerInfo?.coscoSupplierBase.personPhone}</span>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="开户行">
|
||||
<span>{registerInfo?.coscoSupplierBase.personBank}</span>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="银行账号">
|
||||
<span>{registerInfo?.coscoSupplierBase.personAccount}</span>
|
||||
</Descriptions.Item>
|
||||
{/* <Descriptions.Item label="相关证照">
|
||||
<span>{registerInfo?.coscoSupplierBase.accessory}</span>
|
||||
</Descriptions.Item> */}
|
||||
</Descriptions>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user