Merge remote-tracking branch 'origin/main'

# Conflicts:
#	fuintAdmin/src/views/EventMarketing/newCertificate/index.vue
This commit is contained in:
Lx 2024-10-18 18:21:19 +08:00
commit 98d534976a
34 changed files with 738 additions and 304 deletions

View File

@ -9,6 +9,15 @@ export function listCardCoupon(query) {
})
}
// 查询优惠券剩余数量>0的
export function getCardCouponNum(query) {
return request({
url: 'cardCoupon/queryByNum',
method: 'get',
params: query
})
}
// 根据id优惠券活动列表
export function getCardCoupon(id) {
return request({

View File

@ -256,7 +256,7 @@ import {
} from "@/api/EventMarketing/activeConsumption";
import {listUserGrade} from "@/api/staff/user/usergrade";
import {getOilNameList} from "@/api/order/oilnumgun";
import {listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getCardCouponNum} from "@/api/EventMarketing/cardCoupon";
import {listUserLabel} from "@/api/staff/user/userlabel";
export default {
@ -538,8 +538,8 @@ export default {
},
getCardCoupon() {
listCardCoupon({status: 1}).then(res => {
this.cardCouponList = res.data.records
getCardCouponNum({status: 1}).then(res => {
this.cardCouponList = res.data
})
},
addPoints(orderType) {

View File

@ -125,7 +125,7 @@ import {
getActiveFullminus,
updateActiveFullminus
} from "@/api/EventMarketing/activeFullminus";
import {listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getCardCouponNum} from "@/api/EventMarketing/cardCoupon";
export default {
name: "ActiveNewlyweds",
@ -255,8 +255,8 @@ export default {
}
},
getCardCoupon() {
listCardCoupon({status: 1}).then(res => {
this.cardCouponList = res.data.records
getCardCouponNum({status: 1}).then(res => {
this.cardCouponList = res.data
console.log("数据",this.cardCouponList)
})
},

View File

@ -1,6 +1,6 @@
<template>
<div class="app-containers">
<!-- 礼品卡-->
<!-- 优惠券 -->
<div class="card-box" style="margin-bottom: 20px">
@ -70,7 +70,7 @@
<span v-if="scope.row.status != 1" style="color: #F44522">下架</span>
</template>
</el-table-column>
<el-table-column prop="createBy" label="创建人"></el-table-column>
<el-table-column prop="createByName" label="创建人"></el-table-column>
<el-table-column prop="createTime" label="创建时间"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
@ -125,8 +125,12 @@
<el-form-item label="优惠券编号" required prop="number" style="width: 45%;">
<el-input v-model="ruleForm.number" placeholder="请输入优惠券编号"></el-input>
</el-form-item>
<el-button type="primary" icon="el-icon-refresh" circle @click="refreshNumber()"
v-if="!this.disabledBol"></el-button>
<el-form-item label="优惠券名称" required prop="name" style="width: 50%;">
<el-input v-model="ruleForm.name" placeholder="请输入优惠券名称"></el-input>
<el-input v-model="ruleForm.name" placeholder="请输入优惠券名称" :disabled="disabledBol"></el-input>
</el-form-item>
</div>
@ -138,7 +142,7 @@
</el-select>
</el-form-item>
<el-form-item label="优惠券类型" prop="type" required style="width: 50%;">
<el-select v-model="ruleForm.type" placeholder="请选择优惠券类型" style="width: 100%">
<el-select v-model="ruleForm.type" placeholder="请选择优惠券类型" style="width: 100%" :disabled="disabledBol">
<el-option v-for="dict in dict.type.CardCoupon_type" :key="dict.value" :label="dict.label"
:value="dict.value"/>
</el-select>
@ -151,16 +155,16 @@
v-if="ruleForm.type=='1'"
prop="useType">
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
<el-select v-model="ruleForm.useType" placeholder="请选择金额" :disabled="disabledBol">
<el-option label="订单金额" value="1"/>
<el-option label="加油升数" value="2"/>
</el-select>
<div style="margin: 0px 5px;"></div>
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 140px">
<template slot="append">{{ruleForm.useType == '1' ? '元' : '升' }}</template>
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 140px" :disabled="disabledBol">
<template slot="append">{{ ruleForm.useType == '1' ? '元' : '升' }}</template>
</el-input>
<div style="width: 60px;text-align: center">优惠</div>
<el-input placeholder="" v-model="ruleForm.reduceAmount" style="width: 140px">
<el-input placeholder="" v-model="ruleForm.reduceAmount" style="width: 140px" :disabled="disabledBol">
<template slot="append"></template>
</el-input>
</div>
@ -170,40 +174,41 @@
v-if="ruleForm.type=='5'"
prop="useType">
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
<el-select v-model="ruleForm.useType" placeholder="请选择金额" :disabled="disabledBol">
<el-option label="订单金额" value="1"/>
</el-select>
<div style="margin: 0px 5px;"></div>
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 140px">
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 140px" :disabled="disabledBol">
<template slot="append"></template>
</el-input>
<div style="width: 60px;text-align: center">优惠</div>
<el-input placeholder="" v-model="ruleForm.reduceAmount" style="width: 140px">
<el-input placeholder="" v-model="ruleForm.reduceAmount" style="width: 140px" :disabled="disabledBol">
<template slot="append"></template>
</el-input>
</div>
</el-form-item>
<el-form-item label="兑换内容" required style="width: 45%;" v-if="ruleForm.type=='2'" prop="exchangeContent">
<el-form-item label="兑换内容" required style="width: 45%;" v-if="ruleForm.type=='2'" prop="exchangeContent"
:disabled="disabledBol">
<el-input placeholder="" v-model="ruleForm.exchangeContent"></el-input>
</el-form-item>
<el-form-item label="优惠条件" required style="width: 45%;" v-if="ruleForm.type=='3'" prop="useType">
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择" style="width: 110px">
<el-select v-model="ruleForm.useType" placeholder="请选择" style="width: 110px" :disabled="disabledBol">
<el-option label="订单金额" value="1"/>
<el-option label="加油升数" value="2"/>
</el-select>
<div style="width: 50px;text-align: center">范围</div>
<el-input placeholder="" v-model="ruleForm.zkStartAmount" style="width: 130px">
<template slot="append">{{ruleForm.useType == '1' ? '元' : '升'}}</template>
<el-input placeholder="" v-model="ruleForm.zkStartAmount" style="width: 130px" :disabled="disabledBol">
<template slot="append">{{ ruleForm.useType == '1' ? '元' : '升' }}</template>
</el-input>
<div style="margin: 0px 5px;">~</div>
<el-input placeholder="" v-model="ruleForm.zkEndAmount" style="width: 130px">
<template slot="append">{{ruleForm.useType == '1' ? '元' : '升'}}</template>
<el-input placeholder="" v-model="ruleForm.zkEndAmount" style="width: 130px" :disabled="disabledBol">
<template slot="append">{{ ruleForm.useType == '1' ? '元' : '升' }}</template>
</el-input>
<div style="width: 50px;text-align: center">优惠</div>
<el-input placeholder="" v-model="ruleForm.zkData" style="width: 130px">
<el-input placeholder="" v-model="ruleForm.zkData" style="width: 130px" :disabled="disabledBol">
<template slot="append"></template>
</el-input>
</div>
@ -211,27 +216,28 @@
<el-form-item label="消费条件" required style="width: 45%;" v-if="ruleForm.type=='4'" prop="useType">
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
<el-select v-model="ruleForm.useType" placeholder="请选择金额" :disabled="disabledBol">
<el-option label="订单金额" value="1"/>
<el-option label="加油升数" value="2"/>
</el-select>
<div style="margin: 0px 5px;"></div>
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 160px">
<template slot="append">{{ruleForm.useType == '1' ? '元' : '升'}}</template>
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 160px" :disabled="disabledBol">
<template slot="append">{{ ruleForm.useType == '1' ? '元' : '升' }}</template>
</el-input>
<div style="width: 40px;text-align: center"></div>
<el-input placeholder="" v-model="ruleForm.ljOilNum" style="width: 160px">
<el-input placeholder="" v-model="ruleForm.ljOilNum" style="width: 160px" :disabled="disabledBol">
<template slot="append">L</template>
</el-input>
<div style="width: 40px;text-align: center"></div>
<el-input placeholder="" v-model="ruleForm.ljOilAmount" style="width: 160px">
<el-input placeholder="" v-model="ruleForm.ljOilAmount" style="width: 160px" :disabled="disabledBol">
<template slot="append"></template>
</el-input>
</div>
</el-form-item>
<!-- 适用油品油号 oilNumber -->
<el-form-item label="适用油品油号" required style="width: 50%;" prop="oilLimit">
<el-form-item label="适用油品油号" required style="width: 50%;" prop="oilLimit"
v-if="ruleForm.type=='1' || ruleForm.type=='3' || ruleForm.type=='4' ">
<div class="d-s">
<el-radio-group v-model="ruleForm.oilLimit">
<el-radio :label="'1'">不限</el-radio>
@ -245,9 +251,9 @@
</el-form-item>
</div>
<div class="d-s" style="justify-content: space-between" v-if="ruleForm.type=='3'">
<div class="d-s" style="justify-content: space-between" v-if="ruleForm.type=='3'|| ruleForm.type=='4' ">
<el-form-item label="最大优惠金额" required style="width: 45%;" prop="zkMaxAmount">
<el-input placeholder="" v-model="ruleForm.zkMaxAmount">
<el-input placeholder="" v-model="ruleForm.zkMaxAmount" :disabled="disabledBol">
<template slot="append"></template>
</el-input>
</el-form-item>
@ -353,13 +359,13 @@
</div>
<div class="d-s" style="justify-content: space-between">
<el-form-item label="时间段设置" prop="availableOrUn">
<el-form-item label="时间段设置" prop="availableOrUn" required>
<el-radio-group v-model="ruleForm.availableOrUn">
<el-radio :label="'0'">适用时间段</el-radio>
<el-radio :label="'1'">不可用时间段</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="ruleForm.availableOrUn == '0'" label="适用时间段" prop="suitTimeSlotType">
<el-form-item v-if="ruleForm.availableOrUn == '0'" label="适用时间段" prop="availableType" required>
<div style="width: 100px;margin-top: 10px">
<el-radio-group v-model="ruleForm.availableType">
<div style="display: flex; width: 500px;margin-bottom: 15px;">
@ -384,7 +390,7 @@
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-form-item label="时间段" label-width="70px" prop="suitTimeSlot">
<el-form-item label="时间段" label-width="70px" prop="availablePeriodStart" required>
<el-time-picker
v-model="ruleForm.availablePeriodStart"
format="HH:mm"
@ -401,7 +407,7 @@
</el-form-item>
</div>
</el-form-item>
<el-form-item v-else label="不适用时间段" prop="noUseTimeType">
<el-form-item v-else label="不适用时间段" prop="unAvailableType" required>
<div>
<el-radio-group v-model="ruleForm.unAvailableType">
<el-radio :label="'1'">每周
@ -424,7 +430,7 @@
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-form-item label="时间段" prop="noUseTimeFront" label-width="70px">
<el-form-item label="时间段" prop="unAvailablePeriodStart" label-width="70px" required>
<el-time-picker
v-model="ruleForm.unAvailablePeriodStart"
format="HH:mm"
@ -466,7 +472,7 @@
<div class="d-s" style="justify-content: space-between">
</div>
<div class="d-s" style="justify-content: space-between">
<el-form-item label="背景图" required style="width: 45%;" prop="backgroundImage">
<el-form-item label="背景图" style="width: 45%;" required prop="backgroundImage">
<imgUpload :limit="1" v-model="ruleForm.backgroundImage"></imgUpload>
</el-form-item>
<el-form-item label="备注" style="width: 50%;">
@ -518,6 +524,7 @@ export default {
dicts: ['CardCoupon_type', 'putType_type', 'oilNumber_type'],
data() {
return {
disabledBol: false,
oilTypelist: [
"不限",
"自定义"
@ -755,6 +762,10 @@ export default {
},
membership: [],
rules: {
backgroundImage: [{required: true, message: '请上传背景图'}],
unAvailableType: [{required: true, message: '请选择不可使用日期类型'}],
availableType: [{required: true, message: '请选择适用日期类型'}],
availableOrUn: [{required: true, message: '请选择时间段'}],
name: [{required: true, message: '请输入名称'}],
number: [{required: true, message: '请输入编号'}],
putType: [{required: true, message: '请选择投放类型'}],
@ -772,13 +783,12 @@ export default {
getNumLimit: [{required: true, message: '请输入每人领券限制'}],
tfTotal: [{required: true, message: '请输入投放总数'}],
dayGetLimit: [{required: true, message: '请输入每日领券限制'}],
backgroundImage: [{required: true, message: '请上传背景图'}],
//
useType: [
{
validator: (rule, value, callback) => {
console.log('优惠券类型',this.dict.type.CardCoupon_type)
console.log('优惠券类型', this.dict.type.CardCoupon_type)
if (this.ruleForm.type == '1' || this.ruleForm.type == '5') {
if (!this.ruleForm.useType) {
@ -822,6 +832,37 @@ export default {
trigger: ['change', 'blur']
}
],
//
unAvailablePeriodStart: [
{
validator: (rule, value, callback) => {
if (this.ruleForm.unAvailablePeriodStart === undefined) {
callback(new Error("请选择开始时间段"));
} else if (this.ruleForm.unAvailablePeriodEnd === undefined) {
callback(new Error("请选择结束时间段"));
} else {
callback();
}
},
trigger: ['change', 'blur']
}
],
//
availablePeriodStart: [
{
validator: (rule, value, callback) => {
if (this.ruleForm.availablePeriodStart === undefined) {
callback(new Error("请选择开始时间段"));
} else if (this.ruleForm.availablePeriodEnd === undefined) {
callback(new Error("请选择结束时间段"));
} else {
callback();
}
},
trigger: ['change', 'blur']
}
],
exchangeContent: [{required: true, message: '请输入兑换内容'}],
}
@ -840,7 +881,11 @@ export default {
imgUpload,
},
methods: {
//
refreshNumber() {
console.log("触发了", this.ruleForm)
this.ruleForm.number = this.generateCouponNumber()
},
getExpirationDate(row) {
if (row.timeType == '1') {
@ -863,7 +908,7 @@ export default {
return '订单金额 满' + row.reachAmount + '元 优惠' + row.reduceAmount + '元'
}
if (row.useType == 2) {
return '实收 满' + row.reachAmount + '元 优惠' + row.reduceAmount + '元'
return '加油升数 满' + row.reachAmount + 'L 优惠' + row.reduceAmount + '元'
}
}
@ -877,7 +922,7 @@ export default {
return '订单金额 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
}
if (row.useType == 2) {
return '加油升数 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
return '加油升数 范围' + row.zkStartAmount + 'L ~ ' + row.zkEndAmount + 'L 优惠' + row.zkData + '折'
}
}
@ -886,7 +931,7 @@ export default {
return '订单金额 满' + row.reachAmount + '元 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
}
if (row.useType == 2) {
return '加油升数 满' + row.reachAmount + ' 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
return '加油升数 满' + row.reachAmount + 'L 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
}
}
@ -990,11 +1035,13 @@ export default {
},
updetenCardCoupon(id) {
//
this.disabledBol = true
this.listUserGrade()
console.log("什么值啊", this.centerDialogVisible)
this.centerDialogVisible = !this.centerDialogVisible
getCardCoupon(id).then(res => {
this.ruleForm = res.data
console.log("类型", typeof this.ruleForm.unAvailablePeriodStart)
if (this.ruleForm.availableOrUn == null || this.ruleForm.availableOrUn == '') {
this.ruleForm.availableOrUn = '0'
}
@ -1019,9 +1066,21 @@ export default {
})
},
//
generateCouponNumber() {
const now = new Date();
var dateStr = now.getFullYear().toString() + //
(now.getMonth() + 1).toString().padStart(2, '0') + //
now.getDate().toString().padStart(2, '0') + //
now.getHours().toString().padStart(2, '0') + //
now.getMinutes().toString().padStart(2, '0') + //
now.getSeconds().toString().padStart(2, '0'); //
return dateStr
},
addCertificate() {
this.disabledBol = false
this.ruleForm = {
useType: '1',
//
@ -1032,7 +1091,7 @@ export default {
availableType: '',
unAvailableType: '',
name: '',
number: '',
number: this.generateCouponNumber(),
quantity: '',
cardAmount: '',
remark: '',
@ -1235,8 +1294,6 @@ export default {
}
},
addBlock() {
console.log("啊啊啊啊啊伟大")
//
this.$refs['ruleForm'].validate(valid => {
if (valid) {
@ -1263,8 +1320,6 @@ export default {
} else {
this.$message.error('操作失败请稍后再试');
}
}).catch().catch(error => {
this.$message.error('操作失败请稍后再试');
});
} else {
editCardCoupon(this.ruleForm).then(res => {

View File

@ -134,7 +134,7 @@ import {
} from "@/api/EventMarketing/activeNewlyweds";
import {getoilName, listExchange, listFavorable, looklook, looklooklook} from "@/api/EventMarketing/activeConsumption";
import QRCode from "qrcodejs2";
import {listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getCardCouponNum} from "@/api/EventMarketing/cardCoupon";
import {listUserGrade} from "@/api/staff/user/usergrade";
import {addActiveBirthday, editActiveBirthday, getActiveBirthday} from "@/api/EventMarketing/activeBirthday";
@ -281,8 +281,8 @@ export default {
})
},
getCardCoupon() {
listCardCoupon({status: 1}).then(res => {
this.cardCouponList = res.data.records
getCardCouponNum({status: 1}).then(res => {
this.cardCouponList = res.data
})
},
getInfo() {

View File

@ -119,7 +119,7 @@ import {
} from "@/api/EventMarketing/activeNewlyweds";
import {getoilName, listExchange, listFavorable, looklook, looklooklook} from "@/api/EventMarketing/activeConsumption";
import QRCode from "qrcodejs2";
import {listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getCardCouponNum} from "@/api/EventMarketing/cardCoupon";
import {
getActiveRecommendInfo,
insertActiveRecommend,
@ -259,8 +259,8 @@ export default {
}
},
getCardCoupon() {
listCardCoupon({status: 1}).then(res => {
this.cardCouponList = res.data.records
getCardCouponNum({status: 1}).then(res => {
this.cardCouponList = res.data
})
},
getInfo() {

View File

@ -158,7 +158,7 @@ import {
} from "@/api/EventMarketing/activeNewlyweds";
import {getoilName, listExchange, listFavorable, looklook, looklooklook} from "@/api/EventMarketing/activeConsumption";
import QRCode from "qrcodejs2";
import {listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getCardCouponNum} from "@/api/EventMarketing/cardCoupon";
import {listUserGrade} from "@/api/staff/user/usergrade";
import {addActivePopUp, editActivePopUp, getActivePopUp} from "@/api/EventMarketing/activePopUp";
@ -350,8 +350,8 @@ export default {
})
},
getCardCoupon(){
listCardCoupon({status:1}).then(res => {
this.cardCouponList = res.data.records
getCardCouponNum({status:1}).then(res => {
this.cardCouponList = res.data
})
},
getInfo(){

View File

@ -146,7 +146,7 @@ import {
} from "@/api/EventMarketing/activeNewlyweds";
import {getoilName, listExchange, listFavorable, looklook, looklooklook} from "@/api/EventMarketing/activeConsumption";
import QRCode from "qrcodejs2";
import {listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getCardCouponNum} from "@/api/EventMarketing/cardCoupon";
import {listUserGrade} from "@/api/staff/user/usergrade";
import {getOilNameList, oilNumberList} from "@/api/order/oilnumgun";
import {
@ -330,8 +330,8 @@ export default {
})
},
getCardCoupon(){
listCardCoupon({status:1}).then(res => {
this.cardCouponList = res.data.records
getCardCouponNum({status:1}).then(res => {
this.cardCouponList = res.data
})
},
getInfo(){

View File

@ -133,7 +133,7 @@ import {
} from "@/api/EventMarketing/activeNewlyweds";
import {getoilName, listExchange, listFavorable, looklook, looklooklook} from "@/api/EventMarketing/activeConsumption";
import QRCode from "qrcodejs2";
import {listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getCardCouponNum} from "@/api/EventMarketing/cardCoupon";
import {listUserGrade} from "@/api/staff/user/usergrade";
import {
addActiveUserRecharge,
@ -283,8 +283,8 @@ export default {
})
},
getCardCoupon(){
listCardCoupon({status:1}).then(res => {
this.cardCouponList = res.data.records
getCardCouponNum({status:1}).then(res => {
this.cardCouponList = res.data
})
},
getInfo(){

View File

@ -7,19 +7,19 @@
{{ item }}
</div>
</div>
<div v-if="tabindex == 0">
<div style="height: 87.5vh;position: relative;" v-if="tabindex == 0">
<div class="card-box"
style="width: 100%;margin: 10px auto;background: #fff;box-sizing: border-box;padding-top: 15px; margin-bottom: 0px ">
style="width: 98%;margin: 0px auto;background: #fff;box-sizing: border-box;padding-top: 5px; margin-bottom: 0px ">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="" prop="status">
<el-select v-model="queryParams.status" style="width: 150px" placeholder="交班方式" clearable
<el-select v-model="queryParams.status" style="width: 220px" placeholder="交班方式" clearable
@change="onChange">
<el-option label="统一交班" value="统一交班">统一交班</el-option>
<el-option label="个人交班" value="个人交班">个人交班</el-option>
</el-select>
</el-form-item>
<el-form-item label="" prop="staffId">
<el-select v-model="queryParams.staffId" style="width: 150px" placeholder="交班员工" clearable @change="onChange2">
<el-select v-model="queryParams.staffId" style="width: 220px" placeholder="交班员工" clearable @change="onChange2">
<el-option
v-for="option in staffList"
:key="option.id"
@ -29,17 +29,18 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item class="flex-container" style="float: right">
<el-form-item class="flex-container" style="margin-right:0px;float: right">
<el-button type="primary" icon="el-icon-search" :disabled="!isSearch" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
<div style="margin-top: 20px; padding-top: 0px; scrollbar-width: none; height: 70vh;overflow: auto" class="box-card">
<div style="margin-top: 10px; padding-top: 0px; height: 73vh;" class="box-card">
<div class="title_" style="height: 50px; padding-top: 20px; background-color: white; display: flex;justify-content: space-between">
<div style="width: 80%;margin-left: 50px">门店交接单</div>
<span style="cursor: pointer; color: blue;font-weight: 400;" >打印预览</span>
<div style="width: 5%;"></div>
<div style="width: 80%;">门店交接单</div>
<span style="cursor: pointer; color: blue;font-weight: 400;" >打印</span>
</div>
<div class="d-s-b">
<div>油站名称</div>
@ -102,6 +103,7 @@
<div>{{ orderSummary.sumnum }}</div>
</div>
<div class="xxing"></div>
<div style="width: 100%; height: 29vh;overflow: auto;scrollbar-width: none; ">
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -129,8 +131,6 @@
<div class="r-size">{{ orderSummary.allyingye + orderSummary.allchuzhika }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -148,7 +148,6 @@
<div class="r-size">{{ item.paidAmount }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -166,7 +165,6 @@
<div class="r-size">{{ item.paidAmount }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -184,7 +182,6 @@
<div class="r-size">{{ item.paidAmount }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -202,8 +199,6 @@
<div class="r-size">{{ item.paidAmount }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -221,7 +216,6 @@
<div class="r-size">{{ item.paidAmount ? item.paidAmount : '--' }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -239,7 +233,6 @@
<div class="r-size">{{ item.paidAmount ? item.paidAmount : '--' }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -257,7 +250,6 @@
<div class="r-size">{{ item.paidAmount ? item.paidAmount : '--' }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -305,8 +297,6 @@
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -324,7 +314,6 @@
<div class="r-size">{{ item.paidAmount ? item.paidAmount : '--' }}</div>
</div>
</div>
<div class="for-box">
<div class="for-title">
<div class="x-"></div>
@ -342,10 +331,9 @@
<div class="r-size">{{ item.paidAmount ? item.paidAmount : '--' }}</div>
</div>
</div>
</div>
<div
style="width: 100%; margin: 20px auto;display: flex;align-items: center;justify-content: center; background: #fff;box-sizing: border-box;margin-bottom: 0px ">
</div>
</div>
<div class="bot-a-ds" >
<el-button type="primary" @click="shift()">交班</el-button>
</div>
</div>
@ -383,7 +371,8 @@ export default {
return {
tabs: [
"交接班1",
"交接班",
// "1",
"交班记录"
],
isSearch: true,
@ -643,7 +632,7 @@ export default {
display: flex;
box-sizing: border-box;
padding: 0px 25px;
margin-bottom: 25px;
//margin-bottom: 25px;
}
.box_ {
height: 100%;
@ -702,6 +691,8 @@ export default {
.el-form--inline .el-form-item {
margin-right: 44px;
margin-top: 5px;
margin-bottom: 10px;
}
.tab-box {
@ -711,6 +702,7 @@ export default {
display: flex;
box-sizing: border-box;
margin-bottom: 25px;
margin-bottom: 15px;
}
@ -748,7 +740,7 @@ export default {
font-weight: 400;
font-size: 14px;
color: #333333;
margin: 20px auto;
margin:5px auto;
}
.xxing {
@ -804,13 +796,27 @@ export default {
width: 98%;
}
.table-boxs {
.table-s {
border-radius: 8px;
width: 98%;
background: #fff;
margin: 25px auto;
box-sizing: border-box;
margin-top: 5px;
padding: 15px;
}
.bot-a-ds{
width: 100%;
background: #fff;
position: absolute;
bottom: 0px;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 15px;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<div class="">
<div style="margin-top: 0px; height: 70vh;overflow: auto" class="box-card">
<div style="margin-top: 0px; height: 70vh;overflow: auto;scrollbar-width: none;" class="box-card">
<div class="title_">门店交接单</div>
<div class="d-s-b">
<div>油站名称</div>
@ -645,7 +645,7 @@ export default {
font-weight: 400;
font-size: 14px;
color: #333333;
margin: 20px auto;
margin: 5px auto;
}
.xxing{
width: 100%;

View File

@ -142,7 +142,7 @@ export default {
<template>
<div class="f-hx">
<div class="table-boxs">
<div class="table-s">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="" prop="status">
<el-select v-model="queryParams.status" style="width: 150px" placeholder="交班方式" clearable>
@ -175,7 +175,7 @@ export default {
placeholder="交易结束日期">
</el-date-picker>
</el-form-item>
<el-form-item class="flex-container" style="float: right">
<el-form-item class="flex-container" style="float: right;margin-right: 0px">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
@ -211,9 +211,9 @@ export default {
<el-dialog title="查看详情" :visible.sync="openSeeDetails" width="600px" append-to-body :close-on-click-modal="false">
<HandoverDetailsInfo :recordData="recordData"></HandoverDetailsInfo>
</el-dialog>
<el-dialog title="商品汇总" :visible.sync="openGoodsSum" width="600px" append-to-body :close-on-click-modal="false">
<el-dialog title="商品汇总" :visible.sync="openGoodsSum" width="600px" style="padding-top: 0px" append-to-body :close-on-click-modal="false">
<div>
<div>油品交易信息</div>
<div class="tou_">油品交易信息</div>
<div>
<el-table :data="oilNumberStatistics" style="width: 100%" border>
<el-table-column align="center" prop="oilName" label="油品油号" ></el-table-column>
@ -224,7 +224,7 @@ export default {
</div>
</div>
<div>
<div>便利店交易信息</div>
<div class="tou_">便利店交易信息</div>
<div>
<el-table :data="goodsNumberStatistics" style="width: 100%" border>
<el-table-column align="center" prop="goodsName" label="商品名称" ></el-table-column>
@ -235,7 +235,7 @@ export default {
</div>
</div>
<div>
<div >积分商城兑换信息</div>
<div class="tou_">积分商城兑换信息</div>
<div>
<el-table :data="IntegerNumberStatistics" style="width: 100%" border>
<el-table-column align="center" prop="giftName" label="商品名称" ></el-table-column>
@ -267,13 +267,14 @@ export default {
margin-bottom: 25px;
}
.table-boxs{
.table-s{
border-radius: 8px;
width: 98%;
background: #fff;
margin: 25px auto;
margin-bottom: 0px;
box-sizing: border-box;
margin-top: 5px;
height: 85vh;
padding: 15px;
}
@ -283,4 +284,10 @@ export default {
padding-bottom: 12px;
}
.tou_{
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
margin-top: 10px;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="aainer">
<div class="wit-b">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="" prop="name">
@ -61,8 +61,21 @@
{{ jsonChange(scope.row.staffIds) }}
</template>
</el-table-column>
<el-table-column align="center" prop="machineCode" label="设备终端号"></el-table-column>
<el-table-column align="center" prop="msign" label="设备密钥"></el-table-column>
<el-table-column align="center" prop="machineCode" label="设备编号"></el-table-column>
<el-table-column align="center" prop="msign" label="密钥"></el-table-column>
<el-table-column align="center" prop="acquiesce" label="设备状态">
<template slot-scope="scope">
<el-switch
v-model="scope.row.acquiesce"
disabled
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column align="center" prop="machineCode" label="备注"></el-table-column>
<el-table-column align="center" prop="machineCode" label="创建时间"></el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -91,10 +104,10 @@
/>
</div>
<el-dialog :title="title" :close-on-click-modal="false" :before-close="handleCancel" :visible.sync="open" width="30%"
<el-dialog :title="title" :close-on-click-modal="false" :before-close="handleCancel" :visible.sync="open" width="24%"
append-to-body >
<el-form ref="form" :model="deviceInfo" label-width="80px">
<el-form :model="deviceInfo" :rules="rules" ref="deviceForm" label-width="120px">
<el-form :model="deviceInfo" :rules="rules" ref="deviceForm" label-width="95px">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="deviceInfo.deviceName" style="width: 300px"></el-input>
</el-form-item>
@ -104,7 +117,7 @@
<el-form-item label="设备功能" prop="deviceAb">
<el-checkbox-group v-model="deviceInfo.deviceAb">
<el-checkbox name="deviceAb" label="打印小票"></el-checkbox>
<el-checkbox name="deviceAb" label="语音播报"></el-checkbox>
<el-checkbox name="deviceA1b" label="语音播报"></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="设备终端号" prop="machineCode">
@ -144,7 +157,7 @@
<el-button type="primary" @click="submitForm('deviceForm')">提交</el-button>
</el-form-item>
</el-form>
</el-form>
</el-dialog>
</div>
@ -188,7 +201,7 @@ export default {
deviceSi: [
{required: true, message: '设备品牌不能为空', trigger: 'blur'}
],
deviceAb: [{type: 'array', required: true, message: '设备功能不能为空', trigger: 'change'}],
deviceAb: [ {required: true, message: '设备功能不能为空', trigger: 'blur'}],
machineCode: [
{required: true, message: '设备终端号不能为空', trigger: 'blur'}
],
@ -234,11 +247,11 @@ export default {
})
},
submitForm(formName) {
this.deviceInfo.deviceAb = this.deviceInfo.deviceAb.join(',')
this.$refs[formName].validate(valid => {
if (valid) {
//
// API
this.deviceInfo.deviceAb = this.deviceInfo.deviceAb.join(',')
this.submitDeviceInfo();
} else {
//
@ -316,6 +329,7 @@ export default {
this.staffIds = a.map(res => res.id)
}
this.deviceInfo = e
this.deviceInfo.deviceAb = this.deviceInfo.deviceAb.split(",")
console.log('提交设备信息数据:', this.deviceInfo);
},
@ -372,6 +386,12 @@ export default {
height: 50px;
line-height: 60px;
}
.aainer{
background: #f5f7f8;
box-sizing: border-box;
padding: 10px;
}
.wit-b{
background: #fff;
border-radius: 8px;

View File

@ -101,16 +101,16 @@
</div>
<div class="hui-hang"></div>
<div class="d-s">
<div>
<div class="h-tt">数据分析</div>
<div id="ccc" style="width: 300px;height: 200px; "></div>
<div style="position: relative">
<div class="h-tt" style="position: absolute;top: 0px">数据分析</div>
<div id="ccc" style="width: 400px;height: 200px; "></div>
</div>
<div class="h-r-ba"></div>
<!-- <div class="h-r-ba"></div>-->
<div>
<!-- <div class="h-tt" >活跃油站</div>-->
<div class="d-s" style="justify-content: space-between">
<div id="cccc" style="width: 300px;height: 200px;margin-right: 50px"></div>
<div id="ccct" style="width: 300px;height: 200px;"></div>
<div id="cccc" style="width: 400px;height: 200px;"></div>
<div id="ccct" style="width: 400px;height: 200px;"></div>
</div>
</div>
</div>
@ -135,7 +135,6 @@
<div style="font-size: 14px">{{ item.name }}</div>
</div>
</div>
</div>
</div>
<div class="b-bs">
@ -793,14 +792,23 @@ export default {
const option = {
color: [
'#b7f1e2',
'#36b713',
'#fc7150',
'#fea500',
'#5facfe',
'#b7f1e2',
],
tooltip: {
trigger: 'item'
},
legend: {
type:'scroll',
orient: 'vertical',
right: '0%',
bottom: '0%',
left:'right',
size:8
},
series: [
{
name: '',
@ -812,7 +820,14 @@ export default {
},
radius: ['40%', '80%'],
data: this.dataAnalysisOilNumberList,
}
label: {
show: true,
position: "inside",
color:'#fff',
formatter: `{d}%`,
},
},
]
};
const option1 = {
@ -823,7 +838,14 @@ export default {
tooltip: {
trigger: 'item'
},
legend: {
type:'scroll',
orient: 'vertical',
right: '0%',
bottom: '0%',
left:'right',
size:8
},
series: [
{
name: '',
@ -837,8 +859,16 @@ export default {
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
},
label: {
show: true,
position: "inside",
color:'#fff',
formatter: `{d}%`,
},
},
]
};
const option2 = {
@ -851,35 +881,19 @@ export default {
tooltip: {
trigger: 'item'
},
legend: {
type:'scroll',
orient: 'vertical',
right: '0%',
bottom: '0%',
left:'right',
size:8
},
series: [
{
name: '',
type: 'pie',
radius: [50, '80%'],
// data: [
// // { value: 28, name: '' },
// // { value: 72, name: '' },
// // { value: 28, name: '' },
// // { value: 72, name: '便' },
// {
// value: this.countPercentage(Number(this.storeAmount.userNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)),
// name: ''
// },
// {
// value: this.countPercentage(Number(this.storeAmount.integralNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)),
// name: ''
// },
// {
// value: this.countPercentage(Number(this.storeAmount.oilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)),
// name: ''
// },
// {
// value: this.countPercentage(Number(this.storeAmount.goodNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)),
// name: '便'
// },
//
// ],
data: this.dataAnalysisAllList,
emphasis: {
itemStyle: {
@ -887,7 +901,14 @@ export default {
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
},
label: {
show: true,
position: "inside",
color:'#fff',
formatter: `{d}%`,
},
}
]
};

View File

@ -205,7 +205,7 @@
</el-form>
</div>
<div style="height: 65vh;overflow: auto">
<el-table ref="tables" v-loading="loading" :data="list" border >
<el-table ref="tables" v-loading="loading" :data="list" border>
<el-table-column label="序号" align="center" type="index" width="55"/>
<el-table-column label="会员等级名称" align="center" prop="name">
<template slot-scope="scope">
@ -399,7 +399,7 @@
</el-table-column>
<el-table-column prop="usePaymentWay" align="center" label="可使用支付方式">
<template slot-scope="scope">
<span>{{ scope.row.usePaymentWay }}</span>
<span>{{ getPayTypeStr(scope.row.usePaymentWay) }}</span>
</template>
</el-table-column>
<el-table-column prop="consumeAmount" align="center" label="最低消费金额" width="220">
@ -647,7 +647,7 @@
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open2" append-to-body width="42%">
<el-form ref="form2" :model="form2" :rules="rules" label-width="120px">
<el-form ref="form2" :model="form2" :rules="rules" label-width="120px">
<el-form-item label="会员等级" prop="gradeId">
<el-select v-model="form2.gradeId" placeholder="请选择会员等级" style="width: 100%">
@ -662,7 +662,8 @@
v-if="dict.value!='APPLET_CODE'"
:key="dict.value"
:label="dict.value"
:value="dict.value">{{dict.label}}</el-checkbox>
:value="dict.value">{{ dict.label }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="折扣" prop="discount">
@ -690,6 +691,7 @@
</el-radio-group>
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="form2.suitDateFront"
style="width: 160px;margin-left: 10px;"
type="date"
@ -697,6 +699,7 @@
</el-date-picker>
<div style="margin: 0 10px;"></div>
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="form2.suitDateAfter"
style="width: 160px"
type="date"
@ -716,20 +719,21 @@
<el-radio-group v-model="form2.suitTimeSlotType">
<div style="display: flex; width: 500px;margin-bottom: 15px;">
<el-radio :label="'1'">每周</el-radio>
<el-checkbox-group v-model="weekDay" style="margin-left: 20px" :disabled="form2.suitTimeSlotType!='1'">
<el-checkbox-group v-model="weekDay" style="margin-left: 20px" :disabled="form2.suitTimeSlotType!='1'">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
</div>
<el-radio :label="'2'">每月
<el-select :disabled="form2.suitTimeSlotType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item+''"
:label="item+'日'"
:value="item+''">
</el-option>
</el-select>
<el-select :disabled="form2.suitTimeSlotType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple
style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item+''"
:label="item+'日'"
:value="item+''">
</el-option>
</el-select>
</el-radio>
</el-radio-group>
</div>
@ -755,12 +759,13 @@
<div>
<el-radio-group v-model="form2.noUseTimeType">
<el-radio :label="'1'">每周
<el-checkbox-group v-model="weekDay1" style="margin-left: 20px" :disabled="form2.noUseTimeType!='1'">
<el-checkbox-group v-model="weekDay1" style="margin-left: 20px" :disabled="form2.noUseTimeType!='1'">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
</el-radio>
<el-radio :label="'2'">每月
<el-select :disabled="form2.noUseTimeType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-select :disabled="form2.noUseTimeType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple
style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item+''"
@ -1107,7 +1112,7 @@ export default {
//
open: false,
form2: {
availableOrUn:'0'
availableOrUn: '0'
},
open2: false,
gradeList: [],
@ -1179,7 +1184,7 @@ export default {
total2: 0,
//
rules: {
availableOrUn:[
availableOrUn: [
{required: true, message: "不能为空", trigger: "blur"},
],
grade: [
@ -1243,15 +1248,22 @@ export default {
{required: true, message: "请选择节假日是否通用", trigger: "blur"},
],
suitDateType: [
{validator: (rule, value, callback) => {
if (this.form2.suitDateType == '1'){
if (this.form2.suitDateFront == undefined){
callback(new Error("请选择开始日期"))
}else if (this.form2.suitDateAfter == undefined){
callback(new Error("请选择结束日期"))
}
}
}},],
{
validator: (rule, value, callback) => {
console.log('走了', this.form2.suitDateType)
if (this.form2.suitDateType == '1') {
if (this.form2.suitDateFront == undefined) {
callback(new Error("请选择开始日期"))
} else if (this.form2.suitDateAfter == undefined) {
callback(new Error("请选择结束日期"))
} else {
callback();
}
} else {
callback();
}
}
},],
suitTimeSlotType: [
{required: true, message: "请选择适用时间段", trigger: "blur"},
],
@ -1288,11 +1300,24 @@ export default {
this.getClearConfig();
this.getRule();
this.getISEnableLevel();
if (this.$route.query.id){
if (this.$route.query.id) {
this.getindex(2)
}
},
methods: {
getPayTypeStr(usePaymentWay) {
//
let arr = usePaymentWay.split(",")
//
for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < this.dict.type.payment_type.length; j++) {
if (arr[i] == this.dict.type.payment_type[j].value) {
arr[i] = this.dict.type.payment_type[j].label
}
}
}
return arr.join(",")
},
addlsit() {
if (this.tindex5 == 0) {
let obj = {
@ -1327,9 +1352,9 @@ export default {
this.open2 = false;
},
//
submitForm2: function () {
this.$refs["form2"].validate(valid => {
if (valid) {
submitForm2() {
this.$refs["form2"].validate(id => {
if (id) {
this.form2.usePaymentWay = this.form2.usePaymentWay.toString()
if (this.form2.suitTimeSlotType == 0) {
this.form2.suitDate = this.weekDay.toString()
@ -1405,7 +1430,7 @@ export default {
suitDateType: '0',
suitTimeSlotType: '0',
noUseTimeType: '0',
availableOrUn:'0'
availableOrUn: '0'
}
this.weekDay = []
this.monthDay = []
@ -1849,7 +1874,7 @@ export default {
flag = true
}
})
if (flag || this.amount.length==0) {
if (flag || this.amount.length == 0) {
this.$message.error("请确保会员降级规则全部填写")
return;
}
@ -1860,7 +1885,7 @@ export default {
flag = true
}
})
if (flag || this.balance.length==0) {
if (flag || this.balance.length == 0) {
this.$message.error("请确保会员降级规则全部填写")
return;
}
@ -1952,7 +1977,7 @@ export default {
if (response.data.relegateRule) {
if (response.data.relegateRuleType == 0) {
this.amount = JSON.parse(response.data.relegateRule)
}else if (response.data.relegateRuleType == 1){
} else if (response.data.relegateRuleType == 1) {
this.balance = JSON.parse(response.data.relegateRule)
}
}

View File

@ -319,6 +319,7 @@
mt_goods god
left JOIN supplier sup on god.supplier_id = sup.id
<where>
god.stock > 0 and
<foreach collection="map" item="value" index="key" open="" close="" separator=" AND ">
<if test="value != null and value != ''">
${key} = #{value}

View File

@ -17,10 +17,13 @@ import com.fuint.business.member.service.ILJDutyService;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.order.service.AllOrderInfoService;
import com.fuint.business.order.vo.AllOrderInfoUniVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.system.role.entity.TDuty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
@ -38,6 +41,9 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
private ILJDutyService dutyService;
@Autowired
private AllOrderInfoMapper allOrderInfoMapper;
@Autowired
@Lazy
private AllOrderInfoService allOrderInfoService;
@Override
public IPage<StaffCommissionVo> selectCommissionList(Page page, StaffCommission commission) {
@ -123,6 +129,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
public void countStaffCommission(Integer staffId, Integer storeId, Double amount, Double payAmount, String type, String orderNo) {
AllOrderInfo allOrderInfo = allOrderInfoMapper.selectOne(new LambdaQueryWrapper<AllOrderInfo>()
.eq(AllOrderInfo::getOrderNo, orderNo));
AllOrderInfo allOrderInfo1 = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
commissionRecordService.addRecord(allOrderInfo.getId());
// if (ObjectUtil.isNotEmpty(staffId)) {
// LJStaff staff = staffService.selectStaffById(staffId);

View File

@ -62,6 +62,15 @@ public class CardCouponController extends BaseController {
return getSuccessResult(this.cardCouponService.pageVo(page, cardCoupon));
}
// 查询 优惠券 剩余数量 >0
@GetMapping("/queryByNum")
public ResponseObject queryByNum(@Param("cardCoupon") CardCoupon cardCoupon) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
cardCoupon.setStoreId(nowAccountInfo.getStoreId());
return getSuccessResult(this.cardCouponService.queryByNum(cardCoupon));
}
/**
* 不分页查询在使用中的优惠卷
*
@ -133,13 +142,13 @@ public class CardCouponController extends BaseController {
@PostMapping
public ResponseObject insert(@RequestBody CardCoupon cardCoupon) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//判断活动编号是否存在
//判断优惠券编号
LambdaQueryWrapper<CardCoupon> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardCoupon::getNumber, cardCoupon.getNumber())
.eq(CardCoupon::getStoreId, nowAccountInfo.getStoreId());
int count = cardCouponService.count(queryWrapper);
if (count > 0) {
return getFailureResult("编号已存在");
return getFailureResult(500, "编号已存在 请点击页面刷新按钮生成新的编号");
}
cardCoupon.setStoreId(nowAccountInfo.getStoreId());
cardCoupon.setChainStorId(nowAccountInfo.getChainStoreId());
@ -154,16 +163,6 @@ public class CardCouponController extends BaseController {
*/
@PutMapping
public ResponseObject update(@RequestBody CardCoupon cardCoupon) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//判断活动编号是否存在
LambdaQueryWrapper<CardCoupon> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardCoupon::getNumber, cardCoupon.getNumber())
.ne(CardCoupon::getId, cardCoupon.getId())
.eq(CardCoupon::getStoreId, nowAccountInfo.getStoreId());
int count = cardCouponService.count(queryWrapper);
if (count > 0) {
return getFailureResult("编号已存在");
}
return getSuccessResult(this.cardCouponService.updateById(cardCoupon));
}
@ -220,7 +219,7 @@ public class CardCouponController extends BaseController {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
cardCouponUser.setStoreId(nowAccountInfo.getStoreId());
cardCouponUser.setChainStoreId(nowAccountInfo.getChainStoreId());
return getSuccessResult(cardCouponService.sendCoupon(cardCouponUser));
return cardCouponService.sendCoupon(cardCouponUser);
}
/**

View File

@ -96,8 +96,10 @@ public class CardCoupon extends Model<CardCoupon> {
//可用日期 01 02 03 04 05 06 逗号隔开
private String availableDay;
//可用时间段开始时间
@JsonFormat(pattern = "HH:mm" , timezone = "GMT+8")
private LocalTime availablePeriodStart;
//可用时间段结束时间
@JsonFormat(pattern = "HH:mm" , timezone = "GMT+8")
private LocalTime availablePeriodEnd;
//适用类型1每周2每月
private String unAvailableType;
@ -106,8 +108,10 @@ public class CardCoupon extends Model<CardCoupon> {
//可用日期 01 02 03 04 05 06 逗号隔开
private String unAvailableDay;
//不可用时间段开始时间
@JsonFormat(pattern = "HH:mm" , timezone = "GMT+8")
private LocalTime unAvailablePeriodStart;
//不可用时间段结束时间
@JsonFormat(pattern = "HH:mm" , timezone = "GMT+8")
private LocalTime unAvailablePeriodEnd;
//使用条件
private String useCondition;
@ -143,6 +147,8 @@ public class CardCoupon extends Model<CardCoupon> {
private List<String> productIdList;
@TableField(exist = false)
private List<String> hxList;
@TableField(exist = false)
private String createByName;
}

View File

@ -19,6 +19,7 @@ import java.util.List;
@Mapper
public interface CardCouponMapper extends BaseMapper<CardCoupon> {
IPage<CardCoupon> pageVo(Page page, @Param("cardCoupon") CardCoupon cardCoupon);
List<CardCoupon> queryByNum(@Param("cardCoupon") CardCoupon cardCoupon);
IPage<CardCouponUniVo> selectAllByPageAndStoreId(Page page, @Param("cardCoupon")CardCoupon cardCoupon);
IPage<CardCouponUniVo> selectAllByPageAndIds(Page page,@Param("ids") List<Integer> ids);
@ -30,5 +31,7 @@ public interface CardCouponMapper extends BaseMapper<CardCoupon> {
*/
List<CardCouponUniVo> selectByStoreIdCount(CardCouponUniVo cardCouponUniVos);
List<CardCoupon> getCanUseCoupon(@Param("cardCoupon") CardCoupon cardCoupon);
}

View File

@ -42,5 +42,8 @@ public interface CardCouponUserMapper extends BaseMapper<CardCouponUser> {
IPage<CardCouponUserVo> queryPage(Page page,@Param("entity") CardCouponUserVo cardCouponUserVo);
List<CardCouponUniVo> selectCouponCount(@Param("storeId") Integer storeId,@Param("userId") Integer userId);
List<CardCouponUser> selectCardCouponUserList(@Param("params") Map<String, Object> params);
}

View File

@ -5,11 +5,10 @@
<select id="pageVo" resultType="com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon">
SELECT
cc.*
cc.* , acc.real_name AS createByName
FROM
card_coupon cc
card_coupon cc left join t_account acc on cc.create_by = acc.acct_id
<where>
cc.tf_total - cc.tf_get_num >0
<if test="cardCoupon.storeId!=null and cardCoupon.storeId!=''">
and cc.store_id = #{cardCoupon.storeId}
</if>
@ -121,5 +120,31 @@
</where>
order by cc.create_time desc
</select>
<select id="queryByNum" resultType="com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon">
SELECT
cc.*
FROM
card_coupon cc
<where>
cc.tf_total - cc.tf_get_num >0
<if test="cardCoupon.storeId!=null and cardCoupon.storeId!=''">
and cc.store_id = #{cardCoupon.storeId}
</if>
<if test="cardCoupon.name!=null and cardCoupon.name!=''">
and cc.name like concat('%',#{cardCoupon.name},'%')
</if>
<if test="cardCoupon.status!=null and cardCoupon.status!=''">
and cc.status = #{cardCoupon.status}
</if>
<if test="cardCoupon.type!=null and cardCoupon.type!=''">
and cc.type = #{cardCoupon.type}
</if>
<if test="cardCoupon.putType!=null and cardCoupon.putType!=''">
and cc.put_type = #{cardCoupon.putType}
</if>
</where>
order by cc.create_time desc
</select>
</mapper>

View File

@ -37,4 +37,24 @@
WHERE store_id = #{storeId} AND mt_user_id = #{userId}
group by card_coupon_id
</select>
<select id="selectCardCouponUserList"
resultType="com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser">
select * from card_coupon_user
<where>
<if test="params.mtUserId != null and params.mtUserId != ''">
and mt_user_id = #{params.mtUserId}
</if>
<if test="params.cardCouponId != null and params.cardCouponId != ''">
and card_coupon_id = #{params.cardCouponId}
</if>
<if test="params.createTimeStart != null">
and create_time &gt;= #{params.createTimeStart}
</if>
<if test="params.createTimeEnd != null">
and create_time &lt;= #{params.createTimeEnd}
</if>
</where>
</select>
</mapper>

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo;
import com.fuint.framework.web.ResponseObject;
import java.util.List;
@ -17,6 +18,9 @@ import java.util.List;
*/
public interface CardCouponService extends IService<CardCoupon> {
IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon);
List<CardCoupon> queryByNum(CardCoupon cardCoupon);
List<CardCoupon> getCanUseCoupon(CardCoupon cardCoupon);
@ -28,7 +32,7 @@ public interface CardCouponService extends IService<CardCoupon> {
int isOnLine(Integer id);
IPage selectAllByPageAndStoreId(Page page, CardCoupon cardCoupon);
int sendCoupon(CardCouponUser cardCouponUser);
ResponseObject sendCoupon(CardCouponUser cardCouponUser);
CardCoupon selectOneBuId(Integer id);

View File

@ -27,8 +27,10 @@ import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@ -43,13 +45,15 @@ import java.util.stream.Collectors;
public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCoupon> implements CardCouponService {
@Autowired
private CardCouponMapper cardCouponMapper;
@Autowired
private CardCouponUserMapper cardCouponUserMapper;
@Autowired
private LJUserService userService;
@Autowired
private UserBalanceMapper userBalanceMapper;
@Override
public IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon) {
IPage<CardCoupon> cardCouponIPage = baseMapper.pageVo(page, cardCoupon);
@ -57,6 +61,11 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
return cardCouponIPage;
}
@Override
public List<CardCoupon> queryByNum(CardCoupon cardCoupon) {
return baseMapper.queryByNum(cardCoupon);
}
@Override
public List<CardCoupon> getCanUseCoupon(CardCoupon cardCoupon) {
return baseMapper.getCanUseCoupon(cardCoupon);
@ -65,7 +74,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
@Override
public int isOnLine(Integer id) {
CardCoupon cardCoupon = baseMapper.selectById(id);
if (ObjectUtil.isEmpty( cardCoupon)) {
if (ObjectUtil.isEmpty(cardCoupon)) {
return 0;
}
cardCoupon.setStatus(cardCoupon.getStatus().equals("0") ? "1" : "0");
@ -85,7 +94,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
IPage<CardCouponUniVo> cardCouponUniVos = baseMapper.selectAllByPageAndStoreId(page, cardCoupon);
//用户拥有的优惠券以及数量
List<CardCouponUniVo> list= cardCouponUserMapper.selectCouponCount(cardCoupon.getStoreId(), nowAccountInfo.getId());
List<CardCouponUniVo> list = cardCouponUserMapper.selectCouponCount(cardCoupon.getStoreId(), nowAccountInfo.getId());
Map<Integer, Integer> map = list.stream().collect(Collectors.toMap(CardCouponUniVo::getId, CardCouponUniVo::getCount));
CardCouponUniVo cardCouponUniVo1 = new CardCouponUniVo();
@ -106,7 +115,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
//循环店铺优惠券
for (CardCouponUniVo coupon : cardCouponUniVos.getRecords()) {
Integer getNum = 0;
if (ObjectUtil.isNotEmpty(coupon.getTfGetNum())){
if (ObjectUtil.isNotEmpty(coupon.getTfGetNum())) {
getNum = coupon.getTfGetNum();
}
//判断当前用户是否符合会员等级
@ -117,13 +126,13 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
//查询该优惠券是否已到达限制数量
if ((getNum < coupon.getTfTotal())) {
Integer count = 0;
if (ObjectUtil.isNotEmpty(cardCouponMap.get(coupon.getId()))){
if (ObjectUtil.isNotEmpty(cardCouponMap.get(coupon.getId()))) {
count = cardCouponMap.get(coupon.getId());
}
if (count < coupon.getDayGetLimit()) {
Integer getNumLimit = coupon.getGetNumLimit();
Integer userCount = 0;
if (ObjectUtil.isNotEmpty(map.get(coupon.getId()))){
if (ObjectUtil.isNotEmpty(map.get(coupon.getId()))) {
userCount = map.get(coupon.getId());
}
if (userCount < getNumLimit) {
@ -142,19 +151,48 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
}
@Override
public int sendCoupon(CardCouponUser cardCouponUser) {
@Transactional(rollbackFor = Exception.class)
public ResponseObject sendCoupon(CardCouponUser cardCouponUser) {
LJUserVo ljUserVo = userService.selectUserById(cardCouponUser.getMtUserId(), cardCouponUser.getStoreId());
//查询 当前用户领取优惠券次数 总次数 每日次数
HashMap<String, Object> m1 = new HashMap<>();
m1.put("cardCouponId", cardCouponUser.getCardCouponId());
m1.put("mtUserId", cardCouponUser.getMtUserId());
List<CardCouponUser> list = cardCouponUserMapper.selectCardCouponUserList(m1);
m1.put("createTimeStart", com.fuint.common.util.DateUtil.getTodayMidnight());
m1.put("createTimeEnd", com.fuint.common.util.DateUtil.getTomorrowMidnight());
m1.put("mtUserId", null);
List<CardCouponUser> list2 = cardCouponUserMapper.selectCardCouponUserList(m1);
//查询 优惠券 信息
CardCoupon card = cardCouponMapper.selectById(cardCouponUser.getCardCouponId());
if (card.getGetNumLimit() <= list.size()) {
return new ResponseObject(500, "领取失败,超出每人总领取上限", null);
}
if (card.getDayGetLimit() <= list2.size()) {
return new ResponseObject(500, "领取失败,超出每日领取上限", null);
}
// 修改优惠券领取数量
card.setTfGetNum(card.getTfGetNum() + 1);
card.setCreateTime(null);
cardCouponMapper.updateById(card);
// 给用户添加 优惠券
cardCouponUser.setMobile(ljUserVo.getMobile());
//通过优惠卷策略计算 开始时间 结束时间
CardCoupon cardCoupon = this.getById(cardCouponUser.getCardCouponId());
if (cardCoupon.getTimeType().equals("1")){
if (cardCoupon.getTimeType().equals("1")) {
cardCouponUser.setStartTime(new Date());
cardCouponUser.setEndTime(DateUtil.offsetDay(new Date(),cardCoupon.getValidityDay()));
}else {
cardCouponUser.setEndTime(DateUtil.offsetDay(new Date(), cardCoupon.getValidityDay()));
} else {
cardCouponUser.setStartTime(cardCoupon.getEffectiveDateStart());
cardCouponUser.setEndTime(cardCoupon.getEffectiveDateEnd());
}
return cardCouponUserMapper.insert(cardCouponUser);
cardCouponUserMapper.insert(cardCouponUser);
return new ResponseObject(200, "领取成功", null);
}
@Override
@ -201,7 +239,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
DateTime now = DateUtil.date();
effectiveDateStart = now;
effectiveDateEnd = DateUtil.offsetDay(now, validityDay);
}else {
} else {
effectiveDateStart = cardCoupon.getEffectiveDateStart();
effectiveDateEnd = cardCoupon.getEffectiveDateEnd();
}
@ -248,7 +286,6 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
// }
// return null;
// }
private static void extracted(CardCouponUniVo coupon) {
//计算领取的比例
double scale = (coupon.getTfGetNum() == null ? 0 : coupon.getTfGetNum() * 1.0 / coupon.getTfTotal()) * 100;

View File

@ -525,8 +525,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
if (ObjectUtils.isEmpty(selectCard.getChooseStaff()) || selectCard.getChooseStaff() == 0) {
cardValueRecordDTO.setMtStaffId(nowAccountInfo.getStaffId());
cardValueRecordDTO.setRealName(nowAccountInfo.getRealName());
LJUserVo ljUserVo1 = ljUserMapper.selectUserById(nowAccountInfo.getId());
cardValueRecordDTO.setStaffMobile(ljUserVo1.getMobile());
LJStaff staff = mtStaffService.getById(nowAccountInfo.getStaffId());
cardValueRecordDTO.setStaffMobile(staff.getMobile());
}else {
LJStaff staff = mtStaffService.getById(selectCard.getChooseStaff());
cardValueRecordDTO.setRealName(staff.getRealName());
@ -536,7 +536,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
baseMapper.insert(cardValueRecordDTO);
orderId = cardValueRecordDTO.getId();
// 当为现金支付时插入到总的订单表
if ("CASH".equals(cardValueRecordDTO.getPaymentType())) {
if ("CASH".equals(selectCard.getPaymentType())) {
cardValueRecordDTO.setRealyPayBills(cardValueRecordDTO.getRechargeBalance());
AllOrderInfo allOrderInfo = getAllOrderInfo(cardValueRecordDTO);
allOrderInfo.setPaymentChannel("现金支付");
@ -575,8 +575,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
if (ObjectUtils.isEmpty(selectCard.getChooseStaff()) || selectCard.getChooseStaff() == 0) {
cardFuelRecordDTO.setMtStaffId(nowAccountInfo.getStaffId());
cardFuelRecordDTO.setRealName(nowAccountInfo.getRealName());
LJUserVo ljUserVo1 = ljUserMapper.selectUserById(nowAccountInfo.getId());
cardFuelRecordDTO.setStaffMobile(ljUserVo1.getMobile());
LJStaff staff = mtStaffService.getById(nowAccountInfo.getStaffId());
cardFuelRecordDTO.setStaffMobile(staff.getMobile());
}else {
LJStaff staff = mtStaffService.getById(selectCard.getChooseStaff());
cardFuelRecordDTO.setRealName(staff.getRealName());

View File

@ -2,8 +2,11 @@ package com.fuint.business.printer.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fuint.repository.model.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@ -16,6 +19,8 @@ import lombok.Data;
public class PrintDeviceInfo extends BaseEntity {
private static final long serialVersionUID = -94445696460905744L;
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
/**
* 设备终端号

View File

@ -82,7 +82,7 @@ public class PrintOilOrderReport {
}
if (ObjectUtil.isNotEmpty(handover.get("consumeRefuelMoney"))) {
sb.append("囤油卡付款:"+handover.get("consumeRefuelMoney")+"L\r\n");
sb.append("囤油卡付款:"+handover.get("consumeRefuelMoney")+"\r\n");
sb.append("--------------------------------\r\n");
}

View File

@ -333,7 +333,7 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
growthValue = growth * growthValue;
//更新用户余额表成长值
UserBalance userBalance = baseMapper.selectOne(new LambdaQueryWrapper<UserBalance>()
.eq(UserBalance::getMtUserId, userId));
.eq(UserBalance::getMtUserId, userId).eq(UserBalance::getStoreId, storeId));
userBalance.setGrowthValue(userBalance.getGrowthValue() + growthValue);
//更新成长值记录变化表

View File

@ -111,7 +111,7 @@ public class PayCenterServiceImpl implements PayCenterService {
private ActiveUserConsumeChildService activeUserConsumeChildService;
/**
* 收银台获取可用优惠券和可以参加的优惠活动
* 收银台获取可以参加的优惠活动
*
* @param map 请求参数
* @return java.lang.Object
@ -149,8 +149,6 @@ public class PayCenterServiceImpl implements PayCenterService {
Double oilPrice = Double.valueOf(map.get("oilPrice"));
//加油金额不含商品金额
Double oilAmount = Double.valueOf(map.get("oilAmount"));
//订单总额含商品金额
Double orderAmount = Double.valueOf(map.get("orderAmount"));
//油升数
Double oilLiter = Double.valueOf(map.get("oilLiter"));
//支付方式
@ -170,14 +168,14 @@ public class PayCenterServiceImpl implements PayCenterService {
}
try {
//2.2 查可参加的立减营销
actList.addAll(this.getLijianAct(nowDate, userId, gradeId, storeId, labelIdList, oilAmount, oilLiter, oilId, payWay));
actList.addAll(this.getLijianAct(nowDate, userId, gradeId, storeId, labelIdList, oilAmount, oilLiter, oilId, payWay));
} catch (Exception e) {
//测试用数据问题先忽略
System.out.println("立减营销" + e);
}
try {
//2.3 查可参加的折扣营销会员折扣
actList.addAll(this.getZhekouAct(nowDate, gradeId, storeId, oilAmount, payWay));
actList.addAll(this.getZhekouAct(nowDate, gradeId, storeId, oilAmount, payWay));
} catch (Exception e) {
//测试用数据问题先忽略
e.printStackTrace();
@ -264,7 +262,7 @@ public class PayCenterServiceImpl implements PayCenterService {
* @param gradeId 会员等级
* @param storeId 店铺id
* @param labelIdList 会员标签id集和
* @param oilAmount 当前加油金额
* @param orderAmount 订单金额
* @param oilLiter 当前加油升数
* @param oilId 当前加油选择的油号id
* @param payWay 支付方式
@ -273,7 +271,7 @@ public class PayCenterServiceImpl implements PayCenterService {
* @date 17:28 2024/9/21
**/
private List<ActivityVO> getLijianAct(Date nowDate, Integer userId, Integer gradeId, Integer storeId,
List<Integer> labelIdList, Double oilAmount, Double oilLiter,
List<Integer> labelIdList, Double orderAmount, Double oilLiter,
Integer oilId, String payWay) {
/*1.先查满足条件的所有生效中的活动规则*/
List<ActiveSubPriceRespVO> activeSubPriceList = activeSubPriceService.selectAllAct(storeId, nowDate);
@ -288,7 +286,8 @@ public class PayCenterServiceImpl implements PayCenterService {
//适用当前油号的
.filter(rule -> checkUtil.checkOilLijian(rule.getApplyOilType(), rule.getApplyOil(), oilId))
//适用当前支付方式的
.filter(rule -> rule.getPaymentType().contains(payWay)).collect(Collectors.toList());
.filter(rule -> rule.getPaymentType().contains(payWay))
.collect(Collectors.toList());
/*3.再次过滤,这里过滤掉用户已经超出参加次数限制的*/
//符合条件的活动规则查询当前会员已经参与的记录此处查立减营销的参与记录
List<String> actTypeList = Arrays.asList("3".split(StrUtil.COMMA));
@ -313,7 +312,11 @@ public class PayCenterServiceImpl implements PayCenterService {
activityVO.setType("3");
activityVO.setActName(rule.getActiveName());
activityVO.setPayTypes(rule.getPaymentType());
activityVO.setDisAmount(checkUtil.computeDisAmountLijian(rule, oilAmount, oilLiter));
Double aDouble = checkUtil.computeDisAmountLijian(rule, orderAmount, oilLiter);
if (aDouble <= 0){
continue;
}
activityVO.setDisAmount(checkUtil.computeDisAmountLijian(rule, orderAmount, oilLiter));
rtnList.add(activityVO);
}
}
@ -422,6 +425,8 @@ public class PayCenterServiceImpl implements PayCenterService {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
int userId = Integer.parseInt(map.get("userId"));
//查询出用户信息
UserBalance userBalance = userBalanceService.selectUserBalanceByStorId(userId, storeId);
//油号id
Integer oilId = Integer.valueOf(map.getOrDefault("oilId", "99999"));
//加油金额不含商品金额
@ -430,6 +435,7 @@ public class PayCenterServiceImpl implements PayCenterService {
Double oilLiter = Double.valueOf(map.getOrDefault("oilLiter", "0"));
//支付方式
String payWay = map.get("payWay");
//还需要 加油升数 订单金额
if ("after_pay".equals(payWay)) {
//挂账不可以用优惠券
return new ArrayList<>();
@ -448,12 +454,15 @@ public class PayCenterServiceImpl implements PayCenterService {
List<CardCouponVO> filteredList = couponVOList.stream()
//当前时间在 适用时间段内 或者 当前时间不在 不适用时间段内的
.filter(rule -> this.checkTimeCouponPrex(rule, nowDate))
//过滤会员等级
.filter(rule -> checkUtil.checkGradeId(userBalance.getGradeId(), rule.getMembershipLevel()))
//如果是油品券需要过滤出当前油品可用的
.filter(rule -> checkUtil.checkOilCoupon(rule, oilId))
//如果是油品券需要过滤出达到满减条件的
.filter(rule -> checkUtil.checkMaxCoupon(rule, oilAmount, oilLiter))
//如果是单品立减券需要过滤出当前选择的商品可用且满足最低消费金额的
.filter(rule -> checkUtil.checkGoodsCoupon(rule, finalGoodsList)).collect(Collectors.toList());
//直接 去掉类型是 2,5 卡券类型 1代金券2兑换券3折扣券4油品立减券5单品代金券
.filter(rule -> rule != null && !Arrays.asList("2", "5").contains(rule.getType()))
.collect(Collectors.toList());
if (filteredList.isEmpty()) {
return new ArrayList<>();
}
@ -691,14 +700,14 @@ public class PayCenterServiceImpl implements PayCenterService {
// 此活动上架 收银台可送 已领取 + 活动发放数量 < 总数量 未超过 总上限 当日上限
if (card.getStatus().equals("1") &&
card.getSySend().equals("1") &&
card.getTfGetNum()+child.getGiftCardTotal() < card.getTfTotal() &&
card.getTfGetNum() + child.getGiftCardTotal() < card.getTfTotal() &&
list1.size() < card.getGetNumLimit() &&
list2.count() < card.getDayGetLimit()) {
// 将优惠卷 当前用户关联 并且 优惠卷 领取数量 + 方法数量
card.setTfGetNum(card.getTfGetNum() + child.getGiftCardTotal());
cardCouponService.updateById(card);
for (int i = 0; i <child.getGiftCardTotal() ; i++) {
for (int i = 0; i < child.getGiftCardTotal(); i++) {
CardCouponUser cardUser = new CardCouponUser();
cardUser.setChainStoreId(invitationBalance.getChainStoreId());
cardUser.setStoreId(invitationBalance.getStoreId());
@ -1061,9 +1070,9 @@ public class PayCenterServiceImpl implements PayCenterService {
.filter(cardCouponUser -> checkUtil.isBetween(cardCouponUser.getCreateTime(), DateUtil.getTodayMidnight(), DateUtil.getTomorrowMidnight()));
// 优惠卷 上架 收银台可送 活动发放数量+已领取 < 总数量 未超过 总上限 当日上限 先都判断一下不为 null 防止空指针
card.setTfGetNum( (card.getTfGetNum() == null) ? 0 : card.getTfGetNum());
card.setTfGetNum((card.getTfGetNum() == null) ? 0 : card.getTfGetNum());
if ( card.getStatus().equals("1") &&
if (card.getStatus().equals("1") &&
card.getSySend().equals("1") &&
(child.getGiftCardTotal() + card.getTfGetNum()) < card.getTfTotal() &&
list1.size() < card.getGetNumLimit() &&
@ -1071,7 +1080,7 @@ public class PayCenterServiceImpl implements PayCenterService {
) {
// 将优惠卷 当前用户关联 并且 优惠卷 领取数量 + 活动设定赠送优惠卷数量
card.setTfGetNum(card.getTfGetNum()+child.getGiftCardTotal());
card.setTfGetNum(card.getTfGetNum() + child.getGiftCardTotal());
cardCouponService.updateById(card);
// 并且 循环 添加多张优惠卷与用户领取记录表
for (int i = 0; i < child.getGiftCardTotal(); i++) {
@ -1152,6 +1161,22 @@ public class PayCenterServiceImpl implements PayCenterService {
}
public Boolean filterCardCouponVOType(CardCouponVO cardCouponVO) {
// 卡券类型 1代金券2兑换券3折扣券4油品立减券5单品代金券
if ("1".equals(cardCouponVO.getType()) || "3".equals(cardCouponVO.getType()) || "4".equals(cardCouponVO.getType())) {
} else if ("2".equals(cardCouponVO.getType())) {
} else if ("5".equals(cardCouponVO.getType())) {
}
return null;
}
/**
* 推荐消费有礼 活动时间前置处理 0永久有效1自定义
@ -1203,7 +1228,7 @@ public class PayCenterServiceImpl implements PayCenterService {
**/
private Boolean checkTimeCouponPrex(CardCouponVO rule, Date nowDate) {
if (rule.getAvailableDay() ==null && rule.getAvailableWeek() == null){
if (StringUtils.isEmpty(rule.getAvailableDay()) && StringUtils.isEmpty(rule.getAvailableWeek()) ) {
return true;
}
String startTimeStr;
@ -1212,12 +1237,14 @@ public class PayCenterServiceImpl implements PayCenterService {
//适用时间
startTimeStr = checkUtil.getTimeFromDate(rule.getAvailablePeriodStart());
endTimeStr = checkUtil.getTimeFromDate(rule.getAvailablePeriodEnd());
return checkUtil.checkTime(rule.getAvailableType(), "1".equals(rule.getAvailableType()) ? rule.getAvailableWeek() : rule.getAvailableDay(), startTimeStr, endTimeStr, nowDate);
Boolean aBoolean = checkUtil.checkTime(rule.getAvailableType(), "1".equals(rule.getAvailableType()) ? rule.getAvailableWeek() : rule.getAvailableDay(), startTimeStr, endTimeStr, nowDate);
return aBoolean;
} else if ("1".equals(rule.getAvailableOrUn())) {
//不适用时间
startTimeStr = checkUtil.getTimeFromDate(rule.getUnAvailablePeriodStart());
endTimeStr = checkUtil.getTimeFromDate(rule.getUnAvailablePeriodEnd());
return checkUtil.checkTimeReverse(rule.getUnAvailableType(), "1".equals(rule.getUnAvailableType()) ? rule.getUnAvailableWeek() : rule.getUnAvailableDay(), startTimeStr, endTimeStr, nowDate);
Boolean aBoolean = checkUtil.checkTimeReverse(rule.getUnAvailableType(), "1".equals(rule.getUnAvailableType()) ? rule.getUnAvailableWeek() : rule.getUnAvailableDay(), startTimeStr, endTimeStr, nowDate);
return aBoolean;
} else {
//超出预设值范围不可用
return false;

View File

@ -63,7 +63,7 @@ public class CheckUtil {
}
/**
* 判断某活动设置的可用会员等级(可以通用 就是比较 某个数值 是否在某组字符串中含有)
* 判断某活动设置的可用会员等级(可以通用 就是比较 某个字符串 是否在某组字符串中含有)
*
* @param gradeId 当前会员的等级
* @param gradeIds 活动设置的会员等级Ids
@ -414,6 +414,8 @@ public class CheckUtil {
}
}
/**
* 判断当前加油的油号是否符合优惠券预设的油号----优惠券专用
*
@ -450,20 +452,20 @@ public class CheckUtil {
* 判断当前加油金额或者加油升数是否达到满减条件----优惠券专用
*
* @param couponVO 优惠券对象
* @param oilAmount 加油金额
* @param orderAmount 订单金额
* @param oilLiter 加油升数
* @return java.lang.Boolean
* @author vinjor-M
* @date 14:42 2024/9/21
**/
public Boolean checkMaxCoupon(CardCouponVO couponVO, Double oilAmount, Double oilLiter) {
public Boolean checkMaxCoupon(CardCouponVO couponVO, Double orderAmount, Double oilLiter) {
//代金券折扣券油品立减券才需要判断加油升数加油金额是否达到满减条件
List<String> couponTypeList = Arrays.asList("1", "3", "4");
if (couponTypeList.contains(couponVO.getType())) {
Double thisValue;
if ("1".equals(couponVO.getUseType())) {
//加油金额
thisValue = oilAmount;
//订单金额
thisValue = orderAmount;
} else if ("2".equals(couponVO.getUseType())) {
//加油升数
thisValue = oilLiter;
@ -777,15 +779,15 @@ public class CheckUtil {
* 根据优惠券优惠规则计算优惠金额四舍五入保留2位小数--优惠券专用
*
* @param coupon 优惠券
* @param oilAmount 加油总价
* @param orderAmount 订单金额
* @param oilLiter 加油升数
* @return java.lang.Double
* @author vinjor-M
* @date 16:35 2024/9/21
**/
public Double computeDisAmountCoupon(CardCouponVO coupon, Double oilAmount, Double oilLiter) {
public Double computeDisAmountCoupon(CardCouponVO coupon, Double orderAmount, Double oilLiter) {
//默认优惠后总价等于原来的总价
Double newOilAmount = oilAmount;
Double newOilAmount = orderAmount;
//优惠金额
Double disAmount = 0.0;
DecimalFormat df = new DecimalFormat("#.00");
@ -796,7 +798,7 @@ public class CheckUtil {
} else if ("3".equals(coupon.getType())) {
//折扣券打折
newOilAmount = newOilAmount * coupon.getZkData();
disAmount = oilAmount - newOilAmount;
disAmount = orderAmount - newOilAmount;
if (disAmount > coupon.getZkMaxAmount()) {
//超出折扣最大优惠金额
disAmount = coupon.getZkMaxAmount();

View File

@ -1008,6 +1008,7 @@ import {getLodop} from "@/api/LodopFuncs";
},
getStaffList(){
console.log("查询负责人走了")
queryStaffs().then(res => {
this.staffList = res.data
})

View File

@ -16,10 +16,14 @@
trigger="hover">
<div> 储值卡{{ chooseVipUser.cardBalance || 0 }}</div>
<div v-if="chooseVipUser.userFuels">
<div v-for="(item,index) in chooseVipUser.userFuels" :key="index"> 囤油卡{{ item.fuelAmount }}</div>
<div v-for="(item,index) in chooseVipUser.userFuels" :key="index">
囤油卡{{item.fuelAmount}}
</div>
</div>
<div v-if="chooseVipUser.fleetInfoUniVos">
<div v-for="(item,index) in chooseVipUser.fleetInfoUniVos" :key="index"> 车队卡{{ item.totalBalance }}</div>
<div v-for="(item,index) in chooseVipUser.fleetInfoUniVos" :key="index">
车队卡{{ item.totalBalance }}
</div>
</div>
<img slot="reference" src="./imgs/kbao.png" style="width: 24px;height: 24px;margin-right: 10px">
@ -73,7 +77,7 @@
<div style="color: #F4F5F9">|</div>
<div class="three_box">合计:{{ orderAmount }}</div>
</div>
<div class="d-top">
<div class="d-top" v-loading="loadingPreferential">
<div class="d-b">
<el-checkbox v-model="showAct">活动优惠 <i class="el-icon-arrow-down"></i></el-checkbox>
@ -131,7 +135,9 @@
<div class="box-bottom">
<div>
<div class="price_">{{ realAmount }}</div>
<div class="price_prefer">优惠合计:{{ disTotal }}</div>
<!-- <div class="price_prefer" style="font-size: 14px">油品优惠:-{{ parseFloat(disOil).toFixed(2)}}</div>-->
<!-- <div class="price_prefer" style="font-size: 14px">商品优惠:-{{ parseFloat(disGoods).toFixed(2) }}</div>-->
<div class="price_prefer">优惠合计:-{{ parseFloat(disTotal).toFixed(2) }}</div>
</div>
<div class="anniu" @click="settlement()" :class="{ disabled: !isClickable }">立即结算</div>
</div>
@ -212,7 +218,7 @@
</div>
<div class="stock_name">{{ item.stock }}</div>
<div class="u-price_name">{{ item.retailPrice }}</div>
<div class="u-price_name">{{ item.retailPrice }}</div>
<div class="u-price_name">{{ item.memberPrice}}</div>
<div class="num_name">
<el-input-number v-model="goodsList[index].num" @change="handleCilone(goodsList[index])" :max=item.stock
size="mini" :min="1">
@ -575,7 +581,7 @@ import {
getCheckTheStatusOfYourPaymentApi,
rechargeCard
} from "@/api/cashier/cardSet";
import {getReturnCode, printOilOrderReport} from '@/api/print'
import {getReturnCode, printOilOrderReport,printCardValueReport,printFuelDieselReport} from '../../../api/print'
import {addLJGoods, scanAppletQrCode} from "@/api/cashier/oilorder";
import {cashierOrderByOrderNo} from '@/api/cashier/cashierorder'
import {addHangBill} from "../../../api/cashier/hangbill";
@ -584,6 +590,9 @@ export default {
dicts: ['CardCoupon_type'],
data() {
return {
disOil: 0.00,
disGoods: 0.00,
loadingPreferential: false,
dialogVisible:false,
isClickable: false, //
payForm: {
@ -715,6 +724,40 @@ export default {
}
},
watch: {
//
chooseVipUser:{
deep: true,
handler(newVal) {
this.goodsList = this.goodsList.map(
item => {
return item;
}
)
}
},
//
goodsList: {
handler(newVal) {
//
if (this.chooseVipUser.hasOwnProperty("id")) {
this.disGoods = 0.00;
//
console.log("走了啊", this.goodsList);
this.goodsList.forEach(item => {
const memberPrice = Number(item.retailPrice - item.memberPrice);
const num = Number(item.num);
const product = (memberPrice * num).toFixed(2); //
this.disGoods = (parseFloat(this.disGoods) + parseFloat(product)).toFixed(2);
});
//
this.disTotal = 0.00;
this.disTotal = (parseFloat(this.disGoods) + parseFloat(this.disOil)).toFixed(2);
}
},
deep: true,
},
//
realAmount: {
handler(newVal) {
@ -776,6 +819,8 @@ export default {
console.log('油枪发生变化', newValue);
if (newValue && newValue.hasOwnProperty("oilNameId")) {
this.orderAmount = (Number(newValue.amount) + Number(this.getGoodsNum)).toFixed(2)
//
this.oilLiter = (this.oilGunClearing.amount / this.oilGunClearing.oilPrice).toFixed(2)
} else {
this.orderAmount = this.getGoodsNum
}
@ -795,8 +840,7 @@ export default {
} else {
this.orderAmount = newVal
}
//
this.getCoupon()
// 使
}
},
components: {
@ -821,8 +865,6 @@ export default {
},
getGoodsItem() {
if (this.oilGunClearing.amount && this.oilGunClearing.amount !== undefined) {
//
this.oilLiter = (this.oilGunClearing.amount / this.oilGunClearing.oilPrice).toFixed(2)
// 821.03L/191.7936
return `${this.oilGunClearing.gunName}${this.oilLiter}L/${this.oilGunClearing.amount}元)`
@ -858,6 +900,11 @@ export default {
},
sendCouponClick() {
console.log("数量",this.sendCoupon.tfTotal - this.sendCoupon.tfGetNum)
if (this.sendCoupon.tfTotal - this.sendCoupon.tfGetNum <=0){
this.$message.error("优惠券已领完")
return
}
//this.sendCoupon this.chooseVipUser.id
this.sendCoupon.mtUserId = this.chooseVipUser.id
this.sendCoupon.fromType = "4"
@ -866,8 +913,14 @@ export default {
this.sendCoupon.status = null
sendCouponFun(this.sendCoupon).then(
res => {
this.$message.success("赠送成功")
this.freeTicket = false
if (res.code == 200){
this.$message.success("赠送成功")
this.freeTicket = false
}
else {
this.$message.error(res.msg)
}
}
)
},
@ -893,13 +946,18 @@ export default {
* */
getDisTotal() {
this.disTotal = 0.00
this.disOil = 0.00
if ("" != this.chooseCouponId) {
this.disTotal += this.chooseCoupon.disAmount
this.disOil = parseFloat(this.disOil)+ parseFloat(this.chooseCoupon.disAmount);
}
if ("" != this.chooseActId) {
this.disTotal += this.chooseAct.disAmount
this.disOil = parseFloat(this.disOil)+ parseFloat(this.chooseAct.disAmount);
}
this.disTotal = (this.disTotal).toFixed(2)
console.log("油品优惠金额", this.disOil);
console.log("商品优惠金额", this.disGoods);
this.disTotal = parseFloat(this.disOil)+ parseFloat(this.disGoods);
},
/**
* 监听活动选择切换
@ -992,8 +1050,10 @@ export default {
}
});
let this_ = this
console.log(this.payForm,1054)
//
let timer = setInterval(async () => {
let flag = false
await getCheckTheStatusOfYourPaymentApi(id).then(async response => {
if (response.data != null) {
const payStatus = response.data.payStatus
@ -1005,8 +1065,9 @@ export default {
this_.isQuery = false;
this_.rechargeBalCard = true
// await this_.printLocally1()
await this_.cardValueReport()
await this_.getMemberAfter();
flag = true
// await this_.cardValueReport()
// await this_.getMemberAfter();
clearInterval(timer);
} else if (payStatus === "payFail") {
this_.isPaySuccess = false;
@ -1014,8 +1075,9 @@ export default {
clearInterval(timer);
}
}
await this_.getMemberAfter();
// await this_.getMemberAfter();
})
if (flag) await this_.cardValueReport()
}, 1000);
let timer2 = setInterval(function () {
@ -1060,7 +1122,9 @@ export default {
this.$message.error('请选择输入充值本金');
return
}
console.log(selectCard,1122)
this.payForm.rechargeBalance = selectCard.rechargeBalance
this.payForm.lockupPrice = selectCard.lockupPrice
this.payForm.realyPayBills = selectCard.rechargeBalance
this.payForm.selectCardId = selectCard.id
this.payForm.cardType = selectCard.cardType
@ -1087,17 +1151,21 @@ export default {
},
//
oilOrderReport() {
console.log(this.goodsOrder,this.goodsList,1095)
//
let oilOrderR = [
{
oilName: this.oilGunClearing.name,
amount: this.oilGunClearing.amount + '',
}
]
let oilOrderR = []
if (this.oilGunClearing && this.oilGunClearing.amount>0){
oilOrderR = [
{
oilName: this.oilGunClearing.oilType + this.oilGunClearing.oilName,
amount: this.oilGunClearing.amount + '',
}
]
}
let goodsOrderR = []
if (this.goodsOrder && this.goodsOrder.length > 0) {
this.goodsOrder.forEach(order => {
if (this.goodsList && this.goodsList.length > 0) {
this.goodsList.forEach(order => {
let o = {
oilName: order.name,
unit: order.num + order.unit,
@ -1114,9 +1182,10 @@ export default {
'WECHAT': '微信',
'ALIPAY': '支付宝',
'UNIONPAY': '银联二维码',
'credit': '挂账',
'oilCard': '囤油卡',
'balance': '储值卡'
'after_pay': '挂账',
'fule_card': '囤油卡',
'card_value': '储值卡',
'car_card_value': '车队卡',
};
let payTypeText = payTypeMap[this.payType] || '小程序码';
@ -1127,26 +1196,92 @@ export default {
unitName: "", //
// consumeAmount:this.consumeAmount,
creditAmount: (this.oilAmount + (+this.goodsAmount)).toFixed(2),//
creditAmount: this.realAmount,//
//
discount: (this.oilDiscount + this.goodsDiscount + this.fullReduction + this.couponAmount).toFixed(2), //
discount: this.disTotal, //
//
consumeAmount: this.consumeAmount,
consumeAmount: this.realAmount,
//
consumeRefuelMoney: this.consumeRefuelMoney ? this.consumeRefuelMoney.toFixed(2) : 0,
consumeRefuelMoney: this.realAmount,
//
actualPay: ((+this.oilActualPay) + (+this.goodsActualPay)).toFixed(2),
actualPay: this.realAmount,
//
seekZero: this.seekZero ? this.seekZero.toFixed(2) : 0,
}
if (this.form1 && this.form1.unitName) f.unitName = this.form1.unitName
if (this.credit && this.credit.unitName) f.unitName = this.credit.unitName
printOilOrderReport(f).then(res => {
console.log(res, 1121)
})
},
// /
cardValueReport(){
//
const payTypeMap = {
'CASH': '现金',
'WECHAT': '微信',
'ALIPAY': '支付宝',
'UNIONPAY': '银联二维码',
'after_pay': '挂账',
'fule_card': '囤油卡',
'card_value': '储值卡',
'car_card_value': '车队卡',
};
if (this.payForm.cardType==0 || this.payForm.cardType==2){
console.log(1226)
let payTypeText = payTypeMap[this.payForm.paymentType]
let actualPay = this.payForm.paymentType == 'CASH' ? this.payForm.authCode:this.payForm.realyPayBills
let a = {
//
realyPayBills:this.payForm.realyPayBills,
//
giftBalance:this.payForm.giftBalance,
//
getAmount:Number(this.payForm.giftBalance) + Number(this.payForm.realyPayBills),
payType:payTypeText,
//
actualPay: actualPay,
//
seekZero:this.payForm.seekZero.toFixed(2),
}
printCardValueReport(a).then(res => {
console.log(res,1245)
})
}
if (this.payForm.cardType==1){
let payTypeText1 = payTypeMap[this.payForm.paymentType]
console.log(this.payForm,1256)
let b = {
//
oilType:this.payForm.oilName,
//
incomeLitres:(this.payForm.rechargeBalance / this.payForm.lockupPrice).toFixed(2),
//
realyPayBills:this.payForm.rechargeBalance,
//
lockupPrice:this.payForm.lockupPrice,
//
payType:payTypeText1,
//
//
seekZero:this.payForm.seekZero.toFixed(2),
}
console.log(b,1271)
printFuelDieselReport(b).then(res=>{
console.log(res,1273)
})
}
},
//
resetting1() {
this.realAmount = 0.00
//
this.disTotal = 0.00
//
this.userMobile = null
//
@ -1157,6 +1292,8 @@ export default {
this.userInfo = false
//
this.payType = "ALIPAY"
this.loading = false;
},
//
queryPayStatus() {
@ -1339,8 +1476,8 @@ export default {
// id
// id
//
if (this.oilGunClearing) {
console.log(this.oilGunClearing)
if (this.oilGunClearing && this.oilGunClearing.amount>0) {
this.payForm.oilOrder = JSON.stringify({
oilPrice: this.oilGunClearing.oilPrice,
oils: this.oilGunClearing.oilNameId,
@ -1361,11 +1498,11 @@ export default {
//
this.payForm.oilAmount = this.oilGunClearing.amount || 0
//
this.payForm.goodsAmount = this.getGoodsNum
this.payForm.goodsAmount = this.getGoodsNum || 0
//
this.payForm.oilActualPay = this.oilGunClearing.amount || 0
this.payForm.oilActualPay = (this.oilGunClearing.getAmount || 0)-(this.disOil || 0)
//
this.payForm.goodsActualPay = this.getGoodsNum
this.payForm.goodsActualPay = (this.getGoodsNum || 0) - (this.disGoods || 0)
//id
this.payForm.oilGunId = this.oilGunClearing.id
//
@ -1379,9 +1516,9 @@ export default {
//
this.payForm.payUser = this.chooseVipUser.mobile
//
this.payForm.oilDiscount = 0;
this.payForm.oilDiscount = this.disOil;
//
this.payForm.goodsDiscount = 0;
this.payForm.goodsDiscount = this.disGoods;
// ()
this.payForm.consumeAmount = this.realAmount;
@ -1448,7 +1585,7 @@ export default {
oilId: this.oilGunClearing.oilNameId,
oilPrice: this.oilGunClearing.oilPrice,
oilAmount: this.oilGunClearing.amount,
orderAmount: this.orderAmount,
// orderAmount: this.orderAmount,
payWay: this.payType,
oilLiter: this.oilLiter
}
@ -1464,13 +1601,15 @@ export default {
/**
* @description 油枪金额和商品金额发生变化请求后端查询可用优惠券
* 传入后台的参数会员的用户id加油油号加油订单金额不包括商品金额加油订单总金额包括商品金额加油总升数
* 修改后 会员的用户id加油油号加油订单金额加油总升数 现在收银台 使用优惠券 是必须有油品才行
* @author vinjor-m
* @date 2024年9月19日
*/
getCoupon() {
this.loadingPreferential = true;
this.chooseCouponId = ''
//
if (this.chooseVipUser.hasOwnProperty("id") && (this.goodsList.length > 0 || (this.oilGunClearing != '' && this.oilGunClearing.hasOwnProperty("oilNameId")))) {
// id
if (this.chooseVipUser.hasOwnProperty("id") && this.oilGunClearing != '' && this.oilGunClearing.hasOwnProperty("oilNameId") ) {
//
let dataObj = {
userId: this.chooseVipUser.id,
@ -1479,7 +1618,7 @@ export default {
if (this.oilGunClearing != '' && this.oilGunClearing.hasOwnProperty("oilNameId")) {
//
dataObj['oilId'] = this.oilGunClearing.oilNameId
dataObj['oilAmount'] = this.oilGunClearing.amount
dataObj['oilAmount'] = this.oilGunClearing.amount
dataObj['oilLiter'] = this.oilLiter
}
if (this.goodsList.length > 0) {
@ -1500,9 +1639,11 @@ export default {
getCouponList(dataObj).then(res => {
console.log("返回的可用的优惠券", res)
this.couponList = res.data
this.loadingPreferential = false;
})
} else {
this.couponList = []
this.loadingPreferential = false;
}
},
restVipUser() {
@ -1871,11 +2012,11 @@ export default {
//
this.payForm.oilAmount = this.oilGunClearing.amount || 0
//
this.payForm.goodsAmount = this.getGoodsNum
this.payForm.goodsAmount = this.getGoodsNum || 0
//
this.payForm.oilActualPay = this.oilGunClearing.amount || 0
this.payForm.oilActualPay = this.oilGunClearing.amount ? this.oilGunClearing.getAmount-this.disOil : 0
//
this.payForm.goodsActualPay = this.getGoodsNum
this.payForm.goodsActualPay = this.getGoodsNum ? this.getGoodsNum-this.disGoods : 0
//id
this.payForm.oilGunId = this.oilGunClearing.id
//
@ -1889,9 +2030,9 @@ export default {
//
this.payForm.payUser = this.chooseVipUser.mobile
//
this.payForm.oilDiscount = 0;
this.payForm.oilDiscount = this.disOil;
//
this.payForm.goodsDiscount = 0;
this.payForm.goodsDiscount = this.disGoods;
// ()
this.payForm.consumeAmount = this.realAmount;
@ -1908,6 +2049,7 @@ export default {
this.payForm.allAmount = this.realAmount
this.payForm.paymentType = this.payType
console.log('支付类型', this.payForm.paymentType)
@ -1934,8 +2076,8 @@ export default {
}
this.accountPending = true
}
if (value == 'car_card_value'){
if (!this.userInfo){
if (value == 'car_card_value') {
if (!this.userInfo) {
this.$message.error("请先选择会员")
return
}
@ -2048,6 +2190,7 @@ export default {
},
handleSelect(row) {
let bo1 = true
console.log('当前选择的商品',row)
// item goodsList +1
// 使 map vue
this.goodsList = this.goodsList.map(

View File

@ -60,13 +60,20 @@ export default {
},
methods:{
chooseFuel(data){
console.log(data,63)
this.$set(this.selectCard,'id',data.id)
this.$set(this.selectCard,'points',data.points)
this.$set(this.selectCard,'rechargeBalance',data.rechargeBalance)
this.$set(this.selectCard,'lockupPrice',data.lockPrice)
},
changeFuelId(){
this.$set(this.selectCard,'id',null)
this.$set(this.selectCard,'points',null)
this.oilList.forEach(item => {
if (this.selectCard.oilNumberId==item.id){
this.$set(this.selectCard,'oilName',item.oilName)
}
})
this.getFuelCards()
},
getOilList(){
@ -75,6 +82,7 @@ export default {
this.oilList = res.data.records
if (this.oilList&&this.oilList.length>0){
this.$set(this.selectCard,'oilNumberId',this.oilList[0].id)
this.$set(this.selectCard,'oilName',this.oilList[0].oilName)
this.getFuelCards()
}