|
@@ -151,13 +151,15 @@ const AchievementDetailShow = Form.create()(React.createClass({
|
|
this.setState({
|
|
this.setState({
|
|
loading: true
|
|
loading: true
|
|
});
|
|
});
|
|
|
|
+
|
|
$.ajax({
|
|
$.ajax({
|
|
method: "get",
|
|
method: "get",
|
|
dataType: "json",
|
|
dataType: "json",
|
|
crossDomain: false,
|
|
crossDomain: false,
|
|
url: globalConfig.context + detailApiUrl,
|
|
url: globalConfig.context + detailApiUrl,
|
|
data: {
|
|
data: {
|
|
- id: id
|
|
|
|
|
|
+ id: id,
|
|
|
|
+ ownerType:this.props.data.ownerType
|
|
},
|
|
},
|
|
success: function (data) {
|
|
success: function (data) {
|
|
let thisData = data.data;
|
|
let thisData = data.data;
|
|
@@ -169,7 +171,6 @@ const AchievementDetailShow = Form.create()(React.createClass({
|
|
};
|
|
};
|
|
this.setState({
|
|
this.setState({
|
|
data: thisData,
|
|
data: thisData,
|
|
-
|
|
|
|
orgDisplay: thisData.ownerType,
|
|
orgDisplay: thisData.ownerType,
|
|
switchValue: Boolean(!thisData.ownerId),
|
|
switchValue: Boolean(!thisData.ownerId),
|
|
radios:thisData.hot==='1'?true:false,
|
|
radios:thisData.hot==='1'?true:false,
|
|
@@ -338,6 +339,7 @@ const AchievementDetailShow = Form.create()(React.createClass({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
componentWillMount() {
|
|
componentWillMount() {
|
|
|
|
+
|
|
this.loadData(this.props.data.id, this.props.detailApiUrl);
|
|
this.loadData(this.props.data.id, this.props.detailApiUrl);
|
|
},
|
|
},
|
|
componentWillReceiveProps(nextProps) {
|
|
componentWillReceiveProps(nextProps) {
|
|
@@ -951,7 +953,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
|
|
|
this.props.form.validateFields((err, values) => {
|
|
this.props.form.validateFields((err, values) => {
|
|
//keyword长度判断
|
|
//keyword长度判断
|
|
- console.log(typeof values.field[0])
|
|
|
|
|
|
+
|
|
if ((this.state.tags ? this.state.tags.length : this.props.tags.length) < 3) {
|
|
if ((this.state.tags ? this.state.tags.length : this.props.tags.length) < 3) {
|
|
message.warning('关键词数量不能小于3个!');
|
|
message.warning('关键词数量不能小于3个!');
|
|
return;
|
|
return;
|
|
@@ -1029,7 +1031,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
//
|
|
//
|
|
ownerId: !this.state.switchValue ? (this.state.dataSourceObj ? this.state.dataSourceObj[values.iOwnerName] : this.state.data.ownerId) : undefined,
|
|
ownerId: !this.state.switchValue ? (this.state.dataSourceObj ? this.state.dataSourceObj[values.iOwnerName] : this.state.data.ownerId) : undefined,
|
|
contacts: !this.state.switchValue ? values.contacts : undefined,
|
|
contacts: !this.state.switchValue ? values.contacts : undefined,
|
|
- ownerType: this.props.detailApiUrl.indexOf('org') != -1 ? 1 : 0,
|
|
|
|
|
|
+ ownerType: this.state.ownerType,//this.props.detailApiUrl.indexOf('org') != -1 ? 1 : 0,
|
|
//自定义
|
|
//自定义
|
|
ownerName: this.state.switchValue ? values.ownerName : undefined,
|
|
ownerName: this.state.switchValue ? values.ownerName : undefined,
|
|
ownerIdNumber: this.state.switchValue ? values.ownerIdNumber : undefined,
|
|
ownerIdNumber: this.state.switchValue ? values.ownerIdNumber : undefined,
|
|
@@ -1233,6 +1235,17 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
<FormItem
|
|
<FormItem
|
|
labelCol={{ span: 4 }}
|
|
labelCol={{ span: 4 }}
|
|
wrapperCol={{ span: 18 }}
|
|
wrapperCol={{ span: 18 }}
|
|
|
|
+ label="成果类别" >
|
|
|
|
+ <Select placeholder="选择成果类别" style={{ width: 120 }}
|
|
|
|
+ value={this.state.ownerType}
|
|
|
|
+ onChange={(e) => { this.setState({ ownerType: e }) }}>
|
|
|
|
+ <Select.Option value="0" >个人</Select.Option>
|
|
|
|
+ <Select.Option value="1" >组织</Select.Option>
|
|
|
|
+ </Select>
|
|
|
|
+ </FormItem>
|
|
|
|
+ <FormItem
|
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
label="摘要" >
|
|
label="摘要" >
|
|
{getFieldDecorator('summary', {
|
|
{getFieldDecorator('summary', {
|
|
initialValue: theData.summary
|
|
initialValue: theData.summary
|
|
@@ -1334,7 +1347,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
fileList={this.state.textFileList}
|
|
fileList={this.state.textFileList}
|
|
onChange={(info) => {
|
|
onChange={(info) => {
|
|
if (info.file.status !== 'uploading') {
|
|
if (info.file.status !== 'uploading') {
|
|
- console.log(info.file, info.fileList);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
if (info.file.status === 'done') {
|
|
if (info.file.status === 'done') {
|
|
if (!info.file.response.error.length) {
|
|
if (!info.file.response.error.length) {
|
|
@@ -1582,7 +1595,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
fileList={this.state.techPlanFileList}
|
|
fileList={this.state.techPlanFileList}
|
|
onChange={(info) => {
|
|
onChange={(info) => {
|
|
if (info.file.status !== 'uploading') {
|
|
if (info.file.status !== 'uploading') {
|
|
- console.log(info.file, info.fileList);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
if (info.file.status === 'done') {
|
|
if (info.file.status === 'done') {
|
|
if (!info.file.response.error.length) {
|
|
if (!info.file.response.error.length) {
|
|
@@ -1617,7 +1630,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
fileList={this.state.businessPlanFileList}
|
|
fileList={this.state.businessPlanFileList}
|
|
onChange={(info) => {
|
|
onChange={(info) => {
|
|
if (info.file.status !== 'uploading') {
|
|
if (info.file.status !== 'uploading') {
|
|
- console.log(info.file, info.fileList);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
if (info.file.status === 'done') {
|
|
if (info.file.status === 'done') {
|
|
if (!info.file.response.error.length) {
|
|
if (!info.file.response.error.length) {
|