|
@@ -4,8 +4,8 @@ import moment from 'moment';
|
|
|
import './techAchievement.less';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
-import { IndustryObject } from '../../DicIndustryList.js';
|
|
|
-import { beforeUploadFile, splitUrl, companySearch } from '../../tools.js';
|
|
|
+import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
|
|
|
+import { beforeUploadFile, splitUrl, companySearch, getAchievementCategory } from '../../tools.js';
|
|
|
|
|
|
const KeyWordTagGroup = React.createClass({
|
|
|
getInitialState() {
|
|
@@ -130,7 +130,7 @@ const PicturesWall = React.createClass({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
+const AchievementDetailShow = Form.create()(React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
visible: false,
|
|
@@ -163,14 +163,8 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
};
|
|
|
thisData = {};
|
|
|
};
|
|
|
- let d = new Date()
|
|
|
- if (thisData && thisData.dateOfBirthMonth && thisData.dateOfBirthYear) {
|
|
|
- d.setMonth(thisData.dateOfBirthMonth - 1);
|
|
|
- d.setYear(parseInt(thisData.dateOfBirthYear));
|
|
|
- };
|
|
|
this.setState({
|
|
|
data: thisData,
|
|
|
- orgDisplay: thisData.ownerType,
|
|
|
tags: thisData.keyword ? thisData.keyword.split(",") : [],
|
|
|
technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
|
|
@@ -182,7 +176,560 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- getSalesmanList() {
|
|
|
+ offShelf() {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/achievement/offShelf",
|
|
|
+ data: { "id": this.props.data.id }
|
|
|
+ }).done(function (data) {
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('撤销成功!');
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ releaseSubmitVisible: false
|
|
|
+ });
|
|
|
+ this.props.handleOk();
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ formSubmit() {
|
|
|
+ this.props.form.validateFields((err, values) => {
|
|
|
+ if (values.auditStatus == 3 && !values.techBroderId) {
|
|
|
+ message.warning('必须选择一个技术经纪人!');
|
|
|
+ return
|
|
|
+ };
|
|
|
+ if (!err) {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + '/api/admin/audit/achievement',
|
|
|
+ data: {
|
|
|
+ id: this.props.data.id,
|
|
|
+ techBroderId: values.techBroderId,
|
|
|
+ auditStatus: values.auditStatus
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ this.state.auditStatus = 0;
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('保存成功!');
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ formSubmitVisible: false
|
|
|
+ });
|
|
|
+ this.props.handleOk();
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSubmit(e) {
|
|
|
+ e.preventDefault();
|
|
|
+ this.props.form.validateFields((err, values) => {
|
|
|
+ if (values.auditStatus == 4) {
|
|
|
+ this.setState({
|
|
|
+ formSubmitVisible: true
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.formSubmit();
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 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.techPlanFileList = [];
|
|
|
+ this.state.businessPlanFileList = [];
|
|
|
+ if (nextProps.data.id) {
|
|
|
+ this.loadData(nextProps.data.id);
|
|
|
+ } else {
|
|
|
+ this.state.data = {};
|
|
|
+ this.state.tags = [];
|
|
|
+ this.state.maturityPictureUrl = [];
|
|
|
+ this.state.technicalPictureUrl = [];
|
|
|
+ };
|
|
|
+ this.props.form.resetFields();
|
|
|
+ };
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ const theData = this.state.data || {};
|
|
|
+ const { getFieldDecorator } = this.props.form;
|
|
|
+ const FormItem = Form.Item
|
|
|
+ const formItemLayout = {
|
|
|
+ labelCol: { span: 8 },
|
|
|
+ wrapperCol: { span: 14 },
|
|
|
+ };
|
|
|
+ return (
|
|
|
+ <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="编号" >
|
|
|
+ <span>{theData.serialNumber}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="名称" >
|
|
|
+ <span>{theData.name}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="数据类别" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.dataCategory) {
|
|
|
+ case "0":
|
|
|
+ return <span>成果</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>技术</span>;
|
|
|
+ case "2":
|
|
|
+ return <span>项目</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="类型" >
|
|
|
+ <span>{getAchievementCategory(theData.category)}</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="是否发布" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.releaseStatus) {
|
|
|
+ case "0":
|
|
|
+ return <span>未发布</span>;
|
|
|
+ case "1":
|
|
|
+ return <div>
|
|
|
+ <span>已发布</span>
|
|
|
+ <Button style={{ marginLeft: '10px' }} onClick={() => { this.setState({ releaseSubmitVisible: true }); }}>撤消发布</Button>
|
|
|
+ <Modal maskClosable={false} title="确认"
|
|
|
+ visible={this.state.releaseSubmitVisible}
|
|
|
+ width='300px'
|
|
|
+ footer={null}
|
|
|
+ onCancel={() => { this.setState({ releaseSubmitVisible: false }) }} >
|
|
|
+ <span>确认要撤销发布吗?</span>
|
|
|
+ <Button className="modal-submit" type="primary" onClick={this.offShelf} >确认</Button>
|
|
|
+ <Button className="modal-submit" type="ghost" onClick={() => { this.setState({ releaseSubmitVisible: false }) }}>取消</Button>
|
|
|
+ </Modal>
|
|
|
+ </div>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="发布时间" >
|
|
|
+ <span>{theData.releaseDateFormattedDate}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="审核状态" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.auditStatus) {
|
|
|
+ case "0":
|
|
|
+ return <span>未提交审核(草稿)</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>提交审核</span>;
|
|
|
+ case "2":
|
|
|
+ return <span>审核中</span>;
|
|
|
+ case "3":
|
|
|
+ return <span>审核通过</span>;
|
|
|
+ case "4":
|
|
|
+ return <span>审核未通过</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="关键词" >
|
|
|
+ {this.state.tags.map((tag) => {
|
|
|
+ return <Tooltip key={tag} title={tag}>
|
|
|
+ <Tag key={tag}>{tag}</Tag>
|
|
|
+ </Tooltip>;
|
|
|
+ })}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="摘要" >
|
|
|
+ <span>{theData.summary}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="成果简介" >
|
|
|
+ <span>{theData.introduction}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="技术图片" >
|
|
|
+ <div className="clearfix">
|
|
|
+ <Upload className="demandDetailShow-upload"
|
|
|
+ listType="picture-card"
|
|
|
+ fileList={this.state.technicalPictureUrl}
|
|
|
+ onPreview={(file) => {
|
|
|
+ this.setState({
|
|
|
+ previewImage: file.url || file.thumbUrl,
|
|
|
+ previewVisible: true,
|
|
|
+ });
|
|
|
+ }} >
|
|
|
+ </Upload>
|
|
|
+ <Modal maskClosable={false} footer={null}
|
|
|
+ visible={this.state.previewVisible}
|
|
|
+ onCancel={() => { this.setState({ previewVisible: false }) }}>
|
|
|
+ <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="应用领域" >
|
|
|
+ <span>{getIndustryCategory(theData.fieldA, theData.fieldB)}</span>
|
|
|
+ </FormItem>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="成熟度" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.maturity) {
|
|
|
+ case "0":
|
|
|
+ return <span>正在研发</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>已有样品</span>;
|
|
|
+ case "2":
|
|
|
+ return <span>通过小试</span>;
|
|
|
+ case "3":
|
|
|
+ return <span>通过中试</span>;
|
|
|
+ case "4":
|
|
|
+ return <span>可以量产</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="创新度" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.innovation) {
|
|
|
+ case "0":
|
|
|
+ return <span>行业先进</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>行业领先</span>;
|
|
|
+ case "2":
|
|
|
+ return <span>国内先进</span>;
|
|
|
+ case "3":
|
|
|
+ return <span>国内领先</span>;
|
|
|
+ case "4":
|
|
|
+ return <span>国际先进</span>;
|
|
|
+ case "5":
|
|
|
+ return <span>国际领先</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="成熟度证明材料(图片)" >
|
|
|
+ <Upload className="demandDetailShow-upload"
|
|
|
+ listType="picture-card"
|
|
|
+ fileList={this.state.maturityPictureUrl}
|
|
|
+ onPreview={(file) => {
|
|
|
+ this.setState({
|
|
|
+ previewImage: file.url || file.thumbUrl,
|
|
|
+ previewVisible: true,
|
|
|
+ });
|
|
|
+ }} >
|
|
|
+ </Upload>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 6 }}
|
|
|
+ label="成熟度证明材料(文本)" >
|
|
|
+ <p>{theData.maturityTextFileUrl ?
|
|
|
+ <span className="download-file">
|
|
|
+ <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
|
|
|
+ </span>
|
|
|
+ : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="成熟度证明材料(视频地址)" >
|
|
|
+ <span>{theData.maturityVideoUrl}</span>
|
|
|
+ </FormItem>
|
|
|
+ <div className="clearfix" >
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="成果所有人名称" >
|
|
|
+ <span>{theData.ownerName}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所有人证件号" >
|
|
|
+ <span>{theData.ownerIdNumber}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所有人联系电话" >
|
|
|
+ <span>{theData.ownerMobile}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所有人电子邮箱" >
|
|
|
+ <span>{theData.ownerEmail}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所有人通信地址" >
|
|
|
+ <span>{theData.ownerPostalAddress}</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所有人类型" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.ownerType) {
|
|
|
+ case "0":
|
|
|
+ return <span>个人</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>组织</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ {theData.ownerType == "1" ? <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所属组织名称" >
|
|
|
+ {getFieldDecorator('orgName', {
|
|
|
+ initialValue: theData.orgName
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所属组织地址" >
|
|
|
+ {getFieldDecorator('orgAddress', {
|
|
|
+ initialValue: theData.orgAddress
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所属组织邮箱" >
|
|
|
+ {getFieldDecorator('orgEmail', {
|
|
|
+ initialValue: theData.orgEmail
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所属组织联系人名称" >
|
|
|
+ {getFieldDecorator('orgContacts', {
|
|
|
+ initialValue: theData.orgContacts
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="所属组织联系人电话" >
|
|
|
+ {getFieldDecorator('orgContactsMobile', {
|
|
|
+ initialValue: theData.orgContactsMobile
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div> : <div></div>}
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="合作方式" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.cooperationMode) {
|
|
|
+ case "0":
|
|
|
+ return <span>技术转让</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>授权生产</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="转让方式" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.transferMode) {
|
|
|
+ case "0":
|
|
|
+ return <span>完全转让</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>许可转让</span>;
|
|
|
+ case "2":
|
|
|
+ return <span>技术入股</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="议价方式" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.bargainingMode) {
|
|
|
+ case "0":
|
|
|
+ return <span>面议</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>定价</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="转让价格" >
|
|
|
+ <span>{theData.transferPrice} 万元</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="技术场景" >
|
|
|
+ <span>{theData.technicalScene}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="技术突破" >
|
|
|
+ <span>{theData.breakthrough}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="专利情况" >
|
|
|
+ <span>{theData.patentCase}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="获奖情况" >
|
|
|
+ <span>{theData.awards}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="技术团队情况" >
|
|
|
+ <span>{theData.teamDes}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ label="技术参数" >
|
|
|
+ <span>{theData.parameter}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 6 }}
|
|
|
+ label="技术方案" >
|
|
|
+ <p>{theData.techPlanUrl ?
|
|
|
+ <span className="download-file">
|
|
|
+ <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
|
|
|
+ </span>
|
|
|
+ : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 6 }}
|
|
|
+ label="商业计划书" >
|
|
|
+ <p>{theData.businessPlanUrl ?
|
|
|
+ <span className="download-file">
|
|
|
+ <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
|
|
|
+ </span>
|
|
|
+ : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
|
+ </FormItem>
|
|
|
+ {window.showAuditStatus && theData.auditStatus == 2 ? <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="审核状态" >
|
|
|
+ {getFieldDecorator('auditStatus')(
|
|
|
+ <Radio.Group>
|
|
|
+ <Radio value={3}>审核通过</Radio>
|
|
|
+ <Radio value={4}>审核未通过</Radio>
|
|
|
+ </Radio.Group>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="技术经纪人" >
|
|
|
+ {getFieldDecorator('techBroderId', {
|
|
|
+ initialValue: theData.techBroderId
|
|
|
+ })(
|
|
|
+ <Select style={{ width: 260 }}>
|
|
|
+ {this.props.techBrodersOption}
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div> : <div></div>}
|
|
|
+ <FormItem wrapperCol={{ span: 12, offset: 4 }}>
|
|
|
+ {theData.auditStatus == 2 ? <Button className="set-submit" type="primary" htmlType="submit">保存</Button> : <span></span>}
|
|
|
+ <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
|
|
|
+ </FormItem>
|
|
|
+ <Modal maskClosable={false} title="确认"
|
|
|
+ visible={this.state.formSubmitVisible}
|
|
|
+ width='360px'
|
|
|
+ footer={null}
|
|
|
+ onCancel={() => { this.setState({ formSubmitVisible: false }) }} >
|
|
|
+ <span>确认该需求审核未通过?</span>
|
|
|
+ <Button className="modal-submit" type="primary" onClick={this.formSubmit}>确认</Button>
|
|
|
+ <Button className="modal-submit" type="ghost" onClick={() => { this.setState({ formSubmitVisible: false }) }}>取消</Button>
|
|
|
+ </Modal>
|
|
|
+ </Spin>
|
|
|
+ </Form >
|
|
|
+ )
|
|
|
+ }
|
|
|
+}));
|
|
|
+
|
|
|
+const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
+ getInitialState() {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ loading: false,
|
|
|
+ auditStatus: 0,
|
|
|
+ textFileList: [],
|
|
|
+ techPlanFileList: [],
|
|
|
+ businessPlanFileList: [],
|
|
|
+ maturityPictureUrl: [],
|
|
|
+ technicalPictureUrl: [],
|
|
|
+ tags: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ loadData(id) {
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
@@ -190,22 +737,24 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/salesman",
|
|
|
+ url: globalConfig.context + "/api/admin/achievement/detail",
|
|
|
+ data: {
|
|
|
+ id: id
|
|
|
+ },
|
|
|
success: function (data) {
|
|
|
- if (!data.data) {
|
|
|
+ let thisData = data.data;
|
|
|
+ if (!thisData) {
|
|
|
if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- return;
|
|
|
- };
|
|
|
- let _me = this, theArr = [];
|
|
|
- for (var item in data.data) {
|
|
|
- theArr.push(
|
|
|
- <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
|
|
|
- )
|
|
|
+ };
|
|
|
+ thisData = {};
|
|
|
};
|
|
|
this.setState({
|
|
|
- salesmanOption: theArr
|
|
|
+ data: thisData,
|
|
|
+ orgDisplay: thisData.ownerType,
|
|
|
+ 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 () {
|
|
@@ -298,9 +847,11 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
orgContactsMobile: values.orgContactsMobile,
|
|
|
releaseStatus: values.releaseStatus,
|
|
|
techPlanUrl: this.state.techPlanUrl,
|
|
|
- businessPlanUrl: this.state.businessPlanUrl
|
|
|
+ businessPlanUrl: this.state.businessPlanUrl,
|
|
|
+ auditStatus: this.state.auditStatus
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
+ this.state.auditStatus = 0;
|
|
|
if (!data.error.length) {
|
|
|
message.success('保存成功!');
|
|
|
this.setState({
|
|
@@ -315,9 +866,8 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
});
|
|
|
},
|
|
|
componentWillMount() {
|
|
|
- this.getSalesmanList();
|
|
|
if (this.props.data.id) {
|
|
|
- this.loadData(this.props.data.id, this.props.detailApiUrl);
|
|
|
+ this.loadData(this.props.data.id);
|
|
|
} else {
|
|
|
this.state.data = {};
|
|
|
};
|
|
@@ -390,23 +940,44 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
</Select>
|
|
|
)}
|
|
|
</FormItem>
|
|
|
- <FormItem className="half-item"
|
|
|
- {...formItemLayout}
|
|
|
- label="是否发布" >
|
|
|
- {getFieldDecorator('releaseStatus', {
|
|
|
- initialValue: theData.releaseStatus
|
|
|
- })(
|
|
|
- <Radio.Group>
|
|
|
- <Radio value="0">未发布</Radio>
|
|
|
- <Radio value="1">发布</Radio>
|
|
|
- </Radio.Group>
|
|
|
- )}
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-item"
|
|
|
- {...formItemLayout}
|
|
|
- label="发布时间" >
|
|
|
- <span>{theData.releaseDateFormattedDate}</span>
|
|
|
- </FormItem>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="是否发布" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.releaseStatus) {
|
|
|
+ case "0":
|
|
|
+ return <span>未发布</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>已发布</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="发布时间" >
|
|
|
+ <span>{theData.releaseDateFormattedDate}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="审核状态" >
|
|
|
+ {(() => {
|
|
|
+ switch (theData.auditStatus) {
|
|
|
+ case "0":
|
|
|
+ return <span>未提交审核(草稿)</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>提交审核</span>;
|
|
|
+ case "2":
|
|
|
+ return <span>审核中</span>;
|
|
|
+ case "3":
|
|
|
+ return <span>审核通过</span>;
|
|
|
+ case "4":
|
|
|
+ return <span>审核未通过</span>;
|
|
|
+ }
|
|
|
+ })()}
|
|
|
+ </FormItem>
|
|
|
+
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<FormItem
|
|
|
labelCol={{ span: 4 }}
|
|
@@ -841,8 +1412,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
</span>
|
|
|
: <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
|
|
|
</FormItem>
|
|
|
- <FormItem wrapperCol={{ span: 12, offset: 3 }}>
|
|
|
+ <FormItem wrapperCol={{ span: 12, offset: 4 }}>
|
|
|
<Button className="set-submit" type="primary" htmlType="submit">保存</Button>
|
|
|
+ <Button className="set-submit" type="ghost" onClick={(e) => { this.state.auditStatus = 1; }} htmlType="submit">发布</Button>
|
|
|
<Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
|
|
|
</FormItem>
|
|
|
</Form >
|
|
@@ -856,6 +1428,39 @@ const AchievementDetail = React.createClass({
|
|
|
visible: false
|
|
|
};
|
|
|
},
|
|
|
+ getTechBrodersList() {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/audit/techBroders",
|
|
|
+ success: function (data) {
|
|
|
+ if (!data.data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ let _me = this, theArr = [];
|
|
|
+ for (var item in data.data) {
|
|
|
+ theArr.push(
|
|
|
+ <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
|
|
|
+ )
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ techBrodersOption: theArr,
|
|
|
+ techBrodersObj: data.data
|
|
|
+ });
|
|
|
+ }.bind(this),
|
|
|
+ }).always(function () {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
showModal() {
|
|
|
this.setState({
|
|
|
visible: true,
|
|
@@ -873,6 +1478,9 @@ const AchievementDetail = React.createClass({
|
|
|
});
|
|
|
this.props.closeDesc(false, true);
|
|
|
},
|
|
|
+ componentWillMount() {
|
|
|
+ this.getTechBrodersList();
|
|
|
+ },
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
this.state.visible = nextProps.showDesc;
|
|
|
},
|
|
@@ -885,14 +1493,27 @@ const AchievementDetail = React.createClass({
|
|
|
width='1000px'
|
|
|
footer=''
|
|
|
className="admin-desc-content">
|
|
|
- <AchievementDetailForm
|
|
|
- data={this.props.data}
|
|
|
- companyOption={this.props.companyOption}
|
|
|
- userOption={this.props.userOption}
|
|
|
- achievementCategoryOption={this.props.achievementCategoryOption}
|
|
|
- closeDesc={this.handleCancel}
|
|
|
- visible={this.state.visible}
|
|
|
- handleOk={this.handleOk} />
|
|
|
+ {(() => {
|
|
|
+ if (this.props.data.auditStatus && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
|
|
|
+ return <AchievementDetailShow
|
|
|
+ data={this.props.data}
|
|
|
+ techBrodersOption={this.state.techBrodersOption}
|
|
|
+ techBrodersObj={this.state.techBrodersObj}
|
|
|
+ closeDesc={this.handleCancel}
|
|
|
+ visible={this.state.visible}
|
|
|
+ handleOk={this.handleOk} />
|
|
|
+ } else {
|
|
|
+ return <AchievementDetailForm
|
|
|
+ data={this.props.data}
|
|
|
+ companyOption={this.props.companyOption}
|
|
|
+ userOption={this.props.userOption}
|
|
|
+ achievementCategoryOption={this.props.achievementCategoryOption}
|
|
|
+ techBrodersObj={this.state.techBrodersObj}
|
|
|
+ closeDesc={this.handleCancel}
|
|
|
+ visible={this.state.visible}
|
|
|
+ handleOk={this.handleOk} />
|
|
|
+ }
|
|
|
+ })()}
|
|
|
</Modal>
|
|
|
</div>
|
|
|
);
|