|
@@ -786,15 +786,6 @@ export default {
|
|
|
},
|
|
|
handleRegister() {
|
|
|
this.form.mainProducts = this.form.mainProductArray.join(',')
|
|
|
- if(this.form.license) {
|
|
|
- validLicenseApi(this.form.license).then(res => {
|
|
|
- // true存在
|
|
|
- if(res.data) {
|
|
|
- this.$message.error('统一社会信用代码已经存在,不可以重复注册');
|
|
|
- return
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
if(this.type == 'update') {
|
|
|
this.$refs.form.validate((valid, obj) => {
|
|
|
if (valid) {
|
|
@@ -827,24 +818,37 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}else if(this.type == 'add'){
|
|
|
+
|
|
|
this.$refs.form.validate((valid, obj) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
- registerEnterUserApi(this.form).then(res => {
|
|
|
- const userName = this.form.userName;
|
|
|
- this.$notify.success({
|
|
|
- title: '系统提示',
|
|
|
- message: '恭喜你,您的账号注册成功!',
|
|
|
- showClose: false,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- setTimeout(() => {
|
|
|
- this.$store.dispatch("tagsView/delView", this.$route);
|
|
|
- this.$router.go(-1);
|
|
|
- }, 2000);
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
+ if(this.form.license) {
|
|
|
+ validLicenseApi(this.form.license).then(res => {
|
|
|
+ // true存在
|
|
|
+ if(res.data) {
|
|
|
+ this.$message.error('统一社会信用代码已经存在,不可以重复注册');
|
|
|
+ this.loading = false;
|
|
|
+ return false
|
|
|
+ }else {
|
|
|
+ registerEnterUserApi(this.form).then(res => {
|
|
|
+ const userName = this.form.userName;
|
|
|
+ this.$notify.success({
|
|
|
+ title: '系统提示',
|
|
|
+ message: '恭喜你,您的账号注册成功!',
|
|
|
+ showClose: false,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$store.dispatch("tagsView/delView", this.$route);
|
|
|
+ this.$router.go(-1);
|
|
|
+ }, 2000);
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}else {
|
|
|
const a = []
|
|
|
for (let key in obj) {
|