import { Badge, Descriptions } from 'kts-components-antd-x4';
import React from 'react';
import moment from 'moment';
import agent from '../../Server';
interface BaseInfoModuleV3_1 {
    websiteList: string;
    legalPersonName: string; // 法人
    fromTime: number; // 经营开始时间
    usedBondName: string; // 股票曾用名
    businessScope: string; // 经营范围
    orgNumber: string; // 组织机构代码
    estiblishTime: number; // 成立日期
    toTime: number; // 经营结束时间
    creditCode: string; // 统一社会信用代码
    historyNames: string; // 曾用名
    socialStaffNum: number;// 参保人数
    regNumber: string; // 公司注册号
    regStatus: string; // 经营状态
    actualCapital: string; //实收注册资金
    approvedTime: number; // 核准日期
    companyOrgType: string; // 企业类型
    staffNumRange: string; // 人员规模
    industry: string; // 行业
    property3: string; // 英文名
    regInstitute: string; // 登记机关 
    regCapital: string; // 注册资本

}
interface IDavVerifierRiskDetailDto {
    companyName: string; // 客商名称 ,
    companyTaxNo: string; // 纳税人识别号 ,
    ic: BaseInfoModuleV3_1;
    icRegStatus: string; // 经营状态 ,
    id: number //: 主键 ,
    jrLawSuitTotal: number;// 法律诉讼总数 ,
    mrAbnormalTotal: number; // 经营异常总数 ,
    mrOwnTaxTotal: number; // 欠税公告总数 ,
    mrPunishmentTotal: number; // 行政处罚总数 ,
    mrTaxContraventionTotal: number; // 税收违法总数 ,
    mtaxCredGrade: string,
    subId: string; // 主体id 
}

export default function App(props: { id: number }) {
    const [detail, setDetail] = React.useState<IDavVerifierRiskDetailDto>();
    React.useEffect(() => {
        if (props.id) {
            (async () => {
                const res: any = await agent.post('/web/verifierparty/risk/get', { id: props.id }, null);
                if (res.err) {
                    return;
                } else {
                    console.log('aaaL', res.res);
                    setDetail(res.res);
                }
            })()
        }
    }, [props.id])
    return <div style={{ padding: '0px 20px 20px', height: 'calc(100vh - 109px)', display: 'flex', flexDirection: 'column', overflow: 'auto' }}>
        <Descriptions labelStyle={{ width: '200px' }} title="" bordered={true} column={2}>
            <Descriptions.Item label="法定代表人">{detail?.ic.legalPersonName}</Descriptions.Item>
            <Descriptions.Item label="经营状态">{detail?.ic?.regStatus}</Descriptions.Item>
            <Descriptions.Item label="工商注册号">{detail?.ic?.regNumber}</Descriptions.Item>
            <Descriptions.Item label="统一社会信用代码">{detail?.ic?.creditCode}</Descriptions.Item>
            <Descriptions.Item label="成立日期">{detail?.ic?.estiblishTime&&moment(detail?.ic?.estiblishTime).format('YYYY-MM-DD')}</Descriptions.Item>
            <Descriptions.Item label="组织机构代码">{detail?.ic?.orgNumber}</Descriptions.Item>
            <Descriptions.Item label="营业期限">{detail?.ic.fromTime&&moment(detail?.ic?.fromTime).format('YYYY-MM-DD')} 至 {detail?.ic?.toTime&&moment(detail?.ic?.toTime).format('YYYY-MM-DD')||'今'}</Descriptions.Item>
            <Descriptions.Item label="注册资本">{detail?.ic?.regCapital}</Descriptions.Item>
            <Descriptions.Item label="核准日期">{detail?.ic?.approvedTime&&moment(detail?.ic?.approvedTime).format('YYYY-MM-DD')}</Descriptions.Item>
            <Descriptions.Item label="企业类型">{detail?.ic?.companyOrgType}</Descriptions.Item>
            <Descriptions.Item label="实缴资本">{detail?.ic?.actualCapital}</Descriptions.Item>
            <Descriptions.Item label="人员规模">{detail?.ic?.staffNumRange}</Descriptions.Item>
            <Descriptions.Item label="参保人数">{detail?.ic?.socialStaffNum}</Descriptions.Item>
            <Descriptions.Item label="纳税人识别号">{detail?.companyTaxNo}</Descriptions.Item>
            <Descriptions.Item label="曾用名">{detail?.ic?.historyNames}</Descriptions.Item>
            <Descriptions.Item label="纳税人资质"> - </Descriptions.Item>
            <Descriptions.Item label="行业">{detail?.ic?.industry}</Descriptions.Item>
            <Descriptions.Item label="登记机关">{detail?.ic?.regInstitute}</Descriptions.Item>
            <Descriptions.Item label="英文名称">{detail?.ic?.property3}</Descriptions.Item>
            <Descriptions.Item label="注册地址">{detail?.ic?.websiteList}</Descriptions.Item>
            <Descriptions.Item label="经营范围">{detail?.ic?.businessScope}</Descriptions.Item>
        </Descriptions>
    </div>
};