init
This commit is contained in:
@@ -361,7 +361,11 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
addUser(this.form).then(data => {
|
||||
addUser({
|
||||
...this.form,
|
||||
residenceCode: this.getCode(this.form.residenceCode),
|
||||
addressCode: this.getCode(this.form.addressCode)
|
||||
}).then(data => {
|
||||
this.$modal.msgSuccess("新增用户成功");
|
||||
this.buttonLoading = false;
|
||||
this.open = false
|
||||
@@ -371,6 +375,15 @@ export default {
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getCode(code){
|
||||
if(!code){
|
||||
return code;
|
||||
}
|
||||
if(Array.isArray(code)){
|
||||
return code[code.length-1]
|
||||
}
|
||||
return code;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -352,7 +352,11 @@ export default {
|
||||
})
|
||||
},
|
||||
submitForm(){
|
||||
updateUser(this.form).then(data => {
|
||||
updateUser({
|
||||
...this.form,
|
||||
residenceCode: this.getCode(this.form.residenceCode),
|
||||
addressCode: this.getCode(this.form.addressCode)
|
||||
}).then(data => {
|
||||
this.$modal.msgSuccess("编辑用户成功");
|
||||
this.buttonLoading = false;
|
||||
this.open = false
|
||||
@@ -360,6 +364,15 @@ export default {
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
},
|
||||
getCode(code){
|
||||
if(!code){
|
||||
return code;
|
||||
}
|
||||
if(Array.isArray(code)){
|
||||
return code[code.length-1]
|
||||
}
|
||||
return code;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user