Skip to content

Commit 38695a1

Browse files
author
puhui999
committed
fix:seckillTime => seckillConfig
1 parent af4ee2e commit 38695a1

File tree

2 files changed

+75
-61
lines changed

2 files changed

+75
-61
lines changed

src/views/mall/promotion/seckill/seckillActivity/index.vue

Lines changed: 60 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</el-form-item>
1818
<el-form-item label="参与场次" prop="timeId">
1919
<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"/>
2121
</el-select>
2222
</el-form-item>
2323
<el-form-item label="创建时间" prop="createTime">
@@ -38,8 +38,9 @@
3838
v-hasPermi="['promotion:seckill-activity:create']">新增秒杀活动</el-button>
3939
</el-col>
4040
<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>
4344
</el-col>
4445
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
4546
</el-row>
@@ -54,8 +55,8 @@
5455
</el-table-column>
5556
<el-table-column label="参与场次" prop="timeIds" width="250">
5657
<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">
5960
<el-tag style="margin:4px;" size="small">{{ item.name }}</el-tag>
6061
</span>
6162
</template>
@@ -110,12 +111,13 @@
110111
<el-form-item label="场次选择">
111112
<el-select v-model="form.timeIds" placeholder="请选择参与场次" clearable size="small" multiple filterable
112113
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>
119121
</el-select>
120122
</el-form-item>
121123
<el-form-item label="商品选择">
@@ -186,37 +188,44 @@
186188
</template>
187189

188190
<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";
193202
194203
export default {
195204
name: "PromotionSeckillActivity",
196205
components: {
197206
},
198207
data() {
199208
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,
220229
timeId: null,
221230
createTime: [],
222231
},
@@ -261,18 +270,18 @@ export default {
261270
this.total = response.data.total;
262271
this.loading = false;
263272
});
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+
});
276285
},
277286
/** 取消按钮 */
278287
cancel() {
@@ -306,10 +315,10 @@ export default {
306315
this.resetForm("queryForm");
307316
this.handleQuery();
308317
},
309-
/**打开秒杀场次管理页面 */
310-
openSeckillTime() {
311-
this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time");
312-
},
318+
/**打开秒杀场次管理页面 */
319+
openSeckillConfig() {
320+
this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time");
321+
},
313322
/** 新增按钮操作 */
314323
handleAdd() {
315324
this.reset();

src/views/mall/promotion/seckill/seckillTime/index.vue

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,19 @@
6363
</template>
6464

6565
<script>
66-
import { createSeckillTime, updateSeckillTime, deleteSeckillTime, getSeckillTime, getSeckillTimePage, exportSeckillTimeExcel, getSeckillTimeList } from "@/api/mall/promotion/seckillTime";
66+
import {
67+
createSeckillConfig,
68+
deleteSeckillConfig,
69+
getSeckillConfig,
70+
getSeckillConfigList,
71+
updateSeckillConfig
72+
} from "@/api/mall/promotion/SeckillConfig";
6773
import router from "@/router";
68-
import { deepClone } from "@/utils";
74+
import {deepClone} from "@/utils";
6975
7076
export default {
71-
name: "PromotionSeckillTime",
72-
components: {
73-
},
77+
name: "PromotionSeckillConfig",
78+
components: {},
7479
data() {
7580
return {
7681
// 遮罩层
@@ -104,7 +109,7 @@ export default {
104109
getList() {
105110
this.loading = true;
106111
// 执行查询
107-
getSeckillTimeList().then(response => {
112+
getSeckillConfigList().then(response => {
108113
this.list = response.data;
109114
this.loading = false;
110115
});
@@ -148,7 +153,7 @@ export default {
148153
handleUpdate(row) {
149154
this.reset();
150155
const id = row.id;
151-
getSeckillTime(id).then(response => {
156+
getSeckillConfig(id).then(response => {
152157
response.data.startAndEndTime = [response.data.startTime, response.data.endTime]
153158
this.form = response.data;
154159
this.open = true;
@@ -168,15 +173,15 @@ export default {
168173
data.endTime = this.form.startAndEndTime[1];
169174
// 修改的提交
170175
if (this.form.id != null) {
171-
updateSeckillTime(data).then(response => {
176+
updateSeckillConfig(data).then(response => {
172177
this.$modal.msgSuccess("修改成功");
173178
this.open = false;
174179
this.getList();
175180
});
176181
return;
177182
}
178183
// 添加的提交
179-
createSeckillTime(data).then(response => {
184+
createSeckillConfig(data).then(response => {
180185
this.$modal.msgSuccess("新增成功");
181186
this.open = false;
182187
this.getList();
@@ -187,7 +192,7 @@ export default {
187192
handleDelete(row) {
188193
const id = row.id;
189194
this.$modal.confirm('是否确认删除秒杀时段编号为"' + id + '"的数据项?').then(function () {
190-
return deleteSeckillTime(id);
195+
return deleteSeckillConfig(id);
191196
}).then(() => {
192197
this.getList();
193198
this.$modal.msgSuccess("删除成功");

0 commit comments

Comments
 (0)