|
17 | 17 | </el-form-item>
|
18 | 18 | <el-form-item label="参与场次" prop="timeId">
|
19 | 19 | <el-select v-model="queryParams.timeId" placeholder="请选择参与场次" clearable size="small">
|
20 |
| - <el-option v-for="item in seckillTimeList" :key="item.id" :label="item.name" :value="item.id" /> |
| 20 | + <el-option v-for="item in SeckillConfigList" :key="item.id" :label="item.name" :value="item.id"/> |
21 | 21 | </el-select>
|
22 | 22 | </el-form-item>
|
23 | 23 | <el-form-item label="创建时间" prop="createTime">
|
|
38 | 38 | v-hasPermi="['promotion:seckill-activity:create']">新增秒杀活动</el-button>
|
39 | 39 | </el-col>
|
40 | 40 | <el-col :span="1.5">
|
41 |
| - <el-button type="primary" plain icon="el-icon-menu" size="mini" @click="openSeckillTime" |
42 |
| - v-hasPermi="['promotion:seckill-activity:create']">管理参与场次</el-button> |
| 41 | + <el-button v-hasPermi="['promotion:seckill-activity:create']" icon="el-icon-menu" plain size="mini" type="primary" |
| 42 | + @click="openSeckillConfig">管理参与场次 |
| 43 | + </el-button> |
43 | 44 | </el-col>
|
44 | 45 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
45 | 46 | </el-row>
|
|
54 | 55 | </el-table-column>
|
55 | 56 | <el-table-column label="参与场次" prop="timeIds" width="250">
|
56 | 57 | <template v-slot="scope">
|
57 |
| - <span v-for="item in seckillTimeList" :key="item.id" |
58 |
| - v-if="scope.row.timeIds.includes(item.id)"> |
| 58 | + <span v-for="item in SeckillConfigList" v-if="scope.row.timeIds.includes(item.id)" |
| 59 | + :key="item.id"> |
59 | 60 | <el-tag style="margin:4px;" size="small">{{ item.name }}</el-tag>
|
60 | 61 | </span>
|
61 | 62 | </template>
|
|
110 | 111 | <el-form-item label="场次选择">
|
111 | 112 | <el-select v-model="form.timeIds" placeholder="请选择参与场次" clearable size="small" multiple filterable
|
112 | 113 | style="width: 880px">
|
113 |
| - <el-option v-for="item in seckillTimeList" :key="item.id" :label="item.name" :value="item.id"> |
114 |
| - <span style="float: left">{{ item.name + ': { ' }} {{ item.startTime }} -- {{ item.endTime + |
115 |
| - ' }' |
116 |
| - }}</span> |
117 |
| - <span style="float: right; color: #8492a6; font-size: 13px"></span> |
118 |
| - </el-option> |
| 114 | + <el-option v-for="item in SeckillConfigList" :key="item.id" :label="item.name" :value="item.id"> |
| 115 | + <span style="float: left">{{ item.name + ': { ' }} {{ item.startTime }} -- {{ |
| 116 | + item.endTime + |
| 117 | + ' }' |
| 118 | + }}</span> |
| 119 | + <span style="float: right; color: #8492a6; font-size: 13px"></span> |
| 120 | + </el-option> |
119 | 121 | </el-select>
|
120 | 122 | </el-form-item>
|
121 | 123 | <el-form-item label="商品选择">
|
|
186 | 188 | </template>
|
187 | 189 |
|
188 | 190 | <script>
|
189 |
| -import { getSkuOptionList } from "@/api/mall/product/sku"; |
190 |
| -import { createSeckillActivity, updateSeckillActivity, closeSeckillActivity, deleteSeckillActivity, getSeckillActivity, getSeckillActivityPage, exportSeckillActivityExcel } from "@/api/mall/promotion/seckillActivity"; |
191 |
| -import { getSeckillTimeList } from "@/api/mall/promotion/seckillTime"; |
192 |
| -import { deepClone } from "@/utils"; |
| 191 | +import {getSkuOptionList} from "@/api/mall/product/sku"; |
| 192 | +import { |
| 193 | + closeSeckillActivity, |
| 194 | + createSeckillActivity, |
| 195 | + deleteSeckillActivity, |
| 196 | + getSeckillActivity, |
| 197 | + getSeckillActivityPage, |
| 198 | + updateSeckillActivity |
| 199 | +} from "@/api/mall/promotion/seckillActivity"; |
| 200 | +import {getSeckillConfigList} from "@/api/mall/promotion/SeckillConfig"; |
| 201 | +import {deepClone} from "@/utils"; |
193 | 202 |
|
194 | 203 | export default {
|
195 | 204 | name: "PromotionSeckillActivity",
|
196 | 205 | components: {
|
197 | 206 | },
|
198 | 207 | data() {
|
199 | 208 | return {
|
200 |
| - // 遮罩层 |
201 |
| - loading: true, |
202 |
| - // 显示搜索条件 |
203 |
| - showSearch: true, |
204 |
| - // 总条数 |
205 |
| - total: 0, |
206 |
| - // 秒杀活动列表 |
207 |
| - list: [], |
208 |
| - // 秒杀场次列表 |
209 |
| - seckillTimeList: [], |
210 |
| - // 弹出层标题 |
211 |
| - title: "", |
212 |
| - // 是否显示弹出层 |
213 |
| - open: false, |
214 |
| - // 查询参数 |
215 |
| - queryParams: { |
216 |
| - pageNo: 1, |
217 |
| - pageSize: 10, |
218 |
| - name: null, |
219 |
| - status: null, |
| 209 | + // 遮罩层 |
| 210 | + loading: true, |
| 211 | + // 显示搜索条件 |
| 212 | + showSearch: true, |
| 213 | + // 总条数 |
| 214 | + total: 0, |
| 215 | + // 秒杀活动列表 |
| 216 | + list: [], |
| 217 | + // 秒杀场次列表 |
| 218 | + SeckillConfigList: [], |
| 219 | + // 弹出层标题 |
| 220 | + title: "", |
| 221 | + // 是否显示弹出层 |
| 222 | + open: false, |
| 223 | + // 查询参数 |
| 224 | + queryParams: { |
| 225 | + pageNo: 1, |
| 226 | + pageSize: 10, |
| 227 | + name: null, |
| 228 | + status: null, |
220 | 229 | timeId: null,
|
221 | 230 | createTime: [],
|
222 | 231 | },
|
@@ -261,18 +270,18 @@ export default {
|
261 | 270 | this.total = response.data.total;
|
262 | 271 | this.loading = false;
|
263 | 272 | });
|
264 |
| - if (timeId) { |
265 |
| - //查询完成后设置为空 |
266 |
| - this.$route.params.timeId = undefined |
267 |
| - } |
268 |
| - // 获得 SKU 商品列表 |
269 |
| - getSkuOptionList().then(response => { |
270 |
| - this.productSkus = response.data; |
271 |
| - }); |
272 |
| - // 获取参与场次列表 |
273 |
| - getSeckillTimeList().then(response => { |
274 |
| - this.seckillTimeList = response.data; |
275 |
| - }); |
| 273 | + if (timeId) { |
| 274 | + //查询完成后设置为空 |
| 275 | + this.$route.params.timeId = undefined |
| 276 | + } |
| 277 | + // 获得 SKU 商品列表 |
| 278 | + getSkuOptionList().then(response => { |
| 279 | + this.productSkus = response.data; |
| 280 | + }); |
| 281 | + // 获取参与场次列表 |
| 282 | + getSeckillConfigList().then(response => { |
| 283 | + this.SeckillConfigList = response.data; |
| 284 | + }); |
276 | 285 | },
|
277 | 286 | /** 取消按钮 */
|
278 | 287 | cancel() {
|
@@ -306,10 +315,10 @@ export default {
|
306 | 315 | this.resetForm("queryForm");
|
307 | 316 | this.handleQuery();
|
308 | 317 | },
|
309 |
| - /**打开秒杀场次管理页面 */ |
310 |
| - openSeckillTime() { |
311 |
| - this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time"); |
312 |
| - }, |
| 318 | + /**打开秒杀场次管理页面 */ |
| 319 | + openSeckillConfig() { |
| 320 | + this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time"); |
| 321 | + }, |
313 | 322 | /** 新增按钮操作 */
|
314 | 323 | handleAdd() {
|
315 | 324 | this.reset();
|
|
0 commit comments