import React from 'react'; import { Icon, Modal, message, Spin, Button, Row, Col, Upload, Tooltip, Tag, Table, Input } from 'antd'; import '../portal.less'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import { getIndustryCategory } from '@/DicIndustryList.js'; import { splitUrl, getAchievementCategory, getMaturity, getInnovation, getOrderStatus, beforeUploadFile } from '@/tools.js'; const AchievementDetail = React.createClass({ getInitialState() { return { visible: false, loading: false, buttonLoading: false, dataSource: [], orderVisible: false, tags: [], technicalPictureUrl: [], maturityPictureUrl: [], columns: [ { title: '状态', dataIndex: 'status', key: 'status', render: (text) => { return getOrderStatus(text) } }, { title: '处理时间', dataIndex: 'recordTimeFormattedDate', key: 'recordTimeFormattedDate', }, { title: '备注', dataIndex: 'comment', key: 'comment', } ], logsOrderStatus: 0 }; }, handleCancel(e) { this.props.closeDesc(false); }, loadData(id) { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/user/portal/achievementDetail', 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 = {}; }; this.setState({ data: thisData, tags: thisData.keyword ? thisData.keyword.split(",") : [], technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [], maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [] }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, loadLogsData(id) { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/user/portal/order/achievementOrderLog', data: { achievementOrderId: id }, success: function (data) { let thisData = data.data, theArr = [], _me = this; if (!thisData) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } else { thisData.map(function (item, i) { theArr.push({ key: i, recordTime: item.recordTime, recordTimeFormattedDate: item.recordTimeFormattedDate, status: item.status, comment: item.comment }); _me.state.logsOrderStatus = item.status; }); }; this.setState({ dataSource: theArr }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, interestClick() { this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/user/portal/achievementInterest', data: { id: this.props.data.id }, success: function (data) { if (data.error && data.error.length) { message.warning(data.error[0].message); } else { this.loadData(this.props.data.id); }; }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this));; }, cancelInterestClick() { this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/user/portal/achievementCancelInterest', data: { id: this.state.data.achievementInterestId }, success: function (data) { if (data.error && data.error.length) { message.warning(data.error[0].message); } else { this.loadData(this.props.data.id); }; }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this));; }, handleSubmit() { this.setState({ buttonLoading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/user/portal/order/orderAchievement', data: { achievementId: this.state.data.id, comment: this.state.comment }, success: function (data) { if (data.error && data.error.length) { message.warning(data.error[0].message); } else { message.success("提交成功!") }; }.bind(this), }).always(function () { this.loadData(this.state.data.id); this.setState({ orderVisible: false, buttonLoading: false }); }.bind(this)); }, cancelSubmit() { this.setState({ buttonLoading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/user/portal/order/achievementShutdown', data: { id: this.state.data.achievementOrderId }, success: function (data) { if (data.error && data.error.length) { message.warning(data.error[0].message); } else { message.success("撤销成功!") }; }.bind(this), }).always(function () { this.loadData(this.state.data.id); this.setState({ buttonLoading: false }); }.bind(this)); }, componentWillReceiveProps(nextProps) { if (!this.props.showDesc && nextProps.showDesc) { if (nextProps.data.id) { this.loadData(nextProps.data.id); if (nextProps.data.orderId) { this.loadLogsData(nextProps.data.orderId) } } else { this.state.data = {}; this.state.tags = []; this.state.maturityPictureUrl = []; this.state.technicalPictureUrl = []; }; }; }, render() { const theData = this.state.data || {}; if (this.props.data) { return ( 成果详情 {theData.achievementInterestId ? 不感兴趣 : 感兴趣} } width='1000px' footer='' className="portal-desc-content"> 编号 {theData.serialNumber} 名称 {theData.name} 数据类别 {(() => { switch (theData.dataCategory) { case "0": return 成果; case "1": return 技术; case "2": return 项目; } })()} 类型 {getAchievementCategory(theData.category)} 应用领域 {getIndustryCategory(theData.fieldA, theData.fieldB)} 发布时间 {theData.releaseDateFormattedDate} 关键词 {this.state.tags.map((tag) => { return {tag} ; })} 摘要 {theData.summary} 成果简介 {theData.introduction} 技术图片
{ this.setState({ previewImage: file.url || file.thumbUrl, previewVisible: true, }); }} > { this.setState({ previewVisible: false }) }}>
成熟度 {getMaturity(theData.maturity)} 创新度 {getInnovation(theData.innovation)} 成熟度证明材料(图片) { this.setState({ previewImage: file.url || file.thumbUrl, previewVisible: true, }); }} > 成熟度证明材料(文本) {theData.maturityTextFileUrl ? { window.open(globalConfig.context + '/api/user/achievement/download?id=' + theData.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件) : 未上传!} 成熟度证明材料(视频地址) {theData.maturityVideoUrl} 成果所有人名称 {theData.ownerName} 合作方式 {(() => { switch (theData.cooperationMode) { case "0": return 技术转让; case "1": return 授权生产; } })()} 转让方式 {(() => { switch (theData.transferMode) { case "0": return 完全转让; case "1": return 许可转让; case "2": return 技术入股; } })()} 转让价格 {(() => { switch (theData.bargainingMode) { case "0": return 面议; case "1": return {theData.transferPrice} 万元; } })()} 技术场景 {theData.technicalScene} 技术突破 {theData.breakthrough} 专利情况 {theData.patentCase} 获奖情况 {theData.awards} 技术团队情况 {theData.teamDes} 技术参数 {theData.parameter} 技术方案 {theData.techPlanUrl ? { window.open(globalConfig.context + '/api/user/achievement/download?id=' + theData.id + '&sign=achievement_tech_plan') }}>技术方案 : 未上传!} 商业计划书 {theData.businessPlanUrl ? { window.open(globalConfig.context + '/api/user/achievement/download?id=' + theData.id + '&sign=achievement_business_plan') }}>商业计划书 : 未上传!} {this.props.data.orderId ?

状态流转记录:

:
} {this.state.logsOrderStatus == 6 ?
:
{theData.achievementOrderId ? : }
} { this.setState({ orderVisible: false }); }}> 备注 : { this.state.comment = e.target.value }} /> ); } else { return
} }, }); export default AchievementDetail;