Commit af60e9ac authored by tianhongyang's avatar tianhongyang

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

parent 54157196
......@@ -55,7 +55,7 @@ export default {
},
addAccountCount: {
type: [String, Number],
default: 1
default: 0
}
},
watch: {
......
......@@ -233,7 +233,7 @@ export default {
// 企业信息
addAccountEnterpriseInfo: {},
// 该租户下已经创建账号数量
addAccountCount: 1
addAccountCount: 0
};
},
created() {
......@@ -242,24 +242,31 @@ export default {
methods: {
enterpriseDialogClose() {
this.addAccountDialog = false;
this.getAccountCount(this.addAccountEnterpriseInfo.tenantId);
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) {
try {
if (!row.tenantId) return this.$message.warning("缺少租户ID");
const countResult = await getEnterpriseAddAccountCountApi(row.tenantId);
if (countResult.code == 200) {
if (countResult.data >= 6) {
this.addAccountCount = countResult.data;
await this.getAccountCount(row.tenantId);
if (this.addAccountCount >= 6) {
return this.$message.warning("该租户下已经添加过五个账号");
}
this.addAccountEnterpriseInfo = row;
this.addAccountDialog = true;
}
} 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