This commit is contained in:
zhaohengkun 2024-10-16 16:17:19 +08:00
parent 8fe169815a
commit 3276ced4ae
17 changed files with 345 additions and 129 deletions

View File

@ -333,7 +333,7 @@
label="数量"
width="240">
<template slot-scope="scope">
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="9999"></el-input-number>
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="scope.row.tfTotal - scope.row.tfGetNum"></el-input-number>
</template>
</el-table-column>
@ -562,9 +562,8 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
youhuiquan:{
name:'',
status:'1',
putType:'1',
pageNum: 1,
pageSize: 10,
pageSize: 1000,
},
ytotal:0,
//
@ -807,6 +806,8 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
giftCardTime: "", //
giftCardTotal: 1,//
instruction: row.instruction,//使
tfTotal: row.tfTotal,
tfGetNum: row.tfGetNum,
}
this.youhuiquanlist.push(data)
this.$message.success("新增成功")

View File

@ -206,16 +206,20 @@
<template slot="append" v-else></template>
</el-input>
<span></span>
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 22%" placeholder="请选择">
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 22%" placeholder="请选择" @change="updateMax(item)">
<el-option
v-for="(item1,index1) in cardCouponList"
:key="index1"
:label="item1.name"
:value="item1.id"></el-option>
</el-select>
<el-input style="width: 25%;margin: 0 10px" v-model="item.giftCardTotal">
<template slot="append"></template>
</el-input>
<el-input-number style="width: 45%; margin-left: 10px;"
v-model.number="item.giftCardTotal"
:min="1"
:max="item.max"
controls-position="right">
<template #append></template>
</el-input-number>
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;"
@click="deleteCoupons(index)">
</div>
@ -442,6 +446,17 @@ export default {
this.getUserLabelList()
},
methods: {
updateMax(item) {
//
item.giftCardTotal = 1;
//
const selectedOption = this.cardCouponList.find(option => option.id === item.vouchersId);
if (selectedOption) {
item.max = selectedOption.tfTotal - selectedOption.tfGetNum;
} else {
item.max = 0; //
}
},
handleCheckedCitiesChange(e) {
console.log(e, this.checkedCities)
@ -523,7 +538,7 @@ export default {
},
getCardCoupon() {
listCardCoupon({status: 1, putType: 1}).then(res => {
listCardCoupon({status: 1}).then(res => {
this.cardCouponList = res.data.records
})
},

View File

@ -77,16 +77,20 @@
<div v-for="(item,index) in couponList" :key="index" style="display: flex;font-size: 14px;align-items: center;margin: 20px 0">
<div style="width: 9.5%;">赠送</div>
<el-select v-model="item.vouchersId" style="width: 45%" placeholder="请选择">
<el-select v-model="item.vouchersId" style="width: 45%" placeholder="请选择" @change="updateMax(item)">
<el-option
v-for="(item1,index1) in cardCouponList"
:key="index1"
:label="item1.name"
:value="item1.id"></el-option>
</el-select>
<el-input style="width: 45%;margin-left: 10px" v-model="item.giftCardTotal">
<template slot="append"></template>
</el-input>
<el-input-number style="width: 45%; margin-left: 10px;"
v-model.number="item.giftCardTotal"
:min="1"
:max="item.max"
controls-position="right">
<template #append></template>
</el-input-number>
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px;"
@click="deleteCoupons(index)">
</div>
@ -239,9 +243,21 @@ export default {
this.getCardCoupon()
},
methods: {
updateMax(item) {
//
item.giftCardTotal = 1;
//
const selectedOption = this.cardCouponList.find(option => option.id === item.vouchersId);
if (selectedOption) {
item.max = selectedOption.tfTotal - selectedOption.tfGetNum;
} else {
item.max = 0; //
}
},
getCardCoupon() {
listCardCoupon({status: 1, putType: 1}).then(res => {
listCardCoupon({status: 1}).then(res => {
this.cardCouponList = res.data.records
console.log("数据",this.cardCouponList)
})
},
getInfo() {

View File

@ -148,12 +148,30 @@
<el-form-item label="消费条件" required style="width: 45%;"
v-if="ruleForm.type=='1' || ruleForm.type=='5'"
v-if="ruleForm.type=='1'"
prop="useType">
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
<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>
<div style="width: 60px;text-align: center">优惠</div>
<el-input placeholder="" v-model="ruleForm.reduceAmount" style="width: 140px">
<template slot="append"></template>
</el-input>
</div>
</el-form-item>
<el-form-item label="消费条件" required style="width: 45%;"
v-if="ruleForm.type=='5'"
prop="useType">
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
<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">
@ -174,15 +192,15 @@
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择" style="width: 110px">
<el-option label="订单金额" value="1"/>
<el-option label="实收金额" value="2"/>
<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"></template>
<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"></template>
<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">
@ -195,11 +213,11 @@
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
<el-option label="订单金额" value="1"/>
<el-option label="实收金额" value="2"/>f
<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"></template>
<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">
@ -765,7 +783,7 @@ export default {
if (!this.ruleForm.useType) {
callback(new Error("请选择优惠券使用条件"));
} else if (!this.ruleForm.reachAmount) {
callback(new Error("请输入满多少元可用"));
callback(new Error("请输入限制条件"));
} else if (!this.ruleForm.reduceAmount) {
callback(new Error("请输入优惠金额"));
} else {
@ -790,7 +808,7 @@ export default {
if (!this.ruleForm.useType) {
callback(new Error("请选择优惠券使用条件"));
} else if (!this.ruleForm.reachAmount) {
callback(new Error("请输入满多少元可用"));
callback(new Error("请输入限制条件"));
} else if (!this.ruleForm.ljOilNum) {
callback(new Error("请输入升数"));
} else if (!this.ruleForm.ljOilAmount) {
@ -858,7 +876,7 @@ export default {
return '订单金额 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
}
if (row.useType == 2) {
return '实收金额 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
return '加油升数 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
}
}
@ -867,7 +885,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 + '元 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
}
}

View File

@ -136,6 +136,9 @@
prop="paymentType"
label="支付方式"
>
<template slot-scope="scope">
{{ getPaymentTypeStr(scope.row.paymentType) }}
</template>
</el-table-column>
<el-table-column
align="center"
@ -233,11 +236,11 @@
则该规则不生效
</div>
</el-form-item>
<el-form-item label="折扣" prop="disValue" v-if="ruleForm.category == '2' ">
<el-form-item label="折扣" required prop="disValue" v-if="ruleForm.category == '2' ">
<el-input v-model="ruleForm.disValue" style="width: 217px"></el-input>
<div>折扣请填写0~1的数字例如输入0.8表示打8折</div>
</el-form-item>
<el-form-item label="减价金额" prop="disValue" v-if="ruleForm.category == '3' ">
<el-form-item label="减价金额" required prop="disValue" v-if="ruleForm.category == '3' ">
<el-input v-model="ruleForm.disValue" style="width: 217px"></el-input>
<div>减价金额不能小于 0.01</div>
</el-form-item>
@ -268,9 +271,17 @@
label="优惠价(元/L"
>
<template slot-scope="scope">
<el-input-number v-model="scope.row.price" controls-position="right" :min="0.1"
:max="999"></el-input-number>
<!-- scope.row-->
<el-form-item
:prop="'oilList.' + scope.$index + '.price'"
:rules="rules['oilList.*.price']"
class="custom-form-itemMy100989"
>
<el-input
v-model="scope.row.price"
type="number"
controls-position="right"
></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -322,10 +333,11 @@
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=" 会员标签" >
<el-form-item label=" 会员标签">
<el-select v-model="ruleForm1.babelIds" multiple placeholder="请选择会员标签" style="width: 100%">
<el-option
v-for="item in userLabelList"
@ -334,11 +346,11 @@
:value="item.id+''"></el-option>
</el-select>
</el-form-item>
<el-form-item label="消费条件" required>
<el-form-item label="消费条件" required prop="consumeType">
<div v-if="ruleForm1.consumeType!=1">
<el-col :span="7">
<el-select v-model="ruleForm1.consumeType" style="width: 90%">
<el-option label="实收金额" value="0"></el-option>
<el-option label="订单金额" value="0"></el-option>
<el-option label="加油升数" value="1"></el-option>
</el-select>
</el-col>
@ -368,7 +380,7 @@
</el-select>
</el-col>
<el-col :span="7">
<el-form-item prop="moneyMin">
<el-form-item prop="literMin">
<el-input v-model="ruleForm1.literMin">
<template slot="append">L</template>
</el-input>
@ -378,7 +390,7 @@
<div style="margin-left: 10px"></div>
</el-col>
<el-col :span="7">
<el-form-item prop="moneyMax">
<el-form-item prop="literMax">
<el-input v-model="ruleForm1.literMax">
<template slot="append">L</template>
</el-input>
@ -386,21 +398,7 @@
</el-col>
</div>
</el-form-item>
<!-- <el-form-item label="适用加油升数" required>-->
<!-- <el-col :span="11">-->
<!-- <el-form-item prop="literMin">-->
<!-- <el-input v-model="ruleForm1.literMin"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="2">-->
<!-- <div style="margin-left: 5px"></div>-->
<!-- </el-col>-->
<!-- <el-col :span="11">-->
<!-- <el-form-item prop="literMax">-->
<!-- <el-input v-model="ruleForm1.literMax"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-form-item>-->
<el-form-item label="最大优惠金额" prop="disMax">
<el-input v-model="ruleForm1.disMax"></el-input>
</el-form-item>
@ -539,12 +537,55 @@ export default {
title: '',
name: '',
region: '',
category: '',
category: '1',
disValue: '',
type: [],
oilList: []
},
rules: {
activeStartTime: [
{required: true, message: '请选择开始时间', trigger: 'change'},
],
activeEndTime:[
{required: true, message: '请选择结束时间', trigger: 'change'}
],
timeApplyStart: [
{
validator: (rule, value, callback) => {
if (this.ruleForm1.dayStartTime === undefined) {
callback(new Error('请选择开始时间点'));
} else if (this.ruleForm1.dayEndTime === undefined) {
callback(new Error('请选择结束时间点'));
} else if (this.ruleForm1.dayStartTime > this.ruleForm1.dayEndTime) {
callback(new Error('结束时间必须晚于开始时间'));
} else {
callback();
}
},
}
],
moneyMax: [
{required: true, message: '请输入订单最高金额', trigger: 'blur'},
],
literMax: [
{required: true, message: '请输入最高加油升数', trigger: 'blur'},
],
moneyMin: [
{required: true, message: '请输入订单最低金额', trigger: 'blur'},
],
literMin: [
{required: true, message: '请输入最低加油升数', trigger: 'blur'},
],
consumeType: [
{required: true, message: '请选择消费类型', trigger: 'change'},
],
disValue:[
{required: true, message: '请输入优惠金额', trigger: 'change'}
],
'oilList.*.price': [
{required: true, message: '请输入优惠价', trigger: 'change'}
],
title: [
{required: true, message: '请输入名称', trigger: 'blur'},
],
@ -557,12 +598,6 @@ export default {
paymentType: [
{required: true, message: '请输入支付方式', trigger: 'blur'},
],
moneyMin: [
{required: true, message: '请输入实收金额', trigger: 'blur'},
],
literMin: [
{required: true, message: '请输入加油升数', trigger: 'blur'},
],
disMax: [
{required: true, message: '请输入优惠金额', trigger: 'blur'},
],
@ -603,7 +638,7 @@ export default {
ruleForm1: {
activeType: 2,
timeType: 0,
consumeType:'',
consumeType: '',
paymentType: []
}
}
@ -612,9 +647,65 @@ export default {
this.getList()
this.getRuleList()
},
watch: {
'ruleForm.category': function (newVal, oldVal) {
//
this.ruleForm.disValue = null;
},
'ruleForm.disValue': function (newVal, oldVal) {
console.log('监听', newVal)
if (this.ruleForm.category == 2) {
// elementui
this.ruleForm.oilList = this.ruleForm.oilList.map(item => ({
...item,
price: Number((item.oilPrice * newVal).toFixed(2))
}));
}
if (this.ruleForm.category == 3) {
this.ruleForm.oilList = this.ruleForm.oilList.map(item => ({
...item,
price: Number((item.oilPrice - newVal).toFixed(2))
}));
}
if (newVal == null) {
this.clearOilListPrice()
}
}
},
methods: {
//
getPaymentTypeStr(value) {
let valueList = value.split(",");
console.log(this.dict.type.payment_type)
let newValueList = valueList.map((item) => {
let matchedLabel = this.dict.type.payment_type.find((item1) => item1.value === item)?.label;
return matchedLabel || item; // label item
});
//
return newValueList.join(",")
},
//
clearOilListPrice() {
this.ruleForm.oilList = this.ruleForm.oilList.map(
item => ({
...item,
price: null
}))
},
//
resetRule(){
resetRule() {
this.ruleForm1 = {
activeType: 2,
timeType: 0,
@ -625,7 +716,7 @@ export default {
this.monthDay = []
},
//
deleteRule(data){
deleteRule(data) {
deletePriceRule(data.id).then(res => {
this.$message.success("删除成功")
this.getRuleList()
@ -641,12 +732,12 @@ export default {
this.getUserLabelList()
this.showDialogVisible = true
if (res.data){
if (res.data) {
this.ruleForm1 = res.data
if (res.data.paymentType) this.ruleForm1.paymentType = res.data.paymentType.split(",")
if (res.data.babelIds) this.ruleForm1.babelIds = res.data.babelIds.split(",")
if (res.data.timeSlots){
if (res.data.timeSlots) {
if (res.data.timeType == "0") {
this.weekDay = this.ruleForm1.timeSlots.split(",")
} else if (this.ruleForm1.timeType == "1") {
@ -658,15 +749,6 @@ export default {
},
//
submitRuleForm() {
if (this.ruleForm1.consumeType == 1){
if (!this.ruleForm1.literMin || !this.ruleForm1.literMax){
this.$message.error("请填写消费条件信息")
}
}else {
if (!this.ruleForm1.moneyMin || !this.ruleForm1.moneyMax){
this.$message.error("请填写消费条件信息")
}
}
this.$refs["ruleForm1"].validate((valid) => {
if (valid) {
if (this.ruleForm1.paymentType) this.ruleForm1.paymentType = this.ruleForm1.paymentType.toString()
@ -703,7 +785,7 @@ export default {
},
//
getTimeShareList() {
getRequestList({pageNo: 1, pageSize: 10000,activeType:2}).then(res => {
getRequestList({pageNo: 1, pageSize: 10000, activeType: 2}).then(res => {
this.timeShareList = res.data.records
})
},
@ -755,7 +837,7 @@ export default {
title: '',
name: '',
region: '',
category: '',
category: '1',
disValue: '',
type: [],
oilList: []
@ -774,30 +856,34 @@ export default {
// /
addSeparateList() {
this.centerDialogVisible = false
if (this.ruleForm.id) {
updateActivePrice(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.getList()
}
})
} else {
postaddList(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.getList()
}
})
}
this.$refs["ruleForm"].validate((valid) => {
if (valid) {
this.centerDialogVisible = false
if (this.ruleForm.id) {
updateActivePrice(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.getList()
}
})
} else {
postaddList(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.getList()
}
})
}
}
})
},
//
getList() {

View File

@ -93,16 +93,20 @@
<div v-for="(item,index) in couponList" :key="index" style="font-size: 14px;margin: 20px 0;display: flex;align-items: center">
<div style="width: 5%;">赠送</div>
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择">
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择" @change="updateMax(item)">
<el-option
v-for="(item1,index1) in cardCouponList"
:key="index1"
:label="item1.name"
:value="item1.id"></el-option>
</el-select>
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
<template slot="append"></template>
</el-input>
<el-input-number style="width: 45%; margin-left: 10px;"
v-model.number="item.giftCardTotal"
:min="1"
:max="item.max"
controls-position="right">
<template #append></template>
</el-input-number>
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
@click="deleteCoupons(index)">
</div>
@ -258,6 +262,17 @@ export default {
this.listUserGrade()
},
methods: {
updateMax(item) {
//
item.giftCardTotal = 1;
//
const selectedOption = this.cardCouponList.find(option => option.id === item.vouchersId);
if (selectedOption) {
item.max = selectedOption.tfTotal - selectedOption.tfGetNum;
} else {
item.max = 0; //
}
},
listUserGrade() {
listUserGrade({page: 1, pageSize: 1000}).then(res => {
if (res.code == 200) {
@ -266,7 +281,7 @@ export default {
})
},
getCardCoupon() {
listCardCoupon({status: 1, putType: 1}).then(res => {
listCardCoupon({status: 1}).then(res => {
this.cardCouponList = res.data.records
})
},

View File

@ -78,16 +78,20 @@
<div v-for="(item,index) in couponList" :key="index" style="font-size: 14px;margin: 20px 0;display: flex;align-items: center">
<div style="width: 5%;">赠送</div>
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择">
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择" @change="updateMax(item)">
<el-option
v-for="(item1,index1) in cardCouponList"
:key="index1"
:label="item1.name"
:value="item1.id"></el-option>
</el-select>
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
<template slot="append"></template>
</el-input>
<el-input-number style="width: 45%; margin-left: 10px;"
v-model.number="item.giftCardTotal"
:min="1"
:max="item.max"
controls-position="right">
<template #append></template>
</el-input-number>
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
@click="deleteCoupons(index)">
</div>
@ -238,8 +242,19 @@ export default {
this.getCardCoupon()
},
methods: {
updateMax(item) {
//
item.giftCardTotal = 1;
//
const selectedOption = this.cardCouponList.find(option => option.id === item.vouchersId);
if (selectedOption) {
item.max = selectedOption.tfTotal - selectedOption.tfGetNum;
} else {
item.max = 0; //
}
},
getCardCoupon() {
listCardCoupon({status: 1, putType: 1}).then(res => {
listCardCoupon({status: 1}).then(res => {
this.cardCouponList = res.data.records
})
},

View File

@ -99,16 +99,20 @@
<div v-for="(item,index) in couponList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<div style="width: 5%">赠送</div>
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择">
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择" @change="updateMax(item)">
<el-option
v-for="(item1,index1) in cardCouponList"
:key="index1"
:label="item1.name"
:value="item1.id"></el-option>
</el-select>
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
<template slot="append"></template>
</el-input>
<el-input-number style="width: 45%; margin-left: 10px;"
v-model.number="item.giftCardTotal"
:min="1"
:max="item.max"
controls-position="right">
<template #append></template>
</el-input-number>
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
@click="deleteCoupons(index)">
</div>
@ -299,6 +303,17 @@ export default {
this.listUserGrade()
},
methods: {
updateMax(item) {
//
item.giftCardTotal = 1;
//
const selectedOption = this.cardCouponList.find(option => option.id === item.vouchersId);
if (selectedOption) {
item.max = selectedOption.tfTotal - selectedOption.tfGetNum;
} else {
item.max = 0; //
}
},
//
validateTimeRange(rule, value, callback) {
const { suitTimeSlotFront, suitTimeSlotAfter } = this.ruleForm;
@ -335,7 +350,7 @@ export default {
})
},
getCardCoupon(){
listCardCoupon({status:1,putType:1}).then(res => {
listCardCoupon({status:1}).then(res => {
this.cardCouponList = res.data.records
})
},

View File

@ -280,8 +280,6 @@
v-model="scope.row.price"
type="number"
controls-position="right"
:min="0.1"
:max="999"
></el-input>
</el-form-item>
</template>
@ -352,7 +350,7 @@
<div v-if="ruleForm1.consumeType!=1">
<el-col :span="7">
<el-select v-model="ruleForm1.consumeType" style="width: 90%">
<el-option label="实收金额" value="0"></el-option>
<el-option label="订单金额" value="0"></el-option>
<el-option label="加油升数" value="1"></el-option>
</el-select>
</el-col>
@ -561,7 +559,7 @@ export default {
{required: true, message: '请输入支付方式', trigger: 'blur'},
],
moneyMin: [
{required: true, message: '请输入实收最低金额', trigger: 'blur'},
{required: true, message: '请输入订单最低金额', trigger: 'blur'},
],
literMin: [
{required: true, message: '请输入最低加油升数', trigger: 'blur'},
@ -585,7 +583,7 @@ export default {
{required: true, message: '请选择消费类型', trigger: 'change'},
],
moneyMax: [
{required: true, message: '请输入实收最高金额', trigger: 'blur'},
{required: true, message: '请输入订单最高金额', trigger: 'blur'},
],
literMax: [
{required: true, message: '请输入最高加油升数', trigger: 'blur'},

View File

@ -105,16 +105,20 @@
<div v-for="(item,index) in couponList" :key="index" style="font-size: 14px;margin: 20px 0;display: flex;align-items: center">
<div style="width: 5%;">赠送</div>
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择">
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择" @change="updateMax(item)">
<el-option
v-for="(item1,index1) in cardCouponList"
:key="index1"
:label="item1.name"
:value="item1.id"></el-option>
</el-select>
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
<template slot="append"></template>
</el-input>
<el-input-number style="width: 45%; margin-left: 10px;"
v-model.number="item.giftCardTotal"
:min="1"
:max="item.max"
controls-position="right">
<template #append></template>
</el-input-number>
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
@click="deleteCoupons(index)">
</div>
@ -284,6 +288,17 @@ export default {
this.getOilList()
},
methods: {
updateMax(item) {
//
item.giftCardTotal = 1;
//
const selectedOption = this.cardCouponList.find(option => option.id === item.vouchersId);
if (selectedOption) {
item.max = selectedOption.tfTotal - selectedOption.tfGetNum;
} else {
item.max = 0; //
}
},
getOilList(){
getOilNameList().then(response => {
this.oilNameList = response.data;
@ -315,7 +330,7 @@ export default {
})
},
getCardCoupon(){
listCardCoupon({status:1,putType:1}).then(res => {
listCardCoupon({status:1}).then(res => {
this.cardCouponList = res.data.records
})
},

View File

@ -92,16 +92,20 @@
<div v-for="(item,index) in couponList" :key="index" style="font-size: 14px;margin: 20px 0;display: flex;align-items: center">
<div style="width: 5%;">赠送</div>
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择">
<el-select v-model="item.vouchersId" style="margin-left: 10px;width: 45%" placeholder="请选择" @change="updateMax(item)">
<el-option
v-for="(item1,index1) in cardCouponList"
:key="index1"
:label="item1.name"
:value="item1.id"></el-option>
</el-select>
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
<template slot="append"></template>
</el-input>
<el-input-number style="width: 45%; margin-left: 10px;"
v-model.number="item.giftCardTotal"
:min="1"
:max="item.max"
controls-position="right">
<template #append></template>
</el-input-number>
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
@click="deleteCoupons(index)">
</div>
@ -260,6 +264,17 @@ export default {
this.listUserGrade()
},
methods: {
updateMax(item) {
//
item.giftCardTotal = 1;
//
const selectedOption = this.cardCouponList.find(option => option.id === item.vouchersId);
if (selectedOption) {
item.max = selectedOption.tfTotal - selectedOption.tfGetNum;
} else {
item.max = 0; //
}
},
listUserGrade() {
listUserGrade({page:1,pageSize:1000}).then(res => {
if (res.code == 200) {
@ -268,7 +283,7 @@ export default {
})
},
getCardCoupon(){
listCardCoupon({status:1,putType:1}).then(res => {
listCardCoupon({status:1}).then(res => {
this.cardCouponList = res.data.records
})
},

View File

@ -164,7 +164,9 @@ export default {
<span>预设油价记录</span>
</div>
<div>
<el-button type="primary" @click = "dialogFormPricesAdd = true, addOilPresePrices()" v-hasPermi="['oilConfig:oilPrice:index:addp']"
<el-button type="primary" @click = "dialogFormPricesAdd = true,
addOilPresePrices()"
v-hasPermi="['oilConfig:oilPrice:index:addp']"
>新增预设油价</el-button>
</div>
</div>

View File

@ -131,6 +131,8 @@ export default {
}
},
async oilTypeMethods(data) {
console.log(this.$store)
if (data === 1) {
// this.oilNumber = {}
this.dialogFormNumberEdit = true

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-card style="margin-bottom: 20px">
<div slot="header" class="clearfix">
<span>油价配置</span>
<span>油价配置(老页面)</span>
</div>
<el-button type="primary" @click="oilTypeMethods(1)"
v-hasPermi="['oilConfig:oilPrice:index:addoil']"

View File

@ -55,7 +55,7 @@ public class CardCouponController extends BaseController {
*/
@GetMapping
public ResponseObject selectAll(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, @Param("cardCoupon") CardCoupon cardCoupon) {
@RequestParam(value = "pageSize", defaultValue = "1000") Integer pageSize, @Param("cardCoupon") CardCoupon cardCoupon) {
Page page = new Page(pageNo, pageSize);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
cardCoupon.setStoreId(nowAccountInfo.getStoreId());

View File

@ -9,6 +9,7 @@
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>

View File

@ -52,7 +52,9 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
private UserBalanceMapper userBalanceMapper;
@Override
public IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon) {
return baseMapper.pageVo( page, cardCoupon);
IPage<CardCoupon> cardCouponIPage = baseMapper.pageVo(page, cardCoupon);
return cardCouponIPage;
}
@Override