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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
| <template>
| <!--
| 作者 luoyiming
| 时间:2020-06-09
| 描述:会员-充值管理-充值设置
| -->
| <div class="pb50 plan-setiting">
| <div class="d-s-s f-w">
| <div class="item d-c-c d-c mb16" v-for="(item, index) in planList" :key="index">
| <div class="f16 fb pb16">{{ item.plan_name }}</div>
| <div class="f14 gray9">
| 支付金额:
| <span class="orange">{{ item.money }}</span>
| </div>
| <div class="f14 gray9">
| 到账金额:
| <span class="orange">{{ item.gift_money }}</span>
| </div>
| <div class="f14 gray9">
| 赠送金额:
| <span class="orange">{{ item.give_money }}</span>
| </div>
| <div class="mt16">
| <span class="p-0-20">
| <el-link type="primary" @click="openEdit(item)">编辑</el-link>
| </span>
| <span class="p-0-20">
| <el-link type="danger" @click="delClick(item)">删除</el-link>
| </span>
| </div>
| </div>
|
| <div class="item item-add d-c-c d-c" @click="openAdd">
| <i class="el-icon-plus"></i>
| <span>添加</span>
| </div>
| </div>
|
| <Add :open="open_add" @close="closeAdd"></Add>
|
| <Edit :open="open_edit" @close="closeEdit" :curModel="curModel"></Edit>
|
| </div>
| </template>
| <script>
| import planApi from '@/api/plan.js';
| import Add from './dialog/Add.vue';
| import Edit from './dialog/Edit.vue';
| export default {
| components: {
| Add,
| Edit
| },
| data() {
| return {
| /*是否正在加载*/
| loading: false,
| /*充值套餐列表*/
| planList: [],
| /*是否打开添加*/
| open_add: false,
| /*是否打开编辑*/
| open_edit: false,
| /*当前项*/
| curModel:{}
| };
| },
| created() {
| /*获取数据*/
| this.getData();
| },
| methods: {
| /*获取数据*/
| getData() {
| let self = this;
| let Params = {};
| planApi
| .listPlan(Params, true)
| .then(res => {
| self.planList = res.data.list;
| })
| .catch(error => {});
| },
|
| /*打开添加*/
| openAdd() {
| this.open_add = true;
| },
|
| /*关闭添加*/
| closeAdd(e) {
| this.open_add = false;
| if (e) {
| this.getData();
| }
| },
|
| /*打开编辑*/
| openEdit(e){
| this.curModel=e;
| this.open_edit = true;
| },
|
| /*关闭编辑*/
| closeEdit(e) {
| this.open_edit = false;
| if (e) {
| this.getData();
| }
| },
|
| /*删除*/
| delClick: function(row) {
| let self = this;
| self
| .$confirm('删除后不可恢复,确认删除该记录吗?', '提示', {
| type: 'warning'
| })
| .then(() => {
| planApi.deletePlan({
| plan_id: row.plan_id
| }).then(data => {
| self.$message({
| message: '删除成功',
| type: 'success'
| });
| self.getData();
| });
| });
| },
|
| }
| };
| </script>
|
| <style>
| .plan-setiting .item {
| width: 240px;
| height: 160px;
| margin-right: 10px;
| border-radius: 16px;
| background: #f4f5f6;
| }
|
| .plan-setiting .item .el-icon-plus {
| font-size: 40px;
| color: #999999;
| }
|
| .plan-setiting .item.item-add {
| cursor: pointer;
| }
| </style>
|
|