11.6
This commit is contained in:
parent
8e3d5b15ac
commit
673b6ad10a
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 查询兑换券列表
|
||||
export function listExchange(query) {
|
||||
return request({
|
||||
url: '/system/exchange/list',
|
||||
url: 'business/marketingActivity/cardExchange',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@ -20,7 +20,7 @@ export function getExchange(id) {
|
||||
// 新增兑换券
|
||||
export function addExchange(data) {
|
||||
return request({
|
||||
url: '/system/exchange',
|
||||
url: 'business/marketingActivity/cardExchange',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
@ -228,7 +228,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listExchange, getExchange, delExchange, addExchange, updateExchange } from "@/api/system/exchange";
|
||||
// import { listExchange, getExchange, delExchange, addExchange, updateExchange } from "@/api/system/exchange";
|
||||
|
||||
export default {
|
||||
name: "Exchange",
|
||||
|
@ -314,8 +314,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/system/record";
|
||||
|
||||
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/EventMarketing/cardExchange";
|
||||
export default {
|
||||
name: "Record",
|
||||
data() {
|
||||
|
@ -53,26 +53,29 @@
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- -->
|
||||
<!-- </template>-->
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="优惠类型"
|
||||
width="100">
|
||||
<el-tag>优惠券</el-tag>
|
||||
</el-table-column>
|
||||
<el-table-column label="券详情">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="满减金额"
|
||||
width="120">
|
||||
满 <el-tag effect="plain">290</el-tag> 元
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="优惠券金额"
|
||||
width="120">
|
||||
减 <el-tag type="success" effect="plain">50</el-tag> 元
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
prop="date"
|
||||
label="有效期(天)"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
@ -99,6 +102,7 @@
|
||||
prop="date"
|
||||
label="二维码"
|
||||
width="100">
|
||||
<i class="el-icon-picture"></i>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
|
@ -1,15 +1,357 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
orange
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="兑换券名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="" prop="isonline">
|
||||
<el-select v-model="queryParams.isonline" placeholder="是否在线">
|
||||
<el-option label="在线" value="0"></el-option>
|
||||
<el-option label="下线" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="兑换券状态">
|
||||
<el-option label="启用" value="0"></el-option>
|
||||
<el-option label="禁用" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="兑换券类型">
|
||||
<el-option label="兑换券" value="0"></el-option>
|
||||
<el-option label="洗车券" value="1"></el-option>
|
||||
<el-option label="洗车卡" value="2"></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-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:exchange:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:exchange:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:exchange:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="exchangeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" />
|
||||
<el-table-column label="所属连锁店id" align="center" prop="chainStorId" />
|
||||
<el-table-column label="所属店铺id" align="center" prop="storeId" />
|
||||
<el-table-column label="是否在线 0:在线 1: 下线" align="center" prop="isonline" />
|
||||
<el-table-column label="兑换券状态 0:启用 1: 禁用" align="center" prop="status" />
|
||||
<el-table-column label="兑换券名称" align="center" prop="name" />
|
||||
<el-table-column label="兑换券类型 0:兑换券 1:洗车券 2:洗车卡" align="center" prop="type" />
|
||||
<el-table-column label="兑换礼品名" align="center" prop="giftName" />
|
||||
<el-table-column label="卡券有效期" align="center" prop="validity" />
|
||||
<el-table-column label="使用说明" align="center" prop="useInstructions" />
|
||||
<el-table-column label="二维码链接" align="center" prop="qrCodeLink" />
|
||||
<el-table-column label="参与次数" align="center" prop="count" />
|
||||
<el-table-column label="到期时间" align="center" prop="outTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改兑换券对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="40%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<!-- <el-form-item label="所属连锁店id" prop="chainStorId">-->
|
||||
<!-- <el-input v-model="form.chainStorId" placeholder="请输入所属连锁店id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="所属店铺id" prop="storeId">-->
|
||||
<!-- <el-input v-model="form.storeId" placeholder="请输入所属店铺id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="兑换券名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入兑换券名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换券类型" prop="type">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio label="0">兑换券</el-radio>
|
||||
<el-radio label="1">洗车券</el-radio>
|
||||
<el-radio label="2">洗车卡</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换礼品名" prop="giftName">
|
||||
<el-input type="textarea" v-model="form.giftName" placeholder="请输入兑换礼品名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="卡券有效期" prop="validity">
|
||||
<el-input placeholder="请输入卡券有效期" v-model="form.validity">
|
||||
<template slot="append">天</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用说明" prop="useInstructions">
|
||||
<el-input type="textarea" v-model="form.useInstructions" placeholder="请输入使用说明"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与次数" prop="count">
|
||||
<el-input-number v-model="form.count" controls-position="right" :min="1" :max="999"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="0">启用</el-radio>
|
||||
<el-radio label="1">禁用</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 { listExchange, getExchange, delExchange, addExchange, updateExchange } from "@/api/EventMarketing/cardExchange";
|
||||
export default {
|
||||
name: 'index'
|
||||
name: "Exchange",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 兑换券表格数据
|
||||
exchangeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
chainStorId: null,
|
||||
storeId: null,
|
||||
isonline: null,
|
||||
status: null,
|
||||
name: null,
|
||||
type: null,
|
||||
giftName: null,
|
||||
validity: null,
|
||||
useInstructions: null,
|
||||
qrCodeLink: null,
|
||||
count: null,
|
||||
outTime: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入兑换券名称', trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请输入兑换券类型', trigger: 'change' }
|
||||
],
|
||||
giftName: [
|
||||
{ required: true, message: '请输入兑换礼品名', trigger: 'change' }
|
||||
],
|
||||
validity: [
|
||||
{ required: true, message: '请输入卡券有效期', trigger: 'change' }
|
||||
],
|
||||
useInstructions: [
|
||||
{ required: true, message: '请输入使用说明', trigger: 'change' }
|
||||
],
|
||||
count: [
|
||||
{ required: true, message: '请输入参与次数', trigger: 'change' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
],
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询兑换券列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExchange(this.queryParams).then(response => {
|
||||
this.exchangeList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
chainStorId: null,
|
||||
storeId: null,
|
||||
isonline: null,
|
||||
status: null,
|
||||
name: null,
|
||||
type: null,
|
||||
giftName: null,
|
||||
validity: null,
|
||||
useInstructions: null,
|
||||
qrCodeLink: null,
|
||||
count: null,
|
||||
outTime: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加兑换券";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.form = row;
|
||||
this.open = true;
|
||||
this.title = "修改兑换券";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateExchange(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addExchange(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除兑换券编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delExchange(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/exchange/export', {
|
||||
...this.queryParams
|
||||
}, `exchange_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user