<template>
|
<app-page-form v-bind="pageFormProps" v-loading="appStore.getLoading('getEntity')">
|
<base-info v-bind="baseInfoProps"/>
|
<workbook-table v-bind="workbookTableProps"/>
|
<joint-table v-bind="jointTableProps"/>
|
<filter-table v-bind="filterTableProps"/>
|
</app-page-form>
|
</template>
|
|
<script setup>
|
|
import BaseInfo from './BaseInfo';
|
import WorkbookTable from './WorkbookTable';
|
import FilterTable from './FilterTable';
|
import JointTable from './JointTable';
|
import {closeTab} from '@/utils/iframe.js';
|
import {useAppStore, useEntityStore} from "@/store/modules";
|
import {convertFilter} from "@/utils/filter.js";
|
|
const entityStore = useEntityStore();
|
const appStore = useAppStore();
|
|
const router = useRouter();
|
|
const baseInfoRef = ref();
|
|
const baseInfoProps = {
|
ref: baseInfoRef,
|
}
|
|
const params = router.currentRoute.value.query;
|
|
const onReset = async () => {
|
const [plan, join] = await Promise.all([
|
entityStore.getEntity({
|
dataName: "pkg_plan",
|
filter: convertFilter({
|
andEqParams: {
|
id: params.id
|
}
|
})
|
}),
|
entityStore.getEntity({
|
dataName: "pkg_plan_joins",
|
filter: convertFilter({
|
andEqParams: {
|
id: params.id
|
}
|
})
|
}),
|
]);
|
const {fee_model_plan, fee_model_workbook} = plan.data;
|
const {fee_model_filter, fee_model_joint} = join.data;
|
|
await nextTick();
|
baseInfoRef.value.onSetData(fee_model_plan);
|
workbookTableRef.value.onSetData(fee_model_workbook);
|
filterTableRef.value.onSetData(fee_model_filter);
|
jointTableRef.value.onSetData(fee_model_joint);
|
|
}
|
|
onMounted(async () => {
|
await onReset();
|
});
|
|
const workbookTableRef = ref();
|
|
const workbookTableProps = {
|
ref: workbookTableRef,
|
}
|
|
const jointTableRef = ref();
|
|
const jointTableProps = {
|
ref: jointTableRef
|
};
|
|
|
const filterTableRef = ref();
|
|
const filterTableProps = {
|
ref: filterTableRef,
|
}
|
|
const pageFormProps = {
|
subClose() {
|
closeTab();
|
},
|
submitDom: false,
|
resetDom: false,
|
}
|
|
</script>
|