|
@@ -2,29 +2,35 @@
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<el-form size="mini">
|
|
<el-form size="mini">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="primary" icon="el-icon-plus" @click="getDetail()" v-hasPermi="['registration:lottery:add']">新增</el-button>
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="getDetail()"
|
|
|
|
+ v-hasPermi="['registration:lottery:add']">新增</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<el-table :data="tableData">
|
|
<el-table :data="tableData">
|
|
<el-table-column label="序号" type="index" align="center" />
|
|
<el-table-column label="序号" type="index" align="center" />
|
|
<el-table-column label="活动名称" prop="name" align="center" />
|
|
<el-table-column label="活动名称" prop="name" align="center" />
|
|
- <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
|
|
|
|
<el-table-column label="活动时间" align="center">
|
|
<el-table-column label="活动时间" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- {{ scope.row.startTime }} 至 {{ scope.row.endTime }}
|
|
|
|
|
|
+ {{ scope.row.startTime }} - {{ scope.row.endTime }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="活动状态" prop="currentStatus" align="center" :formatter="currentFormatter" />
|
|
<el-table-column label="活动状态" prop="currentStatus" align="center" :formatter="currentFormatter" />
|
|
|
|
+ <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
|
|
<el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
|
|
- <span v-if="scope.row.status === 1">
|
|
|
|
- <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['registration:lottery:edit']" style="margin-left: 10px">编辑</el-button>
|
|
|
|
- <el-button type="text" @click="getChange(scope.row, 0)" v-hasPermi="['registration:lottery:up']">启用</el-button>
|
|
|
|
- <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['registration:lottery:delete']">删除</el-button>
|
|
|
|
|
|
+ <span v-if="scope.row.status === 1" style="margin: 0 10px;">
|
|
|
|
+ <el-button type="text" @click="getDetail(scope.row.id)"
|
|
|
|
+ v-hasPermi="['registration:lottery:edit']">编辑</el-button>
|
|
|
|
+ <el-button type="text" @click="getChange(scope.row, 0)"
|
|
|
|
+ v-hasPermi="['registration:lottery:up']">上架</el-button>
|
|
|
|
+ <el-button type="delete" @click="getDelete(scope.row)"
|
|
|
|
+ v-hasPermi="['registration:lottery:delete']">删除</el-button>
|
|
</span>
|
|
</span>
|
|
- <el-button v-else type="delete" @click="getChange(scope.row, 1)" v-hasPermi="['registration:lottery:down']">禁用</el-button>
|
|
|
|
|
|
+ <el-button v-else type="text" @click="getChange(scope.row, 1)"
|
|
|
|
+ v-hasPermi="['registration:lottery:down']">下架</el-button>
|
|
|
|
+ <el-button type="text" @click="getCopy(scope.row.id)">复制</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -32,7 +38,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { list, change, remove } from '@/api/registration/lottery'
|
|
|
|
|
|
+import { list, change, remove, copy } from '@/api/registration/lottery'
|
|
import { disabledMixin, currentMixin } from '@/mixin/index'
|
|
import { disabledMixin, currentMixin } from '@/mixin/index'
|
|
export default {
|
|
export default {
|
|
mixins: [disabledMixin, currentMixin],
|
|
mixins: [disabledMixin, currentMixin],
|
|
@@ -80,7 +86,7 @@ export default {
|
|
|
|
|
|
// 上下架
|
|
// 上下架
|
|
getChange(row, status) {
|
|
getChange(row, status) {
|
|
- let title = status === 0 ? '启用' : '禁用'
|
|
|
|
|
|
+ let title = status === 0 ? '上架' : '下架'
|
|
this.$confirm(`是否${title}${row.name}?`, '提示', {
|
|
this.$confirm(`是否${title}${row.name}?`, '提示', {
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
@@ -112,6 +118,22 @@ export default {
|
|
}).catch(() => { })
|
|
}).catch(() => { })
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 复制
|
|
|
|
+ getCopy(id) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: `/registration/lotteryConfig/detail`,
|
|
|
|
+ query: {
|
|
|
|
+ copyId: id
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // copy(id).then(res => {
|
|
|
|
+ // if (res.code === 0) {
|
|
|
|
+ // this.$message.success(`复制成功!`)
|
|
|
|
+ // this.getList()
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ },
|
|
|
|
+
|
|
// 字典翻译
|
|
// 字典翻译
|
|
statusFormatter(row) {
|
|
statusFormatter(row) {
|
|
return this.selectDictLabel(this.disabledOptions, row.status)
|
|
return this.selectDictLabel(this.disabledOptions, row.status)
|