Commit 9f52667c by lixiaomin

优惠券领取信息列表

parent 86005f80
......@@ -52,10 +52,10 @@ export function onlineCoupon(id) {
});
}
// 赠送优惠券
export function giveCoupon(data) {
// 用户领取优惠券列表
export function getCouponInfoList(data) {
return request({
url: "/coupon-user/give",
url: "/coupon-user/list",
method: "post",
data: data,
});
......
......@@ -21,11 +21,11 @@
</el-form>
<el-table v-loading="loading" :data="customerList">
<el-table-column label="用户" align="center" prop="userName" >
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<a myattr="mcv" v-hasPermi="['system:customer:view']">
<span @click="getDetial(scope.row)" style="color: blue"> {{ scope.row.userName }}</span>
</a>
</template>
</template> -->
</el-table-column>
<el-table-column label="手机号" align="center" prop="phoneNumber"/>
<el-table-column label="订单量" align="center" prop="orderCount"/>
......@@ -137,7 +137,7 @@ export default {
this.$message.error("请选择需要赠送的优惠券!");
return;
}
giveCoupon({"userId":userId,"couponId":couponId}).then((response) => {
giveCoupon({"custId":userId,"couponId":couponId}).then((response) => {
if(response.code==200){
this.$modal.msgSuccess("赠送成功");
this.giveOpen = false;
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="分类名称 ">
<el-input v-model="queryParams.name" placeholder="请输入分类名称" clearable @keyup.enter.native="handleQuery" />
<el-form-item label="优惠券名称 ">
<el-input v-model="queryParams.name" placeholder="请输入优惠券名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="优惠券类别">
<el-select v-model="queryParams.categoryId" placeholder="请选择优惠券类别" clearable @keyup.enter.native="handleQuery">
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="优惠券类别" >
<el-input v-model="queryParams.name" clearable @keyup.enter.native="handleQuery"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="queryParams.state" placeholder="请选择状态" clearable @keyup.enter.native="handleQuery">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" v-hasPermi="['coupon:category:query']">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="couponInfoList">
<el-table-column label="用户名" align="center" prop="custName">
<template slot-scope="scope">
<a @click="handleUpdate(scope.row)" style="color: blue">{{ scope.row.custName }}</a>
</template>
</el-table-column>
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="用户手机号" align="center" prop="custPhone" />
<el-table-column label="领取优惠券名称" align="center" prop="couponName" />
<el-table-column label="领取入口" align="center" prop="source"/>
<el-table-column label="触发事件" align="center" prop="typeDesc"/>
<el-table-column label="领取时间" align="center" prop="receiveTime"/>
<el-table-column label="优惠券适用时间" align="center" >
<template slot-scope="scope">
{{formateTime(scope.row.startTime)}}~{{formateTime(scope.row.expiredTime)}}
</template>
</el-table-column>
<el-table-column label="优惠券状态" align="center" prop="stateDesc"/>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
<script>
import {getCouponInfoList} from "@/api/coupon/coupon";
export default {
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 表格数据
couponInfoList: [],
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
state: null
},
options: [{
value: null,
label: '全部'
},{
value: '1',
label: '生效中'
},{
value: '2',
label: '未生效'
}],
};
},
created() {
this.getList();
},
methods: {
formateTime(val){
let index =val.indexOf(":");
val=val.substring(0, index-3);
console.log("val",val);
return val;
},
/** 查询列表 */
getList() {
this.loading = true;
getCouponInfoList(this.queryParams).then((response) => {
this.couponInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.name=null;
this.queryParams.state=null;
this.handleQuery();
},
},
};
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment