import React, { Component } from 'react' import { RouteComponentProps, withRouter } from 'react-router-dom' import CustBreadcrumb from '@/components/CustComponents/CustBreadcrumb' import './style.scss' import API from '@/api' import { AJAX_STATUS } from '@/shared/common/constants' type SCMDetailProps = RouteComponentProps<{ id: string }> & {} interface SCMDetailState { dataSource: any } @(withRouter as any) class SCMDetail extends Component { constructor(props: SCMDetailProps) { super(props) this.state = { dataSource: {}, } } componentDidMount() { this.getData() } getData = async () => { const { match: { params }, } = this.props const id = +params.id try { const res = await API.supplyChain.selectSupplier(id) if (res.code === AJAX_STATUS.SUCCESS) { this.setState({ dataSource: res.data, }) } } catch (e) { console.log(e) this.setState({ dataSource: { // 公司名称 companyName: '11111111', // 公司网址 url: '11111111', // 公司介绍 presentation: '11111111', // 公司地址 address: '11111111', // 公司联系人名称 contactsName: '11111111', // 联系人手机号 contactsPhone: '11111111', // 联系人邮箱 contactsEmail: '11111111', }, }) } } render() { const routes = [ { path: '/scm/scmList', name: '供应商管理', }, { path: '', name: '供应商详情', }, ] const { dataSource } = this.state return (
供应商详情
公司名称:
{dataSource.companyName}
公司网址:
{dataSource.url}
公司介绍:
{dataSource.presentation}
公司地址:
{dataSource.address}
联系人姓名:
{dataSource.contactsName}
联系人手机号:
{dataSource.contactsPhone}
联系人邮箱:
{dataSource.contactsEmail}
) } } export default SCMDetail