bug1
This commit is contained in:
parent
6d48219cd6
commit
0d42e10334
@ -89,7 +89,6 @@
|
||||
title="订单记录"
|
||||
:visible.sync="orderShow"
|
||||
size="55%"
|
||||
:before-close="handleClose"
|
||||
center>
|
||||
<div class="box-der">
|
||||
<div class="d-b">
|
||||
|
@ -147,7 +147,6 @@
|
||||
title="订单记录"
|
||||
:visible.sync="orderShow"
|
||||
size="55%"
|
||||
:before-close="handleClose"
|
||||
center>
|
||||
<div class="box-der">
|
||||
<div class="d-b">
|
||||
@ -223,7 +222,7 @@
|
||||
width="40%"
|
||||
@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-input v-model="ruleForm2.activeNum"></el-input>
|
||||
@ -397,6 +396,7 @@ export default {
|
||||
dicts: ['card_gift_type'],
|
||||
data() {
|
||||
return {
|
||||
value1:'',
|
||||
//http://localhost:81/dev-api/cardGiftActive
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + ' /cardGiftActive/importCardInfo',
|
||||
Encryption: false,
|
||||
|
@ -21,7 +21,7 @@
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="开始日期">
|
||||
</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
|
||||
v-if="ruleForm.activeTimeType=='1'"
|
||||
v-model="ruleForm.activeEndTime"
|
||||
@ -35,12 +35,12 @@
|
||||
|
||||
<el-form-item label="优惠类型" prop="offerType">
|
||||
<div class="d-s">
|
||||
<el-radio-group v-model="ruleForm.offerType" @input="changeOfferType()">
|
||||
<el-radio :label="'0'" >立减优惠</el-radio>
|
||||
<el-radio :label="'1'" >折扣优惠</el-radio>
|
||||
<el-radio-group v-model="ruleForm.offerType" @input="changeOfferType()">
|
||||
<el-radio :label="'0'">立减优惠</el-radio>
|
||||
<el-radio :label="'1'">折扣优惠</el-radio>
|
||||
</el-radio-group>
|
||||
</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 label="活动类型" prop="activeType">
|
||||
@ -98,13 +98,14 @@
|
||||
<el-radio-group v-model="ruleForm.timeType">
|
||||
<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="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-group>
|
||||
</div>
|
||||
|
||||
<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
|
||||
v-for="item in 31"
|
||||
:key="item+''"
|
||||
@ -140,7 +141,8 @@
|
||||
<el-radio :label="'0'">不限</el-radio>
|
||||
<el-radio :label="'1'">自定义</el-radio>
|
||||
</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"
|
||||
:label="getOilNamess(oilNameList,item.oilName)" :value="item.oilName"></el-option>
|
||||
</el-select>
|
||||
@ -153,12 +155,13 @@
|
||||
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="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>
|
||||
<img src="@/assets/images/tjb.png"
|
||||
style="width: 20px;height: 20px;cursor: pointer;margin-left: 10px"
|
||||
@ -166,7 +169,8 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<el-input placeholder="请输入" style="width: 30%;margin: 0 10px" v-model="item.full">
|
||||
<template slot="append">元</template>
|
||||
@ -180,7 +184,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full">
|
||||
<template slot="append">元</template>
|
||||
@ -198,7 +203,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<el-input placeholder="请输入" style="width: 19%;margin: 0 10px" v-model="item.full">
|
||||
<template slot="append">元</template>
|
||||
@ -216,7 +222,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full">
|
||||
<template slot="append">元</template>
|
||||
@ -242,7 +249,8 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<el-input placeholder="请输入" style="width: 30%;margin: 0 10px" v-model="item.full">
|
||||
<template slot="append">L</template>
|
||||
@ -257,7 +265,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full">
|
||||
<template slot="append">L</template>
|
||||
@ -277,7 +286,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<el-input placeholder="请输入" style="width: 19%;margin: 0 10px" v-model="item.full">
|
||||
<template slot="append">L</template>
|
||||
@ -297,7 +307,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<el-input placeholder="请输入" style="width: 20%;margin: 0 10px" v-model="item.full">
|
||||
<template slot="append">L</template>
|
||||
@ -338,7 +349,7 @@ import {addActiveSubPrice, editActiveSubPrice, getActiveSubPrice} from "@/api/Ev
|
||||
export default {
|
||||
name: "LiJianMarketing",
|
||||
dicts: ['payment_type'],
|
||||
props:['activeId'],
|
||||
props: ['activeId'],
|
||||
data() {
|
||||
return {
|
||||
ruleForm: {
|
||||
@ -390,10 +401,10 @@ export default {
|
||||
}],
|
||||
// 表单校验
|
||||
rules: {
|
||||
timeType:[
|
||||
timeType: [
|
||||
{required: true, message: '适用时间段不能为空', trigger: 'blur'},
|
||||
],
|
||||
activeType:[
|
||||
activeType: [
|
||||
{required: true, message: '活动类型不能为空', trigger: 'blur'},
|
||||
],
|
||||
activeName: [
|
||||
@ -451,9 +462,9 @@ export default {
|
||||
this.getOilList()
|
||||
},
|
||||
methods: {
|
||||
changeOfferType(){
|
||||
changeOfferType() {
|
||||
this.ruleForm.activeType = '0'
|
||||
console.log( this.ruleForm,446)
|
||||
console.log(this.ruleForm, 446)
|
||||
},
|
||||
getOilList() {
|
||||
getOilNameList().then(response => {
|
||||
@ -584,6 +595,37 @@ export default {
|
||||
this.ruleForm.activeType = index
|
||||
},
|
||||
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.ruleForm.activeStartTime || !this.ruleForm.activeEndTime) {
|
||||
this.$message.error("请选择活动开始时间")
|
||||
@ -602,131 +644,18 @@ export default {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.ruleForm.activeManner.length==0){
|
||||
if (this.ruleForm.activeManner.length == 0) {
|
||||
this.$message.warning("请选择活动方式");
|
||||
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")){
|
||||
let flag1 = true
|
||||
//按照加油升数
|
||||
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
|
||||
}
|
||||
|
||||
if (this.ruleForm.activeManner && this.ruleForm.activeManner.includes('1')) {
|
||||
//如果加油 则清空订单
|
||||
this.orderList = []
|
||||
}
|
||||
|
||||
this.$refs[formName].validate((valid) => {
|
||||
@ -748,7 +677,7 @@ export default {
|
||||
editActiveSubPrice(this.ruleForm).then(res => {
|
||||
this.$message.success("修改成功")
|
||||
// this.getInfo()
|
||||
this.$router.push({path:"/EventMarketing/center/index",query:{id:'3'}})
|
||||
this.$router.push({path: "/EventMarketing/center/index", query: {id: '3'}})
|
||||
})
|
||||
} else {
|
||||
// 添加
|
||||
@ -756,7 +685,7 @@ export default {
|
||||
if (res.data) {
|
||||
this.$message.success("添加成功")
|
||||
// this.getInfo()
|
||||
this.$router.push({path:"/EventMarketing/center/index",query:{id:'3'}})
|
||||
this.$router.push({path: "/EventMarketing/center/index", query: {id: '3'}})
|
||||
} else {
|
||||
this.$message.error("添加失败")
|
||||
}
|
||||
@ -768,7 +697,7 @@ export default {
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
// this.getInfo()
|
||||
this.$router.push({path:"/EventMarketing/center/index",query: {activeId:this.activeId}})
|
||||
this.$router.push({path: "/EventMarketing/center/index", query: {activeId: this.activeId}})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -46,15 +46,16 @@
|
||||
<span v-if="scope.row.putType==3">积分兑换</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="优惠内容">
|
||||
<!-- 优惠券列表中优惠内容 展示消费条件 订单金额 满 元 每 减 元 -->
|
||||
<el-table-column label="消费条件">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.remark }}</span>
|
||||
<span>{{ getConditionsOfConsumption(scope.row) }}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="有效期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.effectiveDateStart }}~{{ scope.row.effectiveDateEnd }}</span>
|
||||
<span>{{ getExpirationDate(scope.row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="tfGetNum" label="已领/投放数量">
|
||||
@ -62,7 +63,7 @@
|
||||
<span>{{ scope.row.tfGetNum || 0 }}/{{ scope.row.tfTotal || 0 }}</span>
|
||||
</template>
|
||||
</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="状态">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.status == 1" style="color: #0DC291">上架</span>
|
||||
@ -122,10 +123,10 @@
|
||||
class="demo-ruleForm">
|
||||
<div class="d-s" style="justify-content: space-between">
|
||||
<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 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>
|
||||
|
||||
</div>
|
||||
@ -137,7 +138,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠券类型" prop="type" required style="width: 50%;">
|
||||
<el-select v-model="ruleForm.type" placeholder="请选择优惠券类型" style="width: 100%" :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"
|
||||
:value="dict.value"/>
|
||||
</el-select>
|
||||
@ -147,65 +148,65 @@
|
||||
|
||||
|
||||
<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">
|
||||
<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="2"/>
|
||||
</el-select>
|
||||
<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>
|
||||
</el-input>
|
||||
<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>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<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 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">
|
||||
<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="2"/>
|
||||
</el-select>
|
||||
<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>
|
||||
</el-input>
|
||||
<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>
|
||||
</el-input>
|
||||
<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>
|
||||
</el-input>
|
||||
</div>
|
||||
</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">
|
||||
<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="2"/>
|
||||
<el-option label="实收金额" value="2"/>f
|
||||
</el-select>
|
||||
<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>
|
||||
</el-input>
|
||||
<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>
|
||||
</el-input>
|
||||
<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>
|
||||
</el-input>
|
||||
</div>
|
||||
@ -288,7 +289,8 @@
|
||||
|
||||
|
||||
<!-- 生效日期 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
|
||||
v-model="ruleForm.effectiveDateStart"
|
||||
style="width: 160px"
|
||||
@ -699,6 +701,7 @@ export default {
|
||||
weekDay1: [],
|
||||
monthDay1: [],
|
||||
ruleForm: {
|
||||
useType: 1,
|
||||
availableOrUn: '0',
|
||||
productIdList: [],
|
||||
productIds: '',
|
||||
@ -722,20 +725,19 @@ export default {
|
||||
//限制多少天内可使用几次的 天字段
|
||||
limitTotalDay: '',
|
||||
//限制多少天内可使用几次的 次字段
|
||||
ruleForm: '',
|
||||
tfTotal: 0,
|
||||
dayGetLimit: 0,
|
||||
getNumLimit: 0,
|
||||
useCondition: "",
|
||||
validityDay: 30,
|
||||
effectiveDateEnd:'',
|
||||
effectiveDateStart:'',
|
||||
effectiveDateEnd: '',
|
||||
effectiveDateStart: '',
|
||||
|
||||
|
||||
},
|
||||
membership: [],
|
||||
rules: {
|
||||
name: [{required: true, message: '请输入名称' }],
|
||||
name: [{required: true, message: '请输入名称'}],
|
||||
number: [{required: true, message: '请输入编号'}],
|
||||
putType: [{required: true, message: '请选择投放类型'}],
|
||||
type: [{required: true, message: '请选择优惠券类型'}],
|
||||
@ -745,14 +747,63 @@ export default {
|
||||
sySend: [{required: true, message: '请选择收银台是否可送', trigger: 'blur'}],
|
||||
timeType: [{required: true, message: '请选择时间类型', trigger: 'change'}],
|
||||
//自定义校验
|
||||
effectiveDateStart: [{ validator: this.validateEffectiveDate}],
|
||||
effectiveDateStart: [{validator: this.validateEffectiveDate}],
|
||||
useWithOther: [{required: true, message: '请选择是否可与其他优惠券同享', trigger: 'blur'}],
|
||||
//自定义校验
|
||||
limitTotalDay: [{validator: this.validateLimitTotalDay}],
|
||||
getNumLimit: [{required: true, message: '请输入每人领券限制' }],
|
||||
getNumLimit: [{required: true, message: '请输入每人领券限制'}],
|
||||
tfTotal: [{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,
|
||||
},
|
||||
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.limitTotalNum)
|
||||
if (this.ruleForm.limitTotalDay == ''){
|
||||
callback(new Error('请输入天数'));
|
||||
}
|
||||
else if (this.ruleForm.limitTotalNum === undefined){
|
||||
callback(new Error('请输入次数'));
|
||||
}
|
||||
else {
|
||||
callback();
|
||||
}
|
||||
if (this.ruleForm.limitTotalDay == '') {
|
||||
callback(new Error('请输入天数'));
|
||||
} else if (this.ruleForm.limitTotalNum === undefined) {
|
||||
callback(new Error('请输入次数'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
},
|
||||
validateOilLimit(rule, value, callback) {
|
||||
if (value == '') {
|
||||
callback(new Error('请选择油品油号'));
|
||||
}
|
||||
else if (value == '2' && this.ruleForm.oilNumber == ''){
|
||||
} else if (value == '2' && this.ruleForm.oilNumber == '') {
|
||||
callback(new Error('请选择自定义'));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
validateEffectiveDate(rule, value, callback){
|
||||
validateEffectiveDate(rule, value, callback) {
|
||||
// 检查开始时间是否为空
|
||||
if (this.ruleForm.effectiveDateStart === undefined || this.ruleForm.effectiveDateStart === null) {
|
||||
callback(new Error('请选择开始时间'));
|
||||
@ -803,8 +902,7 @@ export default {
|
||||
// 检查结束时间是否为空
|
||||
else if (this.ruleForm.effectiveDateEnd === undefined || this.ruleForm.effectiveDateEnd === null) {
|
||||
callback(new Error('请选择结束时间'));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
@ -874,6 +972,7 @@ export default {
|
||||
|
||||
updetenCardCoupon(id) {
|
||||
this.listUserGrade()
|
||||
console.log("什么值啊", this.centerDialogVisible)
|
||||
this.centerDialogVisible = !this.centerDialogVisible
|
||||
getCardCoupon(id).then(res => {
|
||||
this.ruleForm = res.data
|
||||
@ -905,6 +1004,7 @@ export default {
|
||||
|
||||
|
||||
this.ruleForm = {
|
||||
useType: '1',
|
||||
//单选框都要有默认值 否则会提示表单约束必填项
|
||||
oilLimit: '',
|
||||
sySend: '',
|
||||
|
@ -87,7 +87,7 @@
|
||||
<div style="width: 20%">
|
||||
<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>
|
||||
<img src="@/assets/images/tjb.png"
|
||||
style="width: 20px;height: 20px;cursor: pointer;margin-left: 10px"
|
||||
|
@ -236,11 +236,11 @@
|
||||
价,则该规则不生效。
|
||||
</div>
|
||||
</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>
|
||||
<div>折扣请填写0~1的数字。例如输入0.8,表示打8折</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="减价金额" prop="disValue" v-if="ruleForm.category == '3' ">
|
||||
<el-form-item label="减价金额" prop="disValue" required v-if="ruleForm.category == '3' ">
|
||||
<el-input v-model="ruleForm.disValue" style="width: 217px"></el-input>
|
||||
<div>减价金额不能小于 0.01</div>
|
||||
</el-form-item>
|
||||
@ -271,9 +271,19 @@
|
||||
label="优惠价(元/L)"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.price" controls-position="right" :min="0.1"
|
||||
:max="999"></el-input-number>
|
||||
<!-- scope.row-->
|
||||
<el-form-item
|
||||
:prop="'oilList.' + scope.$index + '.price'"
|
||||
:rules="rules['oilList.*.price']"
|
||||
class="custom-form-itemMy100989"
|
||||
>
|
||||
<el-input
|
||||
v-model="scope.row.price"
|
||||
type="number"
|
||||
controls-position="right"
|
||||
:min="0.1"
|
||||
:max="999"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
@ -338,7 +348,7 @@
|
||||
:value="item.id+''"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="消费条件" required>
|
||||
<el-form-item label="消费条件" required prop="consumeType">
|
||||
<div v-if="ruleForm1.consumeType!=1">
|
||||
<el-col :span="7">
|
||||
<el-select v-model="ruleForm1.consumeType" style="width: 90%">
|
||||
@ -367,7 +377,7 @@
|
||||
<div v-if="ruleForm1.consumeType==1">
|
||||
<el-col :span="7">
|
||||
<el-select v-model="ruleForm1.consumeType" style="width: 90%">
|
||||
<el-option label="实收金额" value="0"></el-option>
|
||||
<el-option label="订单金额" value="0"></el-option>
|
||||
<el-option label="加油升数" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
@ -390,21 +400,7 @@
|
||||
</el-col>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="适用加油升数" required>-->
|
||||
<!-- <el-col :span="11">-->
|
||||
<!-- <el-form-item prop="literMin">-->
|
||||
<!-- <el-input v-model="ruleForm1.literMin"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="2">-->
|
||||
<!-- <div style="margin-left: 5px">到</div>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="11">-->
|
||||
<!-- <el-form-item prop="literMax">-->
|
||||
<!-- <el-input v-model="ruleForm1.literMax"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item label="最大优惠金额" prop="disMax">
|
||||
<el-input v-model="ruleForm1.disMax"></el-input>
|
||||
</el-form-item>
|
||||
@ -540,14 +536,20 @@ export default {
|
||||
title: '',
|
||||
name: '',
|
||||
region: '',
|
||||
category: '',
|
||||
category: '1',
|
||||
disValue: '',
|
||||
type: [],
|
||||
oilList: []
|
||||
},
|
||||
rules: {
|
||||
'oilList.*.price': [
|
||||
{required: true, message: '请输入优惠价', trigger: 'change'}
|
||||
],
|
||||
disValue: [
|
||||
{required: true, message: '请输入', trigger: 'blur'},
|
||||
],
|
||||
title: [
|
||||
{required: true, message: '请输入名称', trigger: 'blur'},
|
||||
{required: true, message: '请输入名称', trigger: 'change'},
|
||||
],
|
||||
category: [
|
||||
{required: true, message: '请输入名称', trigger: 'blur'},
|
||||
@ -559,10 +561,10 @@ export default {
|
||||
{required: true, message: '请输入支付方式', trigger: 'blur'},
|
||||
],
|
||||
moneyMin: [
|
||||
{required: true, message: '请输入实收金额', trigger: 'blur'},
|
||||
{required: true, message: '请输入实收最低金额', trigger: 'blur'},
|
||||
],
|
||||
literMin: [
|
||||
{required: true, message: '请输入加油升数', trigger: 'blur'},
|
||||
{required: true, message: '请输入最低加油升数', trigger: 'blur'},
|
||||
],
|
||||
disMax: [
|
||||
{required: true, message: '请输入优惠金额', trigger: 'blur'},
|
||||
@ -579,6 +581,37 @@ export default {
|
||||
limitNum: [
|
||||
{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,
|
||||
showDialogVisible: false,
|
||||
@ -612,8 +645,52 @@ export default {
|
||||
created() {
|
||||
this.getList()
|
||||
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: {
|
||||
//清空历史
|
||||
clearOilListPrice() {
|
||||
this.ruleForm.oilList = this.ruleForm.oilList.map(item => ({
|
||||
...item,
|
||||
price: null
|
||||
}));
|
||||
},
|
||||
//支付方式 转义
|
||||
getPaymentTypeStr(value) {
|
||||
|
||||
@ -676,15 +753,7 @@ export default {
|
||||
},
|
||||
// 提交活动规则
|
||||
submitRuleForm() {
|
||||
if (this.ruleForm1.consumeType == 1) {
|
||||
if (!this.ruleForm1.literMin || !this.ruleForm1.literMax) {
|
||||
this.$message.error("请填写消费条件信息")
|
||||
}
|
||||
} else {
|
||||
if (!this.ruleForm1.moneyMin || !this.ruleForm1.moneyMax) {
|
||||
this.$message.error("请填写消费条件信息")
|
||||
}
|
||||
}
|
||||
|
||||
this.$refs["ruleForm1"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.ruleForm1.paymentType) this.ruleForm1.paymentType = this.ruleForm1.paymentType.toString()
|
||||
@ -773,7 +842,7 @@ export default {
|
||||
title: '',
|
||||
name: '',
|
||||
region: '',
|
||||
category: '',
|
||||
category: '1',
|
||||
disValue: '',
|
||||
type: [],
|
||||
oilList: []
|
||||
@ -791,31 +860,34 @@ export default {
|
||||
},
|
||||
// 新增/修改
|
||||
addSeparateList() {
|
||||
this.$refs["ruleForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
this.centerDialogVisible = false
|
||||
if (this.ruleForm.id) {
|
||||
updateActivePrice(this.ruleForm).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
this.centerDialogVisible = false
|
||||
if (this.ruleForm.id) {
|
||||
updateActivePrice(this.ruleForm).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
postaddList(this.ruleForm).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
} else {
|
||||
postaddList(this.ruleForm).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
//列表查询
|
||||
getList() {
|
||||
@ -857,6 +929,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
|
||||
.center_ {
|
||||
width: 100%;
|
||||
border-radius: 8px;
|
||||
@ -956,3 +1030,10 @@ export default {
|
||||
color: #FF770F !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- elementUi 有些是行内样式 只能通过 多重选择器 来改变样式 -->
|
||||
<style>
|
||||
.custom-form-itemMy100989 .el-form-item__content {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -153,7 +153,6 @@
|
||||
title="订单记录"
|
||||
:visible.sync="orderShow"
|
||||
size="55%"
|
||||
:before-close="handleClose"
|
||||
center>
|
||||
<div class="box-der">
|
||||
<div class="d-b">
|
||||
@ -233,7 +232,7 @@
|
||||
</el-drawer>
|
||||
<!-- 规则-->
|
||||
<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-input disabled v-model="oilForm.name"></el-input>
|
||||
</el-form-item>
|
||||
|
@ -1243,8 +1243,15 @@ export default {
|
||||
{required: true, message: "请选择节假日是否通用", trigger: "blur"},
|
||||
],
|
||||
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: [
|
||||
{required: true, message: "请选择适用时间段", trigger: "blur"},
|
||||
],
|
||||
|
@ -23,6 +23,7 @@ public class OilNumber extends BaseEntity {
|
||||
@TableId(value = "number_id", type = IdType.AUTO)
|
||||
public Integer numberId; //id(主键)
|
||||
private String oilType; // 油品类型
|
||||
@TableField(exist = false)
|
||||
private Integer oilId; // 油品id
|
||||
private String oilName; //油品名称
|
||||
private Double oilPrice; //油品单价
|
||||
|
Loading…
Reference in New Issue
Block a user