|
@@ -0,0 +1,121 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="姓名">
|
|
|
+ <el-input v-model="queryParams['user.name']" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="手机号">
|
|
|
+ <el-cascader v-model="queryParams['user.phone']" :options="voucher_category" :props="{emitPath:false}"></el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="群体">
|
|
|
+ <el-select v-model="queryParams['user.tags']" placeholder="请选择">
|
|
|
+ <el-option v-for="dict in dict.type.user_tags" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="taskList">
|
|
|
+ <el-table-column label="姓名" align="center" prop="user.name" />
|
|
|
+ <el-table-column label="手机号" align="center" prop="user.phone" />
|
|
|
+ <el-table-column label="群体" align="center" prop="user.tags" />
|
|
|
+ <el-table-column label="代金券种类" align="center" prop="voucher.category" />
|
|
|
+ <el-table-column label="面额" align="center" prop="voucher.money" />
|
|
|
+ <el-table-column label="状态" align="center" prop="status" />
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ import { listVoucher } from "@/api/goods/voucher/index";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: "voucher",
|
|
|
+ dicts: ['tags'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: false,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 检测代金券管理表格数据
|
|
|
+ taskList: [],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+ voucher_category: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ // this.getList();
|
|
|
+ const dict = await this.getDicts('voucher_category');
|
|
|
+ dict.data = dict.data.map(e => ({ ...e, label: e.dictLabel, value: e.dictValue }))
|
|
|
+ this.voucher_category = dict.data.filter(e => !e.remark).map(e => {
|
|
|
+ const children = dict.data.filter(j => j.remark == e.dictValue);
|
|
|
+ if (children.length > 0) e.children = children;
|
|
|
+ return e;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询检测代金券管理列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listVoucher(this.queryParams).then(response => {
|
|
|
+ this.taskList = response.rows.map(e => {
|
|
|
+ const dict = this.dict.type.voucher_category.find(j => j.dictValue == e.category)
|
|
|
+ if (dict) e.categoryText = dict.dictLabel;
|
|
|
+ return e;
|
|
|
+ });
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('system/user/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `user_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ }
|
|
|
+ };
|
|
|
+ </script>
|
|
|
+
|