|
@@ -5,7 +5,7 @@ import './techAchievement.less';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
|
|
|
-import { beforeUploadFile, splitUrl, companySearch, getAchievementCategory } from '../../tools.js';
|
|
|
+import { beforeUploadFile, splitUrl, companySearch, getAchievementCategory, getDemandType } from '../../tools.js';
|
|
|
import throttle from '../../throttle.js';
|
|
|
|
|
|
const KeyWordTagGroup = React.createClass({
|
|
@@ -489,91 +489,10 @@ const AchievementDetailShow = Form.create()(React.createClass({
|
|
|
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 == "0" ? <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) {
|
|
@@ -758,6 +677,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
|
|
|
});
|
|
|
+ if (thisData.ownerType == "1") {
|
|
|
+ this.getContactsList(thisData.ownerId);
|
|
|
+ };
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
|
this.setState({
|
|
@@ -765,6 +687,35 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ getContactsList(theUid) {
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/getContacts",
|
|
|
+ data: {
|
|
|
+ uid: theUid
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ let theOption = [];
|
|
|
+ if (!data.data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ };
|
|
|
+ for (let item in data.data) {
|
|
|
+ let theData = data.data[item];
|
|
|
+ theOption.push(
|
|
|
+ <Select.Option value={item} key={theData}>{theData}</Select.Option>
|
|
|
+ );
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ contactsOption: theOption
|
|
|
+ });
|
|
|
+ }.bind(this),
|
|
|
+ });
|
|
|
+ },
|
|
|
getTagsArr(e) {
|
|
|
this.setState({ tags: e });
|
|
|
},
|
|
@@ -837,7 +788,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
message.warning('关键词数量不能小于3个!');
|
|
|
return;
|
|
|
};
|
|
|
- if (!this.state.dataSourceObj[values.ownerId]) {
|
|
|
+ if (values.iOwnerName && this.state.dataSourceObj && !this.state.dataSourceObj[values.iOwnerName]) {
|
|
|
message.warning('请选择一个有效的公司!');
|
|
|
return;
|
|
|
}
|
|
@@ -885,7 +836,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
maturityTextFileUrl: this.state.maturityTextFileUrl,
|
|
|
maturityVideoUrl: values.maturityVideoUrl,
|
|
|
innovation: values.innovation,
|
|
|
- ownerId: this.state.dataSourceObj[values.ownerId],
|
|
|
+ ownerId: this.state.dataSourceObj ? this.state.dataSourceObj[values.iOwnerName] : this.state.data.ownerId,
|
|
|
ownerType: this.props.detailApiUrl.indexOf('org') != -1 ? 1 : 0,
|
|
|
cooperationMode: values.cooperationMode,
|
|
|
transferMode: values.transferMode,
|
|
@@ -1173,17 +1124,35 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
<FormItem className="half-item"
|
|
|
{...formItemLayout}
|
|
|
label="成果所有人" >
|
|
|
- {getFieldDecorator('ownerId', {
|
|
|
+ {getFieldDecorator('iOwnerName', {
|
|
|
rules: [{ required: true, message: '此项为必填项!' }],
|
|
|
- initialValue: theData.ownerId
|
|
|
+ initialValue: theData.iOwnerName || ''
|
|
|
})(
|
|
|
<AutoComplete
|
|
|
dataSource={this.state.dataSource}
|
|
|
style={{ width: 200 }}
|
|
|
onSearch={this.state.therottleSearch}
|
|
|
- placeholder="输入成果所有人" />
|
|
|
+ placeholder="输入成果所有人"
|
|
|
+ onSelect={(e) => {
|
|
|
+ this.getContactsList(this.state.dataSourceObj[e]);
|
|
|
+ }} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
+ {this.props.detailApiUrl.indexOf('org') >= 0 ? <FormItem className="half-item"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="联系人" >
|
|
|
+ {getFieldDecorator('contacts', {
|
|
|
+ initialValue: theData.contacts
|
|
|
+ })(
|
|
|
+ <Select style={{ width: 260 }}
|
|
|
+ placeholder="请选择联系人"
|
|
|
+ notFoundContent="未获取到联系人列表"
|
|
|
+ showSearch
|
|
|
+ filterOption={companySearch}>
|
|
|
+ {this.state.contactsOption}
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem> : <div></div>}
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
<FormItem className="half-item"
|
|
@@ -1381,13 +1350,28 @@ const AchievementDetail = React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
+ tabsKey: 1,
|
|
|
columns: [
|
|
|
{
|
|
|
title: '编号',
|
|
|
dataIndex: 'serialNumber',
|
|
|
key: 'serialNumber',
|
|
|
}, {
|
|
|
- title: '需求名称',
|
|
|
+ title: '数据类型',
|
|
|
+ dataIndex: 'dataCategory',
|
|
|
+ key: 'dataCategory',
|
|
|
+ render: text => {
|
|
|
+ switch (text) {
|
|
|
+ case "0":
|
|
|
+ return <span>成果</span>;
|
|
|
+ case "1":
|
|
|
+ return <span>技术</span>;
|
|
|
+ case "2":
|
|
|
+ return <span>项目</span>;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ title: '名称',
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
}, {
|
|
@@ -1395,73 +1379,23 @@ const AchievementDetail = React.createClass({
|
|
|
dataIndex: 'keyword',
|
|
|
key: 'keyword',
|
|
|
}, {
|
|
|
- title: '需求类型',
|
|
|
+ title: '类型',
|
|
|
dataIndex: 'demandType',
|
|
|
key: 'demandType',
|
|
|
render: text => { return getDemandType(text); }
|
|
|
}, {
|
|
|
- title: '信息来源',
|
|
|
- dataIndex: 'infoSources',
|
|
|
- key: 'infoSources',
|
|
|
- render: text => {
|
|
|
- switch (text) {
|
|
|
- case "0":
|
|
|
- return <span>平台采集</span>;
|
|
|
- case "1":
|
|
|
- return <span>客户发布</span>
|
|
|
- }
|
|
|
- }
|
|
|
- }, {
|
|
|
- title: '雇主名称',
|
|
|
- dataIndex: 'username',
|
|
|
- key: 'username',
|
|
|
- }, {
|
|
|
- title: '审核状态',
|
|
|
- dataIndex: 'auditStatus',
|
|
|
- key: 'auditStatus',
|
|
|
- render: text => {
|
|
|
- switch (text) {
|
|
|
- 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>;
|
|
|
- }
|
|
|
- }
|
|
|
- }, {
|
|
|
- title: '需求状态',
|
|
|
- dataIndex: 'status',
|
|
|
- key: 'status',
|
|
|
- render: text => {
|
|
|
- switch (text) {
|
|
|
- case "0":
|
|
|
- return <span>未解决</span>;
|
|
|
- case "1":
|
|
|
- return <span>已解决</span>;
|
|
|
- }
|
|
|
- }
|
|
|
- }, {
|
|
|
- title: '有效期限',
|
|
|
- dataIndex: 'validityPeriodFormattedDate',
|
|
|
- key: 'validityPeriodFormattedDate',
|
|
|
+ title: '所有人名称',
|
|
|
+ dataIndex: 'theName',
|
|
|
+ key: 'theName',
|
|
|
}, {
|
|
|
title: '发布时间',
|
|
|
dataIndex: 'releaseDateFormattedDate',
|
|
|
key: 'releaseDateFormattedDate',
|
|
|
}, {
|
|
|
- title: '管理员',
|
|
|
- dataIndex: 'principalId',
|
|
|
- key: 'principalId',
|
|
|
- }, {
|
|
|
- title: '技术经纪人',
|
|
|
- dataIndex: 'techBrokerId',
|
|
|
- key: 'techBrokerId',
|
|
|
- }
|
|
|
+ title: '有效期限',
|
|
|
+ dataIndex: 'validityPeriodFormattedDate',
|
|
|
+ key: 'validityPeriodFormattedDate',
|
|
|
+ },
|
|
|
],
|
|
|
dataSource: [],
|
|
|
};
|
|
@@ -1499,7 +1433,7 @@ const AchievementDetail = React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- getTableList(id) {
|
|
|
+ getTableList() {
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
@@ -1507,24 +1441,33 @@ const AchievementDetail = React.createClass({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/audit/techBroders",
|
|
|
- data: { id: id || this.props.data.id },
|
|
|
+ url: globalConfig.context + "/api/admin/achievement/achievementDemand",
|
|
|
+ data: { id: this.props.data.id },
|
|
|
success: function (data) {
|
|
|
+ let theArr = [];
|
|
|
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>
|
|
|
- )
|
|
|
+ };
|
|
|
+ } else if (data.data.length) {
|
|
|
+ for (let i = 0; i < data.data.length; i++) {
|
|
|
+ let thisdata = data.data[i];
|
|
|
+ theArr.push({
|
|
|
+ key: i,
|
|
|
+ id: thisdata.id,
|
|
|
+ serialNumber: thisdata.serialNumber,
|
|
|
+ dataCategory: thisdata.dataCategory,
|
|
|
+ name: thisdata.name,
|
|
|
+ keyword: thisdata.keyword,
|
|
|
+ demandType: thisdata.demandType,
|
|
|
+ theName: thisdata.username || thisdata.unitName,
|
|
|
+ releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
|
|
|
+ validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate
|
|
|
+ });
|
|
|
+ };
|
|
|
};
|
|
|
this.setState({
|
|
|
- techBrodersOption: theArr,
|
|
|
- techBrodersObj: data.data
|
|
|
+ dataSource: theArr,
|
|
|
});
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
@@ -1534,8 +1477,11 @@ const AchievementDetail = React.createClass({
|
|
|
}.bind(this));
|
|
|
},
|
|
|
tableRowClick(record, index) {
|
|
|
- this.state.RowData = record;
|
|
|
- debugger
|
|
|
+ if (record.ownerType == "0") {
|
|
|
+ window.open(globalConfig.context + '/admin/demand.html?rid=' + record.id + '#techDemandOrg');
|
|
|
+ } else if (record.ownerType == "1") {
|
|
|
+ window.open(globalConfig.context + '/admin/demand.html?rid=' + record.id + '#techDemandUser')
|
|
|
+ };
|
|
|
},
|
|
|
handleCancel(e) {
|
|
|
this.setState({
|
|
@@ -1551,13 +1497,13 @@ const AchievementDetail = React.createClass({
|
|
|
},
|
|
|
componentWillMount() {
|
|
|
this.getTechBrodersList();
|
|
|
- this.getTableList();
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
- this.state.visible = nextProps.showDesc;
|
|
|
- if (!this.props.showDesc && nextProps.showDesc) {
|
|
|
- this.getTableList(nextProps.data.id);
|
|
|
+ if (nextProps.showDesc) {
|
|
|
+ this.state.tabsKey = "1";
|
|
|
+ this.state.tabBool = true;
|
|
|
};
|
|
|
+ this.state.visible = nextProps.showDesc;
|
|
|
},
|
|
|
render() {
|
|
|
if (this.props.data) {
|
|
@@ -1568,7 +1514,14 @@ const AchievementDetail = React.createClass({
|
|
|
width='1000px'
|
|
|
footer=''
|
|
|
className="admin-desc-content">
|
|
|
- <Tabs defaultActiveKey="1">
|
|
|
+ <Tabs activeKey={this.state.tabsKey}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({ tabsKey: e });
|
|
|
+ if (e == "2" && this.state.tabBool) {
|
|
|
+ this.getTableList();
|
|
|
+ this.state.tabBool = false;
|
|
|
+ };
|
|
|
+ }} >
|
|
|
<Tabs.TabPane tab="成果详情" key="1">
|
|
|
{(() => {
|
|
|
if (this.props.data.auditStatus && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
|