解决分销商bug

This commit is contained in:
red-deng-deng 2021-11-30 02:28:49 +08:00
parent 1dc627daaa
commit 71f90f27e2
2 changed files with 44 additions and 16 deletions

View File

@ -398,10 +398,21 @@ export const getResellerList = (params) => {
export const getExistName = (name) => {
return req('get', baseurl + "/reseller/exist_name/"+name)
}
//编辑分销商异步校验分销商名称是否重复
export const geteditExistName = (name,params) => {
return req('get', baseurl + "/reseller/exist_name/"+name,params)
}
//新建分销商异步校验分销商登陆账号是否重复
export const getExistAccount = (name) => {
return req('get', baseurl + "/reseller/exist_account/"+name)
}
//编辑分销商异步校验分销商登陆账号是否重复
export const geteditExistAccount = (name,params) => {
return req('get', baseurl + "/reseller/exist_account/"+name,params)
}
//新建分销商-销售人员
export const getPersonnel = () => {
return req('get', baseurl + "/auth/admin/all")

View File

@ -8,7 +8,7 @@ import "../../../assets/comm.css"
import {Select,Dialog,Button,ImageUpload ,onUpload,FormInputField,Notify,CopyButton } from "zent"
import Bus from "../../../assets/eventBus.js"
import _ from "lodash";
import {getExistName,getCompany,uploadImg,getPersonnel,handelResponse,getExistAccount} from "../../../assets/api.js"
import {getExistName,geteditExistName,getCompany,uploadImg,getPersonnel,geteditExistAccount,handelResponse,getExistAccount} from "../../../assets/api.js"
export default class adduserinfo extends React.Component{
constructor(props){
@ -197,28 +197,45 @@ export default class adduserinfo extends React.Component{
}
//校验分销商名称
NameblurFn(e){
console.log(200,this.props.enumer);
if(this.props.enumer==0){
getExistName(e).then(res=>{
handelResponse(res,(response,msg)=>{
},err=>{
},err=>{});
}).catch(err=>{});
}else{
let formInfo=JSON.parse(sessionStorage.getItem('dataInfo'));
let data={
id:formInfo.id
}
geteditExistName(e,data).then(res=>{
handelResponse(res,(response,msg)=>{
});
}).catch(err=>{
});
},err=>{});
}).catch(err=>{});
}
}
//校验登陆账号名称
AccountblurFn(e){
if(this.props.enumer==0){
getExistAccount(e).then(res=>{
handelResponse(res,(response,msg)=>{
},err=>{
});
},err=>{});
}).catch(err=>{
});
}else{
let formInfo=JSON.parse(sessionStorage.getItem('dataInfo'));
let data={
id:formInfo.id
}
geteditExistAccount(e,data).then(res=>{
handelResponse(res,(response,msg)=>{
},err=>{});
}).catch(err=>{
});
}
}
cancel(){
let model2 = {}