4
4
<ContentWrap >
5
5
<!-- 搜索工作栏 -->
6
6
<el-form
7
- class =" -mb-15px"
8
- :model =" queryParams"
9
7
ref =" queryFormRef"
10
8
:inline =" true"
9
+ :model =" queryParams"
10
+ class =" -mb-15px"
11
11
label-width =" 68px"
12
12
>
13
13
<el-form-item label =" 活动名称" prop =" name" >
14
14
<el-input
15
15
v-model =" queryParams.name"
16
- placeholder = " 请输入活动名称 "
16
+ class = " !w-240px "
17
17
clearable
18
+ placeholder =" 请输入活动名称"
18
19
@keyup.enter =" handleQuery"
19
- class =" !w-240px"
20
20
/>
21
21
</el-form-item >
22
22
<el-form-item label =" 活动状态" prop =" status" >
23
23
<el-select
24
24
v-model =" queryParams.status"
25
- placeholder =" 请选择活动状态"
26
- clearable
27
25
class =" !w-240px"
26
+ clearable
27
+ placeholder =" 请选择活动状态"
28
28
>
29
29
<el-option
30
30
v-for =" dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
35
35
</el-select >
36
36
</el-form-item >
37
37
<el-form-item >
38
- <el-button @click =" handleQuery" ><Icon icon =" ep:search" class =" mr-5px" /> 搜索</el-button >
39
- <el-button @click =" resetQuery" ><Icon icon =" ep:refresh" class =" mr-5px" /> 重置</el-button >
38
+ <el-button @click =" handleQuery" >
39
+ <Icon class =" mr-5px" icon =" ep:search" />
40
+ 搜索
41
+ </el-button >
42
+ <el-button @click =" resetQuery" >
43
+ <Icon class =" mr-5px" icon =" ep:refresh" />
44
+ 重置
45
+ </el-button >
40
46
<el-button
41
- type = " primary "
47
+ v-hasPermi = " ['promotion:combination-activity:create'] "
42
48
plain
49
+ type =" primary"
43
50
@click =" openForm('create')"
44
- v-hasPermi =" ['promotion:combination-activity:create']"
45
51
>
46
- <Icon icon =" ep:plus" class =" mr-5px" /> 新增
52
+ <Icon class =" mr-5px" icon =" ep:plus" />
53
+ 新增
47
54
</el-button >
48
55
</el-form-item >
49
56
</el-form >
50
57
</ContentWrap >
51
58
52
59
<!-- 列表 -->
53
60
<ContentWrap >
54
- <el-table v-loading =" loading" :data =" list" :stripe =" true" :show-overflow-tooltip =" true" >
55
- <el-table-column label =" 活动编号" prop = " id " min-width =" 80" />
56
- <el-table-column label =" 活动名称" prop = " name " min-width =" 140" />
61
+ <el-table v-loading =" loading" :data =" list" :show-overflow-tooltip =" true" :stripe =" true" >
62
+ <el-table-column label =" 活动编号" min-width =" 80" prop = " id " />
63
+ <el-table-column label =" 活动名称" min-width =" 140" prop = " name " />
57
64
<el-table-column label =" 活动时间" min-width =" 210" >
58
65
<template #default =" scope " >
59
66
{{ formatDate(scope.row.startTime, 'YYYY-MM-DD') }}
60
67
~ {{ formatDate(scope.row.endTime, 'YYYY-MM-DD') }}
61
68
</template >
62
69
</el-table-column >
63
- <el-table-column label =" 商品图片" prop = " spuName " min-width =" 80" >
70
+ <el-table-column label =" 商品图片" min-width =" 80" prop = " spuName " >
64
71
<template #default =" scope " >
65
72
<el-image
73
+ :preview-src-list =" [scope.row.picUrl]"
66
74
:src =" scope.row.picUrl"
67
75
class =" h-40px w-40px"
68
- :preview-src-list =" [scope.row.picUrl]"
69
76
preview-teleported
70
77
/>
71
78
</template >
72
79
</el-table-column >
73
- <el-table-column label =" 商品标题" prop = " spuName " min-width =" 300" />
80
+ <el-table-column label =" 商品标题" min-width =" 300" prop = " spuName " />
74
81
<el-table-column
82
+ :formatter =" fenToYuanFormat"
75
83
label =" 原价"
76
- prop =" marketPrice"
77
84
min-width =" 100"
78
- :formatter = " fenToYuanFormat "
85
+ prop = " marketPrice "
79
86
/>
80
- <el-table-column label =" 拼团价" prop = " seckillPrice " min-width =" 100" >
87
+ <el-table-column label =" 拼团价" min-width =" 100" prop = " seckillPrice " >
81
88
<template #default =" scope " >
82
89
{{ formatCombinationPrice(scope.row.products) }}
83
90
</template >
84
91
</el-table-column >
85
- <el-table-column label =" 开团组数" prop = " groupCount " min-width =" 100" />
86
- <el-table-column label =" 成团组数" prop = " groupSuccessCount " min-width =" 100" />
87
- <el-table-column label =" 购买次数" prop = " recordCount " min-width =" 100" />
88
- <el-table-column label = " 活动状态 " align =" center" prop = " status " min-width =" 100" >
92
+ <el-table-column label =" 开团组数" min-width =" 100" prop = " groupCount " />
93
+ <el-table-column label =" 成团组数" min-width =" 100" prop = " groupSuccessCount " />
94
+ <el-table-column label =" 购买次数" min-width =" 100" prop = " recordCount " />
95
+ <el-table-column align =" center" label = " 活动状态 " min-width =" 100" prop = " status " >
89
96
<template #default =" scope " >
90
97
<dict-tag :type =" DICT_TYPE.COMMON_STATUS" :value =" scope.row.status" />
91
98
</template >
92
99
</el-table-column >
93
100
<el-table-column
94
- label = " 创建时间 "
101
+ :formatter = " dateFormatter "
95
102
align =" center"
103
+ label =" 创建时间"
96
104
prop =" createTime"
97
- :formatter =" dateFormatter"
98
105
width =" 180px"
99
106
/>
100
- <el-table-column label = " 操作 " align = " center " width = " 150px " fixed = " right " >
107
+ <el-table-column align = " center " fixed = " right " label = " 操作 " width = " 150px " >
101
108
<template #default =" scope " >
102
109
<el-button
110
+ v-hasPermi =" ['promotion:combination-activity:update']"
103
111
link
104
112
type =" primary"
105
113
@click =" openForm('update', scope.row.id)"
106
- v-hasPermi =" ['promotion:combination-activity:update']"
107
114
>
108
115
编辑
109
116
</el-button >
110
117
<el-button
118
+ v-if =" scope.row.status === 0"
119
+ v-hasPermi =" ['promotion:combination-activity:close']"
111
120
link
112
121
type =" danger"
113
122
@click =" handleClose(scope.row.id)"
114
- v-if =" scope.row.status === 0"
115
- v-hasPermi =" ['promotion:combination-activity:close']"
116
123
>
117
124
关闭
118
125
</el-button >
119
126
<el-button
127
+ v-else
128
+ v-hasPermi =" ['promotion:combination-activity:delete']"
120
129
link
121
130
type =" danger"
122
131
@click =" handleDelete(scope.row.id)"
123
- v-else
124
- v-hasPermi =" ['promotion:combination-activity:delete']"
125
132
>
126
133
删除
127
134
</el-button >
130
137
</el-table >
131
138
<!-- 分页 -->
132
139
<Pagination
133
- :total =" total"
134
- v-model:page =" queryParams.pageNo"
135
140
v-model:limit =" queryParams.pageSize"
141
+ v-model:page =" queryParams.pageNo"
142
+ :total =" total"
136
143
@pagination =" getList"
137
144
/>
138
145
</ContentWrap >
141
148
<CombinationActivityForm ref =" formRef" @success =" getList" />
142
149
</template >
143
150
144
- <script setup lang="ts">
151
+ <script lang="ts" setup >
145
152
import { DICT_TYPE , getIntDictOptions } from ' @/utils/dict'
146
- import { dateFormatter } from ' @/utils/formatTime'
153
+ import { dateFormatter , formatDate } from ' @/utils/formatTime'
147
154
import * as CombinationActivityApi from ' @/api/mall/promotion/combination/combinationActivity'
148
155
import CombinationActivityForm from ' ./CombinationActivityForm.vue'
149
- import { formatDate } from ' @/utils/formatTime'
150
156
import { fenToYuanFormat } from ' @/utils/formatter'
151
157
import { fenToYuan } from ' @/utils'
152
158
@@ -165,7 +171,6 @@ const queryParams = reactive({
165
171
status: null
166
172
})
167
173
const queryFormRef = ref () // 搜索的表单
168
- const exportLoading = ref (false ) // 导出的加载中
169
174
170
175
/** 查询列表 */
171
176
const getList = async () => {
@@ -197,12 +202,11 @@ const openForm = (type: string, id?: number) => {
197
202
formRef .value .open (type , id )
198
203
}
199
204
200
- // TODO 芋艿:这里要改下
201
205
/** 关闭按钮操作 */
202
206
const handleClose = async (id : number ) => {
203
207
try {
204
208
// 关闭的二次确认
205
- await message .confirm (' 确认关闭该秒杀活动吗 ?' )
209
+ await message .confirm (' 确认关闭该拼团活动吗 ?' )
206
210
// 发起关闭
207
211
await CombinationActivityApi .closeCombinationActivity (id )
208
212
message .success (' 关闭成功' )
0 commit comments