|
@@ -1,11 +1,27 @@
|
|
|
import React,{Component} from "react";
|
|
|
-import {Modal, Form, Row, Col, Tabs, Table, Spin, message, Button, Input, Select, DatePicker, Popconfirm} from "antd";
|
|
|
+import {
|
|
|
+ Modal,
|
|
|
+ Form,
|
|
|
+ Row,
|
|
|
+ Col,
|
|
|
+ Table,
|
|
|
+ Spin,
|
|
|
+ message,
|
|
|
+ Button,
|
|
|
+ Input,
|
|
|
+ Select,
|
|
|
+ DatePicker,
|
|
|
+ Popconfirm,
|
|
|
+ Tooltip
|
|
|
+} from "antd";
|
|
|
import $ from "jquery/src/ajax";
|
|
|
import moment from 'moment';
|
|
|
import ReminderLog from "../../customer/NEW/crm/reminderLog";
|
|
|
|
|
|
import {getPatentType} from "@/tools.js";
|
|
|
|
|
|
+import { patentTypeList} from '@/dataDic.js';
|
|
|
+
|
|
|
const FormItem = Form.Item;
|
|
|
|
|
|
const formItemLayout = {
|
|
@@ -68,8 +84,12 @@ class PatentDetails extends Component{
|
|
|
if (!readOnly) {
|
|
|
this.setState({
|
|
|
patentNo: detailsInfor.patentNo,
|
|
|
+ tid: detailsInfor.tid,
|
|
|
email:detailsInfor.email,
|
|
|
name: detailsInfor.name,
|
|
|
+ type: detailsInfor.type,
|
|
|
+ holders: detailsInfor.holders,
|
|
|
+ inventor: detailsInfor.inventor,
|
|
|
applyDates: detailsInfor.applyDates,
|
|
|
authorizationDates: detailsInfor.authorizationDates,
|
|
|
annualFeeStatus: detailsInfor.annualFeeStatus,
|
|
@@ -122,28 +142,44 @@ class PatentDetails extends Component{
|
|
|
message.warning('请输入专利名称')
|
|
|
return;
|
|
|
}
|
|
|
- if(!this.state.applyDates){
|
|
|
- message.warning('请选择申请日期')
|
|
|
+ if(isNaN(parseInt(this.state.type))){
|
|
|
+ message.warning('请选择专利类型')
|
|
|
return;
|
|
|
}
|
|
|
- if(!this.state.authorizationDates){
|
|
|
- message.warning('请选择授权日期')
|
|
|
+ if(!this.state.tid){
|
|
|
+ message.warning('请输入项目编号')
|
|
|
return;
|
|
|
}
|
|
|
- if(!this.state.email){
|
|
|
- message.warning('请输入邮箱')
|
|
|
- return;
|
|
|
- }
|
|
|
- if(isNaN(parseInt(this.state.annualFeeStatus))){
|
|
|
- message.warning('请选择年费状态')
|
|
|
+ if(!this.state.applyDates){
|
|
|
+ message.warning('请选择申请日期')
|
|
|
return;
|
|
|
}
|
|
|
- if(isNaN(parseInt(this.state.delayingAmount))){
|
|
|
- message.warning('请输入滞纳金')
|
|
|
+ // if(!this.state.authorizationDates){
|
|
|
+ // message.warning('请选择授权日期')
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if(!this.state.email){
|
|
|
+ // message.warning('请输入邮箱')
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if(isNaN(parseInt(this.state.annualFeeStatus))){
|
|
|
+ // message.warning('请选择年费状态')
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if(!this.state.holders){
|
|
|
+ // message.warning('请输入权利人')
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if(!this.state.inventor){
|
|
|
+ // message.warning('请输入发明人')
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ if(!isNaN(parseInt(this.state.delayingAmount)) && this.state.delayingAmount < 0){
|
|
|
+ message.warning('滞纳金不能小于零')
|
|
|
return;
|
|
|
}
|
|
|
- if(isNaN(parseInt(this.state.recoveryAmount))){
|
|
|
- message.warning('请输入权利恢复费')
|
|
|
+ if(!isNaN(parseInt(this.state.recoveryAmount)) && this.state.recoveryAmount < 0){
|
|
|
+ message.warning('权利恢复费不能小于零')
|
|
|
return;
|
|
|
}
|
|
|
this.setState({
|
|
@@ -158,19 +194,24 @@ class PatentDetails extends Component{
|
|
|
data: {
|
|
|
id:detailsInfor.id,
|
|
|
patentNo: this.state.patentNo,
|
|
|
- email: this.state.email,
|
|
|
name: this.state.name,
|
|
|
+ type: this.state.type,
|
|
|
applyDates: this.state.applyDates,
|
|
|
- authorizationDates: this.state.authorizationDates,
|
|
|
- annualFeeStatus: this.state.annualFeeStatus,
|
|
|
- delayingAmount: this.state.delayingAmount,
|
|
|
- recoveryAmount: this.state.recoveryAmount,
|
|
|
+ tid: this.state.tid,
|
|
|
+
|
|
|
+ email: this.state.email || undefined,
|
|
|
+ holders: this.state.holders || undefined,
|
|
|
+ inventor: this.state.inventor || undefined,
|
|
|
+ authorizationDates: this.state.authorizationDates || undefined,
|
|
|
+ annualFeeStatus: this.state.annualFeeStatus || undefined,
|
|
|
+ delayingAmount: isNaN(parseInt(this.state.delayingAmount)) ? undefined : this.state.delayingAmount,
|
|
|
+ recoveryAmount: isNaN(parseInt(this.state.recoveryAmount)) ? undefined : this.state.recoveryAmount,
|
|
|
},
|
|
|
success: function (data) {
|
|
|
if(data.error.length === 0){
|
|
|
message.success('修改成功');
|
|
|
- this.payLoadData();
|
|
|
this.props.onRefresh();
|
|
|
+ this.props.onCancel();
|
|
|
}else{
|
|
|
message.warning(data.error[0].message);
|
|
|
}
|
|
@@ -200,6 +241,7 @@ class PatentDetails extends Component{
|
|
|
<Row gutter={40}>
|
|
|
<Col span={8}>
|
|
|
<FormItem
|
|
|
+ required
|
|
|
{...formItemLayout}
|
|
|
label='专利号'
|
|
|
>
|
|
@@ -220,6 +262,7 @@ class PatentDetails extends Component{
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label='专利名称'
|
|
|
+ required
|
|
|
>
|
|
|
{
|
|
|
readOnly ? detailsInfor.name :
|
|
@@ -238,9 +281,46 @@ class PatentDetails extends Component{
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label='专利类型'
|
|
|
+ required
|
|
|
>
|
|
|
{
|
|
|
- getPatentType(detailsInfor.type)
|
|
|
+ readOnly ?
|
|
|
+ getPatentType(detailsInfor.type) :
|
|
|
+ <Select
|
|
|
+ placeholder="请选择专利类型"
|
|
|
+ style={{paddingTop: '5px'}}
|
|
|
+ value={getPatentType(this.state.type)}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ type: e });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {patentTypeList.map(function(item) {
|
|
|
+ return (
|
|
|
+ <Select.Option key={item.value}>
|
|
|
+ {item.key}
|
|
|
+ </Select.Option>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Select>
|
|
|
+ }
|
|
|
+ </FormItem>
|
|
|
+ </Col>
|
|
|
+ <Col span={8}>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label='项目编号'
|
|
|
+ required
|
|
|
+ >
|
|
|
+ {
|
|
|
+ readOnly ? detailsInfor.tid :
|
|
|
+ <Input
|
|
|
+ value={this.state.tid}
|
|
|
+ onChange={(e)=>{
|
|
|
+ this.setState({
|
|
|
+ tid:e.target.value
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
}
|
|
|
</FormItem>
|
|
|
</Col>
|
|
@@ -248,6 +328,7 @@ class PatentDetails extends Component{
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label='申请日期'
|
|
|
+ required
|
|
|
>
|
|
|
{
|
|
|
readOnly ? detailsInfor.applyDates:
|
|
@@ -255,7 +336,6 @@ class PatentDetails extends Component{
|
|
|
value={this.state.applyDates ? moment(this.state.applyDates) : ''}
|
|
|
format='YYYY-MM-DD'
|
|
|
onChange={(date)=>{
|
|
|
- console.log(date,'date')
|
|
|
this.setState({
|
|
|
applyDates:date ? moment(date).format('YYYY-MM-DD') : '',
|
|
|
})
|
|
@@ -275,7 +355,6 @@ class PatentDetails extends Component{
|
|
|
value={this.state.authorizationDates ? moment(this.state.authorizationDates) : ''}
|
|
|
format='YYYY-MM-DD'
|
|
|
onChange={(date)=>{
|
|
|
- console.log(date,'date')
|
|
|
this.setState({
|
|
|
authorizationDates:date ? moment(date).format('YYYY-MM-DD') : '',
|
|
|
})
|
|
@@ -290,7 +369,17 @@ class PatentDetails extends Component{
|
|
|
label='Email'
|
|
|
>
|
|
|
{
|
|
|
- readOnly ? detailsInfor.email:
|
|
|
+ readOnly ?
|
|
|
+ <Tooltip placement="topLeft" title={detailsInfor.email}>
|
|
|
+ <div style={{
|
|
|
+ width:'100%',
|
|
|
+ overflow: 'hidden',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ textOverflow: 'ellipsis',
|
|
|
+ }}>
|
|
|
+ {detailsInfor.email}
|
|
|
+ </div>
|
|
|
+ </Tooltip>:
|
|
|
<Input
|
|
|
value={this.state.email}
|
|
|
onChange={(e)=>{
|
|
@@ -302,14 +391,14 @@ class PatentDetails extends Component{
|
|
|
}
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- {readOnly ? <Col span={8}>
|
|
|
+ <Col span={8}>
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
|
label='年费'
|
|
|
>
|
|
|
{detailsInfor.patentAmount}
|
|
|
</FormItem>
|
|
|
- </Col> : null }
|
|
|
+ </Col>
|
|
|
<Col span={8}>
|
|
|
<FormItem
|
|
|
{...formItemLayout}
|
|
@@ -367,30 +456,69 @@ class PatentDetails extends Component{
|
|
|
}
|
|
|
</FormItem>
|
|
|
</Col>
|
|
|
- <Col span={16}>
|
|
|
+ <Col span={8}>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label='权利人'
|
|
|
+ >
|
|
|
+ {
|
|
|
+ readOnly ? detailsInfor.holders :
|
|
|
+ <Input
|
|
|
+ value={this.state.holders}
|
|
|
+ onChange={(e)=>{
|
|
|
+ this.setState({
|
|
|
+ holders:e.target.value
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ }
|
|
|
+ </FormItem>
|
|
|
+ </Col>
|
|
|
+ <Col span={8}>
|
|
|
<FormItem
|
|
|
- labelCol={{span: 5}}
|
|
|
- wrapperCol={{span: 19}}
|
|
|
+ {...formItemLayout}
|
|
|
+ label='发明人'
|
|
|
+ >
|
|
|
+ {
|
|
|
+ readOnly ? detailsInfor.inventor :
|
|
|
+ <Input
|
|
|
+ value={this.state.inventor}
|
|
|
+ onChange={(e)=>{
|
|
|
+ this.setState({
|
|
|
+ inventor:e.target.value
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ }
|
|
|
+ </FormItem>
|
|
|
+ </Col>
|
|
|
+ <Col span={8}>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
label='通知'
|
|
|
>
|
|
|
- <div style={{display:'flex',alignItems:'center'}}>
|
|
|
- {
|
|
|
- detailsInfor.salesmanRemind === 0 ? '未通知' :
|
|
|
- detailsInfor.salesmanRemind === 1 ? '已通知' : ''
|
|
|
- }
|
|
|
- <Button
|
|
|
- onClick={()=>{
|
|
|
- this.setState({
|
|
|
- visible:true,
|
|
|
- id:detailsInfor.id
|
|
|
- })
|
|
|
- }}
|
|
|
- style={{marginLeft:"15px"}}
|
|
|
- type='primary'>
|
|
|
- 查看专利日志
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
+ <div style={{display:'flex',alignItems:'center'}}>
|
|
|
+ {
|
|
|
+ detailsInfor.salesmanRemind === 0 ? '未通知' :
|
|
|
+ detailsInfor.salesmanRemind === 1 ? '已通知' : ''
|
|
|
+ }
|
|
|
+ </div>
|
|
|
</FormItem>
|
|
|
+ <Button
|
|
|
+ onClick={()=>{
|
|
|
+ this.setState({
|
|
|
+ visible:true,
|
|
|
+ id:detailsInfor.id
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ style={{
|
|
|
+ position: 'absolute',
|
|
|
+ top: 0,
|
|
|
+ right: 0,
|
|
|
+ }}
|
|
|
+ type='primary'>
|
|
|
+ 查看专利日志
|
|
|
+ </Button>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
{!readOnly ?
|