<template>
|
<app-layout-row>
|
<app-layout-col :span="5">
|
<group-list v-bind="groupListProps"/>
|
</app-layout-col>
|
<app-layout-col :span="19" :padding-left="15">
|
<band-table v-bind="bandTableProps"/>
|
</app-layout-col>
|
</app-layout-row>
|
</template>
|
|
<script setup>
|
|
import GroupList from './GroupList';
|
import BandTable from './BandTable';
|
import {openTab} from "@/utils/iframe.js";
|
import {uuid} from "@/utils/tools.js";
|
import {modal} from "@/plugins/index.js";
|
|
const props = defineProps({
|
subCurrent: {
|
type: Function,
|
default: () => {
|
}
|
}
|
});
|
|
const groupListRef = ref();
|
const bandTableRef = ref();
|
|
const bandTableProps = {
|
ref: bandTableRef,
|
subCurrent(row) {
|
props.subCurrent(row);
|
}
|
}
|
|
|
const groupListProps = {
|
ref: groupListRef,
|
subActive(active) {
|
bandTableRef.value.onActive(active);
|
}
|
}
|
|
const onOpenTab = async (row) => {
|
await openTab({
|
icon: 'icon-product',
|
id: uuid(),
|
sceneCode: "edit",
|
text: "折扣模板",
|
title: "折扣模板编辑",
|
path: '/fee/complexForm',
|
params: {view: 'form', ...(row.id ? {id: row.id} : {})}
|
}
|
);
|
}
|
|
const onDelete = async (row) => {
|
await modal.confirm("是否确认删除?");
|
|
await entityStore.deleteEntity({
|
dataName: 'fee_model_band',
|
id: row.id
|
});
|
bandTableRef.value.onReload();
|
};
|
|
const onOpenDetail = async (row) => {
|
await openTab({
|
icon: 'icon-product',
|
id: uuid(),
|
sceneCode: "edit",
|
text: "折扣模板",
|
title: "折扣模板编辑",
|
path: '/fee/complexForm',
|
params: {view: 'detail',id: row.id}
|
}
|
);
|
}
|
|
defineExpose({
|
onOpenTab,
|
onDelete,
|
onOpenDetail
|
});
|
|
|
</script>
|