This commit is contained in:
@QQNZX 2023-11-16 10:55:35 +08:00
parent 758442ff37
commit f0342e4544
9 changed files with 673 additions and 106 deletions

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询折扣营销列表 // 查询折扣营销列表
export function listActiveDiscount(query) { export function listActiveDiscount(query) {
return request({ return request({
url: '/business/marketingActivity/activeDiscount/list', url: 'business/marketingActivity/activeDiscount',
method: 'get', method: 'get',
params: query params: query
}) })

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询满减营销列表 // 查询满减营销列表
export function listActiveFullminus(query) { export function listActiveFullminus(query) {
return request({ return request({
url: '/business/marketingActivity/activeFullminus/list', url: '/business/marketingActivity/activeFullminus',
method: 'get', method: 'get',
params: query params: query
}) })

View File

@ -38,13 +38,12 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="activeConsumptionList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="activeConsumptionList" @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="id" />
<el-table-column label="活动名称" align="center" prop="name" /> <el-table-column label="活动名称" align="center" prop="name" />
@ -53,22 +52,13 @@
<span>{{ scope.row.participationConditionMoney }} </span> <span>{{ scope.row.participationConditionMoney }} </span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="活动开始时间" align="center" prop="activeStartTime" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.activeStartTime, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="适用会员类型" align="center" prop="adaptUserType" > <el-table-column label="适用会员类型" align="center" prop="adaptUserType" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.adaptUserType == 0">全部用户</span> <span v-if="scope.row.adaptUserType == 0">全部用户</span>
<span v-if="scope.row.adaptUserType == 1">全部会员</span> <span v-if="scope.row.adaptUserType == 1">全部会员</span>
<span v-if="scope.row.adaptUserType == 2">等级会员</span> <span v-if="scope.row.adaptUserType == 2">等级会员</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="柴油会员等级" align="center" prop="dieselUserLevel" > <el-table-column label="柴油会员等级" align="center" prop="dieselUserLevel" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="(item,index) in scope.row.dieselUserLevel "> V{{item}}会员 </span> <span v-for="(item,index) in scope.row.dieselUserLevel "> V{{item}}会员 </span>
@ -85,15 +75,6 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="活动奖品 " align="center" prop="activeGift" >-->
<!-- <template slot-scope="scope">-->
<!-- <span v-if="scope.row.activeGift == 1">赠送优惠券</span>-->
<!-- <span v-if="scope.row.activeGift == 2">赠送兑换券</span>-->
<!-- <span v-if="scope.row.activeGift == 4">赠送实物</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="活动状态" align="center" prop="status" > <el-table-column label="活动状态" align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">

View File

@ -43,13 +43,30 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="activeDiscountList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="activeDiscountList" @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="id" />
<el-table-column label="活动名称" align="center" prop="name" /> <el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="柴油会员等级 " align="center" prop="dieselUserLevel" /> <el-table-column label="柴油会员等级" align="center" prop="dieselUserLevel" >
<el-table-column label="汽油会员等级 " align="center" prop="gasolineUserLevel" /> <template slot-scope="scope">
<el-table-column label="天然气会员等级 " align="center" prop="naturalUserLevel" /> <span v-for="(item,index) in scope.row.dieselUserLevel "> V{{item}}会员 </span>
<el-table-column label="活动状态 " align="center" prop="status" /> </template>
</el-table-column>
<el-table-column label="汽油会员等级" align="center" prop="gasolineUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.gasolineUserLevel "> V{{item}}会员 </span>
</template>
</el-table-column>
<el-table-column label="天然气会员等级 " align="center" prop="naturalUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.naturalUserLevel "> V{{item}}会员 </span>
</template>
</el-table-column>
<el-table-column label="活动状态 " align="center" prop="status" >
<template slot-scope="scope">
<span v-if="scope.row.status == 0" > 启用</span>
<span v-if="scope.row.status == 1" > 禁用</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -59,13 +76,13 @@
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>修改</el-button> >修改</el-button>
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
icon="el-icon-delete" <!-- icon="el-icon-delete"-->
@click="handleDeletexia(scope.row)" <!-- @click="handleDeletexia(scope.row)"-->
v-if="scope.row.isonline == 0" <!-- v-if="scope.row.isonline == 0"-->
>下线</el-button> <!-- >下线</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -79,11 +96,30 @@
/> />
</el-card> </el-card>
<!-- 添加或修改折扣营销对话框 --> <!-- 添加或修改折扣营销对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="45%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="活动名称" prop="name"> <el-form-item label="活动名称" prop="name">
<el-input v-model="form.name" placeholder="请输入活动名称" /> <el-input v-model="form.name" placeholder="请输入活动名称" />
</el-form-item> </el-form-item>
<el-form-item label="满减规则" prop="activeDiscountChildList">
<div v-for="(item,index) in form.activeDiscountChildList" :key="index" style="width: 100%; display: flex;align-items: center; margin-bottom: 10px ">
<div style="width: 25%;display: flex; align-items: center;margin-right: 20px " >
<span></span><el-input v-model="item.amount" placeholder="多少" style="margin: 0px 10px" /> <span></span>
</div>
<div style="width: 25%;display: flex; align-items: center;">
<span></span><el-input v-model="item.discount" placeholder="多少" style="margin: 0px 10px" /><span></span>
</div>
<div @click="deleteactiveDiscountChildList(index)">
<el-button type="danger" icon="el-icon-delete" circle style="margin-left: 8px" ></el-button>
</div>
</div>
<div @click="addactiveDiscountChildList">
<el-button type="primary" icon="el-icon-plus">新增</el-button>
</div>
</el-form-item>
<el-form-item label="活动开始时间" prop="activeStartTime"> <el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable <el-date-picker clearable
v-model="form.activeStartTime" v-model="form.activeStartTime"
@ -182,7 +218,9 @@ export default {
name: "ActiveDiscount", name: "ActiveDiscount",
data() { data() {
return { return {
oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#',], discount:'',
amount:'',
oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#'],
// //
loading: true, loading: true,
// //
@ -227,6 +265,36 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
name: [
{ required: true, message: '不能为空', trigger: 'change' }
],
activeStartTime:[
{ required: true, message: '不能为空', trigger: 'change' }
],
activeEndTime:[
{ required: true, message: '不能为空', trigger: 'change' }
],
adaptOil:[
{ required: true, message: '不能为空', trigger: 'change' }
],
dieselUserLevel:[
{ required: true, message: '不能为空', trigger: 'change' }
],
gasolineUserLevel:[
{ required: true, message: '不能为空', trigger: 'change' }
],
naturalUserLevel:[
{ required: true, message: '不能为空', trigger: 'change' }
],
participationCondition:[
{ required: true, message: '不能为空', trigger: 'change' }
],
participationAcount:[
{ required: true, message: '不能为空', trigger: 'change' }
],
isonline:[
{ required: true, message: '不能为空', trigger: 'change' }
],
} }
}; };
}, },
@ -238,11 +306,24 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listActiveDiscount(this.queryParams).then(response => { listActiveDiscount(this.queryParams).then(response => {
console.log(response)
this.activeDiscountList = response.data.records; this.activeDiscountList = response.data.records;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
}); });
}, },
//
addactiveDiscountChildList(){
let data = {
discount :this.form.activeDiscountChildList.discount,
amount:this.form.activeDiscountChildList.amount,
}
this.form.activeDiscountChildList.push(data)
},
deleteactiveDiscountChildList(index){
this.form.activeDiscountChildList.splice(index, 1)
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -304,6 +385,7 @@ export default {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids
getActiveDiscount(id).then(response => { getActiveDiscount(id).then(response => {
console.log( response.data)
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改折扣营销"; this.title = "修改折扣营销";

View File

@ -43,13 +43,30 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="activeFullminusList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="activeFullminusList" @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="id" />
<el-table-column label="活动名称" align="center" prop="name" /> <el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="柴油会员等级 " align="center" prop="dieselUserLevel" /> <el-table-column label="柴油会员等级" align="center" prop="dieselUserLevel" >
<el-table-column label="汽油会员等级 " align="center" prop="gasolineUserLevel" /> <template slot-scope="scope">
<el-table-column label="天然气会员等级 " align="center" prop="naturalUserLevel" /> <span v-for="(item,index) in scope.row.dieselUserLevel "> V{{item}}会员 </span>
<el-table-column label="活动状态 " align="center" prop="status" /> </template>
</el-table-column>
<el-table-column label="汽油会员等级" align="center" prop="gasolineUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.gasolineUserLevel "> V{{item}}会员 </span>
</template>
</el-table-column>
<el-table-column label="天然气会员等级 " align="center" prop="naturalUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.naturalUserLevel "> V{{item}}会员 </span>
</template>
</el-table-column>
<el-table-column label="活动状态 " align="center" prop="status" >
<template slot-scope="scope">
<span v-if="scope.row.status == 0" > 启用</span>
<span v-if="scope.row.status == 1" > 禁用</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -57,15 +74,15 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['business/marketingActivity:activeFullminus:edit']"
>修改</el-button> >修改</el-button>
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
icon="el-icon-delete" <!-- icon="el-icon-delete"-->
@click="handleDelete(scope.row)" <!-- @click="handleDelete(scope.row)"-->
v-hasPermi="['business/marketingActivity:activeFullminus:remove']" <!-- -->
>下线</el-button> <!-- >下线</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -80,11 +97,30 @@
</el-card> </el-card>
<!-- 添加或修改满减营销对话框 --> <!-- 添加或修改满减营销对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="45%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="活动名称" prop="name"> <el-form-item label="活动名称" prop="name">
<el-input v-model="form.name" placeholder="请输入活动名称" /> <el-input v-model="form.name" placeholder="请输入活动名称" />
</el-form-item> </el-form-item>
<el-form-item label="满减规则" prop="activeDiscountChildList">
<div v-for="(item,index) in form.activeDiscountChildList" :key="index" style="width: 100%; display: flex;align-items: center; margin-bottom: 10px ">
<div style="width: 25%;display: flex; align-items: center;margin-right: 20px " >
<span></span><el-input v-model="item.amount" placeholder="多少" style="margin: 0px 10px" /> <span></span>
</div>
<div style="width: 25%;display: flex; align-items: center;">
<span></span><el-input v-model="item.deductionAmount" placeholder="多少" style="margin: 0px 10px" /><span></span>
</div>
<div @click="deleteactiveDiscountChildList(index)">
<el-button type="danger" icon="el-icon-delete" circle style="margin-left: 8px" ></el-button>
</div>
</div>
<div @click="addactiveDiscountChildList">
<el-button type="primary" icon="el-icon-plus">新增</el-button>
</div>
</el-form-item>
<el-form-item label="活动开始时间" prop="activeStartTime"> <el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable <el-date-picker clearable
v-model="form.activeStartTime" v-model="form.activeStartTime"
@ -183,7 +219,7 @@ export default {
name: "ActiveFullminus", name: "ActiveFullminus",
data() { data() {
return { return {
oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#',], oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#'],
// //
loading: true, loading: true,
// //
@ -211,7 +247,7 @@ export default {
name: null, name: null,
activeStartTime: null, activeStartTime: null,
activeEndTime: null, activeEndTime: null,
adaptOil: null, adaptOil: [],
adaptUserType: null, adaptUserType: null,
memberType: null, memberType: null,
dieselUserLevel: null, dieselUserLevel: null,
@ -228,6 +264,36 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
name: [
{ required: true, message: '不能为空', trigger: 'change' }
],
activeStartTime:[
{ required: true, message: '不能为空', trigger: 'change' }
],
activeEndTime:[
{ required: true, message: '不能为空', trigger: 'change' }
],
adaptOil:[
{ required: true, message: '不能为空', trigger: 'change' }
],
dieselUserLevel:[
{ required: true, message: '不能为空', trigger: 'change' }
],
gasolineUserLevel:[
{ required: true, message: '不能为空', trigger: 'change' }
],
naturalUserLevel:[
{ required: true, message: '不能为空', trigger: 'change' }
],
participationCondition:[
{ required: true, message: '不能为空', trigger: 'change' }
],
participationAcount:[
{ required: true, message: '不能为空', trigger: 'change' }
],
isonline:[
{ required: true, message: '不能为空', trigger: 'change' }
],
} }
}; };
}, },
@ -244,6 +310,18 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
//
addactiveDiscountChildList(){
let data = {
amount :this.form.activeDiscountChildList.discount,
deductionAmount:this.form.activeDiscountChildList.amount,
}
this.form.activeDiscountChildList.push(data)
},
deleteactiveDiscountChildList(index){
this.form.activeDiscountChildList.splice(index, 1)
},
// //
cancel() { cancel() {
this.open = false; this.open = false;

View File

@ -44,7 +44,7 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="activeNewlywedsList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="activeNewlywedsList" @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="id" />
<el-table-column label="活动名称" align="center" prop="name" /> <el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="活动开始时间" align="center" prop="activeStartTime" width="180"> <el-table-column label="活动开始时间" align="center" prop="activeStartTime" width="180">
@ -58,20 +58,27 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="有礼奖励 有礼奖励 0优惠券 1兑换券" align="center" prop="courtesyReward" > <el-table-column label="有礼奖励" align="center" prop="courtesyReward" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="(item,index) in scope.row.courtesyReward "> V{{item}}会员 </span> <div v-for="(item,index) in scope.row.courtesyReward ">
<div v-if="item == 0" >优惠券</div>
<div v-if="item == 1">兑换券</div>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="活动码" align="center" prop="activeCode" /> <el-table-column label="活动码" align="center" prop="activeCode" >
<template slot-scope="scope">
<div style="cursor: pointer" @click="qrcodelook(scope.row.activeCode)">
<i class="el-icon-picture" ></i>
</div>
</template>
</el-table-column>
<el-table-column label="活动状态" align="center" prop="status" > <el-table-column label="活动状态" align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 0"> <el-tag>进行中</el-tag> </span>
<span v-if="scope.row.status == 0">启用</span> <span v-if="scope.row.status == 1"> <el-tag type="success">待生效</el-tag> </span>
<span v-if="scope.row.status == 1">禁用</span> <span v-if="scope.row.status == 2"> <el-tag type="danger">已结束</el-tag> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -81,15 +88,9 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['business/marketingActivity:activeNewlyweds:edit']"
>修改</el-button> >修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['business/marketingActivity:activeNewlyweds:remove']"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -104,8 +105,8 @@
</el-card> </el-card>
<!-- 添加或修改新人有礼活动对话框 --> <!-- 添加或修改新人有礼活动对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="45%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="活动名称" prop="name"> <el-form-item label="活动名称" prop="name">
<el-input v-model="form.name" placeholder="请输入活动名称" /> <el-input v-model="form.name" placeholder="请输入活动名称" />
</el-form-item> </el-form-item>
@ -125,34 +126,302 @@
placeholder="请选择活动结束时间"> placeholder="请选择活动结束时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="有礼奖励 " prop="courtesyReward"> <el-form-item label="有礼奖励" prop="courtesyReward" >
<el-input v-model="form.courtesyReward" placeholder="请输入有礼奖励 " /> <el-checkbox-group v-model="form.courtesyReward">
<el-checkbox label="1" >赠送优惠券</el-checkbox>
<el-checkbox label="2" >赠送兑换券</el-checkbox>
</el-checkbox-group>
</el-form-item> </el-form-item>
<!-- 选择优惠券-->
<div class="xh-box" v-if="form.courtesyReward && form.courtesyReward.indexOf('1')>-1 " >
<div class="box-bt"> <div >赠送卡券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
<div style="margin: 10px 0px">
<el-table
:data="form.tableDatas"
border
style="width: 100%">
<el-table-column
prop="giftCardName"
label="卡券名称"
width="0">
</el-table-column>
<el-table-column
prop="giftCardType"
label="券类型"
width="80">
<template slot-scope="scope">
<span v-if="scope.row.giftCardType == 0" >油品券</span>
<span v-if="scope.row.giftCardType == 1" >商品券</span>
<span v-if="scope.row.giftCardType == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="券详情"
width="80">
<template slot-scope="scope">
<span>{{scope.row.giftCardDetail}}</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)"
width="240">
<template slot-scope="scope">
<span v-if="scope.row.timeType == 0" > <el-input-number v-model="scope.row.validityZero" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
<span v-if="scope.row.timeType == 1" > <el-input-number v-model="scope.row.validityOne" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
<span v-if="scope.row.timeType == 2" > <el-input-number v-model="scope.row.validityTwo" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="数量"
width="240">
<template slot-scope="scope">
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="9999"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="deletedata(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- 选择兑换券-->
<div class="xh-box" v-if="form.courtesyReward && form.courtesyReward.indexOf('2')>-1 " >
<div class="box-bt"> <div >选择兑换券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistExchange()" >新增</el-button> </div>
<div style="margin: 10px 0px">
<el-table
:data="tableDatas"
border
style="width: 100%">
<el-table-column
prop="giftCardName"
label="卡券名称"
width="80">
</el-table-column>
<el-table-column
prop="date"
label="券类型"
width="80">
<template slot-scope="scope">
<span v-if="scope.row.giftCardType == 0" >油品券</span>
<span v-if="scope.row.giftCardType == 1" >商品券</span>
<span v-if="scope.row.giftCardType == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="券详情"
width="80">
<template slot-scope="scope">
<span>{{scope.row.giftCardDetail}}</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)"
width="240">
<template slot-scope="scope">
<span > <el-input-number v-model="scope.row.giftCardTime" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="数量"
width="240">
<template slot-scope="scope">
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="9999"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="deletedhdata(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-form-item label="赠送积分" prop="points"> <el-form-item label="赠送积分" prop="points">
<el-input v-model="form.points" placeholder="请输入赠送积分" /> <el-input-number v-model="form.points" controls-position="right" :min="1" :max="99999"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="赠送成长值" prop="growthValue"> <el-form-item label="赠送成长值" prop="growthValue">
<el-input v-model="form.growthValue" placeholder="请输入赠送成长值" /> <el-input-number v-model="form.growthValue" controls-position="right" :min="1" :max="9999999"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="自定义规则" prop="remark"> <el-form-item label="自定义规则" prop="remark">
<el-input v-model="form.remark" placeholder="请输入自定义规则" /> <el-input v-model="form.remark" placeholder="请输入自定义规则" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 优惠券列表-->
<el-dialog title="优惠券列表" :visible.sync="dialogTableVisible">
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
prop="name"
label="卡券名称"
width="100">
</el-table-column>
<el-table-column
prop="date"
label="券类型"
width="100">
<template slot-scope="scope">
<span v-if="scope.row.type == 0" >油品券</span>
<span v-if="scope.row.type == 1" >商品券</span>
<span v-if="scope.row.type == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="券详情"
width="100">
<template slot-scope="scope">
<span>{{scope.row.fullDeduction}} {{scope.row.discountAmount}} </span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)"
width="180">
<template slot-scope="scope">
<span v-if="scope.row.timeType == 0" >{{scope.row.validityZero}} </span>
<span v-if="scope.row.timeType == 1" >{{scope.row.validityOne}} </span>
<span v-if="scope.row.timeType == 2" >{{scope.row.validityTwo}} </span>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="chosedata(scope.row)"
>选择</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<!-- 兑换券列表-->
<el-dialog title="兑换券列表" :visible.sync="dialogTableVisibledh">
<el-table
:data="tableDatadh"
border
style="width: 100%">
<el-table-column
prop="name"
label="卡券名称"
width="100">
</el-table-column>
<el-table-column
prop="date"
label="券类型"
width="100">
<template slot-scope="scope">
<span v-if="scope.row.type == 0" >油品券</span>
<span v-if="scope.row.type == 1" >商品券</span>
<span v-if="scope.row.type == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="使用说明"
width="100">
<template slot-scope="scope">
<span>{{scope.row.useInstructions}}</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)"
width="180">
<template slot-scope="scope">
<span >{{scope.row.validity}} </span>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="Favorabledata(scope.row)"
>选择</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog
title="二维码"
v-loading="loadingdialog"
:visible.sync="centerDialogVisible"
width="350px"
center>
<div style="display: flex;align-items: center">
<div class="qr-code" id="qrCode" ref="qrCodeUrl"></div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="centerDialogVisible = false"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listActiveNewlyweds, getActiveNewlyweds, delActiveNewlyweds, addActiveNewlyweds, updateActiveNewlyweds } from "@/api/EventMarketing/activeNewlyweds"; import { listActiveNewlyweds, getActiveNewlyweds, delActiveNewlyweds, addActiveNewlyweds, updateActiveNewlyweds } from "@/api/EventMarketing/activeNewlyweds";
import {listExchange, listFavorable} from "@/api/EventMarketing/activeConsumption";
import QRCode from "qrcodejs2";
export default { export default {
name: "ActiveNewlyweds", name: "ActiveNewlyweds",
data() { data() {
return { return {
loadingdialog:false,
centerDialogVisible:false,
pdidlist:[],//id
pddhidlist:[],//id
tableData: [],//
tableDatadh:[],//
dialogTableVisible:false,//
dialogTableVisibledh:false,//
tableDatas:[],
// //
loading: true, loading: true,
// //
@ -189,9 +458,33 @@ export default {
growthValue: null, growthValue: null,
}, },
// //
form: {}, form: {
tableDatas:[],
activeNewlywedsChildList:[],
},
// //
rules: { rules: {
name: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
activeStartTime: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
activeEndTime: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
courtesyReward: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
points: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
growthValue: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
remark: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
} }
}; };
}, },
@ -208,6 +501,25 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
qrcodelook(url) {
this.loadingdialog = true
this.centerDialogVisible = true
setTimeout(() => {
this.creatQrCode(url)
this.loadingdialog = false
}, 1000);
},
creatQrCode(url) {
document.getElementById("qrCode").innerHTML = ""
new QRCode(this.$refs.qrCodeUrl, {
text: url, //
width: 300,
height: 300,
colorDark: '#000',
colorLight: '#fff',
correctLevel: QRCode.CorrectLevel.H
})
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -223,6 +535,8 @@ export default {
activeStartTime: null, activeStartTime: null,
activeEndTime: null, activeEndTime: null,
courtesyReward: [], courtesyReward: [],
tableDatas:[],
activeNewlywedsChildList:[],
activeCode: null, activeCode: null,
isonline: null, isonline: null,
status: null, status: null,
@ -237,6 +551,123 @@ export default {
}; };
this.resetForm("form"); this.resetForm("form");
}, },
//
getlistExchange(){
listExchange().then(res=>{
if(res.code==200){
this.dialogTableVisibledh = true
this.tableDatadh = res.data.records
}
})
},
//
getlistFavorable(){
listFavorable(this.listFavorable).then(res=>{
if(res.code == 200){
this.dialogTableVisible = true
this.tableData = res.data.records
}
})
},
//
Favorabledata(row){
this.dialogTableVisibledh = false
if(this.pddhidlist.indexOf(row.id)>-1 ){
this.$message.error("该兑换卡券已存在")
return
}
this.pddhidlist.push(row.id)
console.log(row)
let data ={
activeGift: 2, // 01 2. 3 4.
goodsIds: "", //id
goodsName:"" , //
goodsTotal: "", //
vouchersId:row.id, //id
giftCardName:row.name, //
giftCardType: row.type, //
validityZero: null,
validityOne: null,
validityTwo:null,
validity:row.validity,
giftCardDetail: row.useInstructions , //
giftCardTime: row.validity, //
giftCardTotal: 1 //
}
this.tableDatas.push(data)
this.$message.success("新增成功")
},
//
chosedata(row){
this.dialogTableVisible = false
if(this.pdidlist.indexOf(row.id)>-1 ){
this.$message.error("该优惠卡券已存在")
return
}
this.pdidlist.push(row.id)
let data ={
activeGift: 1, // 01 2. 3 4.
goodsIds: "", //id
goodsName:"" , //
goodsTotal: "", //
vouchersId:row.id, //id
giftCardName:row.name, //
giftCardType: row.type, //
timeType: row.timeType,
validityZero: row.validityZero,
validityOne: row.validityOne,
validityTwo:row.validityTwo,
giftCardDetail: "满"+ row.fullDeduction+"减 "+row.discountAmount+"元" , //
giftCardTime: "", //
giftCardTotal: 1//
}
this.form.tableDatas.push(data)
this.$message.success("新增成功")
},
//
deletedata(row){
if(this.form.tableDatas&&this.form.tableDatas.length>0){
let delIdx=-1;
for ( let item of this.form.tableDatas) {
delIdx++;
if (item.id===row.id){
break
}
}
this.pdidlist.splice(delIdx,1);
this.form.tableDatas.splice(delIdx,1);
}
},
//
deletedhdata(row){
if(this.tableDatas&&this.tableDatas.length>0){
let delIdx=-1;
for ( let item of this.tableDatas) {
delIdx++;
if (item.id===row.id){
break
}
}
this.pddhidlist.splice(delIdx,1);
this.tableDatas.splice(delIdx,1);
}
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -265,12 +696,16 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getActiveNewlyweds(id).then(response => { getActiveNewlyweds(id).then(response => {
this.form = response.data; this.form = response.data;
this.form.tableDatas = response.data.activeNewlywedsChildList.filter(item => item.activeGift == '1')
this.tableDatas = response.data.activeNewlywedsChildList.filter(item => item.activeGift == '2')
this.open = true; this.open = true;
this.title = "修改新人有礼活动"; this.title = "修改新人有礼活动";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
// this.form.activeNewlywedsChildList
this.form.activeNewlywedsChildList = this.form.tableDatas.concat(this.tableDatas);
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {

View File

@ -172,15 +172,15 @@
<el-input-number v-model="ruleForm.growthValue" controls-position="right" :min="0" :max="999999999"></el-input-number> <el-input-number v-model="ruleForm.growthValue" controls-position="right" :min="0" :max="999999999"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="新用户获得" prop="resource"> <el-form-item label="新用户获得" prop="newuserGiftType">
<el-radio-group v-model="ruleForm.resource"> <el-radio-group v-model="ruleForm.newuserGiftType">
<el-radio label="0">优惠券</el-radio> <el-radio label="0">优惠券</el-radio>
<el-radio label="1">新人有礼活动</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 新用户--> <!-- 新用户-->
<div class="xh-box" v-if=" ruleForm.resource == 0 " > <div class="xh-box" v-if=" ruleForm.newuserGiftType == 0 " >
<div class="box-bt"> <div >赠送卡券</div> <el-button type="primary" icon="el-icon-plus" @click="xgetlistFavorable()" >新增</el-button> </div> <div class="box-bt"> <div >新用户获得</div> <el-button type="primary" icon="el-icon-plus" @click="xgetlistFavorable()" >新增</el-button> </div>
<div style="margin: 10px 0px"> <div style="margin: 10px 0px">
<el-table <el-table
@ -598,17 +598,14 @@ export default {
/** 查询推荐有礼列表 */ /** 查询推荐有礼列表 */
getList() { getList() {
this.loading = true; this.loading = true;
getActiveRecommend(1).then(response => { getActiveRecommend(1).then(response => {
this.ruleForm = response.data this.ruleForm = response.data
console.log( response.data.records) this.ruleForm.xylist = response.data.activeRecommendChildList.filter(item => item.giftUserType == '1')
this.ruleForm.ylist = response.data.activeRecommendChildList.filter(item => { return item.activeGift === '1' && item.giftUserType=== '0'; })
this.ruleForm.xylist = response.data.activeConsumptionChildList.filter(item => item.giftUserType == '1') this.ruleForm.dlist = response.data.activeRecommendChildList.filter(item => item.activeGift == '2')
this.ruleForm.ylist = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1') console.log( "1", this.ruleForm.xylist)//
this.ruleForm.dlist = response.data.activeConsumptionChildList.filter(item => item.activeGift == '0') console.log( "2",this.ruleForm.ylist)//
console.log(this.ruleForm.xylist) console.log( "3",this.ruleForm.dlist)//
console.log(this.ruleForm.ylist)
console.log(this.ruleForm.dlist)
this.loading = false; this.loading = false;
}); });
}, },
@ -646,7 +643,6 @@ export default {
this.$message.error("该兑换卡券已存在") this.$message.error("该兑换卡券已存在")
return return
} }
this.pddhidlist.push(row.id) this.pddhidlist.push(row.id)
console.log(row) console.log(row)
let data ={ let data ={
@ -680,6 +676,7 @@ export default {
this.xpdidlist.push(row.id) this.xpdidlist.push(row.id)
let data ={ let data ={
giftUserType:1,//
activeGift: 1, // 01 2. 3 4. activeGift: 1, // 01 2. 3 4.
goodsIds: "", //id goodsIds: "", //id
goodsName:"" , // goodsName:"" , //
@ -698,7 +695,7 @@ export default {
this.ruleForm.xylist.push(data) this.ruleForm.xylist.push(data)
this.$message.success("新增成功") this.$message.success("新增成功")
}, },
// //
chosedata(row){ chosedata(row){
this.dialogTableVisible = false this.dialogTableVisible = false
if(this.pdidlist.indexOf(row.id)>-1 ){ if(this.pdidlist.indexOf(row.id)>-1 ){
@ -709,6 +706,7 @@ export default {
this.pdidlist.push(row.id) this.pdidlist.push(row.id)
let data ={ let data ={
giftUserType:0,//
activeGift: 1, // 01 2. 3 4. activeGift: 1, // 01 2. 3 4.
goodsIds: "", //id goodsIds: "", //id
goodsName:"" , // goodsName:"" , //
@ -724,7 +722,9 @@ export default {
giftCardTime: "", // giftCardTime: "", //
giftCardTotal: 1// giftCardTotal: 1//
} }
console.log(data)
this.ruleForm.ylist.push(data) this.ruleForm.ylist.push(data)
console.log(this.ruleForm.ylist)
this.$message.success("新增成功") this.$message.success("新增成功")
}, },
// //
@ -801,6 +801,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
activeRecommendChildList:[],
updateTime: null updateTime: null
}; };
this.resetForm("form"); this.resetForm("form");
@ -840,8 +841,8 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.ruleForm.activeConsumptionChildList = this.ruleForm.ylist.concat(this.ruleForm.dlist,this.ruleForm.xylist); this.ruleForm.activeRecommendChildList = this.ruleForm.ylist.concat(this.ruleForm.dlist,this.ruleForm.xylist);
console.log(this.ruleForm.activeConsumptionChildList) console.log(this.ruleForm.activeRecommendChildList)
console.log(this.ruleForm) console.log(this.ruleForm)
this.$refs["ruleForm"].validate(valid => { this.$refs["ruleForm"].validate(valid => {

View File

@ -25,14 +25,11 @@
<el-option label="通用券" value="2"></el-option> <el-option label="通用券" value="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<el-card style="margin-bottom: 20px"> <el-card style="margin-bottom: 20px">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
@ -98,12 +95,9 @@
<el-table-column label="满足金额" align="center" prop="satisfiedAmount" /> <el-table-column label="满足金额" align="center" prop="satisfiedAmount" />
<el-table-column label="二维码链接" align="center" prop="qrCodeLink" > <el-table-column label="二维码链接" align="center" prop="qrCodeLink" >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <span >{{scope.row.qrCodeLink}}</span>-->
<div style="cursor: pointer" @click="qrcodelook(scope.row.qrCodeLink)"> <div style="cursor: pointer" @click="qrcodelook(scope.row.qrCodeLink)">
<i class="el-icon-picture" ></i> <i class="el-icon-picture" ></i>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="优惠券状态" align="center" prop="status" > <el-table-column label="优惠券状态" align="center" prop="status" >

View File

@ -15,13 +15,9 @@
<activeFullminus v-if="value == 3"></activeFullminus> <activeFullminus v-if="value == 3"></activeFullminus>
<activeNewlyweds v-if="value == 4" ></activeNewlyweds> <activeNewlyweds v-if="value == 4" ></activeNewlyweds>
<activeRecommend v-if="value == 5"></activeRecommend> <activeRecommend v-if="value == 5"></activeRecommend>
<!-- 添加或修改兑换券对话框 --> <!-- 添加或修改兑换券对话框 -->
</div> </div>
</template> </template>
<script> <script>
import activeDiscount from '../activeDiscount/index' import activeDiscount from '../activeDiscount/index'