|
@@ -27,17 +27,17 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
};
|
|
|
},
|
|
|
componentWillMount() {
|
|
|
- this.loadData();
|
|
|
- this.state.initialData = this.props.data || {};
|
|
|
+ this.loadData();
|
|
|
+ this.state.initialData = this.props.data || {};
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
- if(!this.props.visible&&nextProps.visible){
|
|
|
- this.setState({
|
|
|
- initialData:nextProps.data
|
|
|
- })
|
|
|
- this.loadData()
|
|
|
- }
|
|
|
- },
|
|
|
+ if (!this.props.visible && nextProps.visible) {
|
|
|
+ this.setState({
|
|
|
+ initialData: nextProps.data
|
|
|
+ })
|
|
|
+ this.loadData()
|
|
|
+ }
|
|
|
+ },
|
|
|
loadData() {
|
|
|
$.when($.ajax({
|
|
|
url: globalConfig.context + '/open/findIndustryCategory'
|
|
@@ -166,6 +166,9 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
method: 'post',
|
|
|
data: values
|
|
|
}).done(function (res) {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
if (res.error && res.error.length) {
|
|
|
message.error(res.error[0].message)
|
|
|
} else {
|
|
@@ -181,8 +184,8 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- onDateChange(date) {
|
|
|
- date && date.date(1)
|
|
|
+ onDateChange(date, dataString) {
|
|
|
+ // date && date.date(1)
|
|
|
this.changeFormField({
|
|
|
'benchmarkDate': date
|
|
|
});
|
|
@@ -192,8 +195,8 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
},
|
|
|
render() {
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
- let { subIndustry, industry, district, loading} = this.state;
|
|
|
- let initialData=this.state.initialData||{};
|
|
|
+ let { subIndustry, industry, district, loading } = this.state;
|
|
|
+ let initialData = this.state.initialData || {};
|
|
|
return (
|
|
|
<Spin spinning={loading}>
|
|
|
<Form className="steps-form">
|
|
@@ -203,24 +206,24 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
initialValue: initialData.name
|
|
|
})(
|
|
|
<Input placeholder="请输入技术名称" />
|
|
|
- )}
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
<FormItem label="所属主行业" {...formItemLayout}>
|
|
|
{getFieldDecorator('industry', {
|
|
|
rules: [{ required: true, message: '请选择技术所属主行业!' }],
|
|
|
- initialValue:initialData.industry
|
|
|
+ initialValue: initialData.industry
|
|
|
})(
|
|
|
<Select placeholder="请选择技术所属主行业" onChange={this.loadSubIndustry}>
|
|
|
{industry.map((it) => {
|
|
|
return <Option key={it.id} value={String(it.id)}>{it.name}</Option>
|
|
|
})}
|
|
|
</Select>
|
|
|
- )}
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
<FormItem label="所属子行业" {...formItemLayout}>
|
|
|
{getFieldDecorator('subIndustry', {
|
|
|
rules: [{ required: true, message: '请选择技术所属子行业!' }],
|
|
|
- initialValue:initialData.subIndustry
|
|
|
+ initialValue: initialData.subIndustry
|
|
|
})(
|
|
|
<Select placeholder="请选择技术所属子行业" allowClear={true} multiple={true} onChange={this.subIndustryChanged}>
|
|
|
{
|
|
@@ -229,7 +232,7 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
}) : []
|
|
|
}
|
|
|
</Select>
|
|
|
- )}
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
<FormItem label="转让方式" {...formItemLayout}>
|
|
|
{getFieldDecorator('transferType', {
|
|
@@ -241,7 +244,7 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
return <Option key={it.id} value={it.id}>{it.text}</Option>
|
|
|
})}
|
|
|
</Select>
|
|
|
- )}
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
<FormItem label="预估技术剩余寿命" {...formItemLayout}>
|
|
|
{getFieldDecorator('timeLeft', {
|
|
@@ -253,27 +256,33 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
return <Option key={it.id} value={it.id}>{it.text}</Option>
|
|
|
})}
|
|
|
</Select>
|
|
|
- )}
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
<FormItem label="转让区域" {...formItemLayout}>
|
|
|
{getFieldDecorator('transferArea', {
|
|
|
rules: [{ required: true, message: '请选择技术转让区域!' }],
|
|
|
- initialValue:initialData.transferArea
|
|
|
+ initialValue: initialData.transferArea
|
|
|
})(
|
|
|
<Select placeholder="请选择技术转让区域" allowClear={true} multiple={true} onChange={this.districtChanged}>
|
|
|
{district.map((it) => {
|
|
|
return <Option key={it.id} value={String(it.id)}>{it.name}</Option>
|
|
|
})}
|
|
|
</Select>
|
|
|
- )}
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
<FormItem label="评估基准日" {...formItemLayout}>
|
|
|
{getFieldDecorator('benchmarkDate', {
|
|
|
rules: [{ required: true, message: '请输入评估基准日!' }],
|
|
|
initialValue: initialData.benchmarkDate ? moment(initialData.benchmarkDate, 'YYYY-MM-DD') : null
|
|
|
})(
|
|
|
- <MonthPicker allowClear={false} onChange={this.onDateChange} placeholder="请输入评估基准日" format="YYYY-MM-DD" />
|
|
|
- )}
|
|
|
+ <DatePicker
|
|
|
+ allowClear={false}
|
|
|
+ onChange={this.onDateChange}
|
|
|
+ placeholder="请输入评估基准日"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ />
|
|
|
+ // <MonthPicker allowClear={false} onChange={this.onDateChange} placeholder="请输入评估基准日" format="YYYY-MM-DD" />
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
<FormItem label="评估币种" {...formItemLayout}>
|
|
|
{getFieldDecorator('currencyType', {
|
|
@@ -285,7 +294,7 @@ const EvaluateStep1 = Form.create({})(React.createClass({
|
|
|
return <Option key={idx} value={it}>{it}</Option>
|
|
|
})}
|
|
|
</Select>
|
|
|
- )}
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
</Form>
|
|
|
<div className="steps-action">
|