import React from 'react'; import $ from 'jquery/src/ajax'; import { Icon, Tabs, Table, Tooltip, Modal, Popover, message, Spin, Upload, Input, InputNumber, Select, DatePicker, Button, Radio, Form, Cascader, Tag, Checkbox, Row, Col } from 'antd'; import { getTechField } from '@/DicTechFieldList.js'; import {areaSelect,getProvince } from '@/NewDicProvinceList'; import { IndustryObject, getIndustryCategory } from '@/DicIndustryList.js'; import { splitUrl, companySearch, getDemandType, getAchievementCategory,getReleaseStateList,getReleasePositionList } from '@/tools.js'; const DemandDetail = Form.create()(React.createClass({ getInitialState() { return { visible: false, loading: false, auditStatus: 0, textFileList: [], videoFileList: [], pictureUrl: [], }; }, loadData(id) { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/user/demand/demandDetail' , data: { id: id }, success: function (data) { let thisData = data.data; if (!thisData) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; thisData = {}; }; // let ProvinceCityArr = []; // let ProvinceS = thisData.locationProvince; //getprovince // let citys = thisData.locationCity; // let Areas = thisData.locationArea; // ProvinceCityArr.push(ProvinceS, citys, Areas); this.setState({ //ProvinceCity:ProvinceCityArr, id:thisData.id, data: thisData, isHot:thisData.isHot, isUrgent:thisData.isUrgent, status:thisData.status, isHot:thisData.isHot, pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : [] }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, getTagsArr(e) { this.setState({ tags: e }); }, getPictureUrl(e) { this.setState({ pictureUrl: e }); }, cancelFun(){ this.props.closeDesc(); }, //刷新发布-撤销发布 updateFun(index){ this.setState({ loading:true }) let api = index?'/api/shuaxin':'/api/chexiao' $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + api, data: { ids: this.state.id } }).done(function (data) { if (!data.error.length) { message.success('删除成功!'); this.setState({ loading: false, }); } else { message.warning(data.error[0].message); }; this.loadData(); }.bind(this)); }, componentWillMount() { if (this.props.data.id) { this.loadData(this.props.data.id); } else { this.state.data = {}; }; }, componentWillReceiveProps(nextProps) { if (!this.props.visible && nextProps.visible) { this.state.textFileList = []; this.state.videoFileList = []; if (nextProps.data.id) { this.loadData(nextProps.data.id); } else { this.state.data = {}; this.state.isUrgent=undefined;//加急需求 this.state.isHot=undefined;//是否悬赏 this.state.status=undefined; this.state.pictureUrl = []; }; this.props.form.resetFields(); }; }, render() { const theData = this.state.data || {}; const { getFieldDecorator } = this.props.form; const FormItem = Form.Item const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 12 }, }; return (
{theData.problemDes} {theData.name}
{getIndustryCategory(theData.industryCategoryA,theData.industryCategoryB)}
{getDemandType(theData.demandType)} {theData.demandType=='5'&& {theData.crowdCost} 元/月 } {theData.demandType=='3'&&
{theData.budgetCost}万元 {theData.researchType?'扩大再生产':'研发'}
}

您还可以说明

{theData.isUrgent?'加急':'非加急'} {theData.isUrgent?
{theData.urgentDays} {theData.urgentMoney}万元
:''}
{theData.isHot?'热点':'非热点'} {theData.status=='0'&&'进行中'} {theData.status=='1'&&'未解决'} {theData.status=='2'&&'已解决'}
{/*
{this.state.ProvinceCity}
*/}
{ this.setState({ previewImage: file.url || file.thumbUrl, previewVisible: true, }); }} > { this.setState({ previewVisible: false }) }}>
{getReleaseStateList(theData.releaseState)}
{getReleasePositionList(theData.publishPages)}
{theData.auditInfo}
{this.props.data.releaseStatus=='2'&& }
) } })); export default DemandDetail;