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 {getTaskStatus,getProjectName,getLiquidationStatus,getJsyPaymentType,getBonusState} from '@/tools.js'; import {splitUrl} from "../../../tools"; import OrderItemStatus from "../../../common/orderItemStatus"; 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() { }, xiangqing(orderNo) { $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail", data: { orderNo, }, success: function (data) { if (data.error.length || data.data.list == "") { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { let thisdata = data.data; this.setState({ deleteSign:thisdata.deleteSign, }); } }.bind(this), }).always( function () { }.bind(this) ); }, componentWillReceiveProps(nextProps) { if(nextProps.data.orderNo){ this.setState({data:nextProps.data}); this.xiangqing(nextProps.data.orderNo); } this.state.visible=nextProps.showDesc; }, render() { const theData = this.state.data || {}; const FormItem = Form.Item; const formItemLayout = { labelCol: { span: 10 }, wrapperCol: { span: 12 }, }; return (
{this.handleSubmit(e,0)}} >
{theData.tid} {theData.orderNo} {theData.commodityName} {theData.targetName} {getTaskStatus(theData.taskStatus)} {theData.commodityQuantity} {getProjectName(theData.projectStatus)} {theData.acceptTime} {theData.reviewTime} {theData.licenceTime} {getLiquidationStatus(theData.liquidationStatus)} {getJsyPaymentType(theData.bonusSubject)} {getBonusState(theData.grantStatus)}
); } }); export default Form.create()(BonusDetail);