合并代码
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Table, Tabs, message } from 'antd';
|
||||
import { useIntl } from 'umi';
|
||||
import { getAccessCategoryList, getCategoryLibraryList } from '../services';
|
||||
import { getCategoryPage, supplierIdPage } from '../services';
|
||||
const { TabPane } = Tabs;
|
||||
|
||||
const AccessCategoryTable = ({id}:{id:any}) => {
|
||||
const AccessCategoryTable = ({id}:{id:string}) => {
|
||||
const intl = useIntl();
|
||||
const columns = [
|
||||
{
|
||||
@ -19,8 +19,8 @@ const AccessCategoryTable = ({id}:{id:any}) => {
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({id: 'component.globalModal.ResponsibleDepartmentID'}),
|
||||
dataIndex: 'deptId',
|
||||
key: 'deptId',
|
||||
dataIndex: 'deptName',
|
||||
key: 'deptName',
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({id: 'component.globalModal.RegionalSelection'}),
|
||||
@ -47,10 +47,10 @@ const AccessCategoryTable = ({id}:{id:any}) => {
|
||||
const fetchAccessData = async (current: number, pageSize: number) => {
|
||||
setAccessLoading(true);
|
||||
try {
|
||||
const { code, data, total } = await getAccessCategoryList({ pageNum: current, pageSize });
|
||||
const { code, data } = await getCategoryPage({ pageNo: current, pageSize, supplierId:id });
|
||||
if (code === 200) {
|
||||
setAccessData(data);
|
||||
setAccessPagination({ current, pageSize, total });
|
||||
setAccessData(data.records);
|
||||
setAccessPagination({ current, pageSize, total: data.total });
|
||||
}
|
||||
} catch {
|
||||
message.error(intl.formatMessage({id:'component.globalModal.FailedToObtainAdmissionCategory'}));
|
||||
@ -63,10 +63,10 @@ const AccessCategoryTable = ({id}:{id:any}) => {
|
||||
const fetchCategoryData = async (current: number, pageSize: number) => {
|
||||
setCategoryLoading(true);
|
||||
try {
|
||||
const { code, data, total } = await getCategoryLibraryList({ pageNum: current, pageSize });
|
||||
const { code, data } = await supplierIdPage({ basePageRequest: { pageNo: current, pageSize } , supplierId: '1935547019799363584' });
|
||||
if (code === 200) {
|
||||
setCategoryData(data);
|
||||
setCategoryPagination({ current, pageSize, total });
|
||||
setCategoryData(data.records);
|
||||
setCategoryPagination({ current, pageSize, total: data.total });
|
||||
}
|
||||
} catch {
|
||||
message.error(intl.formatMessage({id:'component.globalModal.FailedToObtainCategoryLibrary'}));
|
||||
|
@ -1,30 +1,55 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Table, message } from 'antd';
|
||||
import { getRiskList } from '../services'
|
||||
import { Descriptions, message } from 'antd';
|
||||
import { queryRiskInfo } from '../services'
|
||||
import { useIntl } from 'umi';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
|
||||
const RiskList = ({id}:{id:any}) => {
|
||||
interface data {
|
||||
hit:string;
|
||||
countries:string;
|
||||
d1:string;
|
||||
d2:string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
||||
const RiskList = ({id}:{id:string}) => {
|
||||
const intl = useIntl();
|
||||
const columns = [
|
||||
{ title: intl.formatMessage({id: 'component.globalModal.Risktype'}), dataIndex: 'type', key: 'type' },
|
||||
{ title: intl.formatMessage({id: 'component.globalModal.level'}), dataIndex: 'level', key: 'level' },
|
||||
{ title: intl.formatMessage({id: 'component.globalModal.desc'}), dataIndex: 'desc', key: 'desc' },
|
||||
const columns:ColumnsType<data> = [
|
||||
{
|
||||
title: intl.formatMessage({ id: 'component.globalModal.hit', defaultMessage: '命中对象' }),
|
||||
dataIndex: 'hit',
|
||||
key: 'hit',
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: 'component.globalModal.countries', defaultMessage: '涉及国家/地区' }),
|
||||
dataIndex: 'countries', // 推荐拼写为 countries
|
||||
key: 'countries',
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: 'component.globalModal.riskD1', defaultMessage: '风险主类' }),
|
||||
dataIndex: 'd1',
|
||||
key: 'd1',
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: 'component.globalModal.riskD2', defaultMessage: '风险分类' }),
|
||||
dataIndex: 'd2',
|
||||
key: 'd2',
|
||||
},
|
||||
]
|
||||
//合规风险
|
||||
const [dataList, setDataList] = useState<any[]>([])
|
||||
const [dataList, setDataList] = useState<data[]>([])
|
||||
//加载
|
||||
const [loading, setLoading] = useState(false);
|
||||
//分页
|
||||
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0, });
|
||||
|
||||
//数据渲染
|
||||
const getList = async (page = 1, pageSize = 10) => {
|
||||
const getList = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { code, data, total } = await getRiskList({ pageNum: page, pageSize });
|
||||
const { code, data } = await queryRiskInfo({ supplierId: id });
|
||||
if (code === 200) {
|
||||
setDataList(data);
|
||||
setPagination({ current: page, pageSize, total });
|
||||
} else {
|
||||
message.error(intl.formatMessage({id: 'component.globalModal.fetchRiskFail'}));
|
||||
}
|
||||
@ -34,31 +59,27 @@ const RiskList = ({id}:{id:any}) => {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
//分页
|
||||
const handleTableChange = (paginationInfo: any) => {
|
||||
getList(paginationInfo.current, paginationInfo.pageSize);
|
||||
};
|
||||
//初始化
|
||||
useEffect(() => {
|
||||
getList();
|
||||
if(id) {
|
||||
getList();
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Table
|
||||
title={() => <div style={{ fontWeight: 'bold', fontSize: 16, textIndent: '-16px' }}>{intl.formatMessage({id: 'component.globalModal.riskList'})}</div>}
|
||||
dataSource={dataList}
|
||||
loading={loading}
|
||||
columns={columns}
|
||||
pagination={{
|
||||
current: pagination.current,
|
||||
pageSize: pagination.pageSize,
|
||||
total: pagination.total,
|
||||
showSizeChanger: true,
|
||||
onChange: (page, pageSize = 10) => getList(page, pageSize),
|
||||
}}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
{
|
||||
dataList.map((item, idx) => (
|
||||
<Descriptions bordered column={1} key={item.id || idx} style={{ marginBottom: 24 }}>
|
||||
{columns.map(col => (
|
||||
<Descriptions.Item label={col.title} key={col.key} labelStyle={{ width: '140px' }}>
|
||||
{item[(col as any).dataIndex] ?? '-'}
|
||||
</Descriptions.Item>
|
||||
))}
|
||||
</Descriptions>
|
||||
))
|
||||
}
|
||||
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -24,6 +24,8 @@ interface BankInfo {
|
||||
city: string;
|
||||
}
|
||||
const SupplierRegisterInfo = ({ registerInfo }: { registerInfo: any }) => {
|
||||
|
||||
|
||||
const intl = useIntl();
|
||||
const qualificationsColumns:ColumnsType<qualifications> = [
|
||||
{ title: intl.formatMessage({id: 'component.globalModal.serialNumber'}), dataIndex: 'index', key: 'index', width: 60, align: 'center', render: (_: any, __: any, index: number) => index + 1 },
|
||||
@ -58,85 +60,85 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
size="middle"
|
||||
style={{ background: '#fff', padding: '16px 0 0' }}
|
||||
>
|
||||
{registerInfo.base.supplierType === 'dvs' && (
|
||||
{registerInfo.coscoSupplierBase.supplierType === 'dvs' && (
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.supplierIdentityType' })}>
|
||||
{intl.formatMessage({ id: 'component.globalModal.domesticEnterprise' })}
|
||||
</Descriptions.Item>
|
||||
)}
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.enterpriseName' })}>
|
||||
{registerInfo.base.name}
|
||||
{registerInfo.coscoSupplierBase.name}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.enterpriseEnglishName' })}>
|
||||
{registerInfo.base.nameEn}
|
||||
{registerInfo.coscoSupplierBase.nameEn}
|
||||
</Descriptions.Item>
|
||||
{registerInfo.base.supplierType !== 'dvs' && (
|
||||
{registerInfo.coscoSupplierBase.supplierType !== 'dvs' && (
|
||||
<>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.foreignCountryRegion' })}>
|
||||
{registerInfo.base.nation}
|
||||
{registerInfo.coscoSupplierBase.nation}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.foreignVAT' })}>
|
||||
{registerInfo.base.vat}
|
||||
{registerInfo.coscoSupplierBase.vat}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.foreignTaxpayerId' })}>
|
||||
{registerInfo.base.taxpayerId}
|
||||
{registerInfo.coscoSupplierBase.taxpayerId}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.foreignCurrency' })}>
|
||||
{registerInfo.base.currency}
|
||||
{registerInfo.coscoSupplierBase.currency}
|
||||
</Descriptions.Item>
|
||||
</>
|
||||
)}
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.creditCode' })}>
|
||||
{registerInfo.base.socialCreditCode}
|
||||
{registerInfo.coscoSupplierBase.socialCreditCode}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.businessScope' })}>
|
||||
{registerInfo.base.range}
|
||||
{registerInfo.coscoSupplierBase.range}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.registerAddress' })}>
|
||||
{registerInfo.base.regAddress}
|
||||
{registerInfo.coscoSupplierBase.regAddress}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.officeAddress' })}>
|
||||
{registerInfo.base.workAddress}
|
||||
{registerInfo.coscoSupplierBase.workAddress}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.parentCompanyInfo' })}>
|
||||
{registerInfo.base.parentCompanyInvestor}
|
||||
{registerInfo.coscoSupplierBase.parentCompanyInvestor}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.legalPerson' })}>
|
||||
{registerInfo.base.legalPerson}
|
||||
{registerInfo.coscoSupplierBase.legalPerson}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.idCardNumber' })}>
|
||||
{registerInfo.base.idCard}
|
||||
{registerInfo.coscoSupplierBase.idCard}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.registeredCapital' })}>
|
||||
{registerInfo.base.capital}
|
||||
{registerInfo.coscoSupplierBase.capital}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.supplierType' })}>
|
||||
{registerInfo.base.enterpriseType}
|
||||
{registerInfo.coscoSupplierBase.enterpriseType}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactName' })}>
|
||||
{registerInfo.base.contactsName}
|
||||
{registerInfo.coscoSupplierBase.contactsName}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactMobile' })}>
|
||||
{registerInfo.base.contactsPhone}
|
||||
{registerInfo.coscoSupplierBase.contactsPhone}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactIdType' })}>
|
||||
{registerInfo.base.contactsType}
|
||||
{registerInfo.coscoSupplierBase.contactsType}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactEmail' })}>
|
||||
{registerInfo.base.contactsEmail}
|
||||
{registerInfo.coscoSupplierBase.contactsEmail}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactPhone' })}>
|
||||
{registerInfo.base.telephone}
|
||||
{registerInfo.coscoSupplierBase.telephone}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
<Table
|
||||
dataSource={registerInfo.qualifications}
|
||||
dataSource={registerInfo.coscoSupplierQualifications}
|
||||
columns={qualificationsColumns}
|
||||
pagination={false}
|
||||
title={() => <div style={{ fontWeight: 'bold', fontSize: 16, textIndent: '-16px' }}>{intl.formatMessage({id: 'component.globalModal.qualificationInfo'})}</div>}
|
||||
/>
|
||||
|
||||
{registerInfo.base.supplierType === 'dvs' && (
|
||||
{registerInfo.coscoSupplierBase.supplierType === 'dvs' && (
|
||||
<Descriptions
|
||||
title={intl.formatMessage({ id: 'component.globalModal.invoiceInfo' })}
|
||||
bordered
|
||||
@ -145,29 +147,29 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
style={{ background: '#fff', padding: '16px 0 0' }}
|
||||
>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.taxpayerType' })}>
|
||||
{registerInfo.invoice.taxpayerType}
|
||||
{registerInfo.coscoSupplierInvoice.taxpayerType}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.invoiceTitle' })}>
|
||||
{registerInfo.invoice.head}
|
||||
{registerInfo.coscoSupplierInvoice.head}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.taxpayerCode' })}>
|
||||
{registerInfo.invoice.taxpayerCode}
|
||||
{registerInfo.coscoSupplierInvoice.taxpayerCode}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.invoiceAddress' })}>
|
||||
{registerInfo.invoice.address}
|
||||
{registerInfo.coscoSupplierInvoice.address}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.invoicePhone' })}>
|
||||
{registerInfo.invoice.phone}
|
||||
{registerInfo.coscoSupplierInvoice.phone}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.invoiceBank' })}>
|
||||
{registerInfo.invoice.bank}
|
||||
{registerInfo.coscoSupplierInvoice.bank}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.invoiceAccount' })}>
|
||||
{registerInfo.invoice.account}
|
||||
{registerInfo.coscoSupplierInvoice.account}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.qualificationCertificate' })}>
|
||||
<a
|
||||
href={registerInfo.invoice.qualificationCertificate}
|
||||
href={registerInfo.coscoSupplierInvoice.qualificationCertificate}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
@ -178,7 +180,7 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
)}
|
||||
|
||||
<Table
|
||||
dataSource={registerInfo.bank}
|
||||
dataSource={registerInfo.coscoSupplierBank}
|
||||
columns={bankColumns}
|
||||
pagination={false}
|
||||
title={() => <div style={{ fontWeight: 'bold', fontSize: 16, textIndent: '-16px' }}>{intl.formatMessage({id: 'component.globalModal.bankAccount'})}</div>}
|
||||
@ -186,7 +188,7 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
|
||||
<div style={{ fontWeight: 'bold', fontSize: 16, textIndent: '-16px', padding: '16px 0 0', color: '#014f8f' }}>{intl.formatMessage({id: 'component.globalModal.ethicsQuestionnaireTitle'})}</div>
|
||||
|
||||
<Descriptions
|
||||
{/* <Descriptions
|
||||
title={intl.formatMessage({ id: 'component.globalModal.fillerInfo' })}
|
||||
bordered
|
||||
column={3}
|
||||
@ -211,11 +213,11 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.fillerDate' })}>
|
||||
{registerInfo.survey.dateTime}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Descriptions> */}
|
||||
|
||||
<div style={{ padding: '16px' }}>
|
||||
{/* <div style={{ padding: '16px' }}>
|
||||
<Table
|
||||
dataSource={registerInfo.questionReply}
|
||||
dataSource={registerInfo.coscoSupplierSurveyAttachments}
|
||||
columns={[
|
||||
{ title: intl.formatMessage({id: 'component.globalModal.index'}), dataIndex: 'index', key: 'index', width: 60, align: 'center', render: (_: any, __: any, index: number) => index + 1 },
|
||||
{ title: intl.formatMessage({id: 'component.globalModal.question'}), dataIndex: 'surveyQuestion', key: 'surveyQuestion' },
|
||||
@ -224,7 +226,7 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
pagination={false}
|
||||
title={() => <div style={{ fontWeight: 'bold', fontSize: 16, textIndent: '-16px' }}>{intl.formatMessage({id: 'component.globalModal.questionnaire'})}</div>}
|
||||
/>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
<Descriptions
|
||||
title={intl.formatMessage({ id: 'component.globalModal.antiBriberyTitle' })}
|
||||
@ -237,7 +239,7 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
label={intl.formatMessage({ id: 'component.globalModal.antiBriberyLabel' })}
|
||||
labelStyle={{ width: '200px' }}
|
||||
>
|
||||
<a href={registerInfo.attachments.fileUrl} target="_blank" rel="noreferrer">{intl.formatMessage({id: 'component.globalModal.viewAttachment'})}</a>
|
||||
<a href={registerInfo.coscoSupplierSurveyAttachments[0].fileUrl} target="_blank" rel="noreferrer">{intl.formatMessage({id: 'component.globalModal.viewAttachment'})}</a>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
@ -252,7 +254,7 @@ const bankColumns:ColumnsType<BankInfo> = [
|
||||
label={intl.formatMessage({ id: 'component.globalModal.otherAttachmentLabel' })}
|
||||
labelStyle={{ width: '200px' }}
|
||||
>
|
||||
<a href={registerInfo.attachments.fileUrl} target="_blank" rel="noreferrer">{intl.formatMessage({id: 'component.globalModal.viewAttachment'})}</a>
|
||||
<a href={registerInfo.coscoSupplierSurveyAttachments[1].fileUrl} target="_blank" rel="noreferrer">{intl.formatMessage({id: 'component.globalModal.viewAttachment'})}</a>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</>
|
||||
|
@ -1,89 +1,54 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Table, Button, message } from 'antd';
|
||||
import { Descriptions, Button, message } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import type { IntlShape } from 'react-intl';
|
||||
import { tianyanchaIc } from '../services';
|
||||
import { getQuery } from '../services';
|
||||
import { useIntl } from 'umi';
|
||||
interface TianyanchaInfo {
|
||||
base: string; // 省份简称
|
||||
name: string; // 企业名称
|
||||
legalPersonName?: string; // 法人
|
||||
legalPersonType?: string; // 法人类型,1 人,2 公司
|
||||
regNumber?: string; // 注册号
|
||||
industry?: string; // 行业
|
||||
companyOrgType?: string; // 企业类型
|
||||
regLocation?: string; // 注册地址
|
||||
estiblishTime?: string; // 成立时间
|
||||
fromTime?: string; // 经营开始时间
|
||||
toTime?: string; // 经营结束时间
|
||||
businessScope?: string; // 经营范围
|
||||
approvedTime?: string; // 核准时间
|
||||
regStatus?: string; // 企业状态
|
||||
regCapital?: string; // 注册资本
|
||||
regInstitute?: string; // 登记机关
|
||||
orgNumber?: string; // 组织机构代码
|
||||
creditCode?: string; // 统一社会信用代码
|
||||
property3?: string; // 英文名
|
||||
updatetime?: string; // 更新时间
|
||||
companyId?: string; // 表对应id
|
||||
taxNumber?: string; // 纳税人识别号
|
||||
email?: string; // 邮箱
|
||||
website?: string; // 网址
|
||||
phoneNumber?: string; // 电话号
|
||||
lastUpdateTime?: string; // 最后更新时间,建议用 ISO 字符串
|
||||
|
||||
|
||||
interface TianyanchaInfoProps {
|
||||
base?: string; // 省份简称
|
||||
name: string; // 企业名称
|
||||
legalPersonName?: string; // 法人
|
||||
legalPersonType?: string; // 法人类型 ,1 人 2 公司
|
||||
regNumber?: string; // 注册号
|
||||
industry?: string; // 行业
|
||||
companyOrgType?: string; // 企业类型
|
||||
regLocation?: string; // 注册地址
|
||||
estiblishTime?: string; // 成立时间
|
||||
fromTime?: string; // 经营开始时间
|
||||
toTime?: string; // 经营结束时间
|
||||
businessScope?: string; // 经营范围
|
||||
approvedTime?: string; // 核准时间
|
||||
regStatus?: string; // 企业状态
|
||||
regCapital?: string; // 注册资本
|
||||
regInstitute?: string; // 登记机关
|
||||
orgNumber?: string; // 组织机构代码
|
||||
creditCode?: string; // 统一社会信用代码
|
||||
property3?: string; // 英文名
|
||||
updatetime?: string; // 更新时间
|
||||
companyId?: string; // 表对应id
|
||||
taxNumber?: string; // 纳税人识别号
|
||||
email?: string; // 邮箱
|
||||
website?: string; // 网址
|
||||
phoneNumber?: string; // 电话号
|
||||
lastUpdateTime?: string; // 最后更新时间
|
||||
}
|
||||
|
||||
|
||||
const TianyanchaInfo = ({ id }:{id:any}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
// 渲染列表头,注意用 intl.formatMessage 做标题国际化
|
||||
const getColumns = (intl: IntlShape): ColumnsType<TianyanchaInfo> => [
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.base' }), dataIndex: 'base', key: 'base' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.name' }), dataIndex: 'name', key: 'name' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.legalPersonName' }), dataIndex: 'legalPersonName', key: 'legalPersonName' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.legalPersonType' }), dataIndex: 'legalPersonType', key: 'legalPersonType' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regNumber' }), dataIndex: 'regNumber', key: 'regNumber' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.industry' }), dataIndex: 'industry', key: 'industry' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.companyOrgType' }), dataIndex: 'companyOrgType', key: 'companyOrgType' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regLocation' }), dataIndex: 'regLocation', key: 'regLocation' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.estiblishTime' }), dataIndex: 'estiblishTime', key: 'estiblishTime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.fromTime' }), dataIndex: 'fromTime', key: 'fromTime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.toTime' }), dataIndex: 'toTime', key: 'toTime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.businessScope' }), dataIndex: 'businessScope', key: 'businessScope' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.approvedTime' }), dataIndex: 'approvedTime', key: 'approvedTime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regStatus' }), dataIndex: 'regStatus', key: 'regStatus' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regCapital' }), dataIndex: 'regCapital', key: 'regCapital' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regInstitute' }), dataIndex: 'regInstitute', key: 'regInstitute' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.orgNumber' }), dataIndex: 'orgNumber', key: 'orgNumber' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.creditCode' }), dataIndex: 'creditCode', key: 'creditCode' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.property3' }), dataIndex: 'property3', key: 'property3' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.updatetime' }), dataIndex: 'updatetime', key: 'updatetime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.companyId' }), dataIndex: 'companyId', key: 'companyId' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.taxNumber' }), dataIndex: 'taxNumber', key: 'taxNumber' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.email' }), dataIndex: 'email', key: 'email' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.website' }), dataIndex: 'website', key: 'website' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.phoneNumber' }), dataIndex: 'phoneNumber', key: 'phoneNumber' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.lastUpdateTime' }), dataIndex: 'lastUpdateTime', key: 'lastUpdateTime' },
|
||||
];
|
||||
|
||||
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
|
||||
const TianyanchaInfo = ({ id }: { id: string }) => {
|
||||
const intl = useIntl();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [dataList, setDataList] = useState<TianyanchaInfo[]>([]);
|
||||
const [dataList, setDataList] = useState<TianyanchaInfoProps[]>([]);
|
||||
const [updateTime, setUpdateTime] = useState<string>(new Date().toLocaleDateString());
|
||||
|
||||
const getList = async (page: number, pageSize: number) => {
|
||||
const getList = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { code, data, total } = await tianyanchaIc({ pageNum: page, pageSize });
|
||||
const { code, data } = await getQuery({ supplierId: id });
|
||||
if (code === 200) {
|
||||
setDataList(data);
|
||||
setPagination({ current: page, pageSize, total });
|
||||
} else {
|
||||
message.error(intl.formatMessage({ id: 'component.tianyancha.fetchFailed' }));
|
||||
}
|
||||
} catch (err) {
|
||||
message.error(intl.formatMessage({ id: 'component.tianyancha.fetchFailed' }));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@ -91,46 +56,63 @@ const getColumns = (intl: IntlShape): ColumnsType<TianyanchaInfo> => [
|
||||
|
||||
const onUpdateTime = () => {
|
||||
setUpdateTime(new Date().toLocaleDateString());
|
||||
getList(pagination.current, pagination.pageSize);
|
||||
message.success(intl.formatMessage({ id: 'component.tianyancha.updateSuccess' }));
|
||||
getList();
|
||||
message.success(intl.formatMessage({ id: 'component.tianyancha.updateSuccess'}));
|
||||
};
|
||||
|
||||
const handleTableChange = (pageInfo: any) => {
|
||||
getList(pageInfo.current, pageInfo.pageSize);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setUpdateTime(new Date().toLocaleDateString());
|
||||
getList(pagination.current, pagination.pageSize);
|
||||
if (id) {
|
||||
setUpdateTime(new Date().toLocaleDateString());
|
||||
getList();
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
// 渲染
|
||||
const getColumns: ColumnsType<TianyanchaInfoProps> = [
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.base' }), dataIndex: 'base', key: 'base' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.name' }), dataIndex: 'name', key: 'name' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.legalPersonName' }), dataIndex: 'legalPersonName', key: 'legalPersonName' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.legalPersonType' }), dataIndex: 'legalPersonType', key: 'legalPersonType' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regNumber' }), dataIndex: 'regNumber', key: 'regNumber' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.industry' }), dataIndex: 'industry', key: 'industry' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.companyOrgType' }), dataIndex: 'companyOrgType', key: 'companyOrgType' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regLocation' }), dataIndex: 'regLocation', key: 'regLocation' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.estiblishTime' }), dataIndex: 'estiblishTime', key: 'estiblishTime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.fromTime' }), dataIndex: 'fromTime', key: 'fromTime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.toTime' }), dataIndex: 'toTime', key: 'toTime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.businessScope' }), dataIndex: 'businessScope', key: 'businessScope' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.approvedTime' }), dataIndex: 'approvedTime', key: 'approvedTime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regStatus' }), dataIndex: 'regStatus', key: 'regStatus' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regCapital' }), dataIndex: 'regCapital', key: 'regCapital' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.regInstitute' }), dataIndex: 'regInstitute', key: 'regInstitute' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.orgNumber' }), dataIndex: 'orgNumber', key: 'orgNumber' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.creditCode' }), dataIndex: 'creditCode', key: 'creditCode' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.property3' }), dataIndex: 'property3', key: 'property3' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.updatetime' }), dataIndex: 'updatetime', key: 'updatetime' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.companyId' }), dataIndex: 'companyId', key: 'companyId' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.taxNumber' }), dataIndex: 'taxNumber', key: 'taxNumber' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.email' }), dataIndex: 'email', key: 'email' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.website' }), dataIndex: 'website', key: 'website' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.phoneNumber' }), dataIndex: 'phoneNumber', key: 'phoneNumber' },
|
||||
{ title: intl.formatMessage({ id: 'component.tianyancha.lastUpdateTime' }), dataIndex: 'lastUpdateTime', key: 'lastUpdateTime' },
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<Table
|
||||
title={() => (
|
||||
<div>
|
||||
<span style={{ fontWeight: 'bold', fontSize: 16, textIndent: '-16px' }}>
|
||||
{intl.formatMessage({ id: 'component.tianyancha.title' })}
|
||||
</span>
|
||||
({intl.formatMessage({ id: 'component.tianyancha.updateTime' })}:{updateTime}){' '}
|
||||
<Button size="small" onClick={onUpdateTime}>
|
||||
{intl.formatMessage({ id: 'component.tianyancha.updateBtn' })}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
rowKey="companyId"
|
||||
dataSource={dataList}
|
||||
columns={getColumns(intl)}
|
||||
pagination={{
|
||||
current: pagination.current,
|
||||
pageSize: pagination.pageSize,
|
||||
total: pagination.total,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ['5', '10', '20'],
|
||||
}}
|
||||
loading={loading}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
<Descriptions title={
|
||||
<div>
|
||||
<span style={{ fontWeight: 'bold', fontSize: 16, textIndent: '-16px' }}>
|
||||
{intl.formatMessage({ id: 'component.tianyancha.title' })}
|
||||
</span>
|
||||
({intl.formatMessage({ id: 'component.tianyancha.updateTime' })}:{updateTime}){' '}
|
||||
<Button size="small" onClick={onUpdateTime}>
|
||||
{intl.formatMessage({ id: 'component.tianyancha.updateBtn' })}
|
||||
</Button>
|
||||
</div>
|
||||
} bordered column={3}>
|
||||
{getColumns.map(col => (
|
||||
<Descriptions.Item label={col.title} key={col.key} labelStyle={{width: '140px'}} >
|
||||
{dataList[(col as any).dataIndex] ?? '-'}
|
||||
</Descriptions.Item>
|
||||
))}
|
||||
</Descriptions>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { connect, useIntl } from 'umi';
|
||||
import { Modal, Button, Space, Tag } from 'antd';
|
||||
import { coscoSupplier } from './services'
|
||||
import { coscoSupplierBase } from './services'
|
||||
import SupplierRegisterInfo from './components/SupplierRegisterInfo';
|
||||
import AccessCategoryTable from './components/AccessCategoryTable';
|
||||
import TianyanchaInfo from './components/TianyanchaInfo';
|
||||
@ -21,7 +21,8 @@ const GlobalModal = ({ visible, id, dispatch }: any) => {
|
||||
//获取供应商信息
|
||||
const fetchRegisterInfo = () => {
|
||||
//供应商信息
|
||||
coscoSupplier({id}).then((res) => {
|
||||
|
||||
coscoSupplierBase(id).then((res) => {
|
||||
let { code, data } = res;
|
||||
if (code == 200) {
|
||||
setRegisterInfo(data);
|
||||
@ -54,9 +55,11 @@ const GlobalModal = ({ visible, id, dispatch }: any) => {
|
||||
};
|
||||
// 初始化
|
||||
useEffect(() => {
|
||||
|
||||
if (visible) {
|
||||
setModalType('register');
|
||||
fetchRegisterInfo();
|
||||
coscoSupplierBase(id)
|
||||
}
|
||||
}, [visible, id]);
|
||||
return (
|
||||
@ -69,10 +72,10 @@ const GlobalModal = ({ visible, id, dispatch }: any) => {
|
||||
title={
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-start', alignItems: 'center' }}>
|
||||
<span>{intl.formatMessage({id: 'component.globalModal.title' })}</span>
|
||||
<span style={{ marginLeft: '10px' }}>
|
||||
{/* <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> */}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
|
@ -1,46 +1,50 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
export async function coscoSupplier(params:any) {
|
||||
console.log(params,'params');
|
||||
|
||||
return request('/api/system/coscoSupplier', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
/**
|
||||
* 天眼查只查询
|
||||
*/
|
||||
interface getQuery {
|
||||
supplierId: string;
|
||||
}
|
||||
export const getQuery = (params: getQuery) => request.get('/tycAndFxSupplierBase/queryAndUpdate', { params});
|
||||
|
||||
export async function library(params:any) {
|
||||
return request('/api/system/library', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export async function getAccessCategoryList(params:any) {
|
||||
return request('/api/system/library', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
/**
|
||||
* 合规风险查询
|
||||
*/
|
||||
interface queryRiskInfo {
|
||||
supplierId: string;
|
||||
}
|
||||
export const queryRiskInfo = (params: queryRiskInfo) => request.get('/tycAndFxSupplierBase/queryRiskInfo', { params});
|
||||
|
||||
export async function getCategoryLibraryList(params:any) {
|
||||
return request('/api/system/library', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export async function getRiskList(params:any) {
|
||||
return request('/api/system/library', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 供应商注册信息
|
||||
*/
|
||||
export const coscoSupplierBase = (id: string) => request.get(`/coscoSupplierBase/${id}` );
|
||||
|
||||
export async function tianyanchaIc(params:any) {
|
||||
return request('/api/system/tianyancha', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
/**
|
||||
* 准入品类
|
||||
*/
|
||||
interface getCategoryPage {
|
||||
pageNo: number;
|
||||
pageSize: number;
|
||||
supplierId?: string;
|
||||
}
|
||||
export const getCategoryPage = (data: getCategoryPage) => request.post('/coscoSupplierBase/getCategoryPage', { data });
|
||||
|
||||
|
||||
/**
|
||||
* 准入品类
|
||||
*/
|
||||
interface supplierIdPage {
|
||||
basePageRequest: basePageRequests;
|
||||
supplierId?: string;
|
||||
}
|
||||
interface basePageRequests {
|
||||
pageNo: number;
|
||||
pageSize: number;
|
||||
}
|
||||
export const supplierIdPage = (data: supplierIdPage) => request.post('/cosco/library/supplierIdPage', { data });
|
||||
|
Reference in New Issue
Block a user