import React, { useEffect, useState } from 'react'; import { Descriptions, Button } from 'antd'; import { coscoSupplierBase } from '../services'; import { useIntl } from 'umi'; import BaseInfoFormModal from './BaseInfoFormModal' 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; } interface BaseInfoTabProps { viewType?: boolean; record?: string; } const BaseInfoTab: React.FC = (props) => { const userId = sessionStorage.getItem('userId') || ''; const { viewType = false, record = userId } = props; const intl = useIntl(); const [registerInfo, setRegisterInfo] = useState(); //变更说明与附件 const [changeDataValue, setChangeDataValue] = useState(); const fetchData = async () => { const res = await coscoSupplierBase(record); if (res.code === 200) { setRegisterInfo(res.data); setChangeDataValue({ title: res.data.title, changeDesc: res.data.changeDesc, coscoSupplierSurveyAttachments: res.data.coscoSupplierSurveyAttachments, }) } }; //增改查 const [formVisible, setFormVisible] = useState(false); const handleAdd = () => { setFormVisible(true); }; const handleFormSubmit = () => { setFormVisible(false); fetchData(); }; useEffect(() => { if (record) { //供应商信息 fetchData() } }, [record]); if (!registerInfo?.coscoSupplierBase) return
{intl.formatMessage({ id: 'component.globalModal.loading' })}...
; return (
{!viewType && ( )} {registerInfo.coscoSupplierBase.supplierType === 'dvs' && ( {intl.formatMessage({ id: 'component.globalModal.domesticEnterprise' })} )} {registerInfo.coscoSupplierBase.name} {registerInfo.coscoSupplierBase.nameEn} {registerInfo.coscoSupplierBase.supplierType !== 'dvs' && ( <> {registerInfo.coscoSupplierBase.nation} {registerInfo.coscoSupplierBase.vat} {/* {registerInfo.coscoSupplierBase.taxpayerId} */} {registerInfo.coscoSupplierBase.currency} )} {registerInfo.coscoSupplierBase.range} {registerInfo.coscoSupplierBase.workAddress} {registerInfo.coscoSupplierBase.parentCompanyInvestor} {registerInfo.coscoSupplierBase.legalPerson} {registerInfo.coscoSupplierBase.capital} {registerInfo.coscoSupplierBase.supplierType === 'dvs' && ( <> {registerInfo.coscoSupplierBase.socialCreditCode} {registerInfo.coscoSupplierBase.regAddress} {registerInfo.coscoSupplierBase.idCard} {registerInfo.coscoSupplierBase.enterpriseType} {registerInfo.coscoSupplierBase.contactsPhone} {registerInfo.coscoSupplierBase.contactsType} )} {registerInfo.coscoSupplierBase.contactsName} {registerInfo.coscoSupplierBase.contactsEmail} {registerInfo.coscoSupplierBase.telephone} setFormVisible(false)} initialValues={registerInfo.coscoSupplierBase || undefined} changeData={changeDataValue} />
); }; export default BaseInfoTab;