Browse Source

专利类型选择问题

HW 3 years ago
parent
commit
d739405786

+ 16 - 6
js/component/manageCenter/customer/NEW/crm/patentPayment.jsx

@@ -332,7 +332,7 @@ const PatentPayment = Form.create()(React.createClass({
 			message.warning('申请日期不能为空')
 			return
 		}
-		if(this.state.patentType === ''){
+		if(isNaN(parseInt(this.state.patentType))){
 		    message.warning('专利类型不能为空');
 		    return
 		}
@@ -424,7 +424,6 @@ const PatentPayment = Form.create()(React.createClass({
 		    });
 		    theorgCodeUrl = picArr.join(",");
 		};
-		console.log(typeof this.state.patentType)
 		if (!this.state.patentNo) {
 			message.warning('专利号不能为空')
 			return
@@ -437,7 +436,7 @@ const PatentPayment = Form.create()(React.createClass({
 			message.warning('申请时间不能为空')
 			return
 		}
-		if(this.state.patentType === ''){
+		if(isNaN(parseInt(this.state.patentType))){
 		    message.warning('专利类型不能为空');
 		    return
 		}
@@ -571,6 +570,7 @@ const PatentPayment = Form.create()(React.createClass({
 	},
 	//获取渠道专员列表
 	getAdminList(value = '') {
+		if(value.length < 4){return}
 		$.ajax({
 			method: "get",
 			dataType: "json",
@@ -929,7 +929,14 @@ const PatentPayment = Form.create()(React.createClass({
 						  !this.props.isOnlyRead ?
 							  <Select
 								  showSearch
-								  value={this.state.customerServiceList.length === 0 ? (this.state.customerName || undefined) : this.state.customerUid}
+								  value={
+								  	this.state.customerServiceList.length === 0 ?
+										(this.state.customerName || undefined) :
+										(
+											this.state.customerServiceList.filter(v=>v.value === this.state.customerUid).length === 0 ?
+												this.state.customerName : this.state.customerUid
+										)
+								  }
 								  style={{ width: 150,marginLeft:'10px' }}
 								  onSearch={this.getAdminList}
 								  onSelect={(v)=>{
@@ -1185,12 +1192,15 @@ const PatentPayment = Form.create()(React.createClass({
 					>
 						<Select
 							showSearch
-							value={this.state.customerUid}
+							value={this.state.customerServiceList.filter(v=>v.value === this.state.customerUid).length === 0 ?
+								this.state.customerName : this.state.customerUid}
 							style={{ width: 150,marginLeft:'10px' }}
 							onSearch={this.getAdminList}
 							onSelect={(v)=>{
+								let arr = this.state.customerServiceList.filter(d=>d.value === v)
 								this.setState({
-									customerUid:v
+									customerUid:v,
+									customerName:arr[0].label
 								})
 							}}
 							filterOption={false}

+ 1 - 0
js/component/manageCenter/index/content.jsx

@@ -423,6 +423,7 @@ const MessageModal = React.createClass({
             message.warning('还存在未读消息,请查看后再关闭当前页面!');
             return;
         }else{
+            this.loadUnread();
             this.setState({
                 newVisible: false
             });