|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Form, Button, Input, Select, Spin, Table, DatePicker, message, Modal, Checkbox, Upload } from 'antd';
|
|
|
+import { Icon, Form, Button, Input, Select, Spin, Table, DatePicker, message, Modal, Radio, Upload } from 'antd';
|
|
|
import { cognizanceStateList } from '../../dataDic.js';
|
|
|
import { getCognizanceState, beforeUpload, beforeUploadFile, downloadFile } from '../../tools.js';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
@@ -19,23 +19,20 @@ const ApplyChangeFrom = Form.create()(React.createClass({
|
|
|
pid: id || this.props.data.pid
|
|
|
},
|
|
|
success: function (data) {
|
|
|
-
|
|
|
if (data.error.length || !data.data) {
|
|
|
message.warning(data.error[0].message);
|
|
|
return;
|
|
|
};
|
|
|
this.state.data = data.data;
|
|
|
-
|
|
|
+ this.state.moneyType = undefined;
|
|
|
if (data.data.projectMode == 1) {
|
|
|
this.state.projectMode = data.data.projectMode;
|
|
|
- this.setState({projectModeState:true});
|
|
|
- }
|
|
|
+ this.setState({ moneyType: 2 });
|
|
|
+ };
|
|
|
if (data.data.subsidy == 1) {
|
|
|
this.state.subsidy = data.data.subsidy;
|
|
|
- this.setState({subsidyState:true});
|
|
|
- }
|
|
|
- this.getDepartmentList();
|
|
|
- this.getContactsList();
|
|
|
+ this.setState({ moneyType: 1 });
|
|
|
+ };
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
|
this.setState({
|
|
@@ -78,63 +75,11 @@ const ApplyChangeFrom = Form.create()(React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- getDepartmentList () {
|
|
|
- this.setState({
|
|
|
- loading: true
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- method: "post",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/user/getDepartment",
|
|
|
- success: function (data) {
|
|
|
- this.state.departmentOption = [];
|
|
|
- if (data.error.length || !data.data) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- return;
|
|
|
- };
|
|
|
- for (var item in data.data) {
|
|
|
- this.state.departmentOption.push(
|
|
|
- <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
|
|
|
- )
|
|
|
- };
|
|
|
- this.setState({department:data.data[this.state.data.department]});
|
|
|
- }.bind(this),
|
|
|
- }).always(function () {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
- getContactsList() {
|
|
|
- $.ajax({
|
|
|
- method: "post",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/user/getContacts",
|
|
|
- success: function (data) {
|
|
|
- let theOption = [];
|
|
|
- if (data.error.length || !data.data) {
|
|
|
- return;
|
|
|
- };
|
|
|
- for (let item in data.data) {
|
|
|
- let theData = data.data[item];
|
|
|
- theOption.push(
|
|
|
- <Select.Option value={item} key={item}>{theData}</Select.Option>
|
|
|
- );
|
|
|
- };
|
|
|
- this.setState({
|
|
|
- contactsOption: theOption,
|
|
|
- contacts: data.data[this.state.data.contacts]
|
|
|
- });
|
|
|
- }.bind(this),
|
|
|
- });
|
|
|
- },
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
departmentOption: [],
|
|
|
- projectDes:'',
|
|
|
+ projectDes: '',
|
|
|
projectMode: 0,
|
|
|
subsidy: 0,
|
|
|
projectModeState: false,
|
|
@@ -208,23 +153,17 @@ const ApplyChangeFrom = Form.create()(React.createClass({
|
|
|
this.getStateData(nextProps.data.pid);
|
|
|
};
|
|
|
},
|
|
|
- projectEstablishmentCheck(e) {
|
|
|
- if (e.target.checked == true) {
|
|
|
- this.setState({projectModeState:true})
|
|
|
- this.state.projectMode = 1;
|
|
|
- } else if (e.target.checked == false) {
|
|
|
- this.setState({projectModeState:false})
|
|
|
- this.state.projectMode = 0;
|
|
|
- };
|
|
|
- },
|
|
|
subsidyCheck(e) {
|
|
|
- if (e.target.checked == true) {
|
|
|
- this.setState({subsidyState:true})
|
|
|
+ if (e.target.value == 1) {
|
|
|
this.state.subsidy = 1;
|
|
|
- } else if (e.target.checked == false) {
|
|
|
- this.setState({subsidyState:false})
|
|
|
+ this.state.projectMode = 0;
|
|
|
+ } else if (e.target.value == 2) {
|
|
|
this.state.subsidy = 0;
|
|
|
+ this.state.projectMode = 1;
|
|
|
};
|
|
|
+ this.setState({
|
|
|
+ moneyType: e.target.value
|
|
|
+ });
|
|
|
},
|
|
|
render() {
|
|
|
const FormItem = Form.Item;
|
|
@@ -249,33 +188,33 @@ const ApplyChangeFrom = Form.create()(React.createClass({
|
|
|
</div>
|
|
|
<div className="half-item">
|
|
|
<span className="item-title">公司地址: </span>
|
|
|
- <span>{theData.province+' '+theData.city+' '+theData.area}</span>
|
|
|
+ <span>{theData.province + ' ' + theData.city + ' ' + theData.area}</span>
|
|
|
</div>
|
|
|
<div className="half-item">
|
|
|
- <FormItem
|
|
|
+ <FormItem
|
|
|
labelCol={{ span: 4 }}
|
|
|
wrapperCol={{ span: 10 }}
|
|
|
label="联系人:"
|
|
|
>
|
|
|
{getFieldDecorator('contacts', {
|
|
|
- initialValue: this.state.contacts
|
|
|
- })(
|
|
|
- <Select>{this.state.contactsOption}</Select>
|
|
|
- )}
|
|
|
+ initialValue: String(theData.contacts)
|
|
|
+ })(
|
|
|
+ <Select>{this.props.contactsOption}</Select>
|
|
|
+ )}
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
<FormItem className="third-item"
|
|
|
{...formItemLayout}
|
|
|
- label="科技部门"
|
|
|
- >
|
|
|
- {getFieldDecorator('department', {
|
|
|
- initialValue: this.state.department
|
|
|
- })(
|
|
|
- <Select>{this.state.departmentOption}</Select>
|
|
|
- )}
|
|
|
- </FormItem>
|
|
|
+ label="科技部门"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('department', {
|
|
|
+ initialValue: this.state.department
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
<div className="half-item">
|
|
@@ -284,92 +223,80 @@ const ApplyChangeFrom = Form.create()(React.createClass({
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
- <div className="half-item">
|
|
|
- <FormItem
|
|
|
- labelCol={{ span: 4 }}
|
|
|
- wrapperCol={{ span: 12 }}
|
|
|
- label="项目名称"
|
|
|
- >
|
|
|
+ <div className="half-item">
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="项目名称"
|
|
|
+ >
|
|
|
{getFieldDecorator('projectName', {
|
|
|
initialValue: theData.projectName
|
|
|
- })(
|
|
|
- <Input />
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
)}
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
- <div className="half-item">
|
|
|
- <FormItem
|
|
|
- labelCol={{ span: 4 }}
|
|
|
- wrapperCol={{ span: 12 }}
|
|
|
- label="项目类型"
|
|
|
- >
|
|
|
+ <div className="half-item">
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="项目类型"
|
|
|
+ >
|
|
|
{getFieldDecorator('projectCatagory', {
|
|
|
initialValue: theData.projectCatagory
|
|
|
- })(
|
|
|
- <Input />
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
)}
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
- <div className="half-item">
|
|
|
- <FormItem
|
|
|
- labelCol={{ span: 4 }}
|
|
|
- wrapperCol={{ span: 12 }}
|
|
|
- label="技术领域"
|
|
|
- >
|
|
|
+ <div className="half-item">
|
|
|
+ <FormItem
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="技术领域"
|
|
|
+ >
|
|
|
{getFieldDecorator('techField', {
|
|
|
initialValue: theData.techField
|
|
|
- })(
|
|
|
- <Input />
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
)}
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
- <span className="item-title">项目简介: </span>
|
|
|
- {getFieldDecorator('projectDes', {
|
|
|
- initialValue: theData.projectDes
|
|
|
- })(
|
|
|
- <Input type="textarea"
|
|
|
- placeholder="多行输入"
|
|
|
- rows={6} />
|
|
|
- )}
|
|
|
+ <span className="item-title">项目简介: </span>
|
|
|
+ {getFieldDecorator('projectDes', {
|
|
|
+ initialValue: theData.projectDes
|
|
|
+ })(
|
|
|
+ <Input type="textarea"
|
|
|
+ placeholder="多行输入"
|
|
|
+ rows={6} />
|
|
|
+ )}
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
<div className="half-item">
|
|
|
- <span className="item-title">是否立项: </span>
|
|
|
- <Checkbox
|
|
|
- onChange={this.projectEstablishmentCheck}
|
|
|
- checked={this.state.projectModeState}
|
|
|
- >
|
|
|
- </Checkbox>
|
|
|
+ <span className="item-title">立项/后补助: </span>
|
|
|
+ <Radio.Group value={this.state.moneyType} onChange={this.subsidyCheck}>
|
|
|
+ <Radio value={1}>立项</Radio>
|
|
|
+ <Radio value={2}>后补助</Radio>
|
|
|
+ </Radio.Group>
|
|
|
</div>
|
|
|
<div className="half-item">
|
|
|
<FormItem
|
|
|
- {...formItemLayout}
|
|
|
- label="立项金额"
|
|
|
- >
|
|
|
+ {...formItemLayout}
|
|
|
+ label={this.state.moneyType !== 2 ? '立项金额' : '后补助金额'}
|
|
|
+ >
|
|
|
{getFieldDecorator('projectApproval', {
|
|
|
initialValue: theData.projectApproval
|
|
|
})(
|
|
|
- <Input style={{ width:150,marginRight:10 }}/>
|
|
|
- )}
|
|
|
+ <Input style={{ width: 200 }} />
|
|
|
+ )}
|
|
|
<span>万元</span>
|
|
|
- </FormItem>
|
|
|
-
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div className="clearfix">
|
|
|
- <div className="half-item">
|
|
|
- <span className="item-title">是否后补助: </span>
|
|
|
- <Checkbox
|
|
|
- onChange={this.subsidyCheck}
|
|
|
- checked={this.state.subsidyState}
|
|
|
- >
|
|
|
- </Checkbox>
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="hrSituation-roster">
|
|
@@ -459,7 +386,9 @@ const ApplyChange = React.createClass({
|
|
|
<ApplyChangeFrom
|
|
|
visible={this.state.visible}
|
|
|
data={this.props.data}
|
|
|
- spinState={this.spinChange} closeModal={this.handleCancel} />
|
|
|
+ contactsOption={this.props.contactsOption}
|
|
|
+ spinState={this.spinChange}
|
|
|
+ closeModal={this.handleCancel} />
|
|
|
</Modal>
|
|
|
</Spin>
|
|
|
</div>
|