import React from 'react'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import { Form, Spin, message, Modal } from 'antd'; import {getProjectName,getNewOrderStatus,getJsyPaymentType} from '@/tools.js'; import OrderItemStatus from "../../../common/orderItemStatus"; import EnterpriseNameChange from "../../../common/enterpriseNameChange"; const BonusDetail=React.createClass({ getInitialState() { return { loading: false, visible:false, showDesc:false, }; }, onCancel(){ this.setState({ visible:false }) this.props.closeDesc(false,false); }, onShow() { this.setState({ visible: false, }); this.props.closeDesc(false, true); }, componentWillMount() { }, xiangqings(orderNo) { $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail", data: { orderNo, }, success: function (data) { let thisdata = data.data; if (data.error.length || data.data.list == "") { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { this.setState({ deleteSign:thisdata.deleteSign, orderUid: thisdata.uid, }); } }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, componentWillReceiveProps(nextProps) { if(nextProps.data.orderNo){ this.setState({data:nextProps.data}); this.xiangqings(nextProps.data.orderNo); } this.state.visible=nextProps.showDesc; }, render() { const theData = this.props.data || {}; const FormItem = Form.Item; const formItemLayout = { labelCol: { span: 10 }, wrapperCol: { span: 12 }, }; return (