Commit af60e9ac authored by tianhongyang's avatar tianhongyang

添加账号弹窗关闭 重新获取账号数量

parent 54157196
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
}, },
addAccountCount: { addAccountCount: {
type: [String, Number], type: [String, Number],
default: 1 default: 0
} }
}, },
watch: { watch: {
......
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
// 企业信息 // 企业信息
addAccountEnterpriseInfo: {}, addAccountEnterpriseInfo: {},
// 该租户下已经创建账号数量 // 该租户下已经创建账号数量
addAccountCount: 1 addAccountCount: 0
}; };
}, },
created() { created() {
...@@ -242,24 +242,31 @@ export default { ...@@ -242,24 +242,31 @@ export default {
methods: { methods: {
enterpriseDialogClose() { enterpriseDialogClose() {
this.addAccountDialog = false; this.addAccountDialog = false;
this.getAccountCount(this.addAccountEnterpriseInfo.tenantId);
this.addAccountEnterpriseInfo = this.$options.data.call(this).addAccountEnterpriseInfo; this.addAccountEnterpriseInfo = this.$options.data.call(this).addAccountEnterpriseInfo;
this.addAccountCount = this.$options.data.call(this).addAccountCount; },
async getAccountCount(tenantId) {
try {
const countResult = await getEnterpriseAddAccountCountApi(tenantId);
if (countResult.code == 200) {
this.addAccountCount = countResult.data;
}
} catch (error) {
console.log(error);
}
}, },
// 新增用户账号 // 新增用户账号
async handleAddAccount(row) { async handleAddAccount(row) {
try { try {
if (!row.tenantId) return this.$message.warning("缺少租户ID"); if (!row.tenantId) return this.$message.warning("缺少租户ID");
const countResult = await getEnterpriseAddAccountCountApi(row.tenantId); await this.getAccountCount(row.tenantId);
if (countResult.code == 200) { if (this.addAccountCount >= 6) {
if (countResult.data >= 6) {
this.addAccountCount = countResult.data;
return this.$message.warning("该租户下已经添加过五个账号"); return this.$message.warning("该租户下已经添加过五个账号");
} }
this.addAccountEnterpriseInfo = row; this.addAccountEnterpriseInfo = row;
this.addAccountDialog = true; this.addAccountDialog = true;
}
} catch (error) { } catch (error) {
console.log(error);
} }
}, },
//获取企业方案列表 //获取企业方案列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment