# Conflicts:
#	gasStation-uni/config.js
This commit is contained in:
wangh 2024-03-05 16:59:22 +08:00
commit 8ab4844445
50 changed files with 812 additions and 339 deletions

View File

@ -8,13 +8,47 @@ export function issueCardFavorable(data) {
data:data
})
}
export function getCardFavorableLists(status) {
return request({
url: 'business/marketingActivity/cardFavorableRecord/getCardFavorableLists',
url: 'business/marketingActivity/oneActiveOneCoupon',
method: 'get',
params: status
})
}
export function getCardFavorable(id) {
return request({
url: 'business/marketingActivity/oneActiveOneCoupon/'+id,
method: 'get',
})
}
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

@ -27,10 +27,9 @@
align="center"
style="width: 100%">
<el-table-column
prop="sort"
label="排序"
align="center"
width="110">
label="序号"
type="index"
>
</el-table-column>
<el-table-column
prop="groupOriented"
@ -172,7 +171,7 @@
<el-popconfirm
style="margin-left: 5px"
@confirm="Deletesl(scope.row)"
title="这是一段内容确定删除吗?">
title="确定删除这条活动配置吗?">
<el-button
size="mini"
type="text"
@ -422,9 +421,8 @@
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>
<span v-if="scope.row.giftCardType == 0" >商品兑换券</span>
<span v-if="scope.row.giftCardType == 1" >洗车券</span>
</template>
</el-table-column>
<el-table-column
@ -998,6 +996,7 @@
deletedelById(resData.id).then(res=>{
console.log(res)
this.getlist()
})

View File

@ -209,7 +209,7 @@
<el-checkbox label="1" >赠送优惠券</el-checkbox>
<el-checkbox label="2" >赠送兑换券</el-checkbox>
<el-checkbox label="4" >赠送实物</el-checkbox>
</el-checkbox-group>
</el-form-item>
<!-- 选择优惠券-->
@ -784,9 +784,6 @@ export default {
activeConsumptionChildList: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
}
};
},

View File

