|
@@ -1,8 +1,8 @@
|
|
|
-import React,{Component} from "react";
|
|
|
-import {AutoComplete, Button, Form, Input, message, Modal, Radio, Select, Spin} from "antd";
|
|
|
-import {boutique} from "../../dataDic";
|
|
|
+import React, { Component } from "react";
|
|
|
+import { AutoComplete, Button, Form, Input, message, Modal, Radio, Select, Spin } from "antd";
|
|
|
+import { boutique } from "../../dataDic";
|
|
|
import $ from "jquery";
|
|
|
-import {getboutique} from "../../tools";
|
|
|
+import { getboutique } from "../../tools";
|
|
|
|
|
|
const FormItem = Form.Item;
|
|
|
|
|
@@ -11,28 +11,28 @@ const formItemLayout = {
|
|
|
wrapperCol: { span: 14 },
|
|
|
};
|
|
|
|
|
|
-class ProjectOperation extends Component{
|
|
|
+class ProjectOperation extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
- this.state={
|
|
|
- commodityName:'',
|
|
|
- commodityQuantity:'',
|
|
|
- patentType:0,
|
|
|
- officialCost:'',
|
|
|
- costReduction:'',
|
|
|
- commodityPrice:'',
|
|
|
- main:'',
|
|
|
- taskComment:'',
|
|
|
- declarationBatch:'',
|
|
|
- ifCertificationFee:'',
|
|
|
+ this.state = {
|
|
|
+ commodityName: '',
|
|
|
+ commodityQuantity: '',
|
|
|
+ patentType: 0,
|
|
|
+ officialCost: '',
|
|
|
+ costReduction: '',
|
|
|
+ commodityPrice: '',
|
|
|
+ main: '',
|
|
|
+ taskComment: '',
|
|
|
+ declarationBatch: '',
|
|
|
+ ifCertificationFee: '',
|
|
|
displayFees: "none",
|
|
|
|
|
|
- customerArr:[],
|
|
|
- patentTypeList:[],
|
|
|
+ customerArr: [],
|
|
|
+ patentTypeList: [],
|
|
|
|
|
|
- loading:false,
|
|
|
+ loading: false,
|
|
|
|
|
|
- patentTransfer:props.dataInfor ? props.dataInfor.patentTransfer : 0 //收否为专利转让 0 否 1 是
|
|
|
+ patentTransfer: props.dataInfor ? props.dataInfor.patentTransfer : 0 //收否为专利转让 0 否 1 是
|
|
|
}
|
|
|
this.onSubmit = this.onSubmit.bind(this);
|
|
|
this.httpChange = this.httpChange.bind(this);
|
|
@@ -46,17 +46,17 @@ class ProjectOperation extends Component{
|
|
|
this.setValue();
|
|
|
}
|
|
|
|
|
|
- setValue(){
|
|
|
- const {dataInfor} = this.props;
|
|
|
- if(!(dataInfor && Object.keys(dataInfor).length > 0)){return;}
|
|
|
- if (dataInfor.type === 1){
|
|
|
+ setValue() {
|
|
|
+ const { dataInfor } = this.props;
|
|
|
+ if (!(dataInfor && Object.keys(dataInfor).length > 0)) { return; }
|
|
|
+ if (dataInfor.type === 1) {
|
|
|
this.setState({
|
|
|
displayFees: "block",
|
|
|
costReduction: dataInfor.costReduction,
|
|
|
officialCost: dataInfor.officialCost,
|
|
|
patentType: dataInfor.patentType ? dataInfor.patentType : 0,
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.setState({
|
|
|
displayFees: "none",
|
|
|
});
|
|
@@ -67,7 +67,7 @@ class ProjectOperation extends Component{
|
|
|
commodityName: dataInfor.commodityName, //项目名称
|
|
|
commodityPrice: dataInfor.commodityPrice, //金额
|
|
|
commodityQuantity: dataInfor.commodityQuantity, //数量
|
|
|
- patentTypeName:dataInfor.patentTypeName,//专利类型名称
|
|
|
+ patentTypeName: dataInfor.patentTypeName,//专利类型名称
|
|
|
taskComment: dataInfor.taskComment, //备注
|
|
|
main: dataInfor.main.toString(), //是否为主要
|
|
|
addState: 0,
|
|
@@ -79,17 +79,25 @@ class ProjectOperation extends Component{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- onSubmit(){
|
|
|
+ onSubmit() {
|
|
|
if (this.state.gid === undefined || !this.state.gid) {
|
|
|
message.warning("服务名称不匹配!");
|
|
|
return false;
|
|
|
}
|
|
|
- if (this.state.displayFees==='block') {
|
|
|
+ let reg = /^([0]|[1-9][0-9]*)$/;
|
|
|
+ if (
|
|
|
+ !this.state.commodityQuantity ||
|
|
|
+ !reg.test(this.state.commodityQuantity)
|
|
|
+ ) {
|
|
|
+ message.warning("请输入正确商品数量!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (this.state.displayFees === 'block') {
|
|
|
if (this.state.patentType === "" && !this.state.patentTransfer) {
|
|
|
message.warning("请选择专利类型!");
|
|
|
return false;
|
|
|
}
|
|
|
- if(this.state.officialCost===''){
|
|
|
+ if (this.state.officialCost === '') {
|
|
|
message.warning("请选择官费!");
|
|
|
return false;
|
|
|
}
|
|
@@ -98,27 +106,19 @@ class ProjectOperation extends Component{
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
- if(isNaN(parseFloat(this.state.commodityPrice))){
|
|
|
+ if (isNaN(parseFloat(this.state.commodityPrice))) {
|
|
|
message.warning("请输入正确的金额!");
|
|
|
return false;
|
|
|
}
|
|
|
- let reg = /^([0]|[1-9][0-9]*)$/;
|
|
|
- if (
|
|
|
- !this.state.commodityQuantity ||
|
|
|
- !reg.test(this.state.commodityQuantity)
|
|
|
- ) {
|
|
|
- message.warning("请输入正确商品数量!");
|
|
|
- return false;
|
|
|
- }
|
|
|
if (!this.state.main) {
|
|
|
message.warning("请选择是否为主要项目!");
|
|
|
return false;
|
|
|
}
|
|
|
- if(this.state.addProjectType === 5 && !this.state.declarationBatch){
|
|
|
+ if (this.state.addProjectType === 5 && !this.state.declarationBatch) {
|
|
|
message.warning("请选择企业要求申报批次!");
|
|
|
return false;
|
|
|
}
|
|
|
- if(this.state.isIso && !this.state.ifCertificationFee){
|
|
|
+ if (this.state.isIso && !this.state.ifCertificationFee) {
|
|
|
message.warning("请选择是否包含认证费用!");
|
|
|
return false;
|
|
|
}
|
|
@@ -134,14 +134,14 @@ class ProjectOperation extends Component{
|
|
|
taskComment: this.state.taskComment, //服务说明
|
|
|
|
|
|
main: this.state.main, //是否为主要项目
|
|
|
- officialCost: this.state.displayFees==='block' ? this.state.officialCost : '', //是否有官费
|
|
|
- costReduction: this.state.displayFees==='block' ? ((this.state.patentType === 0 || this.state.patentType === 2) ? (this.state.officialCost === 1 ? this.state.costReduction : 0) : 0) : '', //是否有费减
|
|
|
- patentType: this.state.displayFees==='block' && !this.state.patentTransfer ? this.state.patentType : undefined, // 专利类型
|
|
|
+ officialCost: this.state.displayFees === 'block' ? this.state.officialCost : '', //是否有官费
|
|
|
+ costReduction: this.state.displayFees === 'block' ? ((this.state.patentType === 0 || this.state.patentType === 2) ? (this.state.officialCost === 1 ? this.state.costReduction : 0) : 0) : '', //是否有费减
|
|
|
+ patentType: this.state.displayFees === 'block' && !this.state.patentTransfer ? this.state.patentType : undefined, // 专利类型
|
|
|
}
|
|
|
- if(this.state.addProjectType === 5){
|
|
|
+ if (this.state.addProjectType === 5) {
|
|
|
infor.declarationBatch = this.state.declarationBatch || 1//申报批次
|
|
|
}
|
|
|
- if(this.state.isIso){
|
|
|
+ if (this.state.isIso) {
|
|
|
infor.ifCertificationFee = this.state.ifCertificationFee || undefined;//是否包含认证费用
|
|
|
}
|
|
|
$.ajax({
|
|
@@ -166,7 +166,7 @@ class ProjectOperation extends Component{
|
|
|
}
|
|
|
|
|
|
onChange() {
|
|
|
- if(isNaN(parseFloat(this.state.commodityPrice))){
|
|
|
+ if (isNaN(parseFloat(this.state.commodityPrice))) {
|
|
|
message.warning("请输入正确的金额!");
|
|
|
return false;
|
|
|
}
|
|
@@ -198,9 +198,9 @@ class ProjectOperation extends Component{
|
|
|
commodityPrice: this.state.commodityPrice, //金额
|
|
|
commodityQuantity: this.state.commodityQuantity, //数量
|
|
|
taskComment: this.state.taskComment, //备注
|
|
|
- officialCost: this.state.displayFees==='block' ? this.state.officialCost : '', //是否有官费
|
|
|
- costReduction: this.state.displayFees==='block' ? ((this.state.patentType === 0 || this.state.patentType === 2) ? (this.state.officialCost === 1 ? this.state.costReduction : 0) : 0) : '', //是否有费减
|
|
|
- patentType: this.state.displayFees==='block' ? this.state.patentType : '', //专利类型
|
|
|
+ officialCost: this.state.displayFees === 'block' ? this.state.officialCost : '', //是否有官费
|
|
|
+ costReduction: this.state.displayFees === 'block' ? ((this.state.patentType === 0 || this.state.patentType === 2) ? (this.state.officialCost === 1 ? this.state.costReduction : 0) : 0) : '', //是否有费减
|
|
|
+ patentType: this.state.displayFees === 'block' ? this.state.patentType : '', //专利类型
|
|
|
declarationBatch: this.state.declarationBatch || undefined,//申报批次
|
|
|
ifCertificationFee: isNaN(parseInt(this.state.ifCertificationFee)) ? undefined : this.state.ifCertificationFee,
|
|
|
},
|
|
@@ -286,12 +286,12 @@ class ProjectOperation extends Component{
|
|
|
displayFees: "none",
|
|
|
});
|
|
|
}
|
|
|
- console.log(value.indexOf("贯标"),'value.indexOf("贯标")')
|
|
|
+ console.log(value.indexOf("贯标"), 'value.indexOf("贯标")')
|
|
|
//0通用 1专利 2软著 3审计 4双软 5高新 6商标
|
|
|
this.setState({
|
|
|
commodityName: value,
|
|
|
gid: kid.id,
|
|
|
- addProjectType: kid.type,
|
|
|
+ addProjectType: kid.type,
|
|
|
isIso: value.indexOf("贯标") !== -1,// 是否为贯标项目
|
|
|
});
|
|
|
}
|
|
@@ -305,9 +305,9 @@ class ProjectOperation extends Component{
|
|
|
success: function (data) {
|
|
|
if (data.error.length === 0) {
|
|
|
this.setState({
|
|
|
- patentTypeList:data.data
|
|
|
+ patentTypeList: data.data
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
message.warning(data.error[0].message);
|
|
|
};
|
|
|
}.bind(this)
|
|
@@ -326,7 +326,7 @@ class ProjectOperation extends Component{
|
|
|
{group.bname}
|
|
|
</Select.Option>
|
|
|
));
|
|
|
- const {readOnly} = this.props;
|
|
|
+ const { readOnly } = this.props;
|
|
|
return (
|
|
|
<Modal
|
|
|
maskClosable={false}
|
|
@@ -334,7 +334,7 @@ class ProjectOperation extends Component{
|
|
|
onOk={this.props.onCancel}
|
|
|
onCancel={this.props.onCancel}
|
|
|
width="900px"
|
|
|
- title={readOnly ? "项目任务详情" : "添加项目任务" }
|
|
|
+ title={readOnly ? "项目任务详情" : "添加项目任务"}
|
|
|
footer=""
|
|
|
className="admin-desc-content"
|
|
|
>
|
|
@@ -380,7 +380,7 @@ class ProjectOperation extends Component{
|
|
|
/>}
|
|
|
<span className="mandatory">*</span>
|
|
|
</FormItem>
|
|
|
- <div style={{marginTop: "33px", color : "red", textAlign : "right", position : "relative", top: "-8", left : "0"}}>如会员项目,服务一年,请填写1,服务二年,请填写2,依次类推</div>
|
|
|
+ <div style={{ marginTop: "33px", color: "red", textAlign: "right", position: "relative", top: "-8", left: "0" }}>如会员项目,服务一年,请填写1,服务二年,请填写2,依次类推</div>
|
|
|
{!this.state.patentTransfer && <FormItem
|
|
|
className="half-item"
|
|
|
labelCol={{ span: 4 }}
|
|
@@ -397,14 +397,14 @@ class ProjectOperation extends Component{
|
|
|
value={this.state.patentType}
|
|
|
onChange={(e) => {
|
|
|
this.setState({ patentType: e });
|
|
|
- if(e !== 0 && e !== 2){
|
|
|
+ if (e !== 0 && e !== 2) {
|
|
|
this.setState({
|
|
|
costReduction: ''
|
|
|
})
|
|
|
}
|
|
|
}}
|
|
|
>
|
|
|
- {this.state.patentTypeList.map(function (v,k) {
|
|
|
+ {this.state.patentTypeList.map(function (v, k) {
|
|
|
return (
|
|
|
<Select.Option key={k} value={v.id}>{v.name}</Select.Option>
|
|
|
);
|
|
@@ -424,49 +424,71 @@ class ProjectOperation extends Component{
|
|
|
marginLeft: "63px",
|
|
|
}}
|
|
|
>
|
|
|
- {readOnly ? (this.state.officialCost === 1 ? '含官费': this.state.officialCost === 0 ? '不含官费' : '') : <Radio.Group
|
|
|
- value={this.state.officialCost}
|
|
|
- onChange={(e) => {
|
|
|
- this.setState({ officialCost: e.target.value });
|
|
|
- if(e.target.value === 0){
|
|
|
- this.setState({
|
|
|
- costReduction: ''
|
|
|
- })
|
|
|
- }
|
|
|
- }}
|
|
|
- >
|
|
|
- <Radio value={1}>含官费</Radio>
|
|
|
- <Radio value={0}>不含官费</Radio>
|
|
|
- </Radio.Group>}
|
|
|
- <span style={{ color: "red", marginLeft: "8px" }}>
|
|
|
- *
|
|
|
- </span>
|
|
|
- </FormItem>
|
|
|
- <FormItem
|
|
|
- className="half-item"
|
|
|
- labelCol={{ span: 3 }}
|
|
|
- wrapperCol={{ span: 14 }}
|
|
|
- label="费减:"
|
|
|
- style={{
|
|
|
- display: this.state.displayFees,
|
|
|
- marginLeft: "63px",
|
|
|
- }}
|
|
|
- >
|
|
|
- {/*不含官费或者专利类型不为复审或者申请时置灰*/}
|
|
|
- {readOnly ? (this.state.costReduction === 1 ? '有费减': this.state.costReduction === 0 ? '无费减' : '') : <Radio.Group
|
|
|
- disabled={this.state.officialCost === 0 || (this.state.patentType !== 0 && this.state.patentType !== 2)}
|
|
|
- value={this.state.costReduction}
|
|
|
- onChange={(e) => {
|
|
|
- this.setState({ costReduction: e.target.value });
|
|
|
- }}
|
|
|
- >
|
|
|
- <Radio value={1}>有费减</Radio>
|
|
|
- <Radio value={0}>无费减</Radio>
|
|
|
- </Radio.Group>}
|
|
|
+ {readOnly
|
|
|
+ ? (this.state.officialCost === 1 ? '含官费' : this.state.officialCost === 0 ? '不含官费' : '')
|
|
|
+ : <Radio.Group
|
|
|
+ value={this.state.officialCost}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({ officialCost: e.target.value });
|
|
|
+ if (e.target.value === 0) {
|
|
|
+ this.setState({
|
|
|
+ costReduction: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Radio value={1}>含官费</Radio>
|
|
|
+ <Radio value={0}>不含官费</Radio>
|
|
|
+ </Radio.Group>}
|
|
|
<span style={{ color: "red", marginLeft: "8px" }}>
|
|
|
- *
|
|
|
+ *
|
|
|
</span>
|
|
|
</FormItem>
|
|
|
+ {
|
|
|
+ readOnly ?
|
|
|
+ <FormItem
|
|
|
+ className="half-item"
|
|
|
+ labelCol={{ span: 3 }}
|
|
|
+ wrapperCol={{ span: 14 }}
|
|
|
+ label="费减:"
|
|
|
+ style={{
|
|
|
+ display: this.state.displayFees,
|
|
|
+ marginLeft: "63px",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {this.state.costReduction === 1 ? '有费减' : this.state.costReduction === 0 ? '无费减' : ''}
|
|
|
+ <span style={{ color: "red", marginLeft: "8px" }}>
|
|
|
+ *
|
|
|
+ </span>
|
|
|
+ </FormItem>
|
|
|
+ :
|
|
|
+ (this.state.patentType === 0 || this.state.patentType === 2) && this.state.officialCost === 1 &&
|
|
|
+ <FormItem
|
|
|
+ className="half-item"
|
|
|
+ labelCol={{ span: 3 }}
|
|
|
+ wrapperCol={{ span: 14 }}
|
|
|
+ label="费减:"
|
|
|
+ style={{
|
|
|
+ display: this.state.displayFees,
|
|
|
+ marginLeft: "63px",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {/*不含官费或者专利类型不为复审或者申请时置灰*/}
|
|
|
+ <Radio.Group
|
|
|
+ disabled={this.state.officialCost === 0 || (this.state.patentType !== 0 && this.state.patentType !== 2)}
|
|
|
+ value={this.state.costReduction}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({ costReduction: e.target.value });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Radio value={1}>有费减</Radio>
|
|
|
+ <Radio value={0}>无费减</Radio>
|
|
|
+ </Radio.Group>
|
|
|
+ <span style={{ color: "red", marginLeft: "8px" }}>
|
|
|
+ *
|
|
|
+ </span>
|
|
|
+ </FormItem>
|
|
|
+ }
|
|
|
<FormItem
|
|
|
className="half-item"
|
|
|
{...formItemLayout}
|
|
@@ -559,10 +581,10 @@ class ProjectOperation extends Component{
|
|
|
</Select>}
|
|
|
<span className="mandatory">*</span>
|
|
|
</FormItem>
|
|
|
- </div>: null
|
|
|
+ </div> : null
|
|
|
}
|
|
|
{
|
|
|
- this.props.isIso || this.state.isIso?<div className="clearfix">
|
|
|
+ this.props.isIso || this.state.isIso ? <div className="clearfix">
|
|
|
<FormItem
|
|
|
className="half-item"
|
|
|
{...formItemLayout}
|
|
@@ -570,7 +592,7 @@ class ProjectOperation extends Component{
|
|
|
>
|
|
|
{readOnly ? (
|
|
|
this.state.ifCertificationFee === 1 ? '包含' :
|
|
|
- this.state.ifCertificationFee === 0 ? '不包含' :'未知'
|
|
|
+ this.state.ifCertificationFee === 0 ? '不包含' : '未知'
|
|
|
) : <Select
|
|
|
placeholder="请选择是否包含认证费用"
|
|
|
style={{ width: "200px" }}
|
|
@@ -588,7 +610,7 @@ class ProjectOperation extends Component{
|
|
|
</Select>}
|
|
|
<span className="mandatory">*</span>
|
|
|
</FormItem>
|
|
|
- </div>: null
|
|
|
+ </div> : null
|
|
|
}
|
|
|
{readOnly ? null : <FormItem
|
|
|
wrapperCol={{ span: 12, offset: 4 }}
|
|
@@ -597,10 +619,10 @@ class ProjectOperation extends Component{
|
|
|
<Button
|
|
|
className="submitSave"
|
|
|
type="primary"
|
|
|
- onClick={()=>{
|
|
|
- if(this.state.jid){
|
|
|
+ onClick={() => {
|
|
|
+ if (this.state.jid) {
|
|
|
this.onChange();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.onSubmit();
|
|
|
}
|
|
|
}}
|