This commit is contained in:
zhaohengkun 2024-10-15 18:11:07 +08:00
parent 6d48219cd6
commit 0d42e10334
9 changed files with 374 additions and 258 deletions

View File

@ -89,7 +89,6 @@
title="订单记录" title="订单记录"
:visible.sync="orderShow" :visible.sync="orderShow"
size="55%" size="55%"
:before-close="handleClose"
center> center>
<div class="box-der"> <div class="box-der">
<div class="d-b"> <div class="d-b">

View File

@ -147,7 +147,6 @@
title="订单记录" title="订单记录"
:visible.sync="orderShow" :visible.sync="orderShow"
size="55%" size="55%"
:before-close="handleClose"
center> center>
<div class="box-der"> <div class="box-der">
<div class="d-b"> <div class="d-b">
@ -223,7 +222,7 @@
width="40%" width="40%"
@close="handleClose2" @close="handleClose2"
> >
<el-form :model="ruleForm2" :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm"> <el-form :model="ruleForm2" ref="ruleForm2" label-width="100px" class="demo-ruleForm">
<el-form-item label="活动编号" prop="activeNum"> <el-form-item label="活动编号" prop="activeNum">
<el-input v-model="ruleForm2.activeNum"></el-input> <el-input v-model="ruleForm2.activeNum"></el-input>
@ -397,6 +396,7 @@ export default {
dicts: ['card_gift_type'], dicts: ['card_gift_type'],
data() { data() {
return { return {
value1:'',
//http://localhost:81/dev-api/cardGiftActive //http://localhost:81/dev-api/cardGiftActive
uploadUrl: process.env.VUE_APP_BASE_API + ' /cardGiftActive/importCardInfo', uploadUrl: process.env.VUE_APP_BASE_API + ' /cardGiftActive/importCardInfo',
Encryption: false, Encryption: false,

View File

@ -21,7 +21,7 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="开始日期"> placeholder="开始日期">
</el-date-picker> </el-date-picker>
<span v-if="ruleForm.activeTimeType=='1'" style="margin: 0 5px"></span> <span v-if="ruleForm.activeTimeType=='1'" style="margin: 0 5px"></span>
<el-date-picker <el-date-picker
v-if="ruleForm.activeTimeType=='1'" v-if="ruleForm.activeTimeType=='1'"
v-model="ruleForm.activeEndTime" v-model="ruleForm.activeEndTime"
@ -35,12 +35,12 @@
<el-form-item label="优惠类型" prop="offerType"> <el-form-item label="优惠类型" prop="offerType">
<div class="d-s"> <div class="d-s">
<el-radio-group v-model="ruleForm.offerType" @input="changeOfferType()"> <el-radio-group v-model="ruleForm.offerType" @input="changeOfferType()">
<el-radio :label="'0'" >立减优惠</el-radio> <el-radio :label="'0'">立减优惠</el-radio>
<el-radio :label="'1'" >折扣优惠</el-radio> <el-radio :label="'1'">折扣优惠</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<span style="color: grey;font-size: 12px">例如:立减优惠满100立减2元;折扣优惠满200享受95折</span> <span style="color: grey;font-size: 12px">例如:立减优惠满100立减2元;折扣优惠满200享受95折</span>
</el-form-item> </el-form-item>
<el-form-item label="活动类型" prop="activeType"> <el-form-item label="活动类型" prop="activeType">
@ -98,13 +98,14 @@
<el-radio-group v-model="ruleForm.timeType"> <el-radio-group v-model="ruleForm.timeType">
<div style="display: flex; width: 500px;margin-bottom: 15px;"> <div style="display: flex; width: 500px;margin-bottom: 15px;">
<el-radio :label="'1'">每周</el-radio> <el-radio :label="'1'">每周</el-radio>
<el-checkbox-group v-model="weekDay" style="margin-left: 20px" :disabled="ruleForm.timeType!='1'"> <el-checkbox-group v-model="weekDay" style="margin-left: 20px" :disabled="ruleForm.timeType!='1'">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox> <el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<el-radio :label="'2'">每月 <el-radio :label="'2'">每月
<el-select :disabled="ruleForm.timeType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px"> <el-select :disabled="ruleForm.timeType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple
style="margin-left: 20px">
<el-option <el-option
v-for="item in 31" v-for="item in 31"
:key="item+''" :key="item+''"
@ -140,7 +141,8 @@
<el-radio :label="'0'">不限</el-radio> <el-radio :label="'0'">不限</el-radio>
<el-radio :label="'1'">自定义</el-radio> <el-radio :label="'1'">自定义</el-radio>
</el-radio-group> </el-radio-group>
<el-select v-if="ruleForm.applyOilType=='1'" v-model="ruleForm.applyOil" multiple clearable placeholder="请选择油品油号(多选)"> <el-select v-if="ruleForm.applyOilType=='1'" v-model="ruleForm.applyOil" multiple clearable
placeholder="请选择油品油号(多选)">
<el-option v-for="(item,index) in oilNumberList" :key="index" <el-option v-for="(item,index) in oilNumberList" :key="index"
:label="getOilNamess(oilNameList,item.oilName)" :value="item.oilName"></el-option> :label="getOilNamess(oilNameList,item.oilName)" :value="item.oilName"></el-option>
</el-select> </el-select>
@ -153,12 +155,13 @@
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="活动方式" prop="activeManner"> <el-form-item label="活动方式" prop="activeManner">
<el-radio-group v-model="ruleForm.activeManner"> <el-radio-group v-model="ruleForm.activeManner">
<div style="display: flex;font-size: 14px;margin: 15px 0;align-items: center"> <div style="display: flex;font-size: 14px;margin: 10px 0;align-items: center">
<el-radio label="0" name="type">按订单金额</el-radio> <el-radio label="0" name="type">按订单金额</el-radio>
<img src="@/assets/images/tjb.png" <img src="@/assets/images/tjb.png"
style="width: 20px;height: 20px;cursor: pointer;margin-left: 10px" style="width: 20px;height: 20px;cursor: pointer;margin-left: 10px"
@ -166,7 +169,8 @@
</div> </div>
<div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 0"> <div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 0">
<div v-for="(item,index) in orderList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center"> <div v-for="(item,index) in orderList" :key="index"
style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<span>订单金额满</span> <span>订单金额满</span>
<el-input placeholder="请输入" style="width: 30%;margin: 0 10px" v-model="item.full"> <el-input placeholder="请输入" style="width: 30%;margin: 0 10px" v-model="item.full">
<template slot="append"></template> <template slot="append"></template>
@ -180,7 +184,8 @@
</div> </div>
</div> </div>
<div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 1"> <div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 1">
<div v-for="(item,index) in orderList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center"> <div v-for="(item,index) in orderList" :key="index"
style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<span>订单金额满</span> <span>订单金额满</span>
<el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full"> <el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full">
<template slot="append"></template> <template slot="append"></template>
@ -198,7 +203,8 @@
</div> </div>
</div> </div>
<div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 2"> <div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 2">
<div v-for="(item,index) in orderList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center"> <div v-for="(item,index) in orderList" :key="index"
style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<span>订单金额每满</span> <span>订单金额每满</span>
<el-input placeholder="请输入" style="width: 19%;margin: 0 10px" v-model="item.full"> <el-input placeholder="请输入" style="width: 19%;margin: 0 10px" v-model="item.full">
<template slot="append"></template> <template slot="append"></template>
@ -216,7 +222,8 @@
</div> </div>
</div> </div>
<div v-if="ruleForm.offerType == 1 && ruleForm.activeType == 0"> <div v-if="ruleForm.offerType == 1 && ruleForm.activeType == 0">
<div v-for="(item,index) in orderList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center"> <div v-for="(item,index) in orderList" :key="index"
style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<span>订单金额满</span> <span>订单金额满</span>
<el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full"> <el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full">
<template slot="append"></template> <template slot="append"></template>
@ -242,7 +249,8 @@
</div> </div>
<div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 0"> <div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 0">
<div v-for="(item,index) in refuelList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center"> <div v-for="(item,index) in refuelList" :key="index"
style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<span>加油升数满</span> <span>加油升数满</span>
<el-input placeholder="请输入" style="width: 30%;margin: 0 10px" v-model="item.full"> <el-input placeholder="请输入" style="width: 30%;margin: 0 10px" v-model="item.full">
<template slot="append">L</template> <template slot="append">L</template>
@ -257,7 +265,8 @@
</div> </div>
</div> </div>
<div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 1"> <div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 1">
<div v-for="(item,index) in refuelList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center"> <div v-for="(item,index) in refuelList" :key="index"
style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<span>加油升数满</span> <span>加油升数满</span>
<el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full"> <el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full">
<template slot="append">L</template> <template slot="append">L</template>
@ -277,7 +286,8 @@
</div> </div>
</div> </div>
<div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 2"> <div v-if="ruleForm.offerType == 0 && ruleForm.activeType == 2">
<div v-for="(item,index) in refuelList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center"> <div v-for="(item,index) in refuelList" :key="index"
style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<span>加油升数每满</span> <span>加油升数每满</span>
<el-input placeholder="请输入" style="width: 19%;margin: 0 10px" v-model="item.full"> <el-input placeholder="请输入" style="width: 19%;margin: 0 10px" v-model="item.full">
<template slot="append">L</template> <template slot="append">L</template>
@ -297,7 +307,8 @@
</div> </div>
</div> </div>
<div v-if="ruleForm.offerType == 1 && ruleForm.activeType == 0"> <div v-if="ruleForm.offerType == 1 && ruleForm.activeType == 0">
<div v-for="(item,index) in refuelList" :key="index" style="font-size: 14px;margin: 15px 0;display: flex;align-items: center"> <div v-for="(item,index) in refuelList" :key="index"
style="font-size: 14px;margin: 15px 0;display: flex;align-items: center">
<span>加油升数满</span> <span>加油升数满</span>
<el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full"> <el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full">
<template slot="append">L</template> <template slot="append">L</template>
@ -338,7 +349,7 @@ import {addActiveSubPrice, editActiveSubPrice, getActiveSubPrice} from "@/api/Ev
export default { export default {
name: "LiJianMarketing", name: "LiJianMarketing",
dicts: ['payment_type'], dicts: ['payment_type'],
props:['activeId'], props: ['activeId'],
data() { data() {
return { return {
ruleForm: { ruleForm: {
@ -390,10 +401,10 @@ export default {
}], }],
// //
rules: { rules: {
timeType:[ timeType: [
{required: true, message: '适用时间段不能为空', trigger: 'blur'}, {required: true, message: '适用时间段不能为空', trigger: 'blur'},
], ],
activeType:[ activeType: [
{required: true, message: '活动类型不能为空', trigger: 'blur'}, {required: true, message: '活动类型不能为空', trigger: 'blur'},
], ],
activeName: [ activeName: [
@ -451,9 +462,9 @@ export default {
this.getOilList() this.getOilList()
}, },
methods: { methods: {
changeOfferType(){ changeOfferType() {
this.ruleForm.activeType = '0' this.ruleForm.activeType = '0'
console.log( this.ruleForm,446) console.log(this.ruleForm, 446)
}, },
getOilList() { getOilList() {
getOilNameList().then(response => { getOilNameList().then(response => {
@ -584,6 +595,37 @@ export default {
this.ruleForm.activeType = index this.ruleForm.activeType = index
}, },
submitRuleForm(formName) { submitRuleForm(formName) {
//
if (this.ruleForm.activeManner && this.ruleForm.activeManner.includes('0')) {
const list = this.orderList.some(item => {
if (item.full === '' || item.sub === '') {
this.$message.error("请填写订单相关活动规则,如不需要请删除");
return true; // true
}
});
if (list) {
return true; //退
}
}
//
if (this.ruleForm.activeManner && this.ruleForm.activeManner.includes('1')) {
const list = this.refuelList.some(item => {
if (item.full === '' || item.sub === '') {
this.$message.error("请填写加油相关活动规则,如不需要请删除");
return true; // true
}
});
if (list) {
return true; //退
}
}
if (this.tindex1 == 1) { if (this.tindex1 == 1) {
if (!this.ruleForm.activeStartTime || !this.ruleForm.activeEndTime) { if (!this.ruleForm.activeStartTime || !this.ruleForm.activeEndTime) {
this.$message.error("请选择活动开始时间") this.$message.error("请选择活动开始时间")
@ -602,131 +644,18 @@ export default {
return; return;
} }
} }
if (this.ruleForm.activeManner.length==0){ if (this.ruleForm.activeManner.length == 0) {
this.$message.warning("请选择活动方式"); this.$message.warning("请选择活动方式");
return return
} }
if (this.ruleForm.activeManner.indexOf("0")){
let flag1 = true;
//
if (this.ruleForm.offerType == 0 && this.ruleForm.activeType == 0){
this.orderList.forEach(item=>{
if (!item.full){
flag1 = false
}
if (!item.sub){
flag1 = false
}
})
}
if (this.ruleForm.offerType == 0 && this.ruleForm.activeType == 1){
this.orderList.forEach(item=>{
if (!item.full){
flag1 = false
}
if (!item.randomFront){
flag1 = false
}
if (!item.randomAfter){
flag1 = false
}
})
}
if (this.ruleForm.offerType == 0 && this.ruleForm.activeType == 2){
this.orderList.forEach(item=>{
if (!item.full){
flag1 = false
}
if (!item.sub){
flag1 = false
}
if (!item.maxPreferential){
flag1 = false
}
})
}
if (this.ruleForm.offerType == 1 && this.ruleForm.activeType == 0){
this.orderList.forEach(item=>{
if (!item.full){
flag1 = false
}
if (!item.enjoyDiscount){
flag1 = false
}
if (!item.maxPreferential){
flag1 = false
}
})
}
if (!flag1){
this.$message.warning("活动方式按订单金额,请填写完整");
return
}
if (this.ruleForm.activeManner && this.ruleForm.activeManner.includes('0')) {
//
this.refuelList = []
} }
if (this.ruleForm.activeManner.indexOf("1")){ if (this.ruleForm.activeManner && this.ruleForm.activeManner.includes('1')) {
let flag1 = true //
// this.orderList = []
if (this.ruleForm.offerType == 0 && this.ruleForm.activeType == 0){
this.refuelList.forEach(item=>{
if (!item.full){
flag1 = false
}
if (!item.sub){
flag1 = false
}
})
}
if (this.ruleForm.offerType == 0 && this.ruleForm.activeType == 1){
this.refuelList.forEach(item=>{
if (!item.full){
flag1 = false
}
if (!item.randomFront){
flag1 = false
}
if (!item.randomAfter){
flag1 = false
}
})
}
if (this.ruleForm.offerType == 0 && this.ruleForm.activeType == 2){
this.refuelList.forEach(item=>{
if (!item.full){
flag1 = false
}
if (!item.sub){
flag1 = false
}
if (!item.maxPreferential){
flag1 = false
}
})
}
if (this.ruleForm.offerType == 1 && this.ruleForm.activeType == 0){
this.refuelList.forEach(item=>{
if (!item.full){
flag1 = false
}
if (!item.enjoyDiscount){
flag1 = false
}
if (!item.maxPreferential){
flag1 = false
}
})
}
if (!flag1){
this.$message.warning("活动方式按加油升数,请填写完整");
return
}
} }
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
@ -748,7 +677,7 @@ export default {
editActiveSubPrice(this.ruleForm).then(res => { editActiveSubPrice(this.ruleForm).then(res => {
this.$message.success("修改成功") this.$message.success("修改成功")
// this.getInfo() // this.getInfo()
this.$router.push({path:"/EventMarketing/center/index",query:{id:'3'}}) this.$router.push({path: "/EventMarketing/center/index", query: {id: '3'}})
}) })
} else { } else {
// //
@ -756,7 +685,7 @@ export default {
if (res.data) { if (res.data) {
this.$message.success("添加成功") this.$message.success("添加成功")
// this.getInfo() // this.getInfo()
this.$router.push({path:"/EventMarketing/center/index",query:{id:'3'}}) this.$router.push({path: "/EventMarketing/center/index", query: {id: '3'}})
} else { } else {
this.$message.error("添加失败") this.$message.error("添加失败")
} }
@ -768,7 +697,7 @@ export default {
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
// this.getInfo() // this.getInfo()
this.$router.push({path:"/EventMarketing/center/index",query: {activeId:this.activeId}}) this.$router.push({path: "/EventMarketing/center/index", query: {activeId: this.activeId}})
}, },
} }
} }

View File

@ -46,15 +46,16 @@
<span v-if="scope.row.putType==3">积分兑换</span> <span v-if="scope.row.putType==3">积分兑换</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="优惠内容"> <!-- 优惠券列表中优惠内容 展示消费条件 订单金额 -->
<el-table-column label="消费条件">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.remark }}</span> <span>{{ getConditionsOfConsumption(scope.row) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="有效期"> <el-table-column prop="createTime" label="有效期">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.effectiveDateStart }}~{{ scope.row.effectiveDateEnd }}</span> <span>{{ getExpirationDate(scope.row) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="tfGetNum" label="已领/投放数量"> <el-table-column prop="tfGetNum" label="已领/投放数量">
@ -62,7 +63,7 @@
<span>{{ scope.row.tfGetNum || 0 }}/{{ scope.row.tfTotal || 0 }}</span> <span>{{ scope.row.tfGetNum || 0 }}/{{ scope.row.tfTotal || 0 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="已核销"></el-table-column> <el-table-column prop="tfUseNum" label="已核销"></el-table-column>
<el-table-column prop="status" label="状态"> <el-table-column prop="status" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 1" style="color: #0DC291">上架</span> <span v-if="scope.row.status == 1" style="color: #0DC291">上架</span>
@ -122,10 +123,10 @@
class="demo-ruleForm"> class="demo-ruleForm">
<div class="d-s" style="justify-content: space-between"> <div class="d-s" style="justify-content: space-between">
<el-form-item label="优惠券编号" required prop="number" style="width: 45%;"> <el-form-item label="优惠券编号" required prop="number" style="width: 45%;">
<el-input v-model="ruleForm.number" :disabled="ruleForm.id" placeholder="请输入优惠券编号"></el-input> <el-input v-model="ruleForm.number" placeholder="请输入优惠券编号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="优惠券名称" required prop="name" style="width: 50%;"> <el-form-item label="优惠券名称" required prop="name" style="width: 50%;">
<el-input v-model="ruleForm.name" :disabled="ruleForm.id" placeholder="请输入优惠券名称"></el-input> <el-input v-model="ruleForm.name" placeholder="请输入优惠券名称"></el-input>
</el-form-item> </el-form-item>
</div> </div>
@ -137,7 +138,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="优惠券类型" prop="type" required style="width: 50%;"> <el-form-item label="优惠券类型" prop="type" required style="width: 50%;">
<el-select v-model="ruleForm.type" placeholder="请选择优惠券类型" style="width: 100%" :disabled="ruleForm.id"> <el-select v-model="ruleForm.type" placeholder="请选择优惠券类型" style="width: 100%">
<el-option v-for="dict in dict.type.CardCoupon_type" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.CardCoupon_type" :key="dict.value" :label="dict.label"
:value="dict.value"/> :value="dict.value"/>
</el-select> </el-select>
@ -147,65 +148,65 @@
<el-form-item label="消费条件" required style="width: 45%;" <el-form-item label="消费条件" required style="width: 45%;"
prop="meetCondition" v-if="ruleForm.type=='1' || ruleForm.type=='5'"
v-if="ruleForm.type=='1' || ruleForm.type=='5'"> prop="useType">
<div class="d-s"> <div class="d-s">
<el-select v-model="ruleForm.useType" :disabled="ruleForm.id" placeholder="请选择金额"> <el-select v-model="ruleForm.useType" placeholder="请选择金额">
<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="margin: 0px 5px;"></div> <div style="margin: 0px 5px;"></div>
<el-input placeholder="" v-model="ruleForm.reachAmount" :disabled="ruleForm.id" style="width: 140px"> <el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 140px">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
<div style="width: 60px;text-align: center">优惠</div> <div style="width: 60px;text-align: center">优惠</div>
<el-input placeholder="" v-model="ruleForm.reduceAmount" :disabled="ruleForm.id" style="width: 140px"> <el-input placeholder="" v-model="ruleForm.reduceAmount" style="width: 140px">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</div> </div>
</el-form-item> </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">
<el-input placeholder="" v-model="ruleForm.exchangeContent" :disabled="ruleForm.id"></el-input> <el-input placeholder="" v-model="ruleForm.exchangeContent"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="优惠条件" required style="width: 45%;" v-if="ruleForm.type=='3'" prop="meetCondition"> <el-form-item label="优惠条件" required style="width: 45%;" v-if="ruleForm.type=='3'" prop="useType">
<div class="d-s"> <div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择" style="width: 110px" :disabled="ruleForm.id"> <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" :disabled="ruleForm.id" style="width: 130px"> <el-input placeholder="" v-model="ruleForm.zkStartAmount" style="width: 130px">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
<div style="margin: 0px 5px;">~</div> <div style="margin: 0px 5px;">~</div>
<el-input placeholder="" v-model="ruleForm.zkEndAmount" :disabled="ruleForm.id" style="width: 130px"> <el-input placeholder="" v-model="ruleForm.zkEndAmount" style="width: 130px">
<template slot="append"></template> <template slot="append"></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" :disabled="ruleForm.id" style="width: 130px"> <el-input placeholder="" v-model="ruleForm.zkData" style="width: 130px">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="消费条件" required style="width: 45%;" v-if="ruleForm.type=='4'" prop="meetCondition"> <el-form-item label="消费条件" required style="width: 45%;" v-if="ruleForm.type=='4'" prop="useType">
<div class="d-s"> <div class="d-s">
<el-select v-model="ruleForm.useType" :disabled="ruleForm.id" placeholder="请选择金额"> <el-select v-model="ruleForm.useType" placeholder="请选择金额">
<el-option label="订单金额" value="1"/> <el-option label="订单金额" value="1"/>
<el-option label="实收金额" value="2"/> <el-option label="实收金额" value="2"/>f
</el-select> </el-select>
<div style="margin: 0px 5px;"></div> <div style="margin: 0px 5px;"></div>
<el-input placeholder="" v-model="ruleForm.reachAmount" :disabled="ruleForm.id" style="width: 160px"> <el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 160px">
<template slot="append"></template> <template slot="append"></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" :disabled="ruleForm.id" style="width: 160px"> <el-input placeholder="" v-model="ruleForm.ljOilNum" style="width: 160px">
<template slot="append">L</template> <template slot="append">L</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.ljOilAmount" :disabled="ruleForm.id" style="width: 160px"> <el-input placeholder="" v-model="ruleForm.ljOilAmount" style="width: 160px">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</div> </div>
@ -288,7 +289,8 @@
<!-- 生效日期 effectiveDateStart 字段 --> <!-- 生效日期 effectiveDateStart 字段 -->
<el-form-item label="生效日期" required style="width: 50%;" v-if="ruleForm.timeType=='2'" prop="effectiveDateStart"> <el-form-item label="生效日期" required style="width: 50%;" v-if="ruleForm.timeType=='2'"
prop="effectiveDateStart">
<el-date-picker <el-date-picker
v-model="ruleForm.effectiveDateStart" v-model="ruleForm.effectiveDateStart"
style="width: 160px" style="width: 160px"
@ -699,6 +701,7 @@ export default {
weekDay1: [], weekDay1: [],
monthDay1: [], monthDay1: [],
ruleForm: { ruleForm: {
useType: 1,
availableOrUn: '0', availableOrUn: '0',
productIdList: [], productIdList: [],
productIds: '', productIds: '',
@ -722,20 +725,19 @@ export default {
//使 //使
limitTotalDay: '', limitTotalDay: '',
//使 //使
ruleForm: '',
tfTotal: 0, tfTotal: 0,
dayGetLimit: 0, dayGetLimit: 0,
getNumLimit: 0, getNumLimit: 0,
useCondition: "", useCondition: "",
validityDay: 30, validityDay: 30,
effectiveDateEnd:'', effectiveDateEnd: '',
effectiveDateStart:'', effectiveDateStart: '',
}, },
membership: [], membership: [],
rules: { rules: {
name: [{required: true, message: '请输入名称' }], name: [{required: true, message: '请输入名称'}],
number: [{required: true, message: '请输入编号'}], number: [{required: true, message: '请输入编号'}],
putType: [{required: true, message: '请选择投放类型'}], putType: [{required: true, message: '请选择投放类型'}],
type: [{required: true, message: '请选择优惠券类型'}], type: [{required: true, message: '请选择优惠券类型'}],
@ -745,14 +747,63 @@ export default {
sySend: [{required: true, message: '请选择收银台是否可送', trigger: 'blur'}], sySend: [{required: true, message: '请选择收银台是否可送', trigger: 'blur'}],
timeType: [{required: true, message: '请选择时间类型', trigger: 'change'}], timeType: [{required: true, message: '请选择时间类型', trigger: 'change'}],
// //
effectiveDateStart: [{ validator: this.validateEffectiveDate}], effectiveDateStart: [{validator: this.validateEffectiveDate}],
useWithOther: [{required: true, message: '请选择是否可与其他优惠券同享', trigger: 'blur'}], useWithOther: [{required: true, message: '请选择是否可与其他优惠券同享', trigger: 'blur'}],
// //
limitTotalDay: [{validator: this.validateLimitTotalDay}], limitTotalDay: [{validator: this.validateLimitTotalDay}],
getNumLimit: [{required: true, message: '请输入每人领券限制' }], getNumLimit: [{required: true, message: '请输入每人领券限制'}],
tfTotal: [{required: true, message: '请输入投放总数'}], tfTotal: [{required: true, message: '请输入投放总数'}],
dayGetLimit: [{required: true, message: '请输入每日领券限制'}], dayGetLimit: [{required: true, message: '请输入每日领券限制'}],
//
useType: [
{
validator: (rule, value, callback) => {
console.log('优惠券类型',this.dict.type.CardCoupon_type)
if (this.ruleForm.type == '1' || this.ruleForm.type == '5') {
if (!this.ruleForm.useType) {
callback(new Error("请选择优惠券使用条件"));
} else if (!this.ruleForm.reachAmount) {
callback(new Error("请输入满多少元可用"));
} else if (!this.ruleForm.reduceAmount) {
callback(new Error("请输入优惠金额"));
} else {
callback();
}
}
if (this.ruleForm.type == '3') {
if (!this.ruleForm.useType) {
callback(new Error("请选择优惠券使用条件"));
} else if (!this.ruleForm.zkStartAmount) {
callback(new Error("请输入范围最小值"));
} else if (!this.ruleForm.zkEndAmount) {
callback(new Error("请输入范围最大值"));
} else if (!this.ruleForm.zkData) {
callback(new Error("请输入折扣"));
} else {
callback();
}
}
if (this.ruleForm.type == '4') {
if (!this.ruleForm.useType) {
callback(new Error("请选择优惠券使用条件"));
} else if (!this.ruleForm.reachAmount) {
callback(new Error("请输入满多少元可用"));
} else if (!this.ruleForm.ljOilNum) {
callback(new Error("请输入升数"));
} else if (!this.ruleForm.ljOilAmount) {
callback(new Error("请输入立减金额"));
} else {
callback();
}
}
},
trigger: ['change', 'blur']
}
],
exchangeContent: [{required: true, message: '请输入兑换内容'}],
} }
} }
@ -770,32 +821,80 @@ export default {
imgUpload, imgUpload,
}, },
methods: { methods: {
validateLimitTotalDay(rule, value, callback){
getExpirationDate(row) {
if (row.timeType == '1') {
return '领取后 ' + row.validityDay + ' 天有效'
}
if (row.timeType == '2') {
return row.effectiveDateStart + ' ~ ' + row.effectiveDateEnd
}
},
getConditionsOfConsumption(row) {
// <span v-if="scope.row.type==1"></span>
// <span v-if="scope.row.type==2"></span>
// <span v-if="scope.row.type==3"></span>
// <span v-if="scope.row.type==4"></span>
// <span v-if="scope.row.type==5"></span>
if (row.type == 1 || row.type == 5) {
if (row.useType == 1) {
return '订单金额 满' + row.reachAmount + '元 优惠' + row.reduceAmount + '元'
}
if (row.useType == 2) {
return '实收 满' + row.reachAmount + '元 优惠' + row.reduceAmount + '元'
}
}
if (row.type == 2) {
return '兑换内容 ' + row.exchangeContent
}
if (row.type == 3) {
if (row.useType == 1) {
return '订单金额 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
}
if (row.useType == 2) {
return '实收金额 范围' + row.zkStartAmount + '元 ~ ' + row.zkEndAmount + '元 优惠' + row.zkData + '折'
}
}
if (row.type == 4) {
if (row.useType == 1) {
return '订单金额 满' + row.reachAmount + '元 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
}
if (row.useType == 2) {
return '实收金额 满' + row.reachAmount + '元 每' + row.ljOilNum + 'L 减' + row.ljOilAmount + '元'
}
}
},
validateLimitTotalDay(rule, value, callback) {
console.log(this.ruleForm.limitTotalDay) console.log(this.ruleForm.limitTotalDay)
console.log(this.ruleForm.limitTotalNum) console.log(this.ruleForm.limitTotalNum)
if (this.ruleForm.limitTotalDay == ''){ if (this.ruleForm.limitTotalDay == '') {
callback(new Error('请输入天数')); callback(new Error('请输入天数'));
} } else if (this.ruleForm.limitTotalNum === undefined) {
else if (this.ruleForm.limitTotalNum === undefined){ callback(new Error('请输入次数'));
callback(new Error('请输入次数')); } else {
} callback();
else { }
callback();
}
}, },
validateOilLimit(rule, value, callback) { validateOilLimit(rule, value, callback) {
if (value == '') { if (value == '') {
callback(new Error('请选择油品油号')); callback(new Error('请选择油品油号'));
} } else if (value == '2' && this.ruleForm.oilNumber == '') {
else if (value == '2' && this.ruleForm.oilNumber == ''){
callback(new Error('请选择自定义')); callback(new Error('请选择自定义'));
} } else {
else {
callback(); callback();
} }
}, },
validateEffectiveDate(rule, value, callback){ validateEffectiveDate(rule, value, callback) {
// //
if (this.ruleForm.effectiveDateStart === undefined || this.ruleForm.effectiveDateStart === null) { if (this.ruleForm.effectiveDateStart === undefined || this.ruleForm.effectiveDateStart === null) {
callback(new Error('请选择开始时间')); callback(new Error('请选择开始时间'));
@ -803,8 +902,7 @@ export default {
// //
else if (this.ruleForm.effectiveDateEnd === undefined || this.ruleForm.effectiveDateEnd === null) { else if (this.ruleForm.effectiveDateEnd === undefined || this.ruleForm.effectiveDateEnd === null) {
callback(new Error('请选择结束时间')); callback(new Error('请选择结束时间'));
} } else {
else {
callback(); callback();
} }
}, },
@ -874,6 +972,7 @@ export default {
updetenCardCoupon(id) { updetenCardCoupon(id) {
this.listUserGrade() this.listUserGrade()
console.log("什么值啊", this.centerDialogVisible)
this.centerDialogVisible = !this.centerDialogVisible this.centerDialogVisible = !this.centerDialogVisible
getCardCoupon(id).then(res => { getCardCoupon(id).then(res => {
this.ruleForm = res.data this.ruleForm = res.data
@ -905,6 +1004,7 @@ export default {
this.ruleForm = { this.ruleForm = {
useType: '1',
// //
oilLimit: '', oilLimit: '',
sySend: '', sySend: '',

View File

@ -87,7 +87,7 @@
<div style="width: 20%"> <div style="width: 20%">
<el-checkbox-group v-model="ruleForm.courtesyReward"> <el-checkbox-group v-model="ruleForm.courtesyReward">
<div style="display: flex;font-size: 14px;margin: 15px 0;align-items: center"> <div style="display: flex;font-size: 14px;align-items: center">
<el-checkbox label="0" name="type">赠送优惠券</el-checkbox> <el-checkbox label="0" name="type">赠送优惠券</el-checkbox>
<img src="@/assets/images/tjb.png" <img src="@/assets/images/tjb.png"
style="width: 20px;height: 20px;cursor: pointer;margin-left: 10px" style="width: 20px;height: 20px;cursor: pointer;margin-left: 10px"

View File

@ -236,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="折扣" prop="disValue" required 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="减价金额" prop="disValue" required 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>
@ -271,9 +271,19 @@
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"
:min="0.1"
:max="999"
></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">
@ -338,7 +348,7 @@
: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%">
@ -367,7 +377,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>
@ -390,21 +400,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>
@ -540,14 +536,20 @@ export default {
title: '', title: '',
name: '', name: '',
region: '', region: '',
category: '', category: '1',
disValue: '', disValue: '',
type: [], type: [],
oilList: [] oilList: []
}, },
rules: { rules: {
'oilList.*.price': [
{required: true, message: '请输入优惠价', trigger: 'change'}
],
disValue: [
{required: true, message: '请输入', trigger: 'blur'},
],
title: [ title: [
{required: true, message: '请输入名称', trigger: 'blur'}, {required: true, message: '请输入名称', trigger: 'change'},
], ],
category: [ category: [
{required: true, message: '请输入名称', trigger: 'blur'}, {required: true, message: '请输入名称', trigger: 'blur'},
@ -559,10 +561,10 @@ 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'},
], ],
disMax: [ disMax: [
{required: true, message: '请输入优惠金额', trigger: 'blur'}, {required: true, message: '请输入优惠金额', trigger: 'blur'},
@ -579,6 +581,37 @@ export default {
limitNum: [ limitNum: [
{required: true, message: '请输入每人累计参与限制', trigger: 'blur'}, {required: true, message: '请输入每人累计参与限制', trigger: 'blur'},
], ],
consumeType: [
{required: true, message: '请选择消费类型', trigger: 'change'},
],
moneyMax: [
{required: true, message: '请输入实收最高金额', trigger: 'blur'},
],
literMax: [
{required: true, message: '请输入最高加油升数', trigger: 'blur'},
],
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();
}
},
}
]
}, },
centerDialogVisible: false, centerDialogVisible: false,
showDialogVisible: false, showDialogVisible: false,
@ -612,8 +645,52 @@ export default {
created() { created() {
this.getList() this.getList()
this.getRuleList() this.getRuleList()
},
watch: {
// ruleForm.category
'ruleForm.category': function (newVal, oldVal) {
this.ruleForm.disValue = null;
},
'ruleForm.disValue': function (newVal, oldVal) {
if (this.ruleForm.category == 2) {
this.clearOilListPrice()
// elementui
this.ruleForm.oilList = this.ruleForm.oilList.map(item => ({
...item,
price: Number((item.oilPrice * newVal).toFixed(2))
}));
}
if (this.ruleForm.category == 3) {
this.clearOilListPrice()
this.ruleForm.oilList = this.ruleForm.oilList.map(item => ({
...item,
price: Number((item.oilPrice - newVal).toFixed(2))
}));
}
if (newVal == null) {
this.clearOilListPrice()
}
}
}, },
methods: { methods: {
//
clearOilListPrice() {
this.ruleForm.oilList = this.ruleForm.oilList.map(item => ({
...item,
price: null
}));
},
// //
getPaymentTypeStr(value) { getPaymentTypeStr(value) {
@ -676,15 +753,7 @@ 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()
@ -773,7 +842,7 @@ export default {
title: '', title: '',
name: '', name: '',
region: '', region: '',
category: '', category: '1',
disValue: '', disValue: '',
type: [], type: [],
oilList: [] oilList: []
@ -791,31 +860,34 @@ 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 => {
if (res.code == 200) { if (res.code == 200) {
this.$message({ this.$message({
message: '添加成功', message: '添加成功',
type: 'success' type: 'success'
})
this.getList()
}
}) })
this.getList() } else {
} postaddList(this.ruleForm).then(res => {
}) if (res.code == 200) {
} else { this.$message({
postaddList(this.ruleForm).then(res => { message: '添加成功',
if (res.code == 200) { type: 'success'
this.$message({ })
message: '添加成功', this.getList()
type: 'success' }
}) })
this.getList()
} }
})
}
}
})
}, },
// //
getList() { getList() {
@ -857,6 +929,8 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.center_ { .center_ {
width: 100%; width: 100%;
border-radius: 8px; border-radius: 8px;
@ -956,3 +1030,10 @@ export default {
color: #FF770F !important; color: #FF770F !important;
} }
</style> </style>
<!-- elementUi 有些是行内样式 只能通过 多重选择器 来改变样式 -->
<style>
.custom-form-itemMy100989 .el-form-item__content {
margin-left: 0 !important;
}
</style>

View File

@ -153,7 +153,6 @@
title="订单记录" title="订单记录"
:visible.sync="orderShow" :visible.sync="orderShow"
size="55%" size="55%"
:before-close="handleClose"
center> center>
<div class="box-der"> <div class="box-der">
<div class="d-b"> <div class="d-b">
@ -233,7 +232,7 @@
</el-drawer> </el-drawer>
<!-- 规则--> <!-- 规则-->
<el-dialog title="编辑囤油卡规则" :visible.sync="Crule"> <el-dialog title="编辑囤油卡规则" :visible.sync="Crule">
<el-form :model="oilForm" :rules="ruleInfo" ref="oilForm" label-width="100px" class="demo-ruleForm" :label-position="labelPosition"> <el-form :model="oilForm" :rules="ruleInfo" ref="oilForm" label-width="100px" class="demo-ruleForm" >
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input disabled v-model="oilForm.name"></el-input> <el-input disabled v-model="oilForm.name"></el-input>
</el-form-item> </el-form-item>

View File

@ -1243,8 +1243,15 @@ export default {
{required: true, message: "请选择节假日是否通用", trigger: "blur"}, {required: true, message: "请选择节假日是否通用", trigger: "blur"},
], ],
suitDateType: [ suitDateType: [
{required: true, message: "请选择适用日期", trigger: "blur"}, {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("请选择结束日期"))
}
}
}},],
suitTimeSlotType: [ suitTimeSlotType: [
{required: true, message: "请选择适用时间段", trigger: "blur"}, {required: true, message: "请选择适用时间段", trigger: "blur"},
], ],

View File

@ -23,6 +23,7 @@ public class OilNumber extends BaseEntity {
@TableId(value = "number_id", type = IdType.AUTO) @TableId(value = "number_id", type = IdType.AUTO)
public Integer numberId; //id主键) public Integer numberId; //id主键)
private String oilType; // 油品类型 private String oilType; // 油品类型
@TableField(exist = false)
private Integer oilId; // 油品id private Integer oilId; // 油品id
private String oilName; //油品名称 private String oilName; //油品名称
private Double oilPrice; //油品单价 private Double oilPrice; //油品单价