Commit f27cc590 authored by 华国豪's avatar 华国豪 🙄

‘优惠券功能扩展’

parent d1864399
<style>
</style>
<template>
<div class="flexOne page-CouponDetail">
<div class="query-box">
<ul class="user_time_picker">
<li>
<span>
<em>状态</em>
<el-select filterable v-model="msg.useState">
<el-option label="未使用" value="1"></el-option>
<el-option label="已使用" value="2"></el-option>
<el-option label="已作废" value="3"></el-option>
</el-select>
</span>
</li>
<li>
<input
type="button"
class="hollowFixedBtn"
value="查询"
@click="resetPageIndex(),getList()"
>
</li>
</ul>
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>获得途径</th>
<th>获得渠道</th>
<th>使用状态</th>
<th>订单号</th>
<th>订单类型</th>
<th>使用日期</th>
<th>类型</th>
<th>用户</th>
<th>获得日期</th>
<!-- <th>操作</th> -->
</tr>
<tr v-for="(item,index) in DataList" v-loading="loading">
<td>
<span v-if="item.accessType == 1">抽奖</span>
</td>
<td>{{item.acessName}}</td>
<td>
<span v-if="item.useState == 1" style="color: green">未使用</span>
<span v-if="item.useState == 2" style="color: gary">已使用</span>
<span v-if="item.useState == 3" style="color: red">已作废</span>
</td>
<td>
<span v-if="item.orderId === 0">暂无</span>
<span v-else>{{item.orderId}}</span>
</td>
<td>
<span v-if="item.orderType === 0">暂无</span>
<span v-else>
<span v-if="item.orderType == 1">团队</span>
<span v-if="item.orderType == 2">签证</span>
<span v-if="item.orderType == 3">机票</span>
</span>
</td>
<td>{{item.useDate ? item.useDate : '未使用'}}</td>
<td>{{item.couponsType ===1 ? "抵用券" : "折扣券"}}</td>
<td>{{item.userPlatform}}{{item.userName}}</td>
<td>{{item.acessDate}}</td>
<!-- <td>
<el-tooltip class="item" effect="dark" content="修改用户信息" placement="top">
<el-button
type="primary"
icon="el-icon-edit"
circle
@click="outerVisible=true,dialogTitle='修改用户信息',updateData(item),getCompany()"
></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除优惠券" placement="top">
<el-button
v-if="item.couponStatus !== 3"
type="danger"
icon="iconfont icon-img_delete_small"
circle
@click="deleteItem(item)"
></el-button>
</el-tooltip>
</td> -->
</tr>
</table>
<div class="noDataNotice" v-if="DataList.length<1">
<i class="iconfont icon-kong"></i>
<p>没有找到你需要的数据</p>
</div>
<el-pagination
background
@current-change="handleCurrentChange"
v-if="DataList.length>0"
:current-page.sync="currentPage"
layout="total,prev, pager, next, jumper"
:page-size="msg.pageSize"
:total="total"
></el-pagination>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
DataList: [],
msg: {
pageIndex: 1,
pageSize: 15,
couponId: '',
useState: '',
},
currentPage: 1,
total: 0,
};
},
created(){
this.msg.couponId = this.$route.query.couponId
this.msg.useState = this.$route.query.useState
},
mounted() {
let userInfo = this.getLocalStorage();
this.getList();
},
methods: {
getList() {
//获取数据
this.loading = true
this.apiJavaPost("/api/sell/coupon/getCouponAllotList", this.msg, res => {
console.log(res);
if (res.data.resultCode === 1) {
// this.currentPage = res.data.data.pageCount
this.total = res.data.data.count
this.DataList = res.data.data.pageData
} else {
this.$message.error(res.data.message)
}
this.loading = false
}, null);
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
resetPageIndex() {
this.msg.pageIndex = 1;
this.currentPage = 1;
},
}
};
</script>
\ No newline at end of file
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
.zidingyiFz i { .zidingyiFz i {
font-size: 14px !important; font-size: 14px !important;
} }
._couponReceiveCount{
text-decoration: underline;
cursor: pointer;
}
</style> </style>
<template> <template>
<div class="flexOne"> <div class="flexOne">
...@@ -39,12 +43,21 @@ ...@@ -39,12 +43,21 @@
<li> <li>
<span> <span>
<em>所属线路</em> <em>所属线路</em>
<el-select filterable v-model="msg.lineId"> <el-select filterable v-model="msg.lineId" @change="getLineTeamList(msg.lineId, 2)">
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="0"></el-option>
<el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID"></el-option> <el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID"></el-option>
</el-select> </el-select>
</span> </span>
</li> </li>
<li>
<span>
<em>所属系列</em>
<el-select filterable v-model="msg.lineteamId">
<el-option label="不限" :value="0"></el-option>
<el-option v-for="item in QLineTeamList" :label="item.LtName" :value="item.LtID" :key="item.LtID"></el-option>
</el-select>
</span>
</li>
<li> <li>
<span> <span>
<em>优惠券名称</em> <em>优惠券名称</em>
...@@ -86,6 +99,7 @@ ...@@ -86,6 +99,7 @@
<th>发放数量</th> <th>发放数量</th>
<th>剩余数量</th> <th>剩余数量</th>
<th>线路名称</th> <th>线路名称</th>
<th>系列名称</th>
<th>类型</th> <th>类型</th>
<th>使用条件</th> <th>使用条件</th>
<th>面额</th> <th>面额</th>
...@@ -93,15 +107,19 @@ ...@@ -93,15 +107,19 @@
<th>叠加使用</th> <th>叠加使用</th>
<th>生效日期</th> <th>生效日期</th>
<th>过期日期</th> <th>过期日期</th>
<th>状态</th>
<th>创建人</th> <th>创建人</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
<tr v-for="(item,index) in DataList" v-loading="loading"> <tr v-for="(item,index) in DataList" v-loading="loading">
<td>{{item.couponsName}}</td> <td>{{item.couponsName}}</td>
<td>{{item.couponCount}}</td> <td>{{item.couponCount}}</td>
<td>{{item.couponReceiveCount}}</td> <td>
<span class="_couponReceiveCount" @click="item.couponReceiveCount === 0 ? '' : goDetail('CouponDetail', item)">{{item.couponReceiveCount}}</span>
</td>
<td>{{(item.couponCount - item.couponReceiveCount) > 0 ? (item.couponCount - item.couponReceiveCount) : 0 }}</td> <td>{{(item.couponCount - item.couponReceiveCount) > 0 ? (item.couponCount - item.couponReceiveCount) : 0 }}</td>
<td>{{item.lineId <= 0 ? '不限' : item.lineName}}</td> <td>{{item.lineId <= 0 ? '不限' : item.lineName}}</td>
<td>{{item.lineteamId <= 0 ? '不限' : item.lineTeamName}}</td>
<td>{{item.couponsType ===1 ? "抵用券" : "折扣券"}}</td> <td>{{item.couponsType ===1 ? "抵用券" : "折扣券"}}</td>
<td>{{item.useCondition}}</td> <td>{{item.useCondition}}</td>
<td>{{item.denomination}}</td> <td>{{item.denomination}}</td>
...@@ -109,6 +127,11 @@ ...@@ -109,6 +127,11 @@
<td>{{item.overlapUse === 0 ? "不允许" : "允许"}}</td> <td>{{item.overlapUse === 0 ? "不允许" : "允许"}}</td>
<td>{{item.effectDate}}</td> <td>{{item.effectDate}}</td>
<td>{{item.expirationDate}}</td> <td>{{item.expirationDate}}</td>
<td>
<span v-if="item.couponStatus == 1" style="color: green">正常</span>
<span v-if="item.couponStatus == 2" style="color: gray">禁用</span>
<span v-if="item.couponStatus == 3" style="color: red">删除</span>
</td>
<td>{{item.createUserName}}</td> <td>{{item.createUserName}}</td>
<td> <td>
<el-tooltip class="item" effect="dark" content="修改用户信息" placement="top"> <el-tooltip class="item" effect="dark" content="修改用户信息" placement="top">
...@@ -119,6 +142,15 @@ ...@@ -119,6 +142,15 @@
@click="outerVisible=true,dialogTitle='修改用户信息',updateData(item),getCompany()" @click="outerVisible=true,dialogTitle='修改用户信息',updateData(item),getCompany()"
></el-button> ></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip class="item" effect="dark" content="删除优惠券" placement="top">
<el-button
v-if="item.couponStatus !== 3"
type="danger"
icon="iconfont icon-img_delete_small"
circle
@click="deleteItem(item)"
></el-button>
</el-tooltip>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -162,15 +194,6 @@ ...@@ -162,15 +194,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</td> </td>
<td>
<el-form-item label="线路" prop="lineId">
<el-select filterable v-model="addMsg.lineId">
<el-option label="不限" :value="-1"></el-option>
<el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID"></el-option>
</el-select>
</el-form-item>
</td>
</tr>
<td> <td>
<el-form-item label="优惠券名称" prop="couponsName"> <el-form-item label="优惠券名称" prop="couponsName">
<el-input <el-input
...@@ -182,11 +205,20 @@ ...@@ -182,11 +205,20 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr>
<td> <td>
<el-form-item label="叠加使用" prop="overlapUse"> <el-form-item label="线路" prop="lineId">
<el-select filterable v-model="addMsg.overlapUse" class="w217"> <el-select filterable v-model="addMsg.lineId" @change="getLineTeamList(addMsg.lineId)">
<el-option label="不允许" :value="0"></el-option> <el-option label="不限" :value="0"></el-option>
<el-option label="允许" :value="1"></el-option> <el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID"></el-option>
</el-select>
</el-form-item>
</td>
<td>
<el-form-item label="系列" prop="lineteamId">
<el-select filterable v-model="addMsg.lineteamId">
<el-option label="不限" :value="0"></el-option>
<el-option v-for="item in LineTeamList" :label="item.LtName" :value="item.LtID" :key="item.LtID"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</td> </td>
...@@ -247,6 +279,37 @@ ...@@ -247,6 +279,37 @@
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
<tr>
<td>
<el-form-item label="叠加使用" prop="overlapUse">
<el-select filterable v-model="addMsg.overlapUse" class="w217">
<el-option label="不允许" :value="0"></el-option>
<el-option label="允许" :value="1"></el-option>
</el-select>
</el-form-item>
</td>
<td>
<el-form-item label="状态">
<el-select filterable v-model="addMsg.couponStatus">
<el-option label="正常" :value="1"></el-option>
<el-option label="禁用" :value="2"></el-option>
<el-option label="作废" :value="3"></el-option>
</el-select>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="适用范围">
<el-select filterable v-model="addMsg.couponsUseScope">
<el-option label="通用" :value="1"></el-option>
<el-option label="团队" :value="2"></el-option>
<el-option label="签证" :value="3"></el-option>
<el-option label="机票" :value="4"></el-option>
</el-select>
</el-form-item>
</td>
</tr>
</table> </table>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -277,7 +340,8 @@ export default { ...@@ -277,7 +340,8 @@ export default {
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
lineId: -1, lineId: 0,
lineteamId: 0,
couponsName: '', couponsName: '',
couponsType: -1, couponsType: -1,
couponStatus: -1, couponStatus: -1,
...@@ -300,12 +364,15 @@ export default { ...@@ -300,12 +364,15 @@ export default {
couponsType: 1, couponsType: 1,
groupId: "", groupId: "",
branchId: "", branchId: "",
lineId: "", lineId: 0,
denomination: "", denomination: "",
overlapUse: 0, overlapUse: 0,
useCondition: "", useCondition: "",
id: 0, id: 0,
couponCount: '', couponCount: '',
lineteamId: 0,
couponsUseScope: 1,
couponStatus: 1,
}, },
pwdMsg: { pwdMsg: {
Id: "", Id: "",
...@@ -325,6 +392,8 @@ export default { ...@@ -325,6 +392,8 @@ export default {
departMentList: [], departMentList: [],
PostList: [], PostList: [],
groupId: '', groupId: '',
LineTeamList: [],
QLineTeamList: [],
}; };
}, },
mounted() { mounted() {
...@@ -372,6 +441,17 @@ export default { ...@@ -372,6 +441,17 @@ export default {
this.loading = false this.loading = false
}, null); }, null);
}, },
// 跳转优惠券发放详情
goDetail: function (path, item) {
this.$router.push({
name: path,
query: {
couponId: item.id,
useState: item.couponStatus,
blank: "y",
}
});
},
maxValue: function (val) { maxValue: function (val) {
if (this.addMsg.couponsType === 2 && val >= 9.99) { if (this.addMsg.couponsType === 2 && val >= 9.99) {
this.addMsg.denomination = 9.99 this.addMsg.denomination = 9.99
...@@ -409,7 +489,26 @@ export default { ...@@ -409,7 +489,26 @@ export default {
} }
}) })
}, },
//获取系列列表
getLineTeamList (LineID, type) {
let msg = {
lineID: LineID,
isTOOP: 1
}
this.apipost('team_post_GetList', msg, res => {
if (res.data.resultCode == 1) {
if (type) {
this.QLineTeamList = res.data.data
} else {
this.LineTeamList = res.data.data
}
}
})
},
// 修改
updateData(item) { updateData(item) {
this.getLineTeamList(item.lineId)
console.log(item)
this.addMsg.couponsName= item.couponsName this.addMsg.couponsName= item.couponsName
this.addMsg.effectDate= item.effectDate this.addMsg.effectDate= item.effectDate
this.addMsg.expirationDate= item.expirationDate this.addMsg.expirationDate= item.expirationDate
...@@ -422,8 +521,33 @@ export default { ...@@ -422,8 +521,33 @@ export default {
this.addMsg.useCondition= item.useCondition this.addMsg.useCondition= item.useCondition
this.addMsg.id= item.id this.addMsg.id= item.id
this.addMsg.couponCount = item.couponCount this.addMsg.couponCount = item.couponCount
this.addMsg.lineteamId = item.lineteamId
this.addMsg.couponsUseScope = item.couponsUseScope
this.addMsg.couponStatus = item.couponStatus
this.isleaveBtn = true; this.isleaveBtn = true;
}, },
// 删除
deleteItem: function (item) {
this.$confirm('确定删除“'+ item.couponsName +'”优惠券?删除后不可恢复!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.apiJavaPost("/api/sell/coupon/updateUserCouponUseState", {couponAllotId: item.id, useState: 3,}, res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message)
}
}, null);
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getList(); this.getList();
...@@ -463,12 +587,15 @@ export default { ...@@ -463,12 +587,15 @@ export default {
couponsType: 1, couponsType: 1,
groupId: this.groupId, groupId: this.groupId,
branchId: "", branchId: "",
lineId: "", lineId: 0,
denomination: "", denomination: "",
overlapUse: 0, overlapUse: 0,
useCondition: "", useCondition: "",
id: 0, id: 0,
couponCount: '', couponCount: '',
lineteamId: 0,
couponsUseScope: 1,
couponStatus: 1,
} }
} }
} }
......
...@@ -165,7 +165,14 @@ ...@@ -165,7 +165,14 @@
@click="goUrl(item)" @click="goUrl(item)"
></el-button> ></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip class="item" effect="dark" content="删除活动" placement="top">
<el-button
type="danger"
icon="iconfont icon-img_delete_small"
circle
@click="deleteItem(item)"
></el-button>
</el-tooltip>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -480,6 +487,28 @@ export default { ...@@ -480,6 +487,28 @@ export default {
this.addMsg.lotteryRules = item.lotteryRules, this.addMsg.lotteryRules = item.lotteryRules,
this.addMsg.image = item.image this.addMsg.image = item.image
}, },
// 删除抽奖
deleteItem: function (item) {
this.$confirm('确定删除“'+ item.lotteryName +'”活动?删除后不可恢复!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.apiJavaPost("/api/sell/lottery/updateLotteryStatus", {lotteryId: item.id, status: 3,}, res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message)
}
}, null);
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
//跳转至获取抽奖奖项信息列表 //跳转至获取抽奖奖项信息列表
goUrl(item){ goUrl(item){
this.$router.push({ this.$router.push({
......
...@@ -2801,6 +2801,14 @@ export default { ...@@ -2801,6 +2801,14 @@ export default {
title: '优惠券列表' title: '优惠券列表'
} }
}, },
{
path: '/CouponDetail',
name: 'CouponDetail',
component: resolve => require(['@/components/activity/CouponDetail'], resolve),
meta: {
title: '优惠券发放列表'
}
},
{ {
path: '/LuckyDraw', path: '/LuckyDraw',
name: 'LuckyDraw', name: 'LuckyDraw',
......
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