import React, { Component } from "react"; import { Alert, Button, Input, message, Modal, Spin, Form } from "antd"; import $ from "jquery/src/ajax"; const FormItem = Form.Item; const confirm = Modal.confirm; class PublicSupplement extends Component { constructor(props) { super(props); this.state = { visible: false, loading: false, supplement: "", nextPlan:"" }; this.addSupplement = this.addSupplement.bind(this); } addSupplement(e) { this.props.closeModel() e.stopPropagation(); if (!this.state.supplement) { message.info("本次公出目标总结不能为空"); return; } if (!this.state.nextPlan) { message.info("下一步公出计划不能为空"); return; } this.setState({ loading: true, }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/release/addSupplement", data: { id: this.props.infor.prid, supplement: (this.props.infor.supplement ? this.props.infor.supplement + '/' : "") + this.state.supplement, nextPlan: (this.props.infor.nextPlan ? this.props.infor.nextPlan + '/' : "") + this.state.nextPlan, }, }).done( function (data) { if (!data.error.length) { message.success("发布成功"); this.setState({ loading: false, visible: false, supplement: "", nextPlan:"" }); this.props.onCancel && this.props.onCancel(); this.props.closeModel() } else { message.warning(data.error[0].message); } }.bind(this) ); } render() { const formItemLayout = { labelCol: { xs: { span: 24 }, sm: { span: 6 }, }, wrapperCol: { xs: { span: 24 }, sm: { span: 14 }, }, }; return (