会员折扣 修改

This commit is contained in:
zhaohengkun 2024-10-18 18:12:26 +08:00
parent 3b2da37b27
commit d0a1a9ca4e

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">
@ -718,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>
@ -757,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+''"
@ -1109,7 +1112,7 @@ export default {
//
open: false,
form2: {
availableOrUn:'0'
availableOrUn: '0'
},
open2: false,
gradeList: [],
@ -1181,7 +1184,7 @@ export default {
total2: 0,
//
rules: {
availableOrUn:[
availableOrUn: [
{required: true, message: "不能为空", trigger: "blur"},
],
grade: [
@ -1245,20 +1248,22 @@ export default {
{required: true, message: "请选择节假日是否通用", trigger: "blur"},
],
suitDateType: [
{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();
}
}},],
{
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"},
],
@ -1295,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 = {
@ -1412,7 +1430,7 @@ export default {
suitDateType: '0',
suitTimeSlotType: '0',
noUseTimeType: '0',
availableOrUn:'0'
availableOrUn: '0'
}
this.weekDay = []
this.monthDay = []
@ -1856,7 +1874,7 @@ export default {
flag = true
}
})
if (flag || this.amount.length==0) {
if (flag || this.amount.length == 0) {
this.$message.error("请确保会员降级规则全部填写")
return;
}
@ -1867,7 +1885,7 @@ export default {
flag = true
}
})
if (flag || this.balance.length==0) {
if (flag || this.balance.length == 0) {
this.$message.error("请确保会员降级规则全部填写")
return;
}
@ -1959,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)
}
}