Compare commits
2 Commits
75cbf0af25
...
7b926e3713
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7b926e3713 | ||
![]() |
3276ced4ae |
@ -333,7 +333,7 @@
|
|||||||
label="数量"
|
label="数量"
|
||||||
width="240">
|
width="240">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -562,9 +562,8 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
|
|||||||
youhuiquan:{
|
youhuiquan:{
|
||||||
name:'',
|
name:'',
|
||||||
status:'1',
|
status:'1',
|
||||||
putType:'1',
|
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 1000,
|
||||||
},
|
},
|
||||||
ytotal:0,
|
ytotal:0,
|
||||||
//请求兑换券列表时的参数
|
//请求兑换券列表时的参数
|
||||||
@ -807,6 +806,8 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
|
|||||||
giftCardTime: "", //券有效期
|
giftCardTime: "", //券有效期
|
||||||
giftCardTotal: 1,//券数量
|
giftCardTotal: 1,//券数量
|
||||||
instruction: row.instruction,//使用说明
|
instruction: row.instruction,//使用说明
|
||||||
|
tfTotal: row.tfTotal,
|
||||||
|
tfGetNum: row.tfGetNum,
|
||||||
}
|
}
|
||||||
this.youhuiquanlist.push(data)
|
this.youhuiquanlist.push(data)
|
||||||
this.$message.success("新增成功")
|
this.$message.success("新增成功")
|
||||||
|
@ -206,16 +206,20 @@
|
|||||||
<template slot="append" v-else>元</template>
|
<template slot="append" v-else>元</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<span>送</span>
|
<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
|
<el-option
|
||||||
v-for="(item1,index1) in cardCouponList"
|
v-for="(item1,index1) in cardCouponList"
|
||||||
:key="index1"
|
:key="index1"
|
||||||
:label="item1.name"
|
:label="item1.name"
|
||||||
:value="item1.id"></el-option>
|
:value="item1.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input style="width: 25%;margin: 0 10px" v-model="item.giftCardTotal">
|
<el-input-number style="width: 45%; margin-left: 10px;"
|
||||||
<template slot="append">张</template>
|
v-model.number="item.giftCardTotal"
|
||||||
</el-input>
|
: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;"
|
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;"
|
||||||
@click="deleteCoupons(index)">
|
@click="deleteCoupons(index)">
|
||||||
</div>
|
</div>
|
||||||
@ -442,6 +446,17 @@ export default {
|
|||||||
this.getUserLabelList()
|
this.getUserLabelList()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
handleCheckedCitiesChange(e) {
|
||||||
console.log(e, this.checkedCities)
|
console.log(e, this.checkedCities)
|
||||||
|
|
||||||
@ -523,7 +538,7 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
getCardCoupon() {
|
getCardCoupon() {
|
||||||
listCardCoupon({status: 1, putType: 1}).then(res => {
|
listCardCoupon({status: 1}).then(res => {
|
||||||
this.cardCouponList = res.data.records
|
this.cardCouponList = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -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 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>
|
<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
|
<el-option
|
||||||
v-for="(item1,index1) in cardCouponList"
|
v-for="(item1,index1) in cardCouponList"
|
||||||
:key="index1"
|
:key="index1"
|
||||||
:label="item1.name"
|
:label="item1.name"
|
||||||
:value="item1.id"></el-option>
|
:value="item1.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input style="width: 45%;margin-left: 10px" v-model="item.giftCardTotal">
|
<el-input-number style="width: 45%; margin-left: 10px;"
|
||||||
<template slot="append">张</template>
|
v-model.number="item.giftCardTotal"
|
||||||
</el-input>
|
: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;"
|
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px;"
|
||||||
@click="deleteCoupons(index)">
|
@click="deleteCoupons(index)">
|
||||||
</div>
|
</div>
|
||||||
@ -239,9 +243,21 @@ export default {
|
|||||||
this.getCardCoupon()
|
this.getCardCoupon()
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
getCardCoupon() {
|
||||||
listCardCoupon({status: 1, putType: 1}).then(res => {
|
listCardCoupon({status: 1}).then(res => {
|
||||||
this.cardCouponList = res.data.records
|
this.cardCouponList = res.data.records
|
||||||
|
console.log("数据",this.cardCouponList)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getInfo() {
|
getInfo() {
|
||||||
|
@ -148,12 +148,30 @@
|
|||||||
|
|
||||||
|
|
||||||
<el-form-item label="消费条件" required style="width: 45%;"
|
<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">
|
prop="useType">
|
||||||
<div class="d-s">
|
<div class="d-s">
|
||||||
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
|
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
|
||||||
<el-option label="订单金额" value="1"/>
|
<el-option label="订单金额" value="1"/>
|
||||||
<el-option label="实收金额" value="2"/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
<div style="margin: 0px 5px;">满</div>
|
<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">
|
||||||
@ -174,15 +192,15 @@
|
|||||||
<div class="d-s">
|
<div class="d-s">
|
||||||
<el-select v-model="ruleForm.useType" placeholder="请选择" style="width: 110px">
|
<el-select v-model="ruleForm.useType" placeholder="请选择" style="width: 110px">
|
||||||
<el-option label="订单金额" value="1"/>
|
<el-option label="订单金额" value="1"/>
|
||||||
<el-option label="实收金额" value="2"/>
|
<el-option label="加油升数" value="2"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<div style="width: 50px;text-align: center">范围</div>
|
<div style="width: 50px;text-align: center">范围</div>
|
||||||
<el-input placeholder="" v-model="ruleForm.zkStartAmount" style="width: 130px">
|
<el-input placeholder="" v-model="ruleForm.zkStartAmount" style="width: 130px">
|
||||||
<template slot="append">元</template>
|
<template slot="append">{{ruleForm.useType == '1' ? '元' : '升'}}</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<div style="margin: 0px 5px;">~</div>
|
<div style="margin: 0px 5px;">~</div>
|
||||||
<el-input placeholder="" v-model="ruleForm.zkEndAmount" style="width: 130px">
|
<el-input placeholder="" v-model="ruleForm.zkEndAmount" style="width: 130px">
|
||||||
<template slot="append">元</template>
|
<template slot="append">{{ruleForm.useType == '1' ? '元' : '升'}}</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<div style="width: 50px;text-align: center">优惠</div>
|
<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">
|
||||||
@ -195,11 +213,11 @@
|
|||||||
<div class="d-s">
|
<div class="d-s">
|
||||||
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
|
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
|
||||||
<el-option label="订单金额" value="1"/>
|
<el-option label="订单金额" value="1"/>
|
||||||
<el-option label="实收金额" value="2"/>f
|
<el-option label="加油升数" value="2"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<div style="margin: 0px 5px;">满</div>
|
<div style="margin: 0px 5px;">满</div>
|
||||||
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 160px">
|
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 160px">
|
||||||
<template slot="append">元</template>
|
<template slot="append">{{ruleForm.useType == '1' ? '元' : '升'}}</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<div style="width: 40px;text-align: center">每</div>
|
<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">
|
||||||
@ -765,7 +783,7 @@ export default {
|
|||||||
if (!this.ruleForm.useType) {
|
if (!this.ruleForm.useType) {
|
||||||
callback(new Error("请选择优惠券使用条件"));
|
callback(new Error("请选择优惠券使用条件"));
|
||||||
} else if (!this.ruleForm.reachAmount) {
|
} else if (!this.ruleForm.reachAmount) {
|
||||||
callback(new Error("请输入满多少元可用"));
|
callback(new Error("请输入限制条件"));
|
||||||
} else if (!this.ruleForm.reduceAmount) {
|
} else if (!this.ruleForm.reduceAmount) {
|
||||||
callback(new Error("请输入优惠金额"));
|
callback(new Error("请输入优惠金额"));
|
||||||
} else {
|
} else {
|
||||||
@ -790,7 +808,7 @@ export default {
|
|||||||
if (!this.ruleForm.useType) {
|
if (!this.ruleForm.useType) {
|
||||||
callback(new Error("请选择优惠券使用条件"));
|
callback(new Error("请选择优惠券使用条件"));
|
||||||
} else if (!this.ruleForm.reachAmount) {
|
} else if (!this.ruleForm.reachAmount) {
|
||||||
callback(new Error("请输入满多少元可用"));
|
callback(new Error("请输入限制条件"));
|
||||||
} else if (!this.ruleForm.ljOilNum) {
|
} else if (!this.ruleForm.ljOilNum) {
|
||||||
callback(new Error("请输入升数"));
|
callback(new Error("请输入升数"));
|
||||||
} else if (!this.ruleForm.ljOilAmount) {
|
} else if (!this.ruleForm.ljOilAmount) {
|
||||||
@ -858,7 +876,7 @@ export default {
|
|||||||
return '订单金额 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
|
return '订单金额 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
|
||||||
}
|
}
|
||||||
if (row.useType == 2) {
|
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 + '元'
|
return '订单金额 满' + row.reachAmount + '元 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
|
||||||
}
|
}
|
||||||
if (row.useType == 2) {
|
if (row.useType == 2) {
|
||||||
return '实收金额 满' + row.reachAmount + '元 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
|
return '加油升数 满' + row.reachAmount + '元 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +136,9 @@
|
|||||||
prop="paymentType"
|
prop="paymentType"
|
||||||
label="支付方式"
|
label="支付方式"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ getPaymentTypeStr(scope.row.paymentType) }}
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
align="center"
|
||||||
@ -233,11 +236,11 @@
|
|||||||
价,则该规则不生效。
|
价,则该规则不生效。
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</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>
|
<el-input v-model="ruleForm.disValue" style="width: 217px"></el-input>
|
||||||
<div>折扣请填写0~1的数字。例如输入0.8,表示打8折</div>
|
<div>折扣请填写0~1的数字。例如输入0.8,表示打8折</div>
|
||||||
</el-form-item>
|
</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>
|
<el-input v-model="ruleForm.disValue" style="width: 217px"></el-input>
|
||||||
<div>减价金额不能小于 0.01</div>
|
<div>减价金额不能小于 0.01</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -268,9 +271,17 @@
|
|||||||
label="优惠价(元/L)"
|
label="优惠价(元/L)"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number v-model="scope.row.price" controls-position="right" :min="0.1"
|
<el-form-item
|
||||||
:max="999"></el-input-number>
|
:prop="'oilList.' + scope.$index + '.price'"
|
||||||
<!-- scope.row-->
|
: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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
@ -322,10 +333,11 @@
|
|||||||
v-if="dict.value!='APPLET_CODE'"
|
v-if="dict.value!='APPLET_CODE'"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
:value="dict.value">{{dict.label}}</el-checkbox>
|
:value="dict.value">{{ dict.label }}
|
||||||
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label=" 会员标签" >
|
<el-form-item label=" 会员标签">
|
||||||
<el-select v-model="ruleForm1.babelIds" multiple placeholder="请选择会员标签" style="width: 100%">
|
<el-select v-model="ruleForm1.babelIds" multiple placeholder="请选择会员标签" style="width: 100%">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userLabelList"
|
v-for="item in userLabelList"
|
||||||
@ -334,11 +346,11 @@
|
|||||||
:value="item.id+''"></el-option>
|
:value="item.id+''"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="消费条件" required>
|
<el-form-item label="消费条件" required prop="consumeType">
|
||||||
<div v-if="ruleForm1.consumeType!=1">
|
<div v-if="ruleForm1.consumeType!=1">
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-select v-model="ruleForm1.consumeType" style="width: 90%">
|
<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-option label="加油升数" value="1"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -368,7 +380,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item prop="moneyMin">
|
<el-form-item prop="literMin">
|
||||||
<el-input v-model="ruleForm1.literMin">
|
<el-input v-model="ruleForm1.literMin">
|
||||||
<template slot="append">L</template>
|
<template slot="append">L</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -378,7 +390,7 @@
|
|||||||
<div style="margin-left: 10px">到</div>
|
<div style="margin-left: 10px">到</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item prop="moneyMax">
|
<el-form-item prop="literMax">
|
||||||
<el-input v-model="ruleForm1.literMax">
|
<el-input v-model="ruleForm1.literMax">
|
||||||
<template slot="append">L</template>
|
<template slot="append">L</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -386,21 +398,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</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-form-item label="最大优惠金额" prop="disMax">
|
||||||
<el-input v-model="ruleForm1.disMax"></el-input>
|
<el-input v-model="ruleForm1.disMax"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -539,12 +537,55 @@ export default {
|
|||||||
title: '',
|
title: '',
|
||||||
name: '',
|
name: '',
|
||||||
region: '',
|
region: '',
|
||||||
category: '',
|
category: '1',
|
||||||
disValue: '',
|
disValue: '',
|
||||||
type: [],
|
type: [],
|
||||||
oilList: []
|
oilList: []
|
||||||
},
|
},
|
||||||
rules: {
|
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: [
|
title: [
|
||||||
{required: true, message: '请输入名称', trigger: 'blur'},
|
{required: true, message: '请输入名称', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
@ -557,12 +598,6 @@ export default {
|
|||||||
paymentType: [
|
paymentType: [
|
||||||
{required: true, message: '请输入支付方式', trigger: 'blur'},
|
{required: true, message: '请输入支付方式', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
moneyMin: [
|
|
||||||
{required: true, message: '请输入实收金额', trigger: 'blur'},
|
|
||||||
],
|
|
||||||
literMin: [
|
|
||||||
{required: true, message: '请输入加油升数', trigger: 'blur'},
|
|
||||||
],
|
|
||||||
disMax: [
|
disMax: [
|
||||||
{required: true, message: '请输入优惠金额', trigger: 'blur'},
|
{required: true, message: '请输入优惠金额', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
@ -603,7 +638,7 @@ export default {
|
|||||||
ruleForm1: {
|
ruleForm1: {
|
||||||
activeType: 2,
|
activeType: 2,
|
||||||
timeType: 0,
|
timeType: 0,
|
||||||
consumeType:'',
|
consumeType: '',
|
||||||
paymentType: []
|
paymentType: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -612,9 +647,65 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
this.getRuleList()
|
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: {
|
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 = {
|
this.ruleForm1 = {
|
||||||
activeType: 2,
|
activeType: 2,
|
||||||
timeType: 0,
|
timeType: 0,
|
||||||
@ -625,7 +716,7 @@ export default {
|
|||||||
this.monthDay = []
|
this.monthDay = []
|
||||||
},
|
},
|
||||||
// 删除活动规则
|
// 删除活动规则
|
||||||
deleteRule(data){
|
deleteRule(data) {
|
||||||
deletePriceRule(data.id).then(res => {
|
deletePriceRule(data.id).then(res => {
|
||||||
this.$message.success("删除成功")
|
this.$message.success("删除成功")
|
||||||
this.getRuleList()
|
this.getRuleList()
|
||||||
@ -641,12 +732,12 @@ export default {
|
|||||||
this.getUserLabelList()
|
this.getUserLabelList()
|
||||||
this.showDialogVisible = true
|
this.showDialogVisible = true
|
||||||
|
|
||||||
if (res.data){
|
if (res.data) {
|
||||||
this.ruleForm1 = res.data
|
this.ruleForm1 = res.data
|
||||||
if (res.data.paymentType) this.ruleForm1.paymentType = res.data.paymentType.split(",")
|
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.babelIds) this.ruleForm1.babelIds = res.data.babelIds.split(",")
|
||||||
|
|
||||||
if (res.data.timeSlots){
|
if (res.data.timeSlots) {
|
||||||
if (res.data.timeType == "0") {
|
if (res.data.timeType == "0") {
|
||||||
this.weekDay = this.ruleForm1.timeSlots.split(",")
|
this.weekDay = this.ruleForm1.timeSlots.split(",")
|
||||||
} else if (this.ruleForm1.timeType == "1") {
|
} else if (this.ruleForm1.timeType == "1") {
|
||||||
@ -658,15 +749,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 提交活动规则
|
// 提交活动规则
|
||||||
submitRuleForm() {
|
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) => {
|
this.$refs["ruleForm1"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.ruleForm1.paymentType) this.ruleForm1.paymentType = this.ruleForm1.paymentType.toString()
|
if (this.ruleForm1.paymentType) this.ruleForm1.paymentType = this.ruleForm1.paymentType.toString()
|
||||||
@ -703,7 +785,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 查询限时优惠列表信息
|
// 查询限时优惠列表信息
|
||||||
getTimeShareList() {
|
getTimeShareList() {
|
||||||
getRequestList({pageNo: 1, pageSize: 10000,activeType:2}).then(res => {
|
getRequestList({pageNo: 1, pageSize: 10000, activeType: 2}).then(res => {
|
||||||
this.timeShareList = res.data.records
|
this.timeShareList = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -755,7 +837,7 @@ export default {
|
|||||||
title: '',
|
title: '',
|
||||||
name: '',
|
name: '',
|
||||||
region: '',
|
region: '',
|
||||||
category: '',
|
category: '1',
|
||||||
disValue: '',
|
disValue: '',
|
||||||
type: [],
|
type: [],
|
||||||
oilList: []
|
oilList: []
|
||||||
@ -774,6 +856,9 @@ export default {
|
|||||||
// 新增/修改
|
// 新增/修改
|
||||||
addSeparateList() {
|
addSeparateList() {
|
||||||
|
|
||||||
|
this.$refs["ruleForm"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
|
||||||
this.centerDialogVisible = false
|
this.centerDialogVisible = false
|
||||||
if (this.ruleForm.id) {
|
if (this.ruleForm.id) {
|
||||||
updateActivePrice(this.ruleForm).then(res => {
|
updateActivePrice(this.ruleForm).then(res => {
|
||||||
@ -797,7 +882,8 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
//列表查询
|
//列表查询
|
||||||
getList() {
|
getList() {
|
||||||
|
@ -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 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>
|
<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
|
<el-option
|
||||||
v-for="(item1,index1) in cardCouponList"
|
v-for="(item1,index1) in cardCouponList"
|
||||||
:key="index1"
|
:key="index1"
|
||||||
:label="item1.name"
|
:label="item1.name"
|
||||||
:value="item1.id"></el-option>
|
:value="item1.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
|
<el-input-number style="width: 45%; margin-left: 10px;"
|
||||||
<template slot="append">张</template>
|
v-model.number="item.giftCardTotal"
|
||||||
</el-input>
|
: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"
|
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
|
||||||
@click="deleteCoupons(index)">
|
@click="deleteCoupons(index)">
|
||||||
</div>
|
</div>
|
||||||
@ -258,6 +262,17 @@ export default {
|
|||||||
this.listUserGrade()
|
this.listUserGrade()
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
||||||
listUserGrade({page: 1, pageSize: 1000}).then(res => {
|
listUserGrade({page: 1, pageSize: 1000}).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@ -266,7 +281,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCardCoupon() {
|
getCardCoupon() {
|
||||||
listCardCoupon({status: 1, putType: 1}).then(res => {
|
listCardCoupon({status: 1}).then(res => {
|
||||||
this.cardCouponList = res.data.records
|
this.cardCouponList = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -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 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>
|
<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
|
<el-option
|
||||||
v-for="(item1,index1) in cardCouponList"
|
v-for="(item1,index1) in cardCouponList"
|
||||||
:key="index1"
|
:key="index1"
|
||||||
:label="item1.name"
|
:label="item1.name"
|
||||||
:value="item1.id"></el-option>
|
:value="item1.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
|
<el-input-number style="width: 45%; margin-left: 10px;"
|
||||||
<template slot="append">张</template>
|
v-model.number="item.giftCardTotal"
|
||||||
</el-input>
|
: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"
|
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
|
||||||
@click="deleteCoupons(index)">
|
@click="deleteCoupons(index)">
|
||||||
</div>
|
</div>
|
||||||
@ -238,8 +242,19 @@ export default {
|
|||||||
this.getCardCoupon()
|
this.getCardCoupon()
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
getCardCoupon() {
|
||||||
listCardCoupon({status: 1, putType: 1}).then(res => {
|
listCardCoupon({status: 1}).then(res => {
|
||||||
this.cardCouponList = res.data.records
|
this.cardCouponList = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -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 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>
|
<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
|
<el-option
|
||||||
v-for="(item1,index1) in cardCouponList"
|
v-for="(item1,index1) in cardCouponList"
|
||||||
:key="index1"
|
:key="index1"
|
||||||
:label="item1.name"
|
:label="item1.name"
|
||||||
:value="item1.id"></el-option>
|
:value="item1.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
|
<el-input-number style="width: 45%; margin-left: 10px;"
|
||||||
<template slot="append">张</template>
|
v-model.number="item.giftCardTotal"
|
||||||
</el-input>
|
: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"
|
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
|
||||||
@click="deleteCoupons(index)">
|
@click="deleteCoupons(index)">
|
||||||
</div>
|
</div>
|
||||||
@ -299,6 +303,17 @@ export default {
|
|||||||
this.listUserGrade()
|
this.listUserGrade()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
validateTimeRange(rule, value, callback) {
|
||||||
const { suitTimeSlotFront, suitTimeSlotAfter } = this.ruleForm;
|
const { suitTimeSlotFront, suitTimeSlotAfter } = this.ruleForm;
|
||||||
@ -335,7 +350,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCardCoupon(){
|
getCardCoupon(){
|
||||||
listCardCoupon({status:1,putType:1}).then(res => {
|
listCardCoupon({status:1}).then(res => {
|
||||||
this.cardCouponList = res.data.records
|
this.cardCouponList = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -280,8 +280,6 @@
|
|||||||
v-model="scope.row.price"
|
v-model="scope.row.price"
|
||||||
type="number"
|
type="number"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:min="0.1"
|
|
||||||
:max="999"
|
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
@ -352,7 +350,7 @@
|
|||||||
<div v-if="ruleForm1.consumeType!=1">
|
<div v-if="ruleForm1.consumeType!=1">
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-select v-model="ruleForm1.consumeType" style="width: 90%">
|
<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-option label="加油升数" value="1"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -561,7 +559,7 @@ export default {
|
|||||||
{required: true, message: '请输入支付方式', trigger: 'blur'},
|
{required: true, message: '请输入支付方式', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
moneyMin: [
|
moneyMin: [
|
||||||
{required: true, message: '请输入实收最低金额', trigger: 'blur'},
|
{required: true, message: '请输入订单最低金额', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
literMin: [
|
literMin: [
|
||||||
{required: true, message: '请输入最低加油升数', trigger: 'blur'},
|
{required: true, message: '请输入最低加油升数', trigger: 'blur'},
|
||||||
@ -585,7 +583,7 @@ export default {
|
|||||||
{required: true, message: '请选择消费类型', trigger: 'change'},
|
{required: true, message: '请选择消费类型', trigger: 'change'},
|
||||||
],
|
],
|
||||||
moneyMax: [
|
moneyMax: [
|
||||||
{required: true, message: '请输入实收最高金额', trigger: 'blur'},
|
{required: true, message: '请输入订单最高金额', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
literMax: [
|
literMax: [
|
||||||
{required: true, message: '请输入最高加油升数', trigger: 'blur'},
|
{required: true, message: '请输入最高加油升数', trigger: 'blur'},
|
||||||
|
@ -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 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>
|
<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
|
<el-option
|
||||||
v-for="(item1,index1) in cardCouponList"
|
v-for="(item1,index1) in cardCouponList"
|
||||||
:key="index1"
|
:key="index1"
|
||||||
:label="item1.name"
|
:label="item1.name"
|
||||||
:value="item1.id"></el-option>
|
:value="item1.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
|
<el-input-number style="width: 45%; margin-left: 10px;"
|
||||||
<template slot="append">张</template>
|
v-model.number="item.giftCardTotal"
|
||||||
</el-input>
|
: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"
|
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
|
||||||
@click="deleteCoupons(index)">
|
@click="deleteCoupons(index)">
|
||||||
</div>
|
</div>
|
||||||
@ -284,6 +288,17 @@ export default {
|
|||||||
this.getOilList()
|
this.getOilList()
|
||||||
},
|
},
|
||||||
methods: {
|
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(){
|
getOilList(){
|
||||||
getOilNameList().then(response => {
|
getOilNameList().then(response => {
|
||||||
this.oilNameList = response.data;
|
this.oilNameList = response.data;
|
||||||
@ -315,7 +330,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCardCoupon(){
|
getCardCoupon(){
|
||||||
listCardCoupon({status:1,putType:1}).then(res => {
|
listCardCoupon({status:1}).then(res => {
|
||||||
this.cardCouponList = res.data.records
|
this.cardCouponList = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -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 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>
|
<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
|
<el-option
|
||||||
v-for="(item1,index1) in cardCouponList"
|
v-for="(item1,index1) in cardCouponList"
|
||||||
:key="index1"
|
:key="index1"
|
||||||
:label="item1.name"
|
:label="item1.name"
|
||||||
:value="item1.id"></el-option>
|
:value="item1.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input style="width: 43%;margin-left: 10px" v-model="item.giftCardTotal">
|
<el-input-number style="width: 45%; margin-left: 10px;"
|
||||||
<template slot="append">张</template>
|
v-model.number="item.giftCardTotal"
|
||||||
</el-input>
|
: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"
|
<img src="@/assets/images/ljt.png" style="width: 25px;height: 25px;margin-left: 10px"
|
||||||
@click="deleteCoupons(index)">
|
@click="deleteCoupons(index)">
|
||||||
</div>
|
</div>
|
||||||
@ -260,6 +264,17 @@ export default {
|
|||||||
this.listUserGrade()
|
this.listUserGrade()
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
||||||
listUserGrade({page:1,pageSize:1000}).then(res => {
|
listUserGrade({page:1,pageSize:1000}).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@ -268,7 +283,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCardCoupon(){
|
getCardCoupon(){
|
||||||
listCardCoupon({status:1,putType:1}).then(res => {
|
listCardCoupon({status:1}).then(res => {
|
||||||
this.cardCouponList = res.data.records
|
this.cardCouponList = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -164,7 +164,9 @@ export default {
|
|||||||
<span>预设油价记录</span>
|
<span>预设油价记录</span>
|
||||||
</div>
|
</div>
|
||||||
<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>
|
>新增预设油价</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -131,6 +131,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async oilTypeMethods(data) {
|
async oilTypeMethods(data) {
|
||||||
|
console.log(this.$store)
|
||||||
|
|
||||||
if (data === 1) {
|
if (data === 1) {
|
||||||
// this.oilNumber = {}
|
// this.oilNumber = {}
|
||||||
this.dialogFormNumberEdit = true
|
this.dialogFormNumberEdit = true
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card style="margin-bottom: 20px">
|
<el-card style="margin-bottom: 20px">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>油价配置</span>
|
<span>油价配置(老页面)</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" @click="oilTypeMethods(1)"
|
<el-button type="primary" @click="oilTypeMethods(1)"
|
||||||
v-hasPermi="['oilConfig:oilPrice:index:addoil']"
|
v-hasPermi="['oilConfig:oilPrice:index:addoil']"
|
||||||
|
@ -55,7 +55,7 @@ public class CardCouponController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResponseObject selectAll(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
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);
|
Page page = new Page(pageNo, pageSize);
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
cardCoupon.setStoreId(nowAccountInfo.getStoreId());
|
cardCoupon.setStoreId(nowAccountInfo.getStoreId());
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
FROM
|
FROM
|
||||||
card_coupon cc
|
card_coupon cc
|
||||||
<where>
|
<where>
|
||||||
|
cc.tf_total - cc.tf_get_num >0
|
||||||
<if test="cardCoupon.storeId!=null and cardCoupon.storeId!=''">
|
<if test="cardCoupon.storeId!=null and cardCoupon.storeId!=''">
|
||||||
and cc.store_id = #{cardCoupon.storeId}
|
and cc.store_id = #{cardCoupon.storeId}
|
||||||
</if>
|
</if>
|
||||||
|
@ -52,7 +52,9 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
|||||||
private UserBalanceMapper userBalanceMapper;
|
private UserBalanceMapper userBalanceMapper;
|
||||||
@Override
|
@Override
|
||||||
public IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon) {
|
public IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon) {
|
||||||
return baseMapper.pageVo( page, cardCoupon);
|
IPage<CardCoupon> cardCouponIPage = baseMapper.pageVo(page, cardCoupon);
|
||||||
|
|
||||||
|
return cardCouponIPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user