【新增】租户创建修改的时候新增专业的点位数据创建和新增
This commit is contained in:
@@ -69,6 +69,12 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 子表的表单 -->
|
||||
<el-tabs v-model="subTabsName">
|
||||
<el-tab-pane label="课程授权" name="demo03Course">
|
||||
<Demo03CourseForm ref="demo03CourseFormRef" :tenant-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
@@ -80,6 +86,7 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as TenantApi from '@/api/system/tenant'
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import * as TenantPackageApi from '@/api/system/tenantPackage'
|
||||
import Demo03CourseForm from "@/views/system/tenant/Demo03CourseForm.vue";
|
||||
|
||||
defineOptions({ name: 'SystemTenantForm' })
|
||||
|
||||
@@ -117,6 +124,10 @@ const formRules = reactive({
|
||||
const formRef = ref() // 表单 Ref
|
||||
const packageList = ref([] as TenantPackageApi.TenantPackageVO[]) // 租户套餐
|
||||
|
||||
/** 子表的表单 */
|
||||
const subTabsName = ref('demo03Course')
|
||||
const demo03CourseFormRef = ref()
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
@@ -144,10 +155,20 @@ const submitForm = async () => {
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 校验子表单
|
||||
// 校验子表单
|
||||
try {
|
||||
await demo03CourseFormRef.value.validate()
|
||||
} catch (e) {
|
||||
subTabsName.value = 'demo03Course'
|
||||
return
|
||||
}
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as TenantApi.TenantVO
|
||||
// 拼接子表的数据
|
||||
data.tenantSpecialtyPointsVOList = demo03CourseFormRef.value.getData()
|
||||
if (formType.value === 'create') {
|
||||
await TenantApi.createTenant(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
Reference in New Issue
Block a user