|
@@ -175,42 +175,44 @@ const Newuser = Form.create()(React.createClass({
|
|
|
name:e
|
|
|
},
|
|
|
success: function (data) {
|
|
|
- let thedata=data.data;
|
|
|
- if (!thedata) {
|
|
|
+ let thedata=data.data;
|
|
|
+ if (!thedata) {
|
|
|
if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
};
|
|
|
thedata = {};
|
|
|
- };
|
|
|
- this.setState({
|
|
|
- customerArr:thedata,
|
|
|
- });
|
|
|
- }.bind(this),
|
|
|
- }).always(function () {
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ customerArr:thedata,
|
|
|
+ });
|
|
|
+ }.bind(this),
|
|
|
+ }).always(function () {
|
|
|
this.setState({
|
|
|
loading: false
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
//上级主管输入框失去焦点是判断客户是否存在
|
|
|
- selectAuto(value,options){
|
|
|
- this.setState({
|
|
|
- superior:value
|
|
|
- })
|
|
|
- },
|
|
|
- blurChange(e){
|
|
|
- let theType='';
|
|
|
- let contactLists=this.state.customerArr||[];
|
|
|
- if (e) {
|
|
|
+ selectAuto(value){
|
|
|
+ let theType='';
|
|
|
+ let contactLists=this.state.customerArr||[];
|
|
|
+ if (value) {
|
|
|
contactLists.map(function (item) {
|
|
|
- if (item.name == e.toString()) {
|
|
|
+ if (item.name === value.toString()) {
|
|
|
theType = item.id;
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
- this.setState({
|
|
|
- theTypes:theType
|
|
|
- })
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ theTypes:theType,
|
|
|
+ superior:value
|
|
|
+ })
|
|
|
+ if(!this.state.reviewerName || !this.state.reviewer){
|
|
|
+ this.setState({
|
|
|
+ reviewerName:value,
|
|
|
+ reviewer:theType
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//值改变时请求客户名称
|
|
|
httpChange(e){
|
|
@@ -502,7 +504,6 @@ const Newuser = Form.create()(React.createClass({
|
|
|
value={this.state.superior}
|
|
|
onChange={this.httpChange}
|
|
|
filterOption={true}
|
|
|
- onBlur={this.blurChange}
|
|
|
onSelect={this.selectAuto}
|
|
|
>
|
|
|
<Input/>
|