Commit 61c4053cbb3c81419d9e549be16e7254d14a6d6b
1 parent
fc3245a0
前端修改秒杀相关文件存放地址
Showing
4 changed files
with
77 additions
and
130 deletions
yudao-ui-admin/src/api/promotion/seckillActivity.js renamed to yudao-ui-admin/src/api/mall/promotion/seckillActivity.js
yudao-ui-admin/src/api/promotion/seckillTime.js renamed to yudao-ui-admin/src/api/mall/promotion/seckillTime.js
yudao-ui-admin/src/views/promotion/seckillActivity/index.vue renamed to yudao-ui-admin/src/views/mall/promotion/seckill/seckillActivity/index.vue
| ... | ... | @@ -18,8 +18,6 @@ |
| 18 | 18 | <el-select v-model="queryParams.timeId" placeholder="请选择参与场次" clearable size="small"> |
| 19 | 19 | <el-option v-for="item in seckillTimeList" :key="item.id" :label="item.name" :value="item.id" /> |
| 20 | 20 | </el-select> |
| 21 | - <!-- <el-option v-for="seckill in seckillTimeList" :key="seckill.id" :lable="seckill.name" :value="seckill.id" /> --> | |
| 22 | - <!-- <el-input v-model="queryParams.timeId" placeholder="请输入秒杀时段id" clearable @keyup.enter.native="handleQuery" /> --> | |
| 23 | 21 | </el-form-item> |
| 24 | 22 | <el-form-item label="创建时间" prop="createTime"> |
| 25 | 23 | <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" |
| ... | ... | @@ -39,8 +37,8 @@ |
| 39 | 37 | v-hasPermi="['promotion:seckill-activity:create']">新增秒杀活动</el-button> |
| 40 | 38 | </el-col> |
| 41 | 39 | <el-col :span="1.5"> |
| 42 | - <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |
| 43 | - :loading="exportLoading" v-hasPermi="['promotion:seckill-activity:export']">导出</el-button> | |
| 40 | + <el-button type="primary" plain icon="el-icon-menu" size="mini" @click="openSeckillTime" | |
| 41 | + v-hasPermi="['promotion:seckill-activity:create']">管理参与场次</el-button> | |
| 44 | 42 | </el-col> |
| 45 | 43 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| 46 | 44 | </el-row> |
| ... | ... | @@ -70,11 +68,6 @@ |
| 70 | 68 | |
| 71 | 69 | <el-table-column label="付款订单数" align="center" prop="orderCount" /> |
| 72 | 70 | <el-table-column label="付款人数" align="center" prop="userCount" /> |
| 73 | - <el-table-column label="订单实付金额" align="center"> | |
| 74 | - <template slot-scope="scope"> | |
| 75 | - ¥{{ (scope.row.totalPrice / 100.0).toFixed(2) }} | |
| 76 | - </template> | |
| 77 | - </el-table-column> | |
| 78 | 71 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 79 | 72 | <template slot-scope="scope"> |
| 80 | 73 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| ... | ... | @@ -84,6 +77,8 @@ |
| 84 | 77 | <template slot-scope="scope"> |
| 85 | 78 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 86 | 79 | v-hasPermi="['promotion:seckill-activity:update']">修改</el-button> |
| 80 | + <el-button size="mini" type="text" icon="el-icon-close" @click="handleClose(scope.row)" | |
| 81 | + v-hasPermi="['promotion:seckill-activity:delete']">关闭</el-button> | |
| 87 | 82 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| 88 | 83 | v-hasPermi="['promotion:seckill-activity:delete']">删除</el-button> |
| 89 | 84 | </template> |
| ... | ... | @@ -99,40 +94,20 @@ |
| 99 | 94 | <el-form-item label="活动名称" prop="name"> |
| 100 | 95 | <el-input v-model="form.name" placeholder="请输入秒杀活动名称" /> |
| 101 | 96 | </el-form-item> |
| 102 | - <!-- <el-form-item label="活动状态" prop="status"> | |
| 103 | - <el-radio-group v-model="form.status"> | |
| 104 | - <el-radio v-for="dict in this.getDictDatas(DICT_TYPE.PROMOTION_ACTIVITY_STATUS)" | |
| 105 | - :key="dict.value" :label="parseInt(dict.value)">{{dict.label}}</el-radio> | |
| 106 | - </el-radio-group> | |
| 107 | - </el-form-item> --> | |
| 108 | - | |
| 109 | 97 | <el-form-item label="活动时间" prop="startAndEndTime"> |
| 110 | 98 | <el-date-picker clearable v-model="form.startAndEndTime" type="datetimerange" |
| 111 | 99 | value-format="timestamp" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" |
| 112 | 100 | style="width: 1080px" /> |
| 113 | 101 | </el-form-item> |
| 114 | - <!-- | |
| 115 | - <el-form-item label="活动结束时间" prop="endTime"> | |
| 116 | - <el-date-picker clearable v-model="form.endTime" type="date" value-format="timestamp" placeholder="选择活动结束时间" /> | |
| 117 | - </el-form-item> --> | |
| 118 | - | |
| 119 | 102 | <el-form-item label="排序" prop="sort"> |
| 120 | 103 | <el-input-number v-model="form.sort" controls-position="right" :min="0" :max="10000"> |
| 121 | 104 | </el-input-number> |
| 122 | 105 | </el-form-item> |
| 123 | - | |
| 124 | - <!-- <el-form-item label="秒杀时段id" prop="timeId"> | |
| 125 | - <el-input v-model="form.timeId" placeholder="请输入秒杀时段id" /> | |
| 126 | - </el-form-item> | |
| 127 | - <el-form-item label="订单实付金额(分)" prop="totalPrice"> | |
| 128 | - <el-input v-model="form.totalPrice" placeholder="请输入订单实付金额(分)" /> | |
| 129 | - </el-form-item> --> | |
| 130 | - | |
| 131 | 106 | <el-form-item label="备注" prop="remark"> |
| 132 | 107 | <el-input type="textarea" v-model="form.remark" placeholder="请输入备注" /> |
| 133 | 108 | </el-form-item> |
| 134 | 109 | <el-form-item label="场次选择"> |
| 135 | - <el-select v-model="form.timeIds" placeholder="请选择参与场次" clearable size="small" multiple filterable | |
| 110 | + <el-select v-model="form.timeId" placeholder="请选择参与场次" clearable size="small" multiple filterable | |
| 136 | 111 | style="width: 880px"> |
| 137 | 112 | <el-option v-for="item in seckillTimeList" :key="item.id" :label="item.name" :value="item.id"> |
| 138 | 113 | <span style="float: left">{{ item.name + ': { ' }} {{ item.startTime }} -- {{ item.endTime + |
| ... | ... | @@ -142,7 +117,6 @@ |
| 142 | 117 | </el-option> |
| 143 | 118 | </el-select> |
| 144 | 119 | </el-form-item> |
| 145 | - | |
| 146 | 120 | <el-form-item label="商品选择"> |
| 147 | 121 | <el-select v-model="form.skuIds" placeholder="请选择活动商品" clearable size="small" multiple filterable |
| 148 | 122 | style="width: 880px" @change="changeFormSku"> |
| ... | ... | @@ -154,13 +128,11 @@ |
| 154 | 128 | }}</span> |
| 155 | 129 | </el-option> |
| 156 | 130 | </el-select> |
| 157 | - | |
| 158 | 131 | <el-row> |
| 159 | 132 | <el-button type="primary" size="mini" @click="batchEditProduct('limitBuyCount')">限购</el-button> |
| 160 | 133 | <el-button type="primary" size="mini" @click="batchEditProduct('seckillPrice')">秒杀价</el-button> |
| 161 | 134 | <el-button type="primary" size="mini" @click="batchEditProduct('seckillStock')">秒杀库存</el-button> |
| 162 | 135 | </el-row> |
| 163 | - | |
| 164 | 136 | <el-table v-loading="loading" ref="productsTable" :data="form.products"> |
| 165 | 137 | <el-table-column type="selection" width="55"> |
| 166 | 138 | </el-table-column> |
| ... | ... | @@ -177,28 +149,23 @@ |
| 177 | 149 | <el-table-column label="库存" align="center" prop="productStock" /> |
| 178 | 150 | <el-table-column label="限购(0为不限购)" align="center" width="150"> |
| 179 | 151 | <template slot-scope="scope"> |
| 180 | - <el-input-number v-model="scope.row.limitBuyCount" size="mini" controls-position="right" | |
| 181 | - :min="0" :max="10000"> | |
| 152 | + <el-input-number v-model="scope.row.limitBuyCount" size="mini" :min="0" :max="10000"> | |
| 182 | 153 | </el-input-number> |
| 183 | 154 | </template> |
| 184 | 155 | </el-table-column> |
| 185 | - | |
| 186 | 156 | <el-table-column label="秒杀价(元)" align="center" width="150"> |
| 187 | 157 | <template slot-scope="scope"> |
| 188 | - <el-input-number v-model="scope.row.seckillPrice" size="mini" controls-position="right" | |
| 189 | - :precision="2" :min="0" :max="10000"> | |
| 158 | + <el-input-number v-model="scope.row.seckillPrice" size="mini" :precision="2" :min="0" | |
| 159 | + :max="10000"> | |
| 190 | 160 | </el-input-number> |
| 191 | 161 | </template> |
| 192 | 162 | </el-table-column> |
| 193 | - | |
| 194 | - <el-table-column label="秒杀库存" align="center" width="150"> | |
| 163 | + <el-table-column label="秒杀库存" align="center" width="150" prop="seckillStock"> | |
| 195 | 164 | <template slot-scope="scope"> |
| 196 | - <el-input-number v-model="scope.row.seckillStock" size="mini" controls-position="right" | |
| 197 | - :min="0" :max="10000"> | |
| 165 | + <el-input-number v-model="scope.row.seckillStock" size="mini" :min="0" :max="10000"> | |
| 198 | 166 | </el-input-number> |
| 199 | 167 | </template> |
| 200 | 168 | </el-table-column> |
| 201 | - | |
| 202 | 169 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 203 | 170 | <template slot-scope="scope"> |
| 204 | 171 | <el-button size="mini" type="text" icon="el-icon-delete" |
| ... | ... | @@ -208,8 +175,6 @@ |
| 208 | 175 | </el-table-column> |
| 209 | 176 | </el-table> |
| 210 | 177 | </el-form-item> |
| 211 | - | |
| 212 | - | |
| 213 | 178 | </el-form> |
| 214 | 179 | <div slot="footer" class="dialog-footer"> |
| 215 | 180 | <el-button type="primary" @click="submitForm">确 定</el-button> |
| ... | ... | @@ -221,10 +186,9 @@ |
| 221 | 186 | |
| 222 | 187 | <script> |
| 223 | 188 | import { getSkuOptionList } from "@/api/mall/product/sku"; |
| 224 | -import { createSeckillActivity, updateSeckillActivity, deleteSeckillActivity, getSeckillActivity, getSeckillActivityPage, exportSeckillActivityExcel } from "@/api/promotion/seckillActivity"; | |
| 225 | -import { getSeckillTimeList } from "@/api/promotion/seckillTime"; | |
| 226 | -import router from '@/router'; | |
| 227 | -import { PromotionDiscountTypeEnum } from "@/utils/constants"; | |
| 189 | +import { createSeckillActivity, updateSeckillActivity, closeSeckillActivity,deleteSeckillActivity, getSeckillActivity, getSeckillActivityPage, exportSeckillActivityExcel } from "@/api/mall/promotion/seckillActivity"; | |
| 190 | +import { getSeckillTimeList } from "@/api/mall/promotion/seckillTime"; | |
| 191 | +import { deepClone } from "@/utils"; | |
| 228 | 192 | |
| 229 | 193 | export default { |
| 230 | 194 | name: "SeckillActivity", |
| ... | ... | @@ -234,8 +198,6 @@ export default { |
| 234 | 198 | return { |
| 235 | 199 | // 遮罩层 |
| 236 | 200 | loading: true, |
| 237 | - // 导出遮罩层 | |
| 238 | - exportLoading: false, | |
| 239 | 201 | // 显示搜索条件 |
| 240 | 202 | showSearch: true, |
| 241 | 203 | // 总条数 |
| ... | ... | @@ -261,7 +223,7 @@ export default { |
| 261 | 223 | form: { |
| 262 | 224 | skuIds: [], // 选中的 SKU |
| 263 | 225 | products: [], // 商品信息 |
| 264 | - timeIds: [], //选中的秒杀场次id | |
| 226 | + timeId: [], //选中的秒杀场次id | |
| 265 | 227 | }, |
| 266 | 228 | // 商品 SKU 列表 |
| 267 | 229 | productSkus: [], |
| ... | ... | @@ -270,9 +232,8 @@ export default { |
| 270 | 232 | name: [{ required: true, message: "秒杀活动名称不能为空", trigger: "blur" }], |
| 271 | 233 | status: [{ required: true, message: "活动状态不能为空", trigger: "blur" }], |
| 272 | 234 | startAndEndTime: [{ required: true, message: "活动时间不能为空", trigger: "blur" }], |
| 273 | - endTime: [{ required: true, message: "活动结束时间不能为空", trigger: "blur" }], | |
| 274 | 235 | sort: [{ required: true, message: "排序不能为空", trigger: "blur" }], |
| 275 | - timeIds: [{ required: true, message: "秒杀场次不能为空", trigger: "blur" }], | |
| 236 | + timeId: [{ required: true, message: "秒杀场次不能为空", trigger: "blur" }], | |
| 276 | 237 | totalPrice: [{ required: true, message: "订单实付金额,单位:分不能为空", trigger: "blur" }], |
| 277 | 238 | } |
| 278 | 239 | }; |
| ... | ... | @@ -280,17 +241,26 @@ export default { |
| 280 | 241 | created() { |
| 281 | 242 | this.getList(); |
| 282 | 243 | }, |
| 244 | + watch:{ | |
| 245 | + $route: 'getList' | |
| 246 | + }, | |
| 283 | 247 | methods: { |
| 284 | 248 | /** 查询列表 */ |
| 285 | 249 | getList() { |
| 250 | + const timeId = this.$route.params && this.$route.params.timeId; | |
| 251 | + if (timeId) { | |
| 252 | + this.queryParams.timeId = timeId | |
| 253 | + } | |
| 286 | 254 | this.loading = true; |
| 287 | 255 | // 执行查询 |
| 288 | 256 | getSeckillActivityPage(this.queryParams).then(response => { |
| 289 | 257 | this.list = response.data.list; |
| 290 | - console.log(response, "查询返回的秒杀活动列表"); | |
| 291 | 258 | this.total = response.data.total; |
| 292 | 259 | this.loading = false; |
| 293 | 260 | }); |
| 261 | + if (timeId) { | |
| 262 | + this.$route.params.timeId = undefined | |
| 263 | + } | |
| 294 | 264 | // 获得 SKU 商品列表 |
| 295 | 265 | getSkuOptionList().then(response => { |
| 296 | 266 | this.productSkus = response.data; |
| ... | ... | @@ -298,7 +268,6 @@ export default { |
| 298 | 268 | // 获取参与场次列表 |
| 299 | 269 | getSeckillTimeList().then(response => { |
| 300 | 270 | this.seckillTimeList = response.data; |
| 301 | - console.log(this.seckillTimeList, "最终获取的参与场次列表"); | |
| 302 | 271 | }); |
| 303 | 272 | }, |
| 304 | 273 | /** 取消按钮 */ |
| ... | ... | @@ -316,7 +285,7 @@ export default { |
| 316 | 285 | startTime: undefined, |
| 317 | 286 | endTime: undefined, |
| 318 | 287 | sort: undefined, |
| 319 | - timeId: undefined, | |
| 288 | + timeId: [], | |
| 320 | 289 | totalPrice: undefined, |
| 321 | 290 | skuIds: [], |
| 322 | 291 | products: [], |
| ... | ... | @@ -333,6 +302,10 @@ export default { |
| 333 | 302 | this.resetForm("queryForm"); |
| 334 | 303 | this.handleQuery(); |
| 335 | 304 | }, |
| 305 | + /**打开秒杀场次管理页面 */ | |
| 306 | + openSeckillTime() { | |
| 307 | + this.$tab.openPage("秒杀场次管理", "/promotion/seckill-time"); | |
| 308 | + }, | |
| 336 | 309 | /** 新增按钮操作 */ |
| 337 | 310 | handleAdd() { |
| 338 | 311 | this.reset(); |
| ... | ... | @@ -341,14 +314,34 @@ export default { |
| 341 | 314 | }, |
| 342 | 315 | /** 修改按钮操作 */ |
| 343 | 316 | handleUpdate(row) { |
| 344 | - console.log(row, "当前行数据"); | |
| 345 | 317 | this.reset(); |
| 346 | 318 | const id = row.id; |
| 347 | 319 | getSeckillActivity(id).then(response => { |
| 320 | + var timeIdList = response.data.timeId.split(',') | |
| 348 | 321 | this.form = response.data; |
| 322 | + // 修改数据 | |
| 323 | + this.form.startAndEndTime = [response.data.startTime, response.data.endTime]; | |
| 324 | + this.form.timeId = timeIdList.map(item => parseInt(item)) | |
| 325 | + this.form.skuIds = response.data.products.map(item => item.skuId); | |
| 326 | + this.form.products.forEach(product => { | |
| 327 | + // 获得对应的 SKU 信息 | |
| 328 | + const sku = this.productSkus.find(item => item.id === product.skuId); | |
| 329 | + if (!sku) { | |
| 330 | + return; | |
| 331 | + } | |
| 332 | + // 设置商品信息 | |
| 333 | + product.name = sku.name; | |
| 334 | + product.spuName = sku.spuName; | |
| 335 | + product.price = sku.price; | |
| 336 | + product.productStock = sku.stock; | |
| 337 | + this.$set(product,'seckillStock',product.stock); | |
| 338 | + product.seckillPrice = product.seckillPrice !== undefined ? product.seckillPrice / 100 : undefined; | |
| 339 | + | |
| 340 | + }); | |
| 341 | + // 打开弹窗 | |
| 349 | 342 | this.open = true; |
| 350 | - this.title = "修改秒杀活动"; | |
| 351 | - }); | |
| 343 | + this.title = "修改限时折扣活动"; | |
| 344 | + }) | |
| 352 | 345 | }, |
| 353 | 346 | /** 提交按钮 */ |
| 354 | 347 | submitForm() { |
| ... | ... | @@ -360,6 +353,11 @@ export default { |
| 360 | 353 | const data = deepClone(this.form); |
| 361 | 354 | data.startTime = this.form.startAndEndTime[0]; |
| 362 | 355 | data.endTime = this.form.startAndEndTime[1]; |
| 356 | + data.timeId = data.timeId.toString(); | |
| 357 | + data.products.forEach(product => { | |
| 358 | + product.stock = product.seckillStock; | |
| 359 | + product.seckillPrice = product.seckillPrice !== undefined ? product.seckillPrice * 100 : undefined; | |
| 360 | + }); | |
| 363 | 361 | // 修改的提交 |
| 364 | 362 | if (this.form.id != null) { |
| 365 | 363 | updateSeckillActivity(data).then(response => { |
| ... | ... | @@ -377,6 +375,16 @@ export default { |
| 377 | 375 | }); |
| 378 | 376 | }); |
| 379 | 377 | }, |
| 378 | + /** 关闭按钮操作 */ | |
| 379 | + handleClose(row) { | |
| 380 | + const id = row.id; | |
| 381 | + this.$modal.confirm('是否确认关闭秒杀活动编号为"' + id + '"的数据项?').then(function () { | |
| 382 | + return closeSeckillActivity(id); | |
| 383 | + }).then(() => { | |
| 384 | + this.getList(); | |
| 385 | + this.$modal.msgSuccess("关闭成功"); | |
| 386 | + }).catch(() => { }); | |
| 387 | + }, | |
| 380 | 388 | /** 删除按钮操作 */ |
| 381 | 389 | handleDelete(row) { |
| 382 | 390 | const id = row.id; |
| ... | ... | @@ -387,20 +395,6 @@ export default { |
| 387 | 395 | this.$modal.msgSuccess("删除成功"); |
| 388 | 396 | }).catch(() => { }); |
| 389 | 397 | }, |
| 390 | - /** 导出按钮操作 */ | |
| 391 | - handleExport() { | |
| 392 | - // 处理查询参数 | |
| 393 | - let params = { ...this.queryParams }; | |
| 394 | - params.pageNo = undefined; | |
| 395 | - params.pageSize = undefined; | |
| 396 | - this.$modal.confirm('是否确认导出所有秒杀活动数据项?').then(() => { | |
| 397 | - this.exportLoading = true; | |
| 398 | - return exportSeckillActivityExcel(params); | |
| 399 | - }).then(response => { | |
| 400 | - this.$download.excel(response, '秒杀活动.xls'); | |
| 401 | - this.exportLoading = false; | |
| 402 | - }).catch(() => { }); | |
| 403 | - }, | |
| 404 | 398 | /** 批量修改商品秒杀价,秒杀库存,每人限购数量 */ |
| 405 | 399 | batchEditProduct(editType) { |
| 406 | 400 | const selectProducts = this.$refs.productsTable.selection; |
| ... | ... | @@ -459,7 +453,6 @@ export default { |
| 459 | 453 | return; |
| 460 | 454 | } |
| 461 | 455 | // 判断已存在,直接跳过 |
| 462 | - console.log(this.form, "当前form") | |
| 463 | 456 | const product = this.form.products.find(item => item.skuId === skuId); |
| 464 | 457 | if (product) { |
| 465 | 458 | return; | ... | ... |
yudao-ui-admin/src/views/promotion/seckillTime/index.vue renamed to yudao-ui-admin/src/views/mall/promotion/seckill/seckillTime/index.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="app-container"> |
| 3 | 3 | |
| 4 | - <!-- 搜索工作栏 --> | |
| 5 | - <!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> | |
| 6 | - <el-form-item label="秒杀时段名称" prop="name"> | |
| 7 | - <el-input v-model="queryParams.name" placeholder="请输入秒杀时段名称" clearable @keyup.enter.native="handleQuery" /> | |
| 8 | - </el-form-item> | |
| 9 | - | |
| 10 | - <el-form-item label="开始时间点" prop="startTime"> | |
| 11 | - <el-time-picker v-model="queryParams.startTime" placeholder="选择开始时间" value-format="HH:mm:ss" /> | |
| 12 | - </el-form-item> | |
| 13 | - | |
| 14 | - <el-form-item label="结束时间点" prop="endTime"> | |
| 15 | - <el-time-picker v-model="queryParams.endTime" placeholder="选择结束时间" value-format="HH:mm:ss" /> | |
| 16 | - </el-form-item> | |
| 17 | - | |
| 18 | - <el-form-item> | |
| 19 | - <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 20 | - <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 21 | - </el-form-item> | |
| 22 | - </el-form> --> | |
| 23 | - | |
| 24 | 4 | <!-- 操作工具栏 --> |
| 25 | 5 | <el-row :gutter="10" class="mb8"> |
| 26 | 6 | <el-col :span="1.5"> |
| 27 | 7 | <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
| 28 | - v-hasPermi="['promotion:seckill-time:create']">新增</el-button> | |
| 8 | + v-hasPermi="['promotion:seckill-time:create']">新增秒杀时段</el-button> | |
| 29 | 9 | </el-col> |
| 30 | - <!-- <el-col :span="1.5"> | |
| 31 | - <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |
| 32 | - :loading="exportLoading" v-hasPermi="['promotion:seckill-time:export']">导出</el-button> | |
| 33 | - </el-col> --> | |
| 34 | 10 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| 35 | 11 | </el-row> |
| 36 | 12 | |
| ... | ... | @@ -55,6 +31,8 @@ |
| 55 | 31 | </el-table-column> |
| 56 | 32 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 57 | 33 | <template slot-scope="scope"> |
| 34 | + <el-button size="mini" type="text" icon="el-icon-view" @click="handleOpenSeckillActivity(scope.row)"> | |
| 35 | + 查看秒杀活动</el-button> | |
| 58 | 36 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 59 | 37 | v-hasPermi="['promotion:seckill-time:update']">修改</el-button> |
| 60 | 38 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| ... | ... | @@ -62,9 +40,6 @@ |
| 62 | 40 | </template> |
| 63 | 41 | </el-table-column> |
| 64 | 42 | </el-table> |
| 65 | - <!-- 分页组件 --> | |
| 66 | - <!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 67 | - @pagination="getList" /> --> | |
| 68 | 43 | |
| 69 | 44 | <!-- 对话框(添加 / 修改) --> |
| 70 | 45 | <el-dialog :title="title" :visible.sync="open" width="600px" v-dialogDrag append-to-body> |
| ... | ... | @@ -87,7 +62,8 @@ |
| 87 | 62 | </template> |
| 88 | 63 | |
| 89 | 64 | <script> |
| 90 | -import { createSeckillTime, updateSeckillTime, deleteSeckillTime, getSeckillTime, getSeckillTimePage, exportSeckillTimeExcel, getSeckillTimeList } from "@/api/promotion/seckillTime"; | |
| 65 | +import { createSeckillTime, updateSeckillTime, deleteSeckillTime, getSeckillTime, getSeckillTimePage, exportSeckillTimeExcel, getSeckillTimeList } from "@/api/mall/promotion/seckillTime"; | |
| 66 | +import router from "@/router"; | |
| 91 | 67 | import { deepClone } from "@/utils"; |
| 92 | 68 | |
| 93 | 69 | export default { |
| ... | ... | @@ -110,14 +86,6 @@ export default { |
| 110 | 86 | title: "", |
| 111 | 87 | // 是否显示弹出层 |
| 112 | 88 | open: false, |
| 113 | - // 查询参数 | |
| 114 | - // queryParams: { | |
| 115 | - // pageNo: 1, | |
| 116 | - // pageSize: 10, | |
| 117 | - // name: null, | |
| 118 | - // startTime: null, | |
| 119 | - // endTime: null, | |
| 120 | - // }, | |
| 121 | 89 | // 表单参数 |
| 122 | 90 | form: {}, |
| 123 | 91 | // 表单校验 |
| ... | ... | @@ -136,9 +104,7 @@ export default { |
| 136 | 104 | this.loading = true; |
| 137 | 105 | // 执行查询 |
| 138 | 106 | getSeckillTimeList().then(response => { |
| 139 | - console.log(response, "返回的数据") | |
| 140 | 107 | this.list = response.data; |
| 141 | - // this.total = response.data.total; | |
| 142 | 108 | this.loading = false; |
| 143 | 109 | }); |
| 144 | 110 | }, |
| ... | ... | @@ -160,7 +126,6 @@ export default { |
| 160 | 126 | }, |
| 161 | 127 | /** 搜索按钮操作 */ |
| 162 | 128 | handleQuery() { |
| 163 | - // this.queryParams.pageNo = 1; | |
| 164 | 129 | this.getList(); |
| 165 | 130 | }, |
| 166 | 131 | /** 重置按钮操作 */ |
| ... | ... | @@ -168,10 +133,13 @@ export default { |
| 168 | 133 | this.resetForm("queryForm"); |
| 169 | 134 | this.handleQuery(); |
| 170 | 135 | }, |
| 136 | + /**查看当前秒杀时段的秒杀活动 */ | |
| 137 | + handleOpenSeckillActivity(row) { | |
| 138 | + router.push({ name: 'SeckillActivity', params: { timeId: row.id } }) | |
| 139 | + }, | |
| 171 | 140 | /** 新增按钮操作 */ |
| 172 | 141 | handleAdd() { |
| 173 | 142 | this.reset(); |
| 174 | - console.log(this.form, "点击新增时的form"); | |
| 175 | 143 | this.open = true; |
| 176 | 144 | this.title = "添加秒杀时段"; |
| 177 | 145 | }, |
| ... | ... | @@ -224,20 +192,6 @@ export default { |
| 224 | 192 | this.$modal.msgSuccess("删除成功"); |
| 225 | 193 | }).catch(() => { }); |
| 226 | 194 | }, |
| 227 | - /** 导出按钮操作 */ | |
| 228 | - // handleExport() { | |
| 229 | - // // 处理查询参数 | |
| 230 | - // let params = { ...this.queryParams }; | |
| 231 | - // params.pageNo = undefined; | |
| 232 | - // params.pageSize = undefined; | |
| 233 | - // this.$modal.confirm('是否确认导出所有秒杀时段数据项?').then(() => { | |
| 234 | - // this.exportLoading = true; | |
| 235 | - // return exportSeckillTimeExcel(params); | |
| 236 | - // }).then(response => { | |
| 237 | - // this.$download.excel(response, '秒杀时段.xls'); | |
| 238 | - // this.exportLoading = false; | |
| 239 | - // }).catch(() => { }); | |
| 240 | - // } | |
| 241 | 195 | } |
| 242 | 196 | }; |
| 243 | 197 | </script> | ... | ... |