2025-06-24 10:52:30 +08:00
|
|
|
import React, { useEffect, useState } from 'react';
|
2025-07-02 16:18:03 +08:00
|
|
|
import { Descriptions, Button } from 'antd';
|
2025-06-27 10:41:33 +08:00
|
|
|
import { coscoSupplierBase } from '../services';
|
2025-06-24 10:52:30 +08:00
|
|
|
import { useIntl } from 'umi';
|
2025-07-02 16:18:03 +08:00
|
|
|
import BaseInfoFormModal from './BaseInfoFormModal'
|
2025-06-24 10:52:30 +08:00
|
|
|
|
2025-06-27 10:41:33 +08:00
|
|
|
|
2025-07-02 16:18:03 +08:00
|
|
|
export interface Request {
|
|
|
|
capital: string;
|
|
|
|
contactsEmail: string;
|
|
|
|
contactsName: string;
|
|
|
|
contactsPhone: string;
|
|
|
|
contactsType: string;
|
|
|
|
enterpriseType: string;
|
|
|
|
id: string;
|
|
|
|
idCard: string;
|
|
|
|
legalPerson: string;
|
|
|
|
licenceAccessory: string;
|
|
|
|
licenceDate: string;
|
|
|
|
name: string;
|
|
|
|
nameEn: string;
|
|
|
|
parentCompanyInvestor: string;
|
|
|
|
range: string;
|
|
|
|
regAddress: string;
|
|
|
|
socialCreditCode: string;
|
|
|
|
telephone: string;
|
|
|
|
workAddress: string;
|
|
|
|
[property: string]: any;
|
|
|
|
}
|
|
|
|
interface changeDataValueProps {
|
|
|
|
id?:string;
|
|
|
|
title?:string;
|
|
|
|
changeDesc?:string;
|
|
|
|
coscoSupplierSurveyAttachments?:coscoSupplierSurveyAttachments[];
|
|
|
|
}
|
|
|
|
interface coscoSupplierSurveyAttachments {
|
|
|
|
attachmentsType: string;
|
|
|
|
fileName: string;
|
|
|
|
fileType: string;
|
|
|
|
fileSize: string;
|
|
|
|
filePath: string;
|
|
|
|
fileUrl: string;
|
|
|
|
}
|
2025-06-27 10:41:33 +08:00
|
|
|
|
2025-07-02 16:18:03 +08:00
|
|
|
interface BaseInfoTabProps {
|
|
|
|
viewType?:boolean;
|
2025-07-03 10:24:33 +08:00
|
|
|
record?:string;
|
2025-07-02 16:18:03 +08:00
|
|
|
}
|
2025-06-24 10:52:30 +08:00
|
|
|
|
2025-07-02 16:18:03 +08:00
|
|
|
const BaseInfoTab: React.FC<BaseInfoTabProps> = (props) => {
|
2025-07-03 10:24:33 +08:00
|
|
|
const { viewType = false, record = '' } = props;
|
2025-07-02 16:18:03 +08:00
|
|
|
const intl = useIntl();
|
|
|
|
const [registerInfo, setRegisterInfo] = useState<Request>();
|
|
|
|
//变更说明与附件
|
|
|
|
const [changeDataValue, setChangeDataValue] = useState<changeDataValueProps>();
|
2025-06-24 10:52:30 +08:00
|
|
|
const fetchData = async () => {
|
2025-07-03 10:24:33 +08:00
|
|
|
const res = await coscoSupplierBase(record);
|
2025-06-24 10:52:30 +08:00
|
|
|
if (res.code === 200) {
|
|
|
|
setRegisterInfo(res.data);
|
2025-07-02 16:18:03 +08:00
|
|
|
setChangeDataValue({
|
|
|
|
title: res.data.title,
|
|
|
|
changeDesc: res.data.changeDesc,
|
|
|
|
coscoSupplierSurveyAttachments: res.data.coscoSupplierSurveyAttachments,
|
|
|
|
})
|
2025-06-24 10:52:30 +08:00
|
|
|
}
|
|
|
|
};
|
2025-07-02 16:18:03 +08:00
|
|
|
//增改查
|
|
|
|
const [formVisible, setFormVisible] = useState(false);
|
|
|
|
const handleAdd = () => {
|
|
|
|
setFormVisible(true);
|
|
|
|
};
|
|
|
|
const handleFormSubmit = () => {
|
|
|
|
setFormVisible(false);
|
|
|
|
fetchData();
|
|
|
|
};
|
2025-06-24 10:52:30 +08:00
|
|
|
|
2025-07-02 16:18:03 +08:00
|
|
|
|
2025-06-24 10:52:30 +08:00
|
|
|
useEffect(() => {
|
|
|
|
//供应商信息
|
|
|
|
fetchData()
|
|
|
|
}, []);
|
|
|
|
|
2025-06-27 10:41:33 +08:00
|
|
|
if (!registerInfo?.coscoSupplierBase) return <div>{intl.formatMessage({ id: 'component.globalModal.loading' })}...</div>;
|
2025-06-24 10:52:30 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div style={{ padding: '0 30px 0 0' }}>
|
2025-07-02 16:18:03 +08:00
|
|
|
|
|
|
|
{ !viewType && (
|
|
|
|
<Button type="primary" onClick={handleAdd}>修改</Button>
|
|
|
|
)}
|
2025-06-24 10:52:30 +08:00
|
|
|
<Descriptions
|
|
|
|
bordered
|
|
|
|
column={2}
|
|
|
|
size="middle"
|
|
|
|
style={{ background: '#fff', padding: '16px 0 0' }}
|
|
|
|
>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.supplierType === 'dvs' && (
|
2025-06-24 10:52:30 +08:00
|
|
|
<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' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.name}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.enterpriseEnglishName' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.nameEn}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.supplierType !== 'dvs' && (
|
2025-06-24 10:52:30 +08:00
|
|
|
<>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.foreignCountryRegion' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.nation}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.foreignVAT' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.vat}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.foreignTaxpayerId' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.taxpayerId}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.foreignCurrency' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.currency}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.creditCode' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.socialCreditCode}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.businessScope' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.range}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.registerAddress' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.regAddress}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.officeAddress' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.workAddress}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.parentCompanyInfo' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.parentCompanyInvestor}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.legalPerson' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.legalPerson}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.idCardNumber' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.idCard}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.registeredCapital' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.capital}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.supplierType' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.enterpriseType}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactName' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.contactsName}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactMobile' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.contactsPhone}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactIdType' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.contactsType}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactEmail' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.contactsEmail}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactPhone' })}>
|
2025-06-27 10:41:33 +08:00
|
|
|
{registerInfo.coscoSupplierBase.telephone}
|
2025-06-24 10:52:30 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
</Descriptions>
|
2025-07-02 16:18:03 +08:00
|
|
|
<BaseInfoFormModal
|
|
|
|
visible={formVisible}
|
|
|
|
onOk={handleFormSubmit}
|
|
|
|
onCancel={() => setFormVisible(false)}
|
|
|
|
initialValues={registerInfo.coscoSupplierBase || undefined}
|
|
|
|
changeData={changeDataValue}
|
|
|
|
/>
|
2025-06-24 10:52:30 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseInfoTab;
|