|
@@ -1,9 +1,9 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Modal, Button, Form, Upload, message, Input, Spin, Checkbox,Select } from 'antd';
|
|
|
+import { Icon, Modal, Button, Form, Upload, message, Input, Spin, Checkbox, Select } from 'antd';
|
|
|
import './comprehensive.less';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js'
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
-import { getBase64,beforeUpload } from '../../../tools.js';
|
|
|
+import { getBase64, beforeUpload } from '../../../tools.js';
|
|
|
|
|
|
class Avatar extends React.Component {
|
|
|
constructor(props) {
|
|
@@ -13,12 +13,11 @@ class Avatar extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
handleChange(info) {
|
|
|
- if ( !this.props.oid ) {
|
|
|
+ if (!this.props.oid || this.props.oid === "") {
|
|
|
message.warning('请先选择公司!');
|
|
|
return;
|
|
|
- }
|
|
|
+ };
|
|
|
if (info.file.status === 'done') {
|
|
|
- debugger
|
|
|
// Get this url from response in real world.
|
|
|
getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl }));
|
|
|
this.props.urlData(info.file.response.data);
|
|
@@ -32,10 +31,10 @@ class Avatar extends React.Component {
|
|
|
name="avatar"
|
|
|
showUploadList={false}
|
|
|
action={globalConfig.context + "/techservice/patent/patentFile"}
|
|
|
- data={{ 'sign': this.props.name,'oid':this.props.oid }}
|
|
|
+ data={{ 'sign': this.props.name, 'oid': this.props.oid }}
|
|
|
beforeUpload={beforeUpload}
|
|
|
onChange={this.handleChange.bind(this)}
|
|
|
- >
|
|
|
+ >
|
|
|
{
|
|
|
imageUrl ?
|
|
|
<img src={imageUrl} role="presentation" className="avatar" /> :
|
|
@@ -63,7 +62,7 @@ const PatentAddFrom = Form.create()(React.createClass({
|
|
|
let _me = this;
|
|
|
for (var item in data.data) {
|
|
|
_me.state.companyOption.push(
|
|
|
- <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
|
|
|
+ <Select.Option value={data.data[item]} key={item}>{data.data[item]}</Select.Option>
|
|
|
)
|
|
|
};
|
|
|
}.bind(this),
|
|
@@ -77,17 +76,21 @@ const PatentAddFrom = Form.create()(React.createClass({
|
|
|
return {
|
|
|
loading: false,
|
|
|
companyOption: [],
|
|
|
- firstCheck:0,
|
|
|
- secondCheck:0,
|
|
|
- thirdCheck:0
|
|
|
+ firstCheck: 0,
|
|
|
+ secondCheck: 0,
|
|
|
+ thirdCheck: 0
|
|
|
|
|
|
};
|
|
|
},
|
|
|
- componentWillMount(){
|
|
|
+ componentWillMount() {
|
|
|
this.getCompanyList();
|
|
|
},
|
|
|
handleSubmit(e) {
|
|
|
e.preventDefault();
|
|
|
+ if (!this.state.companyName || this.state.companyName === "") {
|
|
|
+ message.warning('请先选择公司!');
|
|
|
+ return;
|
|
|
+ };
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
if (!err) {
|
|
|
this.props.spinState(true);
|
|
@@ -95,17 +98,18 @@ const PatentAddFrom = Form.create()(React.createClass({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/techservice/patent/clientApplyPatent",
|
|
|
+ url: globalConfig.context + "/techservice/patent/managerApplyPatent",
|
|
|
data: {
|
|
|
- 'firstInventorIdNumber':values.firstInventorID,
|
|
|
- 'firstInventorName':values.firstInventorName,
|
|
|
- 'patentDes':values.intro,
|
|
|
- 'secondInventorName':values.secondInventorName,
|
|
|
- 'thirdInventorName':values.thirdInventorName,
|
|
|
- 'firstInventorIsPublish':this.state.firstCheck,
|
|
|
- 'secondInventorIsPublish':this.state.secondCheck,
|
|
|
- 'thirdInventorIsPublish':this.state.thirdCheck,
|
|
|
- 'patentProryStatementUrl':this.state.avatarUrl
|
|
|
+ 'uid':this.state.companyId,
|
|
|
+ 'firstInventorIdNumber': values.firstInventorID,
|
|
|
+ 'firstInventorName': values.firstInventorName,
|
|
|
+ 'patentDes': values.intro,
|
|
|
+ 'secondInventorName': values.secondInventorName,
|
|
|
+ 'thirdInventorName': values.thirdInventorName,
|
|
|
+ 'firstInventorIsPublish': this.state.firstCheck,
|
|
|
+ 'secondInventorIsPublish': this.state.secondCheck,
|
|
|
+ 'thirdInventorIsPublish': this.state.thirdCheck,
|
|
|
+ 'patentProryStatementUrl': this.state.avatarUrl
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
@@ -122,27 +126,27 @@ const PatentAddFrom = Form.create()(React.createClass({
|
|
|
});
|
|
|
},
|
|
|
firstInventorCheck(e) {
|
|
|
- if ( e.target.checked == true ) {
|
|
|
+ if (e.target.checked == true) {
|
|
|
this.state.firstCheck = 1;
|
|
|
- } else if ( e.target.checked == false ) {
|
|
|
+ } else if (e.target.checked == false) {
|
|
|
this.state.firstCheck = 0;
|
|
|
}
|
|
|
},
|
|
|
secondInventorCheck(e) {
|
|
|
- if ( e.target.checked == true ) {
|
|
|
+ if (e.target.checked == true) {
|
|
|
this.state.secondCheck = 1;
|
|
|
- } else if ( e.target.checked == false ) {
|
|
|
+ } else if (e.target.checked == false) {
|
|
|
this.state.secondCheck = 0;
|
|
|
};
|
|
|
},
|
|
|
thirdInventorCheck(e) {
|
|
|
- if ( e.target.checked == true ) {
|
|
|
+ if (e.target.checked == true) {
|
|
|
this.state.thirdCheck = 1;
|
|
|
- } else if ( e.target.checked == false ) {
|
|
|
+ } else if (e.target.checked == false) {
|
|
|
this.state.thirdCheck = 0;
|
|
|
};
|
|
|
},
|
|
|
- avatarUrl(e){
|
|
|
+ avatarUrl(e) {
|
|
|
this.state.avatarUrl = e;
|
|
|
},
|
|
|
render() {
|
|
@@ -155,12 +159,17 @@ const PatentAddFrom = Form.create()(React.createClass({
|
|
|
const _me = this;
|
|
|
return (
|
|
|
<Form horizontal onSubmit={this.handleSubmit} className="person-form">
|
|
|
- <Select placeholder="选择公司" value={this.state.companyName} style={{ width: 200 }} onChange={(e) => { this.setState({ companyName: e }); } }>{this.state.companyOption}</Select>
|
|
|
+ <Select placeholder="选择公司"
|
|
|
+ filterOption={(input, option) => {
|
|
|
+ this.state.companyId = option.key;
|
|
|
+ option.props.value.indexOf(input) >= 0;
|
|
|
+ }}
|
|
|
+ showSearch={true} style={{ width: 200 }} >{this.state.companyOption}</Select>
|
|
|
<FormItem
|
|
|
labelCol={{ span: 24 }}
|
|
|
wrapperCol={{ span: 18 }}
|
|
|
label="专利简要描述"
|
|
|
- >
|
|
|
+ >
|
|
|
{getFieldDecorator('intro', {
|
|
|
initialValue: this.state.intro || null
|
|
|
})(
|
|
@@ -173,58 +182,58 @@ const PatentAddFrom = Form.create()(React.createClass({
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label="姓名"
|
|
|
- >
|
|
|
+ >
|
|
|
{getFieldDecorator('firstInventorName', {
|
|
|
rules: [{ required: true, message: 'Please input name!' }]
|
|
|
})(
|
|
|
- <Input className="mini-input"/>
|
|
|
+ <Input className="mini-input" />
|
|
|
)}
|
|
|
- <Checkbox onChange={this.firstInventorCheck}>是否公布</Checkbox>
|
|
|
+ <Checkbox onChange={this.firstInventorCheck}>告知专利局是否公布</Checkbox>
|
|
|
</FormItem>
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label="身份证"
|
|
|
- >
|
|
|
+ >
|
|
|
{getFieldDecorator('firstInventorID', {
|
|
|
rules: [{ required: true, message: 'Please input ID!' }]
|
|
|
})(
|
|
|
- <Input className="mini-input"/>
|
|
|
+ <Input className="mini-input" />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
<p>第二发明人</p>
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label="姓名"
|
|
|
- >
|
|
|
+ >
|
|
|
{getFieldDecorator('secondInventorName')(
|
|
|
- <Input className="mini-input"/>
|
|
|
- )}
|
|
|
- <Checkbox onChange={this.secondInventorCheck}>是否公布</Checkbox>
|
|
|
+ <Input className="mini-input" />
|
|
|
+ )}
|
|
|
+ <Checkbox onChange={this.secondInventorCheck}>告知专利局是否公布</Checkbox>
|
|
|
</FormItem>
|
|
|
<p>第三发明人</p>
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label="姓名"
|
|
|
- >
|
|
|
+ >
|
|
|
{getFieldDecorator('thirdInventorName')(
|
|
|
- <Input className="mini-input"/>
|
|
|
- )}
|
|
|
- <Checkbox onChange={this.thirdInventorCheck}>是否公布</Checkbox>
|
|
|
+ <Input className="mini-input" />
|
|
|
+ )}
|
|
|
+ <Checkbox onChange={this.thirdInventorCheck}>告知专利局是否公布</Checkbox>
|
|
|
</FormItem>
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label="上传代理委托书"
|
|
|
labelCol={{ span: 24 }}
|
|
|
wrapperCol={{ span: 12 }}
|
|
|
- >
|
|
|
+ >
|
|
|
{getFieldDecorator('avatar')(
|
|
|
- <Avatar urlData={this.avatarUrl} name='patent_prory_statement' oid={this.state.companyName}/>
|
|
|
+ <Avatar urlData={this.avatarUrl} name='patent_prory_statement' oid={this.state.companyName} />
|
|
|
)}
|
|
|
- <span>请上传专利代理委托书</span><a onClick={()=>{window.open(globalConfig.context + "/techservice/patent/downLoadTemplate")}}>模板下载</a>
|
|
|
+ <span>请上传专利代理委托书</span><a onClick={() => { window.open(globalConfig.context + "/techservice/patent/downLoadTemplate") }}>模板下载</a>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
<Button className="set-submit" type="primary" htmlType="submit">保存</Button>
|
|
|
- <Button type="ghost" style={{marginLeft:'20px'}} onClick={this.props.closeModal}>取消</Button>
|
|
|
+ <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
|
|
|
</FormItem>
|
|
|
</Form >
|
|
|
);
|
|
@@ -268,8 +277,8 @@ const PatentAdd = React.createClass({
|
|
|
onOk={this.handleOk} onCancel={this.handleCancel}
|
|
|
width='800px'
|
|
|
footer=''
|
|
|
- >
|
|
|
- <PatentAddFrom spinState={this.spinChange} closeModal={this.handleCancel}/>
|
|
|
+ >
|
|
|
+ <PatentAddFrom spinState={this.spinChange} closeModal={this.handleCancel} />
|
|
|
</Modal>
|
|
|
</Spin>
|
|
|
</div>
|