Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-03-05 16:58:38 +08:00
commit e48e5c97fe
7 changed files with 277 additions and 90 deletions

View File

@ -23,6 +23,32 @@ export function getCardFavorable(id) {
})
}
export function updetaCardFavorable(data) {
return request({
url: 'business/marketingActivity/oneActiveOneCoupon',
method: 'put',
data:data
})
}
export function deleteCardFavorable(id) {
return request({
url: 'business/marketingActivity/oneActiveOneCoupon/delById/'+id,
method: 'delete',
})
}
export function postyijian(data) {
return request({
url: 'business/marketingActivity/cardFavorableRecord/issueCardFavorable',
method: 'post',
data:data
})
}
export function getAdaptUserList(data) {
return request({

View File

@ -171,7 +171,7 @@
<el-popconfirm
style="margin-left: 5px"
@confirm="Deletesl(scope.row)"
title="这是一段内容确定删除吗?">
title="确定删除这条活动配置吗?">
<el-button
size="mini"
type="text"
@ -996,6 +996,7 @@
deletedelById(resData.id).then(res=>{
console.log(res)
this.getlist()
})

View File

@ -165,7 +165,7 @@
</el-radio-group>
<!-- <p v-if="form.type == 2" style="color: red">洗车卡为不限次数卡,仅在有效期内可用,如按次数,请选择洗车券</p>-->
</el-form-item>
<el-form-item label="选择兑换商品" prop="giftId">
<el-form-item label="选择兑换商品" prop="giftId" v-if="form.type==0">
<!-- <el-input type="textarea" v-model="form.giftName" placeholder="请输入兑换礼品名"></el-input>-->
<el-select v-model="form.giftId" placeholder="请选择" @change="change" >
<el-option

View File

@ -182,27 +182,27 @@
<el-table-column
prop="number"
label="电子礼品卡号"
width="210">
>
</el-table-column>
<el-table-column
prop="cardAmount"
label="面值"
width="180">
>
</el-table-column>
<el-table-column
prop="effectiveTimeStart"
label="使用时间"
width="220">
>
</el-table-column>
<el-table-column
prop="sailTime"
label="售出时间"
width="180">
>
</el-table-column>
<el-table-column
prop="status"
label="礼品卡状态"
width="120">
>
<template slot-scope="scope">
<el-switch
@ -222,13 +222,13 @@
<el-table-column
prop="createTime"
label="创建时间"
width="220"
>
</el-table-column>
<el-table-column
prop="effectiveTimeStart"
label="有效期"
width="220"
>
<template slot-scope="scope">
@ -239,9 +239,22 @@
<el-table-column
prop="createBy"
label="操作员"
width="220"
>
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="yj(scope.row)"
>售卡</el-button>
</template>
</el-table-column>
<!-- <el-table-column
prop="remark"
label="备注信息"
@ -410,7 +423,7 @@ import {
//
handleChange(file, fileList) {
this.uploading = true;
console.log(file,111)
console.log(file)
if(file.status === 'success'){
this.uploading = false;
this.openUpload = false;

View File

@ -2,15 +2,13 @@
<div class="app-container">
<el-card style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="券状态" prop="name">
<el-select v-model="status" clearable placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-form-item label="活动名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入活动名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -81,8 +79,24 @@
<el-button
size="mini"
type="text"
@click="updated(scope.row)"
@click="yj(scope.row)"
>一键发券</el-button>
<el-button
size="mini"
type="text"
@click="lookDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
@ -100,16 +114,16 @@
<el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" label-width="110px">
<el-form-item label="活动名称" prop="activeName">
<el-input v-model="activeName" placeholder="请输入活动名称" />
<el-input v-model="form.activeName" placeholder="请输入活动名称" />
</el-form-item>
<el-form-item label="会员等级" prop="" >
<el-select v-model="gradeIds" multiple clearable placeholder="会员等级" @change="change">
<el-select v-model="form.gradeIds" multiple clearable placeholder="会员等级" @change="change">
<el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
</el-select>
</el-form-item>
<el-form-item label="不活跃用户" prop="">
<div style="display: flex;align-items: center">
<el-input-number v-model="days" :min="1" :max="999" label="描述文字"></el-input-number>
<el-input-number v-model="form.days" :min="1" :max="999" label="描述文字"></el-input-number>
<div style="margin-left: 5px"> <span style="color: red">(查找最近N天未进行消费的用户)</span> </div>
</div>
</el-form-item>
@ -150,18 +164,18 @@
border
style="width: 100%">
<el-table-column
prop="giftCardName"
prop="name"
label="卡券名称"
>
</el-table-column>
<el-table-column
prop="giftCardType"
prop="type"
label="券类型"
>
<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>
<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
@ -169,7 +183,7 @@
label="券详情"
>
<template slot-scope="scope">
<span>{{scope.row.giftCardDetail}}</span>
<span>{{scope.row.cardDetail}}</span>
</template>
</el-table-column>
<el-table-column
@ -182,14 +196,14 @@
<span v-if="scope.row.timeType == 2" > <el-input-number v-model="scope.row.validityTwo" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number></span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="数量"
>
<template slot-scope="scope">
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="date"-->
<!-- label="数量"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-input-number v-model="scope.row.giftCardTotal" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="address"
@ -216,7 +230,7 @@
border
style="width: 100%">
<el-table-column
prop="giftCardName"
prop="name"
label="卡券名称"
>
</el-table-column>
@ -225,9 +239,9 @@
label="券类型"
>
<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>
<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
@ -235,7 +249,7 @@
label="券详情"
>
<template slot-scope="scope">
<span>{{scope.row.giftCardDetail}}</span>
<span>{{scope.row.cardDetail}}</span>
<!-- <span>{{scope.row.fullDeduction}} {{scope.row.discountAmount}} </span>-->
</template>
</el-table-column>
@ -244,22 +258,21 @@
label="有效期(天)"
>
<template slot-scope="scope">
<span > <el-input-number v-model="scope.row.giftCardTime" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number> </span>
<span > <el-input-number v-model="scope.row.validity" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number> </span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="数量"
>
<template slot-scope="scope">
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="date"-->
<!-- label="数量"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-input-number v-model="scope.row.giftCardTotal" controls-position="right" size="mini" :min="1" :max="9999"></el-input-number>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="address"
label="操作"
>
<template slot-scope="scope">
<el-button
@ -281,6 +294,50 @@
<!-- 最终提交-->
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="详情统计" :visible.sync="opendetails" width="45%" append-to-body>
<div style="display: flex;justify-content: space-between;width: 100%;">
<div class="x-box">
<div>优惠券数量统计</div>
<div>总数量: {{statisticsyou.count ||0}}</div>
<div>已使用数量: {{statisticsyou.countEd ||0}}</div>
<div>未使用数量: {{statisticsyou.countLd ||0}}</div>
</div>
<div class="x-box">
<div>兑换券数量统计</div>
<div>总数量: {{statisticsyou.counts ||0}}</div>
<div>已使用数量: {{statisticsyou.countEds ||0}}</div>
<div>未使用数量: {{statisticsyou.countLds ||0}}</div>
</div>
</div>
<el-table
:data="looklist"
style="width: 100%">
<el-table-column
prop="name"
label="昵称"
>
</el-table-column>
<el-table-column
prop="mobile"
label="联系方式"
>
</el-table-column>
<el-table-column
prop="createTime"
label="领取日期"
>
</el-table-column>
<el-table-column
prop="exchangeFrom"
label="获取方式"
>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog title="优惠券列表" :visible.sync="dialogTableVisible">
<div style="display: flex;align-items: center; margin-bottom: 20px ">
@ -294,12 +351,12 @@
<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>
@ -309,7 +366,7 @@
<el-table-column
prop="date"
label="券详情"
width="100">
>
<template slot-scope="scope">
<span>{{scope.row.satisfiedAmount}} {{scope.row.discountAmount}} </span>
</template>
@ -317,7 +374,7 @@
<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>
@ -360,12 +417,12 @@
<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>
@ -375,7 +432,7 @@
<el-table-column
prop="date"
label="使用说明"
width="100">
>
<template slot-scope="scope">
<span>{{scope.row.useInstructions}}</span>
</template>
@ -383,7 +440,7 @@
<el-table-column
prop="date"
label="有效期(天)"
width="180">
>
<template slot-scope="scope">
<span >{{scope.row.validity}} </span>
</template>
@ -414,14 +471,29 @@
</template>
<script>
import { getoiltype,getoilName, listActiveConsumption,listExchange,listLJGoods, getActiveConsumption, delActiveConsumption, addActiveConsumption, updateActiveConsumption,listFavorable } from "@/api/EventMarketing/activeConsumption";
import {issueCardFavorable,getCardFavorableLists,getAdaptUserList,getCardFavorable} from "@/api/EventMarketing/yijian";
import {
getoiltype,
getoilName,
listActiveConsumption,
listExchange,
listLJGoods,
getActiveConsumption,
delActiveConsumption,
addActiveConsumption,
updateActiveConsumption,
listFavorable,
looklook, looklooklook
} from "@/api/EventMarketing/activeConsumption";
import {issueCardFavorable,getCardFavorableLists,getAdaptUserList,getCardFavorable,updetaCardFavorable,deleteCardFavorable,postyijian} from "@/api/EventMarketing/yijian";
import {listUserGrade} from "@/api/staff/user/usergrade";
export default {
name: "ActiveConsumption",
data() {
return {
opendetails:false,
looklist:[],
statisticsyou:{},
options:[
{
value: 0,
@ -528,7 +600,7 @@ export default {
//
form: {},
cardFavorableIds:[],
activeName:'',
gradeIds:[],
days:15,
//
@ -586,6 +658,39 @@ export default {
this.listUserGrade()
},
methods: {
lookDetail(row){
this.opendetails = true
let data = {
id:row.id
}
looklook(data).then(res=>{
if(res.data){
this.looklist = res.data
}
console.log('详情',res)
})
looklooklook(row.id).then(resp=>{
if( resp.data){
this.statisticsyou = resp.data
}
console.log('优惠券详情统计',resp)
})
},
//
yj(row){
let data = {
activeId:row.id
}
postyijian(data).then(res=>{
console.log(res)
})
},
updated(row){
getCardFavorable(row.id).then(res=>{
console.log(res)
@ -717,13 +822,13 @@ export default {
goodsName:"" , //
goodsTotal: "", //
vouchersId:row.id, //id
giftCardName:row.name, //
giftCardType: row.type, //
name:row.name, //
type: row.type, //
validityZero: null,
validityOne: null,
validityTwo:null,
validity:row.validity,
giftCardDetail: row.useInstructions , //
cardDetail: row.useInstructions , //
giftCardTime: row.validity, //
giftCardTotal: 1 //
}
@ -734,8 +839,6 @@ export default {
//
chosedata(row){
this.dialogTableVisible = false
if( this.cardFavorableIds.indexOf(row.id)>-1 ){
this.$message.error("该优惠卡券已存在")
return
@ -748,13 +851,13 @@ export default {
goodsName:"" , //
goodsTotal: "", //
vouchersId:row.id, //id
giftCardName:row.name, //
giftCardType: row.type, //
name:row.name, //
type: row.type, //
timeType: row.timeType,
validityZero: row.validityZero,
validityOne: row.validityOne,
validityTwo:row.validityTwo,
giftCardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //
cardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //
giftCardTime: "", //
giftCardTotal: 1//
}
@ -829,6 +932,9 @@ export default {
//
reset() {
this.form = {
activeName : null,
gradeIds:null,
condition:null,
id: null,
chainStorId: null,
storeId: null,
@ -892,13 +998,25 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// this.reset();
const id = row.id || this.ids
getActiveConsumption(id).then(response => {
getCardFavorable(id).then(response => {
this.form = response.data;
this.form.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1')
this.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '2')
this.form.shiwudata = response.data.activeConsumptionChildList.filter(item => item.activeGift == '4')
this.form.gradeIds = response.data.gradeIds
this.form.days = response.data.condition,
this.cardFavorableIds = response.data.cardFavorableIds
this.pddhidlist = response.data.cardExchangeIds
if(response.data.cardExchangeList){
this.tableDatas = response.data.cardExchangeList
}
if(response.data.cardFavorableList){
this.form.tableDatas = response.data.cardFavorableList
}
console.log( 'x', this.form)
// this.form.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1')
// this.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '2')
// this.form.shiwudata = response.data.activeConsumptionChildList.filter(item => item.activeGift == '4')
this.open = true;
this.title = "修改一键发券";
});
@ -952,13 +1070,33 @@ export default {
},
/** 提交按钮 */
submitForm() {
if(this.form.id){
console.log('修改',this.form.days)
this.form.activeConsumptionChildList = this.form.tableDatas.concat(this.tableDatas, this.form.shiwudata);
console.log(this.form.activeConsumptionChildList)
let data = {
activeName : this.activeName,
gradeIds:this.gradeIds,
condition:this.days,
id:this.form.id,
activeName : this.form.activeName,
gradeIds:this.form.gradeIds,
condition:this.form.days,
cardFavorableIds:this.cardFavorableIds,
cardExchangeIds:this.pddhidlist
}
updetaCardFavorable(data).then(response => {
this.$modal.msgSuccess("修改");
this.open = false;
this.getList()
})
}else{
console.log('新增')
this.form.activeConsumptionChildList = this.form.tableDatas.concat(this.tableDatas, this.form.shiwudata);
console.log(this.form.activeConsumptionChildList)
let data = {
activeName : this.form.activeName,
gradeIds:this.form.gradeIds,
condition:this.form.days,
cardFavorableIds:this.cardFavorableIds,
cardExchangeIds:this.pddhidlist
@ -968,6 +1106,9 @@ export default {
this.open = false;
this.getList()
})
}
return
// this.$refs["form"].validate(valid => {
// if (valid) {
@ -979,7 +1120,7 @@ export default {
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除消费有礼活动编号为"' + ids + '"的数据项?').then(function() {
return delActiveConsumption(ids);
return deleteCardFavorable(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
@ -1002,4 +1143,11 @@ export default {
align-items: center;
font-size: 18px;
}
.x-box{
background: #f9f9f9;
border-radius: 6px;
box-sizing: border-box;
padding: 15px;
width: 45%;
}
</style>

View File

@ -382,7 +382,7 @@
<el-col :span="8">
<el-form-item label="兑换次数" prop="exchangeTimes">
<el-input v-model.number="dataForm.exchangeTimes" placeholder="" maxlength="30" style="width: 202px;">
<template slot="append"></template>
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>

View File

@ -585,7 +585,7 @@
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisiblevip = false"> </el-button>
<el-button type="primary" :disabled="isSure" @click="chooseUser(member)"> </el-button>
<el-button type="primary" :disabled="isSure==false" @click="chooseUser(member)"> </el-button>
</span>
</el-dialog>
@ -1577,7 +1577,7 @@
//
oilNumberList:[],
//
isSure:true,
isSure:false,
//
couponAmount:0,
//
@ -1763,7 +1763,7 @@
},
//
async userRecharge() {
if (this.isSure){
if (!this.isSure){
// if (this.member){
this.$message.error("请先选择会员")
return;
@ -2866,7 +2866,6 @@
resetMember(){
this.member = {};
this.isMember = false;
this.isSure = false;
this.map.payUser == "";
this.balance = 0;
this.oilDiscount = 0;
@ -3449,7 +3448,7 @@
},
//
handleChoose(data) {
this.isSure = false;
this.isSure = true;
this.member = data;
if (data.refuelMoney){
this.refuelMoney = JSON.parse(data.refuelMoney)
@ -3798,7 +3797,7 @@
return;
}
getUserInfoMobile({mobile:this.userNo}).then( response => {
if (response.data!=null){
if (response.data){
this.member = response.data
if (response.data.refuelMoney){
this.refuelMoney = JSON.parse(response.data.refuelMoney)
@ -3806,7 +3805,7 @@
this.refuelMoney = null
}
this.storeId = response.data.storeId
this.isSure = false
this.isSure = true
}else {
this.$modal.msgError("会员信息不存在")
}