提交 08f6250e 作者: 郁骅焌

审核优惠券列表

上级 11bad5e9
......@@ -214,7 +214,18 @@
>
<template slot-scope="scope">
<div class="operator-btn" :style="table.operatorConfig && table.operatorConfig.style">
<el-button
<template v-for="(item, index) in operatorButtons">
<el-button
v-if="checkIsShow(scope, item)"
:key="index"
:type="item.type || 'text'"
:style="item.style"
:icon="item.icon"
:size="item.size || 'small'"
@click="item.fun && item.fun(scope.row, scope.$index, table.data)"
>{{ item.text }}</el-button>
</template>
<!-- <el-button
v-for="(item, index) in operatorButtons"
v-show="checkIsShow(scope, item)"
:key="index"
......@@ -223,7 +234,7 @@
:icon="item.icon"
:size="item.size || 'small'"
@click="item.fun && item.fun(scope.row, scope.$index, table.data)"
>{{ item.text }}</el-button>
>{{ item.text }}</el-button> -->
<el-dropdown
v-if="operatorMoreButtons.length > 0"
......
import request from '@/utils/request'
// 查询列表
export function listAudit(query) {
return request({
url: '/coupon/coupon/list',
method: 'get',
params: query
})
}
// 查询详细
export function auditDetail(id) {
return request({
url: '/coupon/coupon/' + id,
method: 'get'
})
}
......@@ -145,6 +145,19 @@ export const constantRoutes = [
meta: { title: '修改生成配置', activeMenu: '/tool/gen'}
}
]
},
{
path: '/coupon',
component: Layout,
hidden: true,
children: [
{
path: 'couponAuditDetail/:couponDetailId(\\d+)',
component: (resolve) => require(['@/views/coupon/audit/detail'], resolve),
name: 'AuthRole',
meta: { title: '详情', activeMenu: '/coupon/couponAudit'}
}
]
}
]
......
<template>
<div>111</div>
</template>
<script>
export default {
name: 'CouponAuditDetail'
}
</script>
<style>
</style>
<template>
<div class="app-container">
<xy-table ref="tableRef" :table="table" :columns="columns">
<template #couponType="{ scope }">
<dict-tag :options="dict.type.coupon_type" :value="scope.row.couponType"/>
</template>
<template #validityType="{ scope }">
{{scope.row.validityType === '1' ? `${scope.row.validityStartDate} ~ ${scope.row.validityEndDate}` : `领取后${scope.row.validityNum}天内`}}
</template>
<template #examineStatus="{ scope }">
<dict-tag :options="dict.type.examine_status" :value="scope.row.examineStatus"/>
</template>
</xy-table>
<!-- 添加或修改岗位对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="分类名称" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入分类名称" />
</el-form-item>
<el-form-item label="是否前端展示" prop="isShow">
<el-radio-group v-model="form.isShow">
<el-radio
v-for="dict in dict.type.classify_isshow"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listAudit, auditDetail } from '@/api/coupon/audit'
export default {
name: 'CouponAudit',
dicts: ['coupon_type', 'examine_status'],
data() {
return {
open: false,
title: undefined,
form: {
id: undefined,
categoryName: undefined,
isShow: '0'
},
rules: {
categoryName: [
{ required: true, message: "分类名称不能为空", trigger: "blur" }
]
},
table: {
rowKey: 'id',
data: [],
firstColumn: { type: 'index' },
// hiddenLine: true,
// 表格内操作列
operator: [
{
text: '审核',
icon: 'el-icon-edit',
noShow: [{key: 'examineStatus', val: [1, 2]}],
fun: (row) => this.handleEdit(row)
},
{
text: '查看',
icon: 'el-icon-delete',
noShow: [{key: 'examineStatus', val: [0]}],
fun: (row) => this.handleDetail(row)
}
],
// 操作列样式
operatorConfig: {
width: 140
},
// 表格外操作
toolbar: [
// {
// text: '新增分类',
// icon: 'el-icon-plus',
// type: 'primary',
// fun: () => this.handleAdd()
// }
],
// 分页配置
page: {
total: 0,
pageNum: 1,
pageSize: 10
},
// 搜索表单配置
searchForm: {
formLabelWidth: '90px',
formData: {
couponTitle: undefined,
examineStatus: undefined
},
fieldList: [
{ prop: 'couponTitle', label: '优惠券标题', type: 'input' },
{ prop: 'examineStatus', label: '状态', type: 'select', options: 'examineStatusOptions' }
],
// 相关下拉列表
listOptions: {
examineStatusOptions: []
}
},
// 请求
request: listAudit
},
columns: [
{ prop: 'couponTitle', label: '优惠券标题' },
{ prop: 'couponType', label: '优惠券类型', slotName: 'couponType' },
{ prop: 'categoryName', label: '优惠券分类'},
{ prop: 'validityType', label: '有效期', slotName: 'validityType', minWidth: 200},
{ prop: 'createTime', label: '创建时间'},
{ prop: 'createBy', label: '创建人'},
{ prop: 'examineStatus', label: '状态', slotName: 'examineStatus'},
{ prop: 'examinePerson', label: '审核人'},
{ prop: 'examineTime', label: '审核时间'},
]
}
},
mounted() {
this.initOptions()
},
methods: {
initOptions() {
this.table.searchForm.listOptions.examineStatusOptions = this.dict.type.examine_status
},
/** 查询列表 */
getList() {
this.$refs.tableRef.getData()
},
/** 新增按钮操作 */
handleAdd() {
},
/** 编辑按钮操作 */
handleEdit(row) {
},
/** 删除按钮操作 */
async handleDelete(row) {
},
// 查询详情
handleDetail(row) {
this.$router.push({ path: '/coupon/couponAuditDetail/' + row.couponDetailId })
}
}
}
</script>
<style>
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论