分销商新建

This commit is contained in:
red-deng-deng 2021-11-20 14:41:08 +08:00
parent 3bbb7d30dc
commit 35cf5d5781
2 changed files with 62 additions and 27 deletions

View File

@ -22,7 +22,6 @@ export default class acclist extends React.Component{
console.log('是否通过',valiform);
console.log('是否通过data',this.refs.disbutorForm.state);
let formInfo=this.refs.disbutorForm.state.model;
let iptVal=this.state.model;
let _this=this;
if(valiform){
//取消二次弹出框
@ -30,19 +29,41 @@ export default class acclist extends React.Component{
type:'warning',
closeBtn:true,
title:'确认操作',
content: _this.props.enumer==0?(<p>是否新增<b>[{formInfo.name}]</b></p>):(<p><b>[{formInfo.name}]</b></p>),
content: _this.state.enumer==0?(<p>是否新增<b>[{formInfo.name}]</b></p>):(<p><b>[{formInfo.name}]</b></p>),
onConfirm:()=>{
//提交接口
let data=_.cloneDeep(formInfo);
if(_this.state.headImg){
if(_this.refs.disbutorForm.state.headImg){
data.head_img=_this.refs.disbutorForm.state.headImg;
}
data.salesman_id=formInfo.salesman_id.key;
data.salesman_name=formInfo.salesman_id.text;
data.company_id=formInfo.company_id.key;
data.company_name=formInfo.company_id.text;
console.log(data);
if(_this.props.enumer==0){
data.identity_type=formInfo.identity_type.key;
let phoneList=[formInfo.contact_phone];
phoneList.push(data.phone1);
phoneList.push(data.phone2);
phoneList.push(data.phone3);
phoneList.push(data.phone4);
let phoneArr=phoneList.filter(o=>o);
data.contact_phone=phoneArr.join(',');
let emilList=[formInfo.contact_email];
emilList.push(data.email1);
emilList.push(data.email2);
emilList.push(data.email3);
emilList.push(data.email4);
let emailArr=emilList.filter(o=>o);
data.contact_email=emailArr.join(',');
delete data.phone1;
delete data.phone2;
delete data.phone3;
delete data.phone4;
delete data.email1;
delete data.email2;
delete data.email3;
delete data.email4;
if(_this.state.enumer==0){
postCreateReseller(data).then(res=>{
handelResponse(res,(response,msg)=>{
Notify.clear();

View File

@ -29,7 +29,14 @@ export default class adduserinfo extends React.Component{
salesman_id:'',
company_id:'',
identity_type:'',
phone1:'',
phone2:'',
phone3:'',
phone4:'',
email1:"",
email2:"",
email3:"",
email4:"",
},
rules:{
fullname: [
@ -394,16 +401,16 @@ export default class adduserinfo extends React.Component{
let model2 = this.state.model;
model2.phone2 = e;
this.setState({model:model2})
Bus.emit('input',"phone2" ,e);
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.phone2 = "";
model2.phone2 = "";
delete this.state.rules.phone2;
this.setState({model:model2})
let nums = this.state.phone_nums - 1;
this.setState({phone_nums:nums})
this.setState({phone_nums:nums,rules:this.state.rules })
}}
countShow= {false}
@ -422,14 +429,15 @@ export default class adduserinfo extends React.Component{
let model2 = this.state.model;
model2.phone3 = e;
this.setState({model:model2})
Bus.emit('input',"phone3" ,e);
// Bus.emit('input',"phone3" ,e);
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.phone3 = "";
this.setState({model:model2})
model2.phone3 = "";
delete this.state.rules.phone3;
this.setState({model:model2,rules:this.state.rules})
let nums = this.state.phone_nums - 1;
this.setState({phone_nums:nums})
@ -451,15 +459,17 @@ export default class adduserinfo extends React.Component{
let model2 = this.state.model;
model2.phone4 = e;
this.setState({model:model2})
Bus.emit('input',"phone1" ,e);
// Bus.emit('input',"phone1" ,e);
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.phone4 = "";
this.setState({model:model2})
model2.phone4 = "";
delete this.state.rules.phone4;
this.setState({model:model2,rules:this.state.rules})
let nums = this.state.phone_nums - 1;
this.setState({phone_nums:nums})
}}
@ -501,14 +511,15 @@ export default class adduserinfo extends React.Component{
let model2 = this.state.model;
model2.email1 = e;
this.setState({model:model2})
Bus.emit('input',"email1" ,e);
// Bus.emit('input',"email1" ,e);
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.email1 = "";
this.setState({model:model2})
model2.email1 = "";
delete this.state.rules.email1;
this.setState({model:model2,rules:this.state.rules})
let nums = this.state.email_nums - 1;
this.setState({email_nums:nums})
@ -528,14 +539,15 @@ export default class adduserinfo extends React.Component{
let model2 = this.state.model;
model2.email2 = e;
this.setState({model:model2})
Bus.emit('input',"email2" ,e);
// Bus.emit('input',"email2" ,e);
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.email2 = "";
this.setState({model:model2})
model2.email2 = "";
delete this.state.rules.email2;
this.setState({model:model2,rules:this.state.rules})
let nums = this.state.email_nums - 1;
this.setState({email_nums:nums})
@ -556,14 +568,15 @@ export default class adduserinfo extends React.Component{
let model2 = this.state.model;
model2.email3 = e;
this.setState({model:model2})
Bus.emit('input',"email3" ,e);
// Bus.emit('input',"email3" ,e);
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.email3 = "";
this.setState({model:model2})
model2.email3 = "";
delete this.state.rules.email3;
this.setState({model:model2,rules:this.state.rules})
let nums = this.state.email_nums - 1;
this.setState({phone_nums:nums})
@ -585,14 +598,15 @@ export default class adduserinfo extends React.Component{
let model2 = this.state.model;
model2.email4 = e;
this.setState({model:model2})
Bus.emit('input',"email4" ,e);
// Bus.emit('input',"email4" ,e);
}}
onClearItem={(e)=>{
let model2 = this.state.model;
model2.email4 = "";
this.setState({model:model2})
model2.email4 = "";
delete this.state.rules.email4;
this.setState({model:model2,rules:this.state.rules})
let nums = this.state.email_nums - 1;
this.setState({phone_nums:nums})