zhuoyuan.wang
2024-06-19 15ebe96f28cadec6a726c5324593a40bbf56205f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<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>