import React, { Component } from "react"; import { Form, Button, message, Modal, Spin, Input, DatePicker, Radio, Popconfirm } from "antd"; import ImgList from "../../../common/imgList"; import $ from "jquery/src/ajax"; const { TextArea } = Input; const RadioGroup = Radio.Group; class legalAdd extends Component { constructor(props) { super(props); this.state = { visible: false, mainModalKeys: 0, type: "", date: "", remarks: "", loading: false, }; this.addLegal = this.addLegal.bind(this); } addLegal() { let theorgCodeUrl = []; if (!this.state.fileList) { message.warning("请上传凭证"); return; } else { let picArr = []; this.state.fileList.map(function (item) { if (item.response && item.response.data && item.response.data.length) { picArr.push(item.response.data); } }); theorgCodeUrl = picArr.join(","); } if (!this.state.date) { message.warning("请选择时间"); return; } this.setState({ addDunOrderLoading: true, loading: true, }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/lagalAffairs/addLagalAffairsLog", data: { orderNo: this.props.orderNo, type: this.state.type, status: this.state.status ? this.state.status : 0 , date: this.state.date, remarks: this.state.remarks, attachmentUrl: theorgCodeUrl.length ? theorgCodeUrl : "", }, success: function (data) { if (data.error.length) { this.setState({ loading: false, }); message.warning(data.error[0].message); } else { this.setState({ loading: false, }); this.props.modelBack(); // this.props.visible = false message.success("添加成功"); this.tabelContentRef && this.tabelContentRef.onRefresh(); } }.bind(this), }).done( function () { this.setState({ addDunOrderLoading: false, }); }.bind(this) ); } render() { // const { getFieldDecorator } = this.props.form; const formItemLayout = { labelCol: { span: 10 }, wrapperCol: { span: 12 }, }; return (