|
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 SeckillConfigList" :key="item.id" :label="item.name" :value="item.id"/> |
| 20 | + <el-option v-for="item in seckillTimeList" :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 v-hasPermi="['promotion:seckill-activity:create']" icon="el-icon-menu" plain size="mini" type="primary" |
42 |
| - @click="openSeckillConfig">管理参与场次 |
43 |
| - </el-button> |
| 41 | + <el-button type="primary" plain icon="el-icon-menu" size="mini" @click="openSeckillTime" |
| 42 | + v-hasPermi="['promotion:seckill-activity:create']">管理参与场次</el-button> |
44 | 43 | </el-col>
|
45 | 44 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
46 | 45 | </el-row>
|
|
55 | 54 | </el-table-column>
|
56 | 55 | <el-table-column label="参与场次" prop="timeIds" width="250">
|
57 | 56 | <template v-slot="scope">
|
58 |
| - <span v-for="item in SeckillConfigList" v-if="scope.row.timeIds.includes(item.id)" |
59 |
| - :key="item.id"> |
| 57 | + <span v-for="item in seckillTimeList" :key="item.id" |
| 58 | + v-if="scope.row.timeIds.includes(item.id)"> |
60 | 59 | <el-tag style="margin:4px;" size="small">{{ item.name }}</el-tag>
|
61 | 60 | </span>
|
62 | 61 | </template>
|
|
111 | 110 | <el-form-item label="场次选择">
|
112 | 111 | <el-select v-model="form.timeIds" placeholder="请选择参与场次" clearable size="small" multiple filterable
|
113 | 112 | style="width: 880px">
|
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> |
| 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> |
121 | 119 | </el-select>
|
122 | 120 | </el-form-item>
|
123 | 121 | <el-form-item label="商品选择">
|
|
188 | 186 | </template>
|
189 | 187 |
|
190 | 188 | <script>
|
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"; |
| 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"; |
202 | 193 |
|
203 | 194 | export default {
|
204 | 195 | name: "PromotionSeckillActivity",
|
205 | 196 | components: {
|
206 | 197 | },
|
207 | 198 | data() {
|
208 | 199 | return {
|
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, |
| 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, |
229 | 220 | timeId: null,
|
230 | 221 | createTime: [],
|
231 | 222 | },
|
@@ -270,18 +261,18 @@ export default {
|
270 | 261 | this.total = response.data.total;
|
271 | 262 | this.loading = false;
|
272 | 263 | });
|
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 |
| - }); |
| 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 | + }); |
285 | 276 | },
|
286 | 277 | /** 取消按钮 */
|
287 | 278 | cancel() {
|
@@ -315,10 +306,10 @@ export default {
|
315 | 306 | this.resetForm("queryForm");
|
316 | 307 | this.handleQuery();
|
317 | 308 | },
|
318 |
| - /**打开秒杀场次管理页面 */ |
319 |
| - openSeckillConfig() { |
320 |
| - this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time"); |
321 |
| - }, |
| 309 | + /**打开秒杀场次管理页面 */ |
| 310 | + openSeckillTime() { |
| 311 | + this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time"); |
| 312 | + }, |
322 | 313 | /** 新增按钮操作 */
|
323 | 314 | handleAdd() {
|
324 | 315 | this.reset();
|
|
0 commit comments