@ -490,6 +490,7 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.activeDiscountChildList = [ {amount:'',discount:''}, ]
this.open = true;
this.title = "添加折扣营销";
},
@ -500,6 +501,11 @@ export default {
getActiveDiscount(id).then(response => {
console.log( response.data)
this.form = response.data;
if (response.data.activeDiscountChildList && response.data.activeDiscountChildList.length>0){
this.activeDiscountChildList = response.data.activeDiscountChildList
}else {
this.activeDiscountChildList = [ {amount:'',discount:''}, ]
}
this.open = true;
this.title = "修改折扣营销";
});

View File

@ -456,6 +456,7 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.activeDiscountChildList = [ {amount:'',deductionAmount:''}, ]
this.open = true;
this.title = "添加满减营销";
},
@ -464,7 +465,13 @@ export default {
this.reset();
const id = row.id || this.ids
getActiveFullminus(id).then(response => {
console.log(response)
this.form = response.data;
if (response.data.activeDiscountChildList && response.data.activeDiscountChildList.length>0){
this.activeDiscountChildList = response.data.activeDiscountChildList
}else {
this.activeDiscountChildList = [ {amount:'',deductionAmount:''}, ]
}
this.open = true;
this.title = "修改满减营销";
});

View File

@ -62,18 +62,10 @@
</el-row>
<el-table v-loading="loading" :data="exchangeList" @selection-change="handleSelectionChange">
<el-table-column label="是否在线" align="center" prop="isonline">
<template slot-scope="scope">
<span v-if="scope.row.isonline == 0">在线</span>
<span v-if="scope.row.isonline == 1">下线</span>
</template>
</el-table-column>
<el-table-column label="兑换券状态" align="center" prop="status">
<template slot-scope="scope">
<span v-if="scope.row.status == 0"> <el-tag>启用</el-tag> </span>
<span v-if="scope.row.status == 1"> <el-tag type="danger">禁用</el-tag> </span>
</template>
<el-table-column
label="序号"
type="index"
>
</el-table-column>
<el-table-column label="兑换券名称" align="center" prop="name"/>
<el-table-column label="兑换券类型 " align="center" prop="type">
@ -103,6 +95,19 @@
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="是否在线" align="center" prop="isonline">
<template slot-scope="scope">
<span v-if="scope.row.isonline == 0">在线</span>
<span v-if="scope.row.isonline == 1">下线</span>
</template>
</el-table-column>
<el-table-column label="兑换券状态" align="center" prop="status">
<template slot-scope="scope">
<span v-if="scope.row.status == 0"> <el-tag>启用</el-tag> </span>
<span v-if="scope.row.status == 1"> <el-tag type="danger">禁用</el-tag> </span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button

View File

@ -19,11 +19,11 @@
</el-select>
</el-form-item>
<el-form-item label="" prop="region">
<el-select v-model="queryParams.type" clearable placeholder="卡券类型">
<!-- <el-select v-model="queryParams.type" clearable placeholder="卡券类型">
<el-option label="油品券" value="0"></el-option>
<!-- <el-option label="商品券" value="1"></el-option>-->
<!-- <el-option label="通用券" value="2"></el-option>-->
</el-select>
&lt;!&ndash; <el-option label="商品券" value="1"></el-option>&ndash;&gt;
&lt;!&ndash; <el-option label="通用券" value="2"></el-option>&ndash;&gt;
</el-select>-->
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -48,6 +48,11 @@
<el-table v-loading="loading" :data="favorableList" @selection-change="handleSelectionChange">
<!-- <el-table-column label="是否在线 0在线 1 下线" align="center" prop="isonline" />-->
<el-table-column
label="序号"
type="index"
>
</el-table-column>
<el-table-column label="优惠券名称" align="center" prop="name" />
<el-table-column label="卡券类型 " align="center" prop="type" >
<template slot-scope="scope">

View File

@ -174,30 +174,35 @@
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
label="序号"
type="index"
>
</el-table-column>
<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
@ -217,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">
@ -234,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="备注信息"
@ -413,6 +431,7 @@ import {
this.fileList.splice(0,1)
this.result = file.response.data
this.getlist()
}
},
putStatus(id){

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>
@ -36,21 +34,72 @@
label="排序"
>
</el-table-column>
<el-table-column label="会员名字" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="券名称" align="center" prop="cardFavorableName"/>
<el-table-column label="券的类型" align="center" prop="discountType" >
<el-table-column label="活动名称" align="center" prop="activeName" />
<el-table-column label="选择条件 " align="center" prop="gradeName" width="400px" >
<template slot-scope="scope">
<span v-if="scope.row.status == 0">满减券</span>
<span v-if="scope.row.status == 1">折扣券</span>
<div v-for="(item,index) in scope.row.userVos">会员名称: {{item.gradeName}} 存量: {{item.countAll}} 不活跃用户: {{item.count}} 占比: {{item.rate}}</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" >
<el-table-column label="不活跃天数" align="center" prop="conditions"/>
<el-table-column label="优惠券领取数量" align="center" prop="couponReceiveCount" >
<template slot-scope="scope">
<span v-if="scope.row.status == 0"> <el-tag>未使用</el-tag> </span>
<span v-if="scope.row.status == 1"><el-tag type="danger">已使用</el-tag> </span>
<span>{{scope.row.couponReceiveCount}}</span>
</template>
</el-table-column>
<el-table-column label="优惠券使用数量" align="center" prop="couponUseCount" >
<template slot-scope="scope">
<span>{{scope.row.couponUseCount}}</span>
</template>
</el-table-column>
<el-table-column label="兑换券领取数量" align="center" prop="exchangeReceiveCount" >
<template slot-scope="scope">
<span>{{scope.row.exchangeReceiveCount}}</span>
</template>
</el-table-column>
<el-table-column label="兑换券使用数量" align="center" prop="exchangeUseCount" >
<template slot-scope="scope">
<span>{{scope.row.exchangeUseCount}}</span>
</template>
</el-table-column>
<el-table-column label="创建时间;" align="center" prop="createTime" >
<template slot-scope="scope">
<span> {{scope.row.createTime}} </span>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createTime" >
<template slot-scope="scope">
<span> {{scope.row.createBy}} </span>
</template>
</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>
<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>
</el-table>
<pagination
v-show="total>0"
@ -65,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>
@ -115,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
@ -134,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
@ -147,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"
@ -173,7 +222,7 @@
</div>
<!-- 选择兑换券-->
<div class="xh-box" >
<div class="box-bt"> <div >选择兑换券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistExchange()" >新增</el-button> </div>
<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
@ -181,7 +230,7 @@
border
style="width: 100%">
<el-table-column
prop="giftCardName"
prop="name"
label="卡券名称"
>
</el-table-column>
@ -190,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
@ -200,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>
@ -209,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
@ -246,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 ">
@ -259,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>
@ -274,7 +366,7 @@
<el-table-column
prop="date"
label="券详情"
width="100">
>
<template slot-scope="scope">
<span>{{scope.row.satisfiedAmount}} {{scope.row.discountAmount}} </span>
</template>
@ -282,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>
@ -325,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>
@ -340,7 +432,7 @@
<el-table-column
prop="date"
label="使用说明"
width="100">
>
<template slot-scope="scope">
<span>{{scope.row.useInstructions}}</span>
</template>
@ -348,7 +440,7 @@
<el-table-column
prop="date"
label="有效期(天)"
width="180">
>
<template slot-scope="scope">
<span >{{scope.row.validity}} </span>
</template>
@ -375,19 +467,33 @@
/></div>
</el-dialog>
<!-- 实物列表-->
</div>
</template>
<script>
import { getoiltype,getoilName, listActiveConsumption,listExchange,listLJGoods, getActiveConsumption, delActiveConsumption, addActiveConsumption, updateActiveConsumption,listFavorable } from "@/api/EventMarketing/activeConsumption";
import {issueCardFavorable,getCardFavorableLists,getAdaptUserList} 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,
@ -494,7 +600,7 @@ export default {
//
form: {},
cardFavorableIds:[],
activeName:'',
gradeIds:[],
days:15,
//
@ -552,6 +658,44 @@ 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)
})
},
change(e){
let data = {
gradeIds:e,
@ -678,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 //
}
@ -695,8 +839,6 @@ export default {
//
chosedata(row){
this.dialogTableVisible = false
if( this.cardFavorableIds.indexOf(row.id)>-1 ){
this.$message.error("该优惠卡券已存在")
return
@ -709,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//
}
@ -790,6 +932,9 @@ export default {
//
reset() {
this.form = {
activeName : null,
gradeIds:null,
condition:null,
id: null,
chainStorId: null,
storeId: null,
@ -853,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 = "修改一键发券";
});
@ -913,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
@ -929,6 +1106,9 @@ export default {
this.open = false;
this.getList()
})
}
return
// this.$refs["form"].validate(valid => {
// if (valid) {
@ -940,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("删除成功");
@ -963,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

@ -255,7 +255,7 @@
<el-option
v-for="option in cardFavorableList"
:key="option.id"
:label="(option.type==0?'油品卷-':option.type==1?'商品卷-':'优惠卷-')+ option.name"
:label="(option.type==0?'油品券-':option.type==1?'商品券-':'优惠券-')+ option.name"
:value="option.id"
></el-option>
</el-select>
@ -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

@ -366,7 +366,7 @@
</div>
</el-tab-pane>
<el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard">
<el-form ref="form" :model="form2" :rules="rules1" label-width="120px">
<el-form ref="form2" :model="form2" :rules="rules1" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="卡号" prop="number" style="width: 500px">
@ -1411,7 +1411,7 @@ export default {
this.title = this.payment
},
confirm1(){
this.$refs["form"].validate(valid => {
this.$refs["form2"].validate(valid => {
if (valid) {
this.form2.userId = this.id
giftCardExchange(this.form2).then(res => {
@ -1422,6 +1422,7 @@ export default {
this.openRecharge = false
this.form2.number = ''
this.form2.cardPassword = ''
this.getUserInfo()
}
})
}
@ -1602,6 +1603,7 @@ export default {
//
this_.isPaySuccess = true;
this_.isQuery = false;
this_.getUserInfo()
}else if (payStatus === "payFail") {
this_.isPaySuccess = false;
this_.isQuery = false;
@ -1675,6 +1677,7 @@ export default {
if (response.data.payStatus == "paid") {
this_.isPaySuccess = true;
this_.isQuery = false;
this_.getUserInfo()
}
if (response.data.payStatus == "payFail") {
this_.isPaySuccess = false;

View File

@ -218,15 +218,15 @@
</el-row>
<el-row>
<el-col :span="24" style="display: flex;margin-bottom: 10px">
<el-form-item label="提成来源" prop="commissionSource" style="width: 420px">
<el-form-item label="提成来源" prop="commissionSource" style="width: 90%">
<el-radio-group v-model="form.commissionSource" v-if="form.commissionSource == '非油品'">
<!-- <el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>-->
<el-radio v-if="form.commissionSource == '非油品'" @change="isChange" label="非油品" value="非油品"></el-radio>
</el-radio-group>
<el-radio-group v-model="form.commissionSource" v-else>
<!-- <el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>-->
<el-radio @change="isChange" label="储值卡充值" value="储值卡充值"></el-radio>
<el-radio @change="isChange" label="囤油卡充值" value="囤油卡充值"></el-radio>
<el-radio @change="isChange" label="电子储值卡充值" value="电子储值卡充值"></el-radio>
<el-radio @change="isChange" label="电子囤油卡充值" value="电子囤油卡充值"></el-radio>
<el-radio @change="isChange" label="车主加油" value="车主加油"></el-radio>
</el-radio-group>
</el-form-item>
@ -286,7 +286,8 @@
<el-col :span="24">
<el-form-item label="提成金额" prop="royaltyRate">
<el-input v-model="form.royaltyRate" placeholder="请输入提成">
<el-select v-model="select" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" style="width: 70px" slot="append" placeholder="请选择">
<el-select v-model="select" maxlength="10"
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" style="width: 70px" slot="append" placeholder="请选择">
<el-option label="元" value="元"></el-option>
<el-option label="%" value="%"></el-option>
</el-select>
@ -730,9 +731,9 @@ export default {
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (/^\d+$/.test(this.form.royaltyRate)){
// if (/^\d+$/.test(this.form.royaltyRate)){
this.form.royaltyRate = this.form.royaltyRate + this.select
}
// }
this.form.staffRoleGroup = this.staffRoleGroup.toString()
if (this.form.id) {
updateCommission(this.form).then(response => {

View File

@ -329,8 +329,8 @@
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>
<!-- <span v-if="scope.row.giftCardType == 1" >洗车</span>-->
<!-- <span v-if="scope.row.giftCardType == 2" >通用券</span>-->
</template>
</el-table-column>
<el-table-column
@ -394,9 +394,9 @@
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>
<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
@ -627,8 +627,8 @@
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>
<!-- <span v-if="scope.row.type == 1" >洗车</span>-->
<!-- <span v-if="scope.row.type == 2" >通用券</span>-->
</template>
</el-table-column>
<el-table-column
@ -692,9 +692,9 @@
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>
<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
@ -1018,23 +1018,25 @@ export default {
//
getISEnableLevel(){
getChainStoreConfig().then(response => {
this.isEnableLevel = response.data.isEnableLevel;
this.clear = response.data.isMonthClear;
if (response.data.gasGrowthValue){
this.gasGrowthValue = response.data.gasGrowthValue;
}
if (response.data.dieselGrowthValue) {
this.dieselGrowthValue = response.data.dieselGrowthValue;
}
if (response.data.naturalGrowthValue) {
this.naturalGrowthValue = response.data.naturalGrowthValue;
}
if (response.data.isEnableLevel=="no"){
this.level1 = true;
this.level2 = false;
}else {
this.level1 = false;
this.level2 = true;
if (response.data) {
this.isEnableLevel = response.data.isEnableLevel;
this.clear = response.data.isMonthClear;
if (response.data.gasGrowthValue) {
this.gasGrowthValue = response.data.gasGrowthValue;
}
if (response.data.dieselGrowthValue) {
this.dieselGrowthValue = response.data.dieselGrowthValue;
}
if (response.data.naturalGrowthValue) {
this.naturalGrowthValue = response.data.naturalGrowthValue;
}
if (response.data.isEnableLevel == "no") {
this.level1 = true;
this.level2 = false;
} else {
this.level1 = false;
this.level2 = true;
}
}
})
// getSysConfig('is_enable_level').then(response => {
@ -1116,7 +1118,7 @@ export default {
//
getClearConfig(){
getChainStoreConfig().then(response => {
this.clear = response.data.levelClearRule;
if (response.data) this.clear = response.data.levelClearRule;
})
},
//
@ -1229,6 +1231,8 @@ export default {
updateUserGrade(this.form).then(response => {
if (response.data==1) {
this.$modal.msgSuccess("修改成功");
this.tableDatas1 = []
this.tableDatas = []
this.open = false;
this.getList();
}else if (response.data==2) {
@ -1248,6 +1252,8 @@ export default {
if (res.data==1){
this.$modal.msgSuccess("新增成功");
this.open = false;
this.tableDatas1 = []
this.tableDatas = []
this.getList();
}else if (res.data==0){
this.$modal.msgError("新增失败最多支持20个等级");

View File

@ -489,6 +489,7 @@
this.$refs["form"].validate(valid => {
if (valid) {
if (!this.form.id) {
this.form.storeId = this.id;
this.form.posPrem = JSON.stringify(this.form.posPrem);
this.form.appletPrem = JSON.stringify(this.form.appletPrem);
addStaff(this.form).then(response => {

View File

@ -211,7 +211,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
}
}
}
if (type.equals("3") && staffCommission.getCommissionSource().equals("储值卡充值")){
if (type.equals("3") && staffCommission.getCommissionSource().equals("电子储值卡充值")){
for (String staffRoleGroup : staffRoleGroups) {
if (staff.getRoleId().equals(staffRoleGroup)) {
commissionRecord.setStaffId(staffId);
@ -247,7 +247,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
}
}
}
if (type.equals("4") && staffCommission.getCommissionSource().equals("囤油卡充值")){
if (type.equals("4") && staffCommission.getCommissionSource().equals("电子囤油卡充值")){
for (String staffRoleGroup : staffRoleGroups) {
if (staff.getRoleId().equals(staffRoleGroup)) {
commissionRecord.setStaffId(staffId);

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.activeDiscount.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@ -132,13 +133,17 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
List<ActiveDiscountChild> activeDiscountChildList = activeDiscountChildService.list(queryWrappers);
BeanUtils.copyProperties(s,activeDiscountVO);
activeDiscountVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
if (ObjectUtil.isNotEmpty(s.getAdaptOil())) {
activeDiscountVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
}
String oilName = "";
for (Integer integer : activeDiscountVO.getAdaptOil()) {
OilName oilNames = oilNameService.selectOilNameById(integer);
oilName += oilNames.getOilType() + "-"+oilNames.getOilName() + ",";
if (ObjectUtils.isNotEmpty(activeDiscountVO.getAdaptOil())) {
for (Integer integer : activeDiscountVO.getAdaptOil()) {
OilName oilNames = oilNameService.selectOilNameById(integer);
oilName += oilNames.getOilType() + "-" + oilNames.getOilName() + ",";
}
}
if (oilName.endsWith(",")) { // 判断字符串是否以逗号结尾

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.activeExchange.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -512,7 +513,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
//折扣+优惠券
for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) {
if (!activeDiscountPayVO.getParticipationCondition().equals("1")){
if (ObjectUtil.isNotEmpty(activeDiscountPayVO.getParticipationCondition())
&& !activeDiscountPayVO.getParticipationCondition().equals("1")){
for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
if(StringUtils.isNotEmpty(cardFavorableRecordVO.getExclusiveFunction()) && cardFavorableRecordVO.getExclusiveFunction().equals("2")
&& StringUtils.isNotEmpty(cardFavorableRecordVO.getExclusiveFunction()) && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
@ -553,7 +555,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
//满减+优惠券
for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) {
if (!activeDiscountPayVO.getParticipationCondition().equals("1")){
if (ObjectUtils.isNotEmpty(activeDiscountPayVO.getParticipationCondition())
&& !activeDiscountPayVO.getParticipationCondition().equals("1")){
for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
if(StringUtils.isNotEmpty(cardFavorableRecordVO.getExclusiveFunction()) && ObjectUtils.isNotEmpty(cardFavorableRecordVO) && cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
@ -838,10 +841,12 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){
for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) {
BigDecimal amount = new BigDecimal(activeConsumptionVO.getAmount());
if (activeConsumptionVO.getMoneyType().equals("1") && paymentActiveDTO.getOrderAmount()>=activeConsumptionVO.getAmount()){
if (ObjectUtils.isNotEmpty(activeConsumptionVO.getMoneyType()) && activeConsumptionVO.getMoneyType().equals("1")
&& paymentActiveDTO.getOrderAmount()>=activeConsumptionVO.getAmount()){
activeConsumptionVOS1.add(activeConsumptionVO);
}
if (activeConsumptionVO.getMoneyType().equals("2") && paymentActiveDTO.getAmount().compareTo(amount)>0){
if (ObjectUtils.isNotEmpty(activeConsumptionVO.getMoneyType()) && activeConsumptionVO.getMoneyType().equals("2")
&& paymentActiveDTO.getAmount().compareTo(amount)>0){
activeConsumptionVOS1.add(activeConsumptionVO);
}
}

View File

@ -12,6 +12,7 @@ public class ActiveOneCouponDTO extends ActiveOneCoupon implements Serializable
private List<Integer> cardFavorableIds;
//兑换券ids
private List<Integer> cardExchangeIds;
private Integer condition;
//会员等级ids
private Integer[] gradeIds;
}

View File

@ -1,7 +1,12 @@
package com.fuint.business.marketingActivity.activeOneCoupon.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -14,23 +19,30 @@ import java.io.Serializable;
*/
@SuppressWarnings("serial")
@Data
@TableName("active_one_coupon")
public class ActiveOneCoupon extends Model<ActiveOneCoupon> {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
private Integer storeId;
private String activeName;
//会员等级id
private String gradeId;
private Integer condition;
//会员等级名字
private String gradeName;
private Integer conditions;
//创建者
private String createBy;
//创建时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date createTime;
//更新者
private String updateBy;
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date updateTime;
/**

View File

@ -1,7 +1,12 @@
package com.fuint.business.marketingActivity.activeOneCoupon.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -14,8 +19,10 @@ import java.io.Serializable;
*/
@SuppressWarnings("serial")
@Data
@TableName("active_one_coupon_child")
public class ActiveOneCouponChild extends Model<ActiveOneCouponChild> {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
private Integer storeId;
//消费有礼活动id
@ -31,10 +38,12 @@ public class ActiveOneCouponChild extends Model<ActiveOneCouponChild> {
//创建者
private String createBy;
//创建时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date createTime;
//更新者
private String updateBy;
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date updateTime;

View File

@ -28,6 +28,7 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.mapper.MtUserGradeMapper;
import com.fuint.repository.model.MtUserGrade;
import com.fuint.repository.model.MtUserGradeVO;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -73,15 +74,16 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
String gradeIdStr = "";
String gradeIdName = "";
Integer[] gradeIds = activeOneCouponDTO.getGradeIds();
/* for (Integer gradeId : gradeIds) {
for (Integer gradeId : gradeIds) {
gradeIdStr+=gradeId + ",";
MtUserGrade mtUserGrade = mtUserGradeMapper.selectById(gradeId);
MtUserGradeVO mtUserGrade = mtUserGradeMapper.selectByGradeId(gradeId);
gradeIdName += mtUserGrade.getName() + ",";
}*/
}
activeOneCoupon.setGradeId(gradeIdStr);
activeOneCoupon.setGradeName(gradeIdName);
activeOneCoupon.setStoreId(nowAccountInfo.getStoreId());
activeOneCoupon.setCondition(activeOneCouponDTO.getCondition());
activeOneCoupon.setConditions(activeOneCouponDTO.getCondition());
activeOneCoupon.setActiveName(activeOneCouponDTO.getActiveName());
flag = save(activeOneCoupon);
//优惠券
List<Integer> cardFavorableIds = activeOneCouponDTO.getCardFavorableIds();
@ -129,14 +131,14 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
String[] gradeId = gradeIds.split(",");
for (String s : gradeId) {
LJUserVos ljUserVos = new LJUserVos();
MtUserGrade mtUserGrade = mtUserGradeMapper.selectById(s);
MtUserGradeVO mtUserGrade = mtUserGradeMapper.selectByGradeId(Integer.parseInt(s));
ljUserVos.setGradeName(mtUserGrade.getName());
LJUserVo ljUserVo = new LJUserVo();
ljUserVo.setGradeId(Integer.parseInt(s));
List<LJUserVo> userLists = userService.getUserCountList(ljUserVo);
ljUserVos.setCountAll(userLists.size());
ljUserVo.setDays(record.getCondition());
ljUserVo.setDays(record.getConditions());
List<LJUserVo> userListss = userService.getUserLists(ljUserVo);
ljUserVos.setCount(userListss.size());
if (ObjectUtils.isNotEmpty(ljUserVos.getCountAll()) && ObjectUtils.isNotEmpty(ljUserVos.getCount()) && ljUserVos.getCountAll()!=0){
@ -144,6 +146,7 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
}
userList.add(ljUserVos);
}
activeOneCouponVO.setUserVos(userList);
//优惠券
LambdaQueryWrapper<CardFavorableRecord> queryWrapper1 = new LambdaQueryWrapper<>();
@ -178,7 +181,7 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
@Override
public ActiveOneCouponVO getOneById(Serializable id) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
ArrayList<String> ids = new ArrayList<>();
ActiveOneCouponVO activeOneCouponVO = new ActiveOneCouponVO();
ActiveOneCoupon oneCoupon = getById(id);
BeanUtils.copyProperties(oneCoupon, activeOneCouponVO);
@ -188,18 +191,29 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
List<ActiveOneCouponChild> activeOneCouponChildren = activeOneCouponChildService.list(queryWrapper);
ArrayList<CardFavorable> cardFavorableArrayList = new ArrayList<>();
ArrayList<CardExchange> cardExchangeArrayList = new ArrayList<>();
ArrayList<Integer> cardFavorableIds = new ArrayList<>();
ArrayList<Integer> cardExchangeIds = new ArrayList<>();
for (ActiveOneCouponChild activeOneCouponChild : activeOneCouponChildren) {
//优惠券
if (activeOneCouponChild.getActiveGift().equals("1")){
CardFavorable byId = cardFavorableService.getById(activeOneCouponChild.getVouchersId());
cardFavorableArrayList.add(byId);
cardFavorableIds.add(byId.getId());
}
//兑换券
if (activeOneCouponChild.getActiveGift().equals("2")){
CardExchange byId = exchangeService.getById(activeOneCouponChild.getVouchersId());
cardExchangeArrayList.add(byId);
cardExchangeIds.add(byId.getId());
}
}
String[] split = oneCoupon.getGradeId().split(",");
for (String s : split) {
ids.add(s);
}
activeOneCouponVO.setGradeIds(ids);
activeOneCouponVO.setCardExchangeIds(cardExchangeIds);
activeOneCouponVO.setCardFavorableIds(cardFavorableIds);
activeOneCouponVO.setCardFavorableList(cardFavorableArrayList);
activeOneCouponVO.setCardExchangeList(cardExchangeArrayList);
return activeOneCouponVO;
@ -211,6 +225,21 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
boolean flag = false;
ActiveOneCoupon activeOneCoupon = new ActiveOneCoupon();
BeanUtils.copyProperties(activeOneCouponDTO,activeOneCoupon);
activeOneCoupon.setConditions(activeOneCouponDTO.getCondition());
//会员等级
String gradeIdStr = "";
String gradeIdName = "";
Integer[] gradeIds = activeOneCouponDTO.getGradeIds();
for (Integer gradeId : gradeIds) {
gradeIdStr+=gradeId + ",";
MtUserGradeVO mtUserGrade = mtUserGradeMapper.selectByGradeId(gradeId);
gradeIdName += mtUserGrade.getName() + ",";
}
activeOneCoupon.setGradeId(gradeIdStr);
activeOneCoupon.setGradeName(gradeIdName);
flag= updateById(activeOneCoupon);
//更新子表数据

View File

@ -13,6 +13,8 @@ import java.util.List;
@Data
public class ActiveOneCouponVO extends ActiveOneCoupon implements Serializable {
private List<LJUserVos> vosList;
//会员等级ids
private List<String> gradeIds;
//优惠券领取数量
private Integer couponReceiveCount;
//优惠券使用数量
@ -34,4 +36,8 @@ public class ActiveOneCouponVO extends ActiveOneCoupon implements Serializable {
private List<ActiveOneCouponChild> activeOneCouponChildren;
private List<CardFavorable> cardFavorableList;
private List<CardExchange> cardExchangeList;
private List<LJUserVos> userVos;
private List<Integer> cardFavorableIds;
//兑换券ids
private List<Integer> cardExchangeIds;
}

View File

@ -29,6 +29,7 @@ public class CardExchange extends Model<CardExchange> {
private Integer storeId;
//是否在线 0在线 1 下线
private String isonline;
private String cardDetail;
//兑换券状态 0启用 1 禁用
private String status;
//兑换券名称

View File

@ -55,8 +55,15 @@ public class CardExchangeServiceImpl extends ServiceImpl<CardExchangeMapper, Car
String secretKey = "sQPoC/1do9BZMkg8I5c09A==";
CryptoUtils.encryptSymmetrically(secretKey, null,cardExchange.getQrCodeLink(), CryptoUtils.Algorithm.Encryption.AES_ECB_PKCS5);
Integer giftId = cardExchange.getGiftId();
LJGoods ljGoods = goodsService.selectLJGoodsById(giftId);
cardExchange.setGiftName(ljGoods.getName());
if (ObjectUtils.isNotEmpty(giftId)){
LJGoods ljGoods = goodsService.selectLJGoodsById(giftId);
cardExchange.setGiftName(ljGoods.getName());
}
if (cardExchange.getType().equals("0")){
cardExchange.setCardDetail("可兑换-"+cardExchange.getGiftName());
}else {
cardExchange.setCardDetail("可兑换-"+"洗车券");
}
return save(cardExchange);
}

View File

@ -27,6 +27,7 @@ public class CardFavorable extends Model<CardFavorable> {
private Integer storeId;
//是否在线 0在线 1 下线
private String isonline;
private String cardDetail;
//优惠券名称
private String name;
//卡券类型 0油品券 1商品券 2通用券

View File

@ -351,7 +351,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
for (String gradeId : split) {
LJUserVo ljUserVo = new LJUserVo();
ljUserVo.setGradeId(Integer.parseInt(gradeId));
ljUserVo.setDays(activeOneCoupon.getCondition());
ljUserVo.setDays(activeOneCoupon.getConditions());
List<LJUserVo> userLists = userService.getUserLists(ljUserVo);
ljUserVosList.addAll(userLists);
}

View File

@ -70,6 +70,11 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
oil += s + ",";
}
cardFavorable.setOilType(oil);
if (cardFavorableDTO.getType().equals("0")){
cardFavorable.setCardDetail(""+cardFavorableDTO.getSatisfiedAmount()+""+cardFavorableDTO.getDiscountAmount());
}else {
cardFavorable.setCardDetail(""+cardFavorableDTO.getSatisfiedAmount()+""+cardFavorableDTO.getSpecialDiscount()+"");
}
return save(cardFavorable);
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.cardGift.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcelFactory;
import com.alipay.api.domain.LoginUserDTO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -176,7 +177,14 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
public CardGift exchange(CardGift cardGift) {
//登录用户id
Integer userId = TokenUtil.getNowAccountInfo().getId();
LJUserVo ljUserVo = ljUserService.selectUserById(userId, TokenUtil.getNowAccountInfo().getStoreId());
if (ObjectUtil.isNotEmpty(cardGift.getUserId())){
userId = cardGift.getUserId();
}
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
if (ObjectUtil.isNotEmpty(cardGift.getStoreId())){
storeId = cardGift.getStoreId();
}
LJUserVo ljUserVo = ljUserService.selectUserById(userId, storeId);
LambdaQueryWrapper<CardGift> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardGift::getNumber,cardGift.getNumber());
queryWrapper.eq(CardGift::getStatus,"1");

View File

@ -117,7 +117,7 @@ public class LJStaffController extends BaseController {
@PostMapping("/mobile")
public ResponseObject staffByMobile(@Validated @RequestBody Map<String ,String > map){
String mobile = map.get("mobile");
LJStaff staff = mtStaffService.selectStaffByMobile(mobile);
LJStaff staff = mtStaffService.selectStaffByMobile(mobile,null);
return getSuccessResult(staff);
}

View File

@ -54,7 +54,7 @@ public interface ILJStaffService extends IService<LJStaff> {
* @param mobile
* @return
*/
public LJStaff selectStaffByMobile(String mobile);
public LJStaff selectStaffByMobile(String mobile,Integer storeId);
public LJStaff selectStaffByMobile2(String mobile);
/**

View File

@ -19,6 +19,8 @@ import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.ResponseObject;
import com.fuint.module.backendApi.controller.BackendFileController;
import com.fuint.repository.model.TAccount;
import com.fuint.system.role.entity.TDuty;
import com.fuint.system.role.service.DutyService;
import com.fuint.utils.Digests;
import com.fuint.utils.Encodes;
import jdk.nashorn.internal.parser.Token;
@ -28,6 +30,7 @@ import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.text.SimpleDateFormat;
@ -45,6 +48,8 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
private AccountService accountService;
@Autowired
private QrCodeUtils qrCodeUtils;
@Resource
private DutyService tDutyService;
/**
* 根据条件分页查询员工信息
@ -126,11 +131,14 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
* @return
*/
@Override
public LJStaff selectStaffByMobile(String mobile) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
public LJStaff selectStaffByMobile(String mobile,Integer storeId) {
if (ObjectUtil.isEmpty(storeId)){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
storeId = nowAccountInfo.getStoreId();
}
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("mobile",mobile);
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
queryWrapper.eq("store_id",storeId);
queryWrapper.eq("if_delete","0");
LJStaff staff = baseMapper.selectOne(queryWrapper);
return staff;
@ -176,19 +184,19 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
*/
@Override
public int insertStaff(LJStaff staff) {
LJStaff staff2 = this.selectStaffByMobile(staff.getMobile());
if (ObjectUtil.isNotEmpty(staff2)) return 0;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
if (ObjectUtil.isNotEmpty(staff.getStoreId())) {
storeId = staff.getStoreId();
}
LJStaff staff2 = this.selectStaffByMobile(staff.getMobile(),storeId);
if (ObjectUtil.isNotEmpty(staff2)) return 0;
staff.setStoreId(storeId);
if (StringUtils.isNotEmpty(staff.getRefundPassword())){
this.entryptPassword(staff);
}
int row = baseMapper.insert(staff);
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile());
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),storeId);
if (ObjectUtil.isNotEmpty(staff1)){
// 添加员工码
staff1.setStaffCode("https://www.tuofeng.cc/oilRefuel?storeId="+storeId+"&staffId="+staff1.getId());
@ -221,15 +229,16 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
}else {
account.setPassword("123456");
}
accountService.createAccountInfo(account,null);
TDuty tDuty = new TDuty();
tDuty.setDutyId(Integer.valueOf(staff1.getRoleId()));
accountService.createAccountInfo(account,tDutyService.getDutyList(tDuty));
return row;
}
@Override
public int addStaff(LJStaff staff,TAccount tAccount) {
int row = baseMapper.insert(staff);
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile());
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),null);
if (ObjectUtil.isNotEmpty(staff1)){
tAccount.setStaffId(staff1.getId());
accountService.updateAccount(tAccount);
@ -245,8 +254,8 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
@Override
public int updateStaff(LJStaff staff) {
int row = 0;
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile());
if (ObjectUtil.isNotEmpty(staff1) && staff1.getId() != staff.getId()){
LJStaff staff1 = this.selectStaffByMobile(staff.getMobile(),staff.getStoreId());
if (ObjectUtil.isNotEmpty(staff1) && !staff1.getId().equals(staff.getId())){
row = 0;
return row;
}

View File

@ -289,7 +289,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 商品优惠金额
Double goodsDiscount = Double.valueOf(map.get("goodsDiscount"));
// 员工id
Integer staffId = Integer.valueOf(map.get("staffId"));
Integer staffId = null;
if (ObjectUtil.isNotEmpty(map.get("staffId"))){
staffId = Integer.valueOf(map.get("staffId"));
}
// 会员消费金额储值卡需要减少的金额
Double consumeAmount = Double.valueOf(map.get("consumeAmount"));
Integer userId = null;
@ -359,7 +362,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
ljOrder.setDiscount(goodsDiscount);
ljOrder.setStaffId(staffId);
ljOrder.setStatus(payStatus);
if (payType.equals("CASH")){
if (payType.equals("CASH") && ObjectUtil.isNotEmpty(staffId)){
staffCommissionService.countStaffCommission(staffId,storeId,goodsAmount,goodsActualPay,"2",orderNo);
ljOrder.setPayTime(new Date());
}
@ -412,7 +415,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setDiscountAmount(oilDiscount);
order.setBalanceAmount(Double.valueOf(balanceAmount));
order.setOilCardAmount(Double.valueOf(oilCardAmount));
if (payType.equals("CASH")){
if (payType.equals("CASH") && ObjectUtil.isNotEmpty(staffId)){
staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,"1",orderNo);
}
order.setCouponId(recordId);
@ -427,7 +430,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setCouponId(null);
}
if (userId!=null){
if (ObjectUtil.isNotEmpty(userId)){
this.updateGrowthValue(oilAmount,oilActualPay, userId, Integer.valueOf(jsonObjects.get(i).get("oilName").toString()),refuelMoney,storeId,orderNo);
}
order.setStoreId(storeId);
@ -551,7 +554,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 调用消费有礼接口
public void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Integer oilId){
if (userId!=null){
if (ObjectUtil.isNotEmpty(userId)){
LJUserVo userVo = userService.queryUserById(userId, storeId);
PaymentActiveVO paymentActiveVO = new PaymentActiveVO();
paymentActiveVO.setUserId(userId);
@ -1383,7 +1386,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
* @param storeId 店铺id
*/
private void updateGrowthValue(Double oilAmount,Double oilActualPay,Integer userid,Integer oilId,String refuelMoney,Integer storeId,String orderNo){
if (oilId!=null){
if (ObjectUtil.isNotEmpty(oilId)){
OilName oilName = oilNameService.selectOilNameById(oilId);
// 获取成长值增长数值
Integer gasGrowthValue = null;
@ -1421,7 +1424,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// }else {
// balance.setRefuelMoney(refuelMoney);
// }
if (ObjectUtil.isNotEmpty(refuelMoney)){
if (ObjectUtil.isNotEmpty(refuelMoney) && !refuelMoney.equals("null")){
String refuelMoney1 = balance.getRefuelMoney();
JSONArray objects = JSONArray.parseArray(refuelMoney);
JSONArray objects1 = JSONArray.parseArray(refuelMoney1);

View File

@ -337,4 +337,10 @@ public class BackendStoreController extends BaseController {
public ResponseObject loginVerification(@RequestBody String flag) {
return getSuccessResult(storeService.loginVerification(flag));
}
@GetMapping("getById/id")
public ResponseObject getById(@PathVariable("id") Integer id) {
//return getSuccessResult(storeService.loginVerification(flag));
return null;
}
}

View File

@ -251,7 +251,7 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
public int updateUserGrade(LJUserGrade userGrade) {
int row = 0;
boolean flag = false;
LJStore store = storeService.selectStoreByStoreId(userGrade.getStoreId());
LJStore store = storeService.selectStoreByStoreId(TokenUtil.getNowAccountInfo().getStoreId());
List<LJUserGrade> ljUserGrades = this.selectUserGradeByChainStoreId(store.getChainStoreId());
for (LJUserGrade ljUserGrade : ljUserGrades) {
if (ljUserGrade.getGrade().equals(userGrade.getGrade()) && !ljUserGrade.getId().equals(userGrade.getId())){

View File

@ -48,17 +48,19 @@ public class MtUserGradeChildServiceImpl extends ServiceImpl<MtUserGradeChildMap
LJUserVo userVo = userService.queryUserById(userId, storeId);
LJStore store = storeService.selectStoreByStoreId(storeId);
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")){
if (ObjectUtil.isNotEmpty(userVo.getGradeId())){
LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeById(userVo.getGradeId());
if (!ljUserGrade.getIfRechargeCoupon().equals("1")){
return new ArrayList<MtUserGradeChild>();
if (ObjectUtil.isNotEmpty(chainStoreConfig)) {
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")) {
if (ObjectUtil.isNotEmpty(userVo.getGradeId())) {
LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeById(userVo.getGradeId());
if (!ljUserGrade.getIfRechargeCoupon().equals("1")) {
return new ArrayList<MtUserGradeChild>();
}
} else {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_grade_id", userVo.getGradeId());
return baseMapper.selectList(queryWrapper);
}
}else{
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_grade_id",userVo.getGradeId());
return baseMapper.selectList(queryWrapper);
}
}
return new ArrayList<MtUserGradeChild>();

View File

@ -994,6 +994,12 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
}
// 新增会员余额信息
userBalanceService.insertUserBalance(userBalanceAdd);
}else {
LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeByStoreId(Integer.parseInt(storeId));
if (ObjectUtil.isNotEmpty(ljUserGrade) && ObjectUtil.isNotEmpty(ljUserGrade.getId())) {
userBalance.setGradeId(ljUserGrade.getId());
}
userBalanceService.updateUserBalance(userBalance);
}
// 查询关联表里面是否有信息 注册邀请
MtInvitation mtInvitation1 = mtInvitationMapper.queryByStoreId(Integer.parseInt(storeId), mtUser.getId());

View File

@ -285,6 +285,9 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
if (ObjectUtil.isNotEmpty(tDuty) && ObjectUtil.isNotEmpty(tDuty.getPermissionType())) {
lambdaQueryWrapper.like(TDuty::getPermissionType,tDuty.getPermissionType());
}
if (ObjectUtil.isNotEmpty(tDuty) && ObjectUtil.isNotEmpty(tDuty.getDutyId())) {
lambdaQueryWrapper.eq(TDuty::getDutyId,tDuty.getDutyId());
}
return baseMapper.selectList(lambdaQueryWrapper);
}

View File

@ -2,6 +2,7 @@ package com.fuint.repository.mapper;
import com.fuint.repository.model.MtUserGrade;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.repository.model.MtUserGradeVO;
/**
* Mapper 接口
@ -10,5 +11,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* CopyRight https://www.fuint.cn
*/
public interface MtUserGradeMapper extends BaseMapper<MtUserGrade> {
MtUserGradeVO selectByGradeId(Integer gradeId);
// empty
}

View File

@ -38,9 +38,9 @@ public class MtUserGrade implements Serializable {
@ApiModelProperty("等级名称")
private String name;
// @ApiModelProperty("升级会员等级条件描述")
/*// @ApiModelProperty("升级会员等级条件描述")
// private String catchCondition;
*/
@ApiModelProperty("升级会员等级条件init:默认获取;pay:付费升级frequency:消费次数amount:累积消费金额升级")
@TableField(exist = false)
private String catchType;

View File

@ -0,0 +1,18 @@
package com.fuint.repository.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class MtUserGradeVO {
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("等级")
private Integer grade;
@ApiModelProperty("等级名称")
private String name;
}

View File

@ -2,4 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.repository.mapper.MtUserGradeMapper">
<select id="selectByGradeId" resultType="com.fuint.repository.model.MtUserGradeVO">
select id,grade,name from mt_user_grade where id = #{gradeId}
</select>
</mapper>

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 测试支付接口
export function giftCardExchange(query) {
return request({
url: '/business/marketingActivity/cardGift/exchange',
url: '/business/marketingActivity/cardGift/exchange?number=' + query.number + "&cardPassword=" + query.cardPassword + "&userId=" + query.userId,
method: 'get',
data:query
})

View File

@ -68,8 +68,8 @@
<div style="width: 200px">{{ getName(oilNameList,item.oilName) }}_{{getName1(gunList,item.gunName)}}</div>
<div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">
<div style="color: red">-{{ item.discount }}</div>
<div style="color: grey" v-if="item.type!=1">满减优惠</div>
<div style="color: grey" v-if="item.type!=2">折扣优惠</div>
<div style="color: grey" v-if="item.type!=2">满减优惠</div>
<div style="color: grey" v-if="item.type!=1">折扣优惠</div>
</div>
</div>
</el-checkbox>
@ -90,7 +90,7 @@
</div>
<div>-{{ fullReduction.toFixed(2) }}</div>
</div>
<div class="center-left-hj" v-show="isMember">
<div class="center-left-hj" v-show="isMember && gradeDiscount.length>0">
<div>
<el-popover
placement="bottom-start"
@ -188,7 +188,7 @@
</div>
<div class="th-box">
<div @click="getStaffList">加油员</div>
<div style="cursor: pointer;color: crimson" @click="getStaffList" >{{ staff.realName }}</div>
<div style="cursor: pointer;color: crimson" @click="getStaffList" >{{ staff ? staff.realName : "--" }}</div>
</div>
</div>
</div>
@ -345,13 +345,16 @@
:visible.sync="dialogVisible"
width="30%"
:close-on-click-modal="false">
<div class="wrap-wrap">
<div class="wrap-wrap" v-if="staffList.length>0">
<div class="of-box" v-for="(item,index) in staffList" :key="index"
@click="chooseStaff(item)"
:style="{'background-color': item.color}">
<div class="of-title">{{ item.realName }}</div>
<div style="text-align: center;font-size: 17px">{{ item.mobile }}</div>
</div>
</div>
<div class="wrap-wrap" v-else>
<span>暂未配置加油员</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
@ -582,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>
@ -794,7 +797,7 @@
</div>
</el-tab-pane>
<el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard">
<el-form ref="form" :model="form3" :rules="rules2" label-width="120px">
<el-form ref="form3" :model="form3" :rules="rules2" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="卡号" prop="number" style="width: 500px">
@ -1574,7 +1577,7 @@
//
oilNumberList:[],
//
isSure:true,
isSure:false,
//
couponAmount:0,
//
@ -1626,7 +1629,7 @@
this.getOilName();
this.getGoods();
// this.getStaffList();
this.getStaff();
// this.getStaff();
this.getList();
this.getCouponList();
// this.getUnitList();
@ -1760,14 +1763,17 @@
},
//
async userRecharge() {
if (this.isSure){
if (!this.isSure){
// if (this.member){
this.$message.error("请先选择会员")
return;
}
await getUserGrade(this.member.gradeId).then(res => {
this.grade = res.data
})
if (this.member && this.member.gradeId){
await getUserGrade(this.member.gradeId).then(res => {
this.grade = res.data
})
}
await this.getCardFuelDieselList()
await this.getCardValueList()
@ -2075,16 +2081,19 @@
}
},
confirm1(){
this.$refs["form"].validate(valid => {
this.$refs["form3"].validate(valid => {
if (valid) {
giftCardExchange(this.form2).then(res => {
this.form3.userId = this.member.id
let cardGift = this.form3
giftCardExchange(cardGift).then(res => {
if (res.data.id == '' || res.data.id == null) {
this.$message.error('兑换失败!');
} else {
this.$message.success('兑换成功!');
this.openRecharge = false
this.form2.number = ''
this.form2.cardPassword = ''
this.form3.number = ''
this.form3.cardPassword = ''
this.getMemberAfter();
}
})
}
@ -2557,7 +2566,9 @@
this.map.consumeAmount = 0.0;
this.map.refuelMoney = JSON.stringify(this.refuelMoney)
this.map.couponId = this.useCouponIds
this.map.staffId = this.staff.id
if (this.staff){
this.map.staffId = this.staff.id
}
this.map.cardFavorableId = this.cardFavorableId
this.map.recordId = this.recordId
this.map.userId = this.member.id
@ -3437,7 +3448,7 @@
},
//
handleChoose(data) {
this.isSure = false;
this.isSure = true;
this.member = data;
if (data.refuelMoney){
this.refuelMoney = JSON.parse(data.refuelMoney)
@ -3569,7 +3580,7 @@
this.dialogVisiblej = true
this.getStaff()
// this.getStaff()
},
//
resetting(){
@ -3786,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)
@ -3794,7 +3805,7 @@
this.refuelMoney = null
}
this.storeId = response.data.storeId
this.isSure = false
this.isSure = true
}else {
this.$modal.msgError("会员信息不存在")
}
@ -3826,6 +3837,7 @@
this.amount = 0
this.dialogVisibleamount = true;
let result = false
this.isExistOilOrder = false;
//
this.oilOrder.forEach(item => {
if (item.id==data.id){
@ -3852,7 +3864,6 @@
},
//
async collection(){
this.loading = true;
if (this.payType=="CASH"){
if (this.authCode<((+this.oilActualPay) + (+this.goodsActualPay)) || this.seekZero<0){
this.$modal.msgError("请输入正确的金额");
@ -3867,6 +3878,7 @@
this.$modal.msgError("请先扫码");
return;
}
this.loading = true;
// JSON.parse()
this.map.seekZero = this.seekZero;
this.map.oilAmount = this.oilAmount;
@ -3887,7 +3899,9 @@
this.updateRefuelMoney();
this.map.refuelMoney = JSON.stringify(this.refuelMoney)
this.map.couponId = this.useCouponIds
this.map.staffId = this.staff.id
if (this.staff) {
this.map.staffId = this.staff.id
}
this.map.cardFavorableId = this.cardFavorableId
this.map.recordId = this.recordId
this.map.userId = this.member.id
@ -3984,6 +3998,7 @@
_this.oilTotal = 0;
_this.goodsTotal = 0;
_this.isMember = false;
_this.isSure = false;
_this.oilOrder = []
_this.goodsOrder = []
_this.amount = 0

View File

@ -367,7 +367,7 @@
</div>
</el-tab-pane>
<el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard">
<el-form ref="form" :model="form2" :rules="rules1" label-width="120px">
<el-form ref="form2" :model="form2" :rules="rules1" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="卡号" prop="number" style="width: 500px">
@ -1368,8 +1368,9 @@ export default {
}
},
confirm1(){
this.$refs["form"].validate(valid => {
this.$refs["form2"].validate(valid => {
if (valid) {
this.form2.userId = this.id;
giftCardExchange(this.form2).then(res => {
if (res.data.id == '' || res.data.id == null) {
this.$message.error('兑换失败!');
@ -1378,6 +1379,7 @@ export default {
this.openRecharge = false
this.form2.number = ''
this.form2.cardPassword = ''
this.getUserInfo();
}
})
}

View File

@ -3,13 +3,12 @@ module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
// baseUrl: 'http://192.168.0.196:8081/',
// baseUrl: 'http://192.168.1.4:8080/',
// baseUrl: 'http://www.nuoyunr.com/lananRsc/',
// baseUrl: 'http://192.168.0.121:8080/',
baseUrl: 'http://192.168.0.178:8008/',
// baseUrl: 'http://192.168.1.5:8002/cdJdc',
imagesUrl: 'http://www.nuoyunr.com/lananRsc',
// 应用信息

View File

@ -61,20 +61,18 @@
<!-- centenr -->
<view class="conttainer-cetr">
<view class="conttainer-title">今日会员价</view>
<view class="conttainer-box">
<view class="c-box-box1" @click="show = true">
<view class="">{{oilInfo.oilName}}</view>
<view class="">
<u-icon name="arrow-down-fill"></u-icon>
</view>
<view class="conttainer-box" v-for="(item,index) in oilTypeList" :key="index">
<view class="c-box-box1">
<view class="">{{item.oilName||''}}</view>
</view>
<view class="c-box-box2">
<view class="xred">会员价</view>
<view class="dred"> <text class="xred"></text> {{oilInfo.oilPrice}}</view>
<view class="dred"> <text class="xred"></text> {{item.oilPrice||0}}</view>
</view>
<view class="c-box-box3">
<view class="xblck">国标价</view>
<view class="dblck"> <text class="xblck"></text> {{oilInfo.gbPrice}}</view>
<view class="dblck"> <text class="xblck"></text> {{item.gbPrice||0}}</view>
</view>
</view>
@ -87,7 +85,8 @@
<view class="station-title" style="display: flex;justify-content: space-between;">
{{store.name}}{{store.description ? "("+store.description+")" : ""}}
<view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
<view>切换位置 <uni-icons type="right" color="#304fff" size="16"></uni-icons> </view>
<view style="font-size: 12px;">切换位置 <uni-icons type="right" color="#304fff"
size="14"></uni-icons> </view>
</view>
</view><!--顺通石化加油站(工业南路站)-->
<view style="display: flex;">
@ -114,7 +113,7 @@
<view style="height: 88px; width: 100%;"></view>
</view>
<!-- 加油站卡片结束-->
<!-- <u-picker :show="show" :columns="columns" @confirm="confirm" @cancel="cancel"></u-picker> -->
<u-picker :columns="columns" @confirm="confirm" :show="show" @cancel="show = false"
keyName="label"></u-picker>
<u-overlay :show="shows == true">
@ -239,7 +238,7 @@
// await this.getOilType();
}
await this.getTheJudgmentIsTheSame();
}else{
} else {
await this.getUserAuthority();
// await this.getOilType();
await this.getTheJudgmentIsTheSame();
@ -278,7 +277,7 @@
method: 'get',
}).then(res => {
_this.list1 = res.data
if (res.data.length>0){
if (res.data.length > 0) {
for (let i = 0; i < res.data.length; i++) {
if (res.data[i].bannerUrl.includes("http")) {
_this.list1[i].bannerUrl = res.data[i].bannerUrl
@ -367,21 +366,21 @@
uni.getSetting({
async success(res) {
if (!res.authSetting['scope.userLocation']) {
// uni.authorize({
// scope: 'scope.userLocation',
// success() {
// //
// // _this.isExistStoreId()
// },
// fail() {
// //
// }
// })
await _this.getAddress(uni.getStorageSync("storeId"));
// uni.authorize({
// scope: 'scope.userLocation',
// success() {
// //
// // _this.isExistStoreId()
// },
// fail() {
// //
// }
// })
await _this.getAddress(uni.getStorageSync("storeId"));
} else {
//
// _this.isExistStoreId()
await _this.getAddress(uni.getStorageSync("storeId"));
//
// _this.isExistStoreId()
await _this.getAddress(uni.getStorageSync("storeId"));
}
},
fail(err) {
@ -391,7 +390,7 @@
},
// tokenid
async getTheJudgmentIsTheSame() {
console.log(this.AppToken,547);
console.log(this.AppToken, 547);
//
if (!this.AppToken) {
return;
@ -410,7 +409,7 @@
// code
if (uni.getStorageSync("appltType")== "WECHAT") {
if (uni.getStorageSync("appltType") == "WECHAT") {
wx.login({
success(res) {
if (res.code) {
@ -433,7 +432,7 @@
})
}
if (uni.getStorageSync("appltType")== "ALIPAY") {
if (uni.getStorageSync("appltType") == "ALIPAY") {
my.getAuthCode({
scopes: 'auth_base',
success: res => {
@ -447,7 +446,7 @@
storeId: uni.getStorageSync("storeId"),
},
}).then((resp) => {
console.log(resp,85412);
console.log(resp, 85412);
if (!resp.data) {
uni.removeStorageSync("App-Token");
}
@ -518,11 +517,11 @@
},
}).then((response) => {
console.log(response,"2154");
console.log(response, "2154");
// uni.showToast({
// title:"121984:"+storeId
// })
if (response.data.store){
if (response.data.store) {
_this.distance = (Math.ceil(response.data.distance))
.toFixed(1)
_this.store = response.data.store
@ -546,14 +545,14 @@
}
_this.lon = _this.store.longitude,
_this.lat = _this.store.latitude,
_this.lat = _this.store.latitude,
_this.getIndexBanner()
_this.getIndexBanner()
_this.getOilType();
}else{
} else {
uni.showToast({
title:"当前店铺已关闭!!!",
icon:"none"
title: "当前店铺已关闭!!!",
icon: "none"
})
}
@ -594,6 +593,7 @@
this.oilInfo.gbPrice = this.oilTypeList[0].gbPrice
}
let oilData = []
console.log(this.oilTypeList);
this.oilTypeList.forEach(res => {
let data = {
id: res.numberId,
@ -605,7 +605,7 @@
})
this.columns = [oilData]
console.log("aaa", this.columns)
}
})
},
@ -675,8 +675,8 @@
uni.openLocation({
latitude: lat,
longitude: lon,
name:this.store.name,
address:this.store.address,
name: this.store.name,
address: this.store.address,
success: function() {
console.log('success');
@ -967,4 +967,4 @@
color: white;
margin: 0 auto;
}
</style>
</style>

View File

@ -487,7 +487,8 @@
if (uni.getStorageSync("inviteStaffId") || this.staffList.length==0) {
this.toPayment(uni.getStorageSync("inviteStaffId"))
} else {
this.$refs.popup.open('bottom')
// this.$refs.popup.open('bottom')
this.toPayment(uni.getStorageSync("inviteStaffId"))
}
} else {
if (this.value == "") {
@ -547,17 +548,19 @@
// if (!this.AppToken) {
// return;
// }
await request({
url: 'chainStoreInfo/theJudgmentIsTheSame',
method: 'get',
data: {
"chainStoreId": uni.getStorageSync("chainStoreId")
}
}).then(res => {
if (!res.data) {
uni.removeStorageSync("App-Token");
}
})
if (this.AppToken) {
await request({
url: 'chainStoreInfo/theJudgmentIsTheSame',
method: 'get',
data: {
"chainStoreId": uni.getStorageSync("chainStoreId")
}
}).then(res => {
if (!res.data) {
uni.removeStorageSync("App-Token");
}
})
}
if (uni.getStorageSync("appltType")== "WECHAT") {
// code

View File

@ -10,7 +10,7 @@
<!-- 储值卡 -->
<view class="xyihang">
<view class="title-hei">储值卡</view>
<view class="title-hei">电子储值卡</view>
</view>
<view class="card-cz">
<view class="card-top">
@ -33,7 +33,7 @@
</view>
<!-- 囤油卡 -->
<view class="xyihang">
<view class="title-hei">囤油卡</view>
<view class="title-hei">电子囤油卡</view>
<view class="d_dis">
<view class="" @click="s_()">
<text>上一张</text>
@ -55,7 +55,7 @@
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between; ">
<view class="bai-box">
<view class="title-card">囤油卡</view>
<view class="title-card">电子囤油卡</view>
<view class="">{{cardsList[cardsIndex].type || '暂无囤油'}}:{{cardsList[cardsIndex].oilName || '0'}}
</view>
<view>剩余油量{{cardsList[cardsIndex].refuelMoney || '0'}}L</view>

View File

@ -3,20 +3,37 @@
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">油卡充值</view>
<view class="my-text" v-if="actinput == 0">电子储值卡</view>
<view class="my-text" v-if="actinput == 1">电子囤油卡</view>
<view class="my-text" v-if="actinput == 2">电子礼品卡</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="tap-box">
<view class="box-tap" :class="{ 'act' :actinput == index }" v-for="(item,index) in taplist" :key="index"
<view class="box-tap" :class="{ 'act' :types == index }" v-for="(item,index) in taplist" :key="index"
@click="getindex(index)">
<view class="title">{{item.title}}</view>
<view class="gang" :class="{ 'actgang' : actinput == index }"></view>
<view class="gang" :class="{ 'actgang' : types == index }"></view>
</view>
</view>
<!-- 储值充值 -->
<view class="boxback" v-if="actinput == 0">
<view class="box-cz">
<view class="box_s" v-for="(item,index) in actList" :key="index">
{{item.discountActiveDescribe || ''}}
</view>
<!-- <view style="display: flex; align-items: center; justify-content: space-around;">
<view class="" @click="types = 0"> <u-button type="primary" text="自定义金额"></u-button></view>
<view class="" @click="types = 1"> <u-button type="primary" :plain="true" text="金额选项"></u-button>
</view>
</view> -->
<view class="inputbox"
style="border-bottom: 1px solid #e7f1ff; box-sizing: border-box; padding-bottom: 15px;"
v-if="types == 1">
<view class="cadname" style="width: 38%;">自定义金额</view>
<input type="text" v-model="balance" placeholder="请输入自定义金额" />
</view>
<view class="box-cz" v-if="types == 0">
<view class="box-jg" :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardValueList"
:key="index"
@click="xzindex(index,item.rechargeBalance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue,item.count,item.id)">
@ -168,6 +185,7 @@
export default {
data() {
return {
types: 0,
query: {
storeId: ''
},
@ -191,6 +209,7 @@
text: '',
fringeBenefit: "",
giftBalance: "",
balance: '',
rechargeBalance: "",
incomeLitres: "",
lockupPrice: "",
@ -202,14 +221,12 @@
shuomingList: [],
shuomingFList: [],
columns: [],
actList: [],
taplist: [{
title: '储值充值'
title: '金额选项'
},
{
title: '囤油充值'
},
{
title: '礼品卡兑换'
title: '自定义金额'
},
],
@ -242,8 +259,22 @@
},
onShow() {
this.getStaffList()
this.activen()
},
methods: {
activen() {
request({
url: '/business/marketingActivity/cardValue/appletList?storeId=24',
method: 'get',
}).then(res => {
if (res.code == 200) {
console.log(res);
this.actList = res.data
}
})
},
open() {
console.log();
},
@ -252,13 +283,13 @@
},
//
addFuleCarRecords() {
if (this.staffId == '') {
uni.showToast({
title: "员工为必填项",
icon: Error
})
return
}
// if (this.staffId == '') {
// uni.showToast({
// title: "",
// icon: Error
// })
// return
// }
if (this.carValueId == '') {
uni.showToast({
title: "囤油卡为必填项",
@ -283,7 +314,7 @@
},
}).then(res => {
if (res.code == 200) {
console.log(res,_this.appltType)
console.log(res, _this.appltType)
if (_this.appltType == "WECHAT") {
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.reservedPayInfo);
@ -319,7 +350,7 @@
}
});
}
if (_this.appltType == "ALIPAY") {
my.tradePay({
tradeNO: res.data.reservedTransactionId
@ -348,19 +379,13 @@
});
}
}
})
},
//
addValueCarRecords() {
if (this.staffId == '') {
uni.showToast({
title: "员工为必填项",
icon: "error"
})
return
}
if (this.carValueId == '') {
uni.showToast({
title: "储值卡为必填项",
@ -369,7 +394,7 @@
return
}
let _this = this
request({
url: 'business/marketingActivity/cardValueRecord',
method: 'post',
@ -380,11 +405,14 @@
storeId: this.storeId,
chainStoreId: this.chainStoreId,
cardFavorableId: this.cardFavorableId,
cardRecordId: this.cardRecordId
cardRecordId: this.cardRecordId,
balance: this.balance,
types: this.types
},
}).then(res => {
if (res.code === 200) {
if (_this.appltType == "WECHAT") {
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.reservedPayInfo);
@ -514,13 +542,14 @@
this.actindex = index
},
getindex(index) {
this.actinput = index
if (index == 0) {
this.getValueCars();
}
if (index == 1) {
this.getFuelCars();
}
// this.actinput = index
this.types = index
// if (index == 0) {
// this.getValueCars();
// }
// if (index == 1) {
// this.getFuelCars();
// }
},
goback() {
uni.navigateBack()
@ -567,8 +596,8 @@
//
exchangeGift() {
request({
url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" +
this.cardPassword,
url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" +
this.cardPassword + "&storeId=" + uni.getStorageSync("storeId"),
method: 'get',
}).then(res => {
if (res.data.id == '' || res.data.id == null) {
@ -664,7 +693,7 @@
}
.box-tap {
width: 33%;
width: 50%;
text-align: center;
}
@ -774,6 +803,7 @@
background: #ffffff;
box-sizing: border-box;
padding-bottom: 1px;
padding-top: 1px;
}
.box-gang {
@ -805,4 +835,16 @@
background: white;
overflow: scroll;
}
.box_s {
width: 90%;
display: flex;
margin: 10px auto;
font-size: 14px;
color: #f40000;
box-sizing: border-box;
padding: 5px;
border-radius: 6px;
background: #f4f5f6;
}
</style>

View File

@ -135,10 +135,10 @@
this.getOilNumber(res.data.storeId)
this.getCardFavorable(res.data.cardFavorableId)
if ( res.data.activeId && res.data.activeType){
if (res.data.activeType == "1"){
if (res.data.activeType == "2"){
this.getFullFavorable(res.data.activeId)
}
if (res.data.activeType == "2"){
if (res.data.activeType == "1"){
this.getDiscountFavorable(res.data.activeId)
}
}