|
@@ -145,7 +145,8 @@ const DemandDetailShow = Form.create()(React.createClass({
|
|
coverImg: []
|
|
coverImg: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- loadData(id, detailApiUrl) {
|
|
|
|
|
|
+ loadData(id, detailApiUrl,dataCategory) {
|
|
|
|
+ console.log(dataCategory);
|
|
this.setState({
|
|
this.setState({
|
|
loading: true
|
|
loading: true
|
|
});
|
|
});
|
|
@@ -156,7 +157,7 @@ const DemandDetailShow = Form.create()(React.createClass({
|
|
url: globalConfig.context + detailApiUrl,
|
|
url: globalConfig.context + detailApiUrl,
|
|
data: {
|
|
data: {
|
|
id: id,
|
|
id: id,
|
|
- dataCategory:this.props.data.dataCategory
|
|
|
|
|
|
+ dataCategory:dataCategory?dataCategory:this.props.data.dataCategory
|
|
},
|
|
},
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
|
|
|
@@ -337,7 +338,7 @@ const DemandDetailShow = Form.create()(React.createClass({
|
|
},
|
|
},
|
|
componentWillReceiveProps(nextProps) {
|
|
componentWillReceiveProps(nextProps) {
|
|
if (!this.props.visible && nextProps.visible) {
|
|
if (!this.props.visible && nextProps.visible) {
|
|
- this.loadData(nextProps.data.id, nextProps.detailApiUrl);
|
|
|
|
|
|
+ this.loadData(nextProps.data.id, nextProps.detailApiUrl,nextProps.data.dataCategory);
|
|
if (nextProps.data.employerId && nextProps.data.dataCategory) {
|
|
if (nextProps.data.employerId && nextProps.data.dataCategory) {
|
|
this.getContactsList(nextProps.data.employerId);
|
|
this.getContactsList(nextProps.data.employerId);
|
|
};
|
|
};
|
|
@@ -786,7 +787,8 @@ const DemandDetailForm = Form.create()(React.createClass({
|
|
}.bind(this),
|
|
}.bind(this),
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- loadData(id, detailApiUrl) {
|
|
|
|
|
|
+ loadData(id, detailApiUrl,dataCategory) {
|
|
|
|
+ console.log(this.props.data);
|
|
this.setState({
|
|
this.setState({
|
|
loading: true
|
|
loading: true
|
|
});
|
|
});
|
|
@@ -797,7 +799,7 @@ const DemandDetailForm = Form.create()(React.createClass({
|
|
url: globalConfig.context + detailApiUrl,
|
|
url: globalConfig.context + detailApiUrl,
|
|
data: {
|
|
data: {
|
|
id: id,
|
|
id: id,
|
|
- dataCategory:this.props.data.dataCategory
|
|
|
|
|
|
+ dataCategory:dataCategory?dataCategory:this.props.data.dataCategory
|
|
},
|
|
},
|
|
success: function (data) {
|
|
success: function (data) {
|
|
let thisData = data.data;
|
|
let thisData = data.data;
|
|
@@ -837,6 +839,10 @@ const DemandDetailForm = Form.create()(React.createClass({
|
|
},
|
|
},
|
|
handleSubmit(e) {
|
|
handleSubmit(e) {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
|
+ if(!this.state.dataCategory){
|
|
|
|
+ message.warning('请选择需求类别');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
this.props.form.validateFields((err, values) => {
|
|
this.props.form.validateFields((err, values) => {
|
|
//keyword长度判断
|
|
//keyword长度判断
|
|
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) {
|
|
@@ -924,6 +930,7 @@ const DemandDetailForm = Form.create()(React.createClass({
|
|
if (!data.error.length) {
|
|
if (!data.error.length) {
|
|
message.success('保存成功!');
|
|
message.success('保存成功!');
|
|
this.props.handleOk();
|
|
this.props.handleOk();
|
|
|
|
+ this.componentWillMount();
|
|
} else {
|
|
} else {
|
|
message.warning(data.error[0].message);
|
|
message.warning(data.error[0].message);
|
|
};
|
|
};
|
|
@@ -998,7 +1005,7 @@ const DemandDetailForm = Form.create()(React.createClass({
|
|
componentWillReceiveProps(nextProps) {
|
|
componentWillReceiveProps(nextProps) {
|
|
if (!this.props.visible && nextProps.visible) {
|
|
if (!this.props.visible && nextProps.visible) {
|
|
if (nextProps.data && nextProps.data.id) {
|
|
if (nextProps.data && nextProps.data.id) {
|
|
- this.loadData(nextProps.data.id, nextProps.detailApiUrl);
|
|
|
|
|
|
+ this.loadData(nextProps.data.id, nextProps.detailApiUrl,nextProps.data.dataCategory);
|
|
};
|
|
};
|
|
this.state.contactsOption = [];
|
|
this.state.contactsOption = [];
|
|
this.state.data = {};
|
|
this.state.data = {};
|
|
@@ -1212,6 +1219,7 @@ const DemandDetailForm = Form.create()(React.createClass({
|
|
tagsArr={this.getTagsArr}
|
|
tagsArr={this.getTagsArr}
|
|
visible={this.props.visible} />
|
|
visible={this.props.visible} />
|
|
</FormItem>
|
|
</FormItem>
|
|
|
|
+
|
|
<FormItem
|
|
<FormItem
|
|
labelCol={{ span: 3 }}
|
|
labelCol={{ span: 3 }}
|
|
wrapperCol={{ span: 20 }}
|
|
wrapperCol={{ span: 20 }}
|
|
@@ -1222,6 +1230,7 @@ const DemandDetailForm = Form.create()(React.createClass({
|
|
<Select.Option value="0" >个人</Select.Option>
|
|
<Select.Option value="0" >个人</Select.Option>
|
|
<Select.Option value="1" >组织</Select.Option>
|
|
<Select.Option value="1" >组织</Select.Option>
|
|
</Select>
|
|
</Select>
|
|
|
|
+
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem
|
|
<FormItem
|
|
labelCol={{ span: 3 }}
|
|
labelCol={{ span: 3 }}
|