|
@@ -64,25 +64,12 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-button size="small" type="primary" style="text-align: center;width: 100%;margin-top: 10px;"
|
|
<el-button size="small" type="primary" style="text-align: center;width: 100%;margin-top: 10px;"
|
|
|
@click="submitForm('ruleForm')">
|
|
@click="submitForm('ruleForm')">
|
|
|
- {{ corpTitle }}
|
|
|
|
|
|
|
+ <span v-if="!loading"> {{ corpTitle }}</span>
|
|
|
|
|
+ <span v-else> {{ corpTitle }}中...</span>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
- <el-dialog width="30%" :title="corpTitle + '企业/团队'" :visible.sync="joinOrCreateVisible" append-to-body>
|
|
|
|
|
- <el-form :model="form" :rules="rules" ref="ruleForm" label-position="top" label-width="80px" size="small">
|
|
|
|
|
- <el-form-item label="企业/团队名称" prop="name" v-if="corpTitle == '创建'">
|
|
|
|
|
- <el-input v-model="form.name" placeholder='请输入你的企业/团队名称'></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="邀请码" prop="tenantId" v-if="corpTitle == '加入'">
|
|
|
|
|
- <el-input v-model="form.url" placeholder='请输入你的邀请码'></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-button size="small" type="primary" style="text-align: center;width: 100%;margin-top: 10px;"
|
|
|
|
|
- @click="submitForm('ruleForm')">
|
|
|
|
|
- {{ corpTitle }}
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -100,6 +87,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ loading: false,
|
|
|
showMyTeam: null,
|
|
showMyTeam: null,
|
|
|
myTeamList: [],
|
|
myTeamList: [],
|
|
|
showJoinTeam: null,
|
|
showJoinTeam: null,
|
|
@@ -154,7 +142,7 @@ export default {
|
|
|
setTenantId(val.id)
|
|
setTenantId(val.id)
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
location.reload()
|
|
location.reload()
|
|
|
- }, 2000)
|
|
|
|
|
|
|
+ }, 1500)
|
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
|
})
|
|
})
|
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
@@ -166,23 +154,30 @@ export default {
|
|
|
submitForm(formName) {
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
|
+ this.loading = true;
|
|
|
console.log(this.form);
|
|
console.log(this.form);
|
|
|
if (this.corpTitle == '创建') {
|
|
if (this.corpTitle == '创建') {
|
|
|
createTenant({ status: 0, name: this.form.name }).then(response => {
|
|
createTenant({ status: 0, name: this.form.name }).then(response => {
|
|
|
this.$modal.msgSuccess("创建成功");
|
|
this.$modal.msgSuccess("创建成功");
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ this.joinOrCreateVisible = false;
|
|
|
|
|
+ this.getOwnJoinTenantList();
|
|
|
|
|
+ this.getOwnCreateTenantList();
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
joinTenant({ tenantId: this.form.tenantId }).then(response => {
|
|
joinTenant({ tenantId: this.form.tenantId }).then(response => {
|
|
|
this.$modal.msgSuccess("加入成功");
|
|
this.$modal.msgSuccess("加入成功");
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ this.joinOrCreateVisible = false;
|
|
|
|
|
+ this.getOwnJoinTenantList();
|
|
|
|
|
+ this.getOwnCreateTenantList();
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
- this.joinOrCreateVisible = false;
|
|
|
|
|
- this.getOwnJoinTenantList();
|
|
|
|
|
- this.getOwnCreateTenantList();
|
|
|
|
|
-
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ this.loading = false;
|
|
|
console.log('error submit!!');
|
|
console.log('error submit!!');
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|