import React, { useState, useEffect } from 'react'; import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message } from 'antd'; import ImageUpload from '../../../components/XForm/ImageUpload'; import moment from 'moment'; import request from '../../../utils/request'; import apis from '../../../services/apis'; import Styles from './style.less'; import { router } from 'umi'; const { Option } = Select; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { Meta } = Card; const { TextArea } = Input; const tailFormItemLayout = { labelCol: { xs: { span: 20 }, sm: { span: 3 }, }, wrapperCol: { xs: { span: 20 }, sm: { span: 16 }, }, }; function body(props) { const { getFieldDecorator } = props.form // eslint-disable-next-line react-hooks/rules-of-hooks const [dataSource, setDataSource] = useState({ picture: '' }) const { id } = props.location.query; if (id !== '') { // eslint-disable-next-line react-hooks/rules-of-hooks useEffect(() => { getById(id) }, []) } // 获取详情信息 function getById(currentId) { request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => { res.reportDate = moment(res.reportDate) props.form.setFieldsValue(res) }) } function submitDate(params) { // props.form.setFieldsValue(res) request({ ...apis.customer.auto, urlData: { id: params.customerId }, params: { verifyStatus: params.verifyStatus } }).then(() => { // eslint-disable-next-line no-unused-expressions router.go(-1) }).catch(err => { // eslint-disable-next-line no-unused-expressions }) } // 提交事件 function handleSubmit(e) { e.preventDefault(); props.form.validateFields((err, values) => { if (!err) { submitDate({ ...values }) } }); } // Change 事件 function handleSelectChange(e) { // eslint-disable-next-line no-console console.log(e) } return ( <>
handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}> {getFieldDecorator('customerId')( , )} {getFieldDecorator('intention')( , )} {getFieldDecorator('picture')( , )} {getFieldDecorator('name')( , )} {getFieldDecorator('phone')( , )} {getFieldDecorator('sex')( , )} {getFieldDecorator('visiteNum')( , )} {getFieldDecorator('describe')(