From 6a3d7af6c13714165a0604a6acba17dfd0ac0a22 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Thu, 19 Sep 2024 14:33:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EventMarketing/liJianMarketing/index.vue | 148 +++++++++++++++++- 1 file changed, 145 insertions(+), 3 deletions(-) diff --git a/fuintAdmin/src/views/EventMarketing/liJianMarketing/index.vue b/fuintAdmin/src/views/EventMarketing/liJianMarketing/index.vue index e32365777..903566e2e 100644 --- a/fuintAdmin/src/views/EventMarketing/liJianMarketing/index.vue +++ b/fuintAdmin/src/views/EventMarketing/liJianMarketing/index.vue @@ -375,8 +375,24 @@ export default { weekList: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"], weekDay: [], monthDay: [], - orderList: [], - refuelList: [], + orderList: [{ + activeManner: 0, + full: "", + sub: "", + randomFront: "", + randomAfter: "", + maxPreferential: "", + enjoyDiscount: "", + }], + refuelList: [{ + activeManner: 1, + full: "", + sub: "", + randomFront: "", + randomAfter: "", + maxPreferential: "", + enjoyDiscount: "", + }], // 表单校验 rules: { activeName: [ @@ -569,6 +585,133 @@ export default { return; } } + 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.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 + } + + } + this.$refs[formName].validate((valid) => { if (valid) { if (this.ruleForm.timeType == 0) { @@ -583,7 +726,6 @@ export default { if (this.ruleForm.activeManner) this.ruleForm.activeManner = this.ruleForm.activeManner.toString() if (this.orderList) this.ruleForm.orderList = this.orderList if (this.refuelList) this.ruleForm.refuelList = this.refuelList - if (this.ruleForm.id) { // 修改 editActiveSubPrice(this.ruleForm).then(res => {