- 合计金额:{{ oilAmount + goodsAmount }}元、优惠合计{{ oilDiscount + goodsDiscount + fullReduction + couponAmount }}元
+ 合计金额:{{ (oilAmount + goodsAmount).toFixed(2) }}元、优惠合计{{ (oilDiscount + goodsDiscount + fullReduction + couponAmount).toFixed(2) }}元
@@ -751,6 +751,38 @@
确 定
+
+
+
@@ -1033,6 +1065,8 @@
isExistOilOrder:false,
// 是否存在固定等级会员优惠
isFixingLevel:false,
+ // 是否为
+ isFixingBalance:false,
// 查询优惠活动信息所需参数
preferentialData:{
userId:"",
@@ -1085,6 +1119,14 @@
},
},
methods:{
+ async printLocally() {
+ const printHTML = document.querySelector('#reportSuccess').innerHTML
+ // 将打印的区域赋值,进行打印
+ window.document.body.innerHTML = printHTML
+ window.print() // 调用window打印方法
+ window.location.reload() // 打印完成后重新加载页面
+
+ },
clear(){
this.dialogVisiblej = false
this.seekZero = 0
@@ -1319,7 +1361,9 @@
this.countAmountFull();
this.isUseBalance = false;
}
- this.getOilCoupon()
+ if (!this.isFixingLevel){
+ this.getOilCoupon()
+ }
},
handleCheckAllChange5(val) {
if (val){
@@ -1454,7 +1498,7 @@
_this.gradeDiscount = [];
if (response.data) {
_this.oilOrder.forEach(item => {
- let discount = {type: "", full: 0, reduce: 0, liters: 0}
+ let discount = {type:"",discount:0,oilName:item.oilName,gunName:item.gunName}
if (item.type == "汽油") {
if (response.data.fixingLevel){
_this.isFixingLevel = true
@@ -1462,145 +1506,60 @@
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.gasolineDiscount == "满减优惠") {
let oilDiscount = 0;
- discount.type = "满减优惠"
for (let i = 1; i <= gasolineRule.length; i++) {
// 将满减条件加入等级优惠列表
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
- discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
- discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
- discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
- discount.reduce = gasolineRule[i - 1].gasolineRule2
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
- discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
- discount.reduce = gasolineRule[i - 1].gasolineRule2
}
}
}
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('满减优惠')
- }
gasolineDiscount += +oilDiscount
+ discount.discount = gasolineDiscount
} else if (response.data.fixingLevel.gasolineDiscount == "每升优惠") {
- discount.type = "每升优惠"
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++) {
// 将满减条件加入等级优惠列表
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
- discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
- discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
- discount.liters = gasolineRule[i - 1].gasolineRule3
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
- discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
- discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
- discount.liters = gasolineRule[i - 1].gasolineRule3
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
- discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
- discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
- discount.liters = gasolineRule[i - 1].gasolineRule3
}
}
}
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('每升优惠')
- }
gasolineDiscount += +oilDiscount
+ discount.discount = gasolineDiscount
} else {
gasolineDiscount = 0;
}
}
-
- }else {
- if (response.data.userGrade) {
- let gasolineRule = JSON.parse(response.data.userGrade.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
- if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
- if (response.data.userGrade.gasolineDiscount == "满减优惠") {
- let oilDiscount = 0;
- discount.type = "满减优惠"
- for (let i = 1; i <= gasolineRule.length; i++) {
- // 将满减条件加入等级优惠列表
- if (gasolineRule.length > 1) {
- if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
- discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
- oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
- discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
- break;
- }
- if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
- discount.full = gasolineRule[i - 1].gasolineRule1
- oilDiscount = gasolineRule[i - 1].gasolineRule2
- discount.reduce = gasolineRule[i - 1].gasolineRule2
- }
- } else {
- if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
- discount.full = gasolineRule[i - 1].gasolineRule1
- oilDiscount = gasolineRule[i - 1].gasolineRule2
- discount.reduce = gasolineRule[i - 1].gasolineRule2
- }
- }
- }
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('满减优惠')
- }
- gasolineDiscount += +oilDiscount
- } else if (response.data.userGrade.gasolineDiscount == "每升优惠") {
- discount.type = "每升优惠"
- let oilDiscount = 0;
- for (let i = 1; i <= gasolineRule.length; i++) {
- // 将满减条件加入等级优惠列表
- if (gasolineRule.length > 1) {
- if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
- discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
- oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
- discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
- discount.liters = gasolineRule[i - 1].gasolineRule3
- break;
- }
- if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
- discount.full = gasolineRule[i - 1].gasolineRule1
- oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
- discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
- discount.liters = gasolineRule[i - 1].gasolineRule3
- }
- } else {
- if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
- discount.full = gasolineRule[i - 1].gasolineRule1
- oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
- discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
- discount.liters = gasolineRule[i - 1].gasolineRule3
- }
- }
- }
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('每升优惠')
- }
- gasolineDiscount += +oilDiscount
- } else {
- gasolineDiscount = 0;
- }
- }
-
- }
+ //
+ // if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
+ // _this.oilDiscount = 0
+ // _this.checkAll4 = false
+ // console.log(111)
+ // }else {
+ _this.oilDiscount += discount.discount
+ _this.gradeDiscount.push(discount)
+ _this.checkAll2 = true
+ _this.checkedCities2.push(discount.gunName)
+ // console.log(222)
+ // }
}
}
if (item.type == "柴油") {
@@ -1610,300 +1569,127 @@
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.dieselDiscount == "满减优惠") {
let oilDiscount = 0;
- discount.type = "满减优惠"
for (let i = 1; i <= dieselRule.length; i++) {
// 将满减条件加入等级优惠列表
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
- discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
- discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
- discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = dieselRule[i - 1].dieselRule2
- discount.reduce = dieselRule[i - 1].dieselRule2
}
} else {
- discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = dieselRule[i - 1].dieselRule2
- discount.reduce = dieselRule[i - 1].dieselRule2
}
}
}
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('满减优惠')
- }
dieselDiscount += +oilDiscount
+ discount.discount = dieselDiscount
} else if (response.data.fixingLevel.dieselDiscount == "每升优惠") {
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++) {
- discount.type = "每升优惠"
// 将满减条件加入等级优惠列表
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
- discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
- discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
- discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
- discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
- discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
- discount.liters = dieselRule[i - 1].dieselRule3
}
} else {
- discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
- discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
- discount.liters = dieselRule[i - 1].dieselRule3
}
}
}
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('每升优惠')
- }
dieselDiscount += +oilDiscount
+ discount.discount = dieselDiscount
} else {
dieselDiscount = 0;
}
}
- }else {
- if (response.data.userGrade) {
- let dieselRule = JSON.parse(response.data.userGrade.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
- if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
- if (response.data.userGrade.dieselDiscount == "满减优惠") {
- let oilDiscount = 0;
- discount.type = "满减优惠"
- for (let i = 1; i <= dieselRule.length; i++) {
- // 将满减条件加入等级优惠列表
- if (dieselRule.length > 1) {
- if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
- discount.full = dieselRule[dieselRule.length - 1].dieselRule1
- oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
- discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
- break;
- }
- if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
- discount.full = dieselRule[i - 1].dieselRule1
- oilDiscount = dieselRule[i - 1].dieselRule2
- discount.reduce = dieselRule[i - 1].dieselRule2
- }
- } else {
- discount.full = dieselRule[i - 1].dieselRule1
- if (item.amount >= dieselRule[i - 1].dieselRule1) {
- oilDiscount = dieselRule[i - 1].dieselRule2
- discount.reduce = dieselRule[i - 1].dieselRule2
- }
- }
- }
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('满减优惠')
- }
- dieselDiscount += +oilDiscount
- } else if (response.data.userGrade.dieselDiscount == "每升优惠") {
- let oilDiscount = 0;
- for (let i = 1; i <= dieselRule.length; i++) {
- discount.type = "每升优惠"
- // 将满减条件加入等级优惠列表
- if (dieselRule.length > 1) {
- if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
- discount.full = dieselRule[dieselRule.length - 1].dieselRule1
- oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
- discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
- discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
- break;
- }
- if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
- discount.full = dieselRule[i - 1].dieselRule1
- oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
- discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
- discount.liters = dieselRule[i - 1].dieselRule3
- }
- } else {
- discount.full = dieselRule[i - 1].dieselRule1
- if (item.amount >= dieselRule[i - 1].dieselRule1) {
- oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
- discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
- discount.liters = dieselRule[i - 1].dieselRule3
- }
- }
- }
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('每升优惠')
- }
- dieselDiscount += +oilDiscount
- } else {
- dieselDiscount = 0;
- }
- }
-
- }
+ // if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
+ // _this.oilDiscount = 0
+ // _this.checkAll4 = false
+ // }else {
+ _this.oilDiscount += discount.discount
+ _this.gradeDiscount.push(discount)
+ _this.checkAll2 = true
+ _this.checkedCities2.push(discount.gunName)
+ // }
}
}
if (item.type == "天然气") {
if (response.data.fixingLevel){
_this.isFixingLevel = true
- let naturalGasRule = JSON.parse(response.data.fixingLevel.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
+ let naturalGasRule = JSON.parse(response.data.fixingLevel.naturalGasRule).sort((a, b) => a.naturalGas1 - b.naturalGas1);
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.naturalGasDiscount == "满减优惠") {
let oilDiscount = 0;
- discount.type = "满减优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
// 将满减条件加入等级优惠列表
if (naturalGasRule.length > 1) {
- if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
- discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
- oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
- discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
+ if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGas1) {
+ oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGas2;
break;
}
- if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
- discount.full = naturalGasRule[i - 1].naturalGasRule1
- oilDiscount = naturalGasRule[i - 1].naturalGasRule2
- discount.reduce = naturalGasRule[i - 1].naturalGasRule2
+ if (item.amount >= naturalGasRule[i - 1].naturalGas1 && item.amount < naturalGasRule[i].naturalGas1) {
+ oilDiscount = naturalGasRule[i - 1].naturalGas2
}
} else {
- if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
- discount.full = naturalGasRule[i - 1].naturalGasRule1
- oilDiscount = naturalGasRule[i - 1].naturalGasRule2
- discount.reduce = naturalGasRule[i - 1].naturalGasRule2
+ if (item.amount >= naturalGasRule[i - 1].naturalGas1) {
+ oilDiscount = naturalGasRule[i - 1].naturalGas2
}
}
}
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('满减优惠')
- }
naturalGasDiscount += +oilDiscount
+ discount.discount = naturalGasDiscount
} else if (response.data.fixingLevel.naturalGasDiscount == "每单位优惠") {
let oilDiscount = 0;
- discount.type = "每单位优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
// 将满减条件加入等级优惠列表
if (naturalGasRule.length > 1) {
- if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
- discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
- oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
- discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
- discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
+ if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGas1) {
+ oilDiscount = (item.liters * naturalGasRule[naturalGasRule.length - 1].naturalGas3).toFixed(2)
break;
}
- if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
- discount.full = naturalGasRule[i - 1].naturalGasRule1
- oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
- discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
- discount.liters = naturalGasRule[i - 1].naturalGasRule3
+ if (item.amount >= naturalGasRule[i - 1].naturalGas1 && item.amount < naturalGasRule[i].naturalGas1) {
+ oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGas3).toFixed(2)
}
} else {
- if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
- discount.full = naturalGasRule[i - 1].naturalGasRule1
- oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
- discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
- discount.liters = naturalGasRule[i - 1].naturalGasRule3
+ if (item.amount >= naturalGasRule[i - 1].naturalGas1) {
+ oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGas3).toFixed(2)
}
}
}
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('每单位优惠')
- }
naturalGasDiscount += +oilDiscount
+ discount.discount = naturalGasDiscount
} else {
naturalGasDiscount = 0;
}
}
- }else {
- if (response.data.userGrade.userGrade) {
- let naturalGasRule = JSON.parse(response.data.userGrade.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
- if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
- if (response.data.userGrade.naturalGasDiscount == "满减优惠") {
- let oilDiscount = 0;
- discount.type = "满减优惠"
- for (let i = 1; i <= naturalGasRule.length; i++) {
- // 将满减条件加入等级优惠列表
- if (naturalGasRule.length > 1) {
- if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
- discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
- oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
- discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
- break;
- }
- if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
- discount.full = naturalGasRule[i - 1].naturalGasRule1
- oilDiscount = naturalGasRule[i - 1].naturalGasRule2
- discount.reduce = naturalGasRule[i - 1].naturalGasRule2
- }
- } else {
- if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
- discount.full = naturalGasRule[i - 1].naturalGasRule1
- oilDiscount = naturalGasRule[i - 1].naturalGasRule2
- discount.reduce = naturalGasRule[i - 1].naturalGasRule2
- }
- }
- }
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('满减优惠')
- }
- naturalGasDiscount += +oilDiscount
- } else if (response.data.userGrade.naturalGasDiscount == "每单位优惠") {
- let oilDiscount = 0;
- discount.type = "每单位优惠"
- for (let i = 1; i <= naturalGasRule.length; i++) {
- // 将满减条件加入等级优惠列表
- if (naturalGasRule.length > 1) {
- if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
- discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
- oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
- discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
- discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
- break;
- }
- if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
- discount.full = naturalGasRule[i - 1].naturalGasRule1
- oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
- discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
- discount.liters = naturalGasRule[i - 1].naturalGasRule3
- }
- } else {
- if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
- discount.full = naturalGasRule[i - 1].naturalGasRule1
- oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
- discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
- discount.liters = naturalGasRule[i - 1].naturalGasRule3
- }
- }
- }
- if (discount.reduce != 0) {
- _this.gradeDiscount.push(discount)
- _this.checkedCities2.push('每单位优惠')
- }
- naturalGasDiscount += +oilDiscount
- } else {
- naturalGasDiscount = 0;
- }
- }
-
- }
+ // if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
+ // _this.oilDiscount = 0
+ // _this.checkAll4 = false
+ // }else {
+ _this.oilDiscount += discount.discount
+ _this.gradeDiscount.push(discount)
+ _this.checkAll2 = true
+ _this.checkedCities2.push(discount.gunName)
+ // }
}
+
}
})
}
- _this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
- _this.checkAll2 = true;
- _this.isDefaultUseCard();
+ // _this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
+ // _this.checkAll2 = true;
+ // _this.isDefaultUseCard();
})
},
// 选择会员
@@ -1931,7 +1717,10 @@
if (this.balance>0){
this.checkAll4 = true
}
- await this.getOilCoupon()
+ await this.getGrade(this.member.id,this.member.gradeId)
+ if (!this.isFixingLevel){
+ await this.getOilCoupon()
+ }
},
getOilCoupon(){
let type = 0;
@@ -1971,7 +1760,7 @@
if(!this.isOilStorageCard) {
_this.oilDiscount += res.data.memberFavorableAmount
_this.checkAll2 = true
- this.checkedCities2.push(discount.oilName)
+ this.checkedCities2.push(discount.gunName)
}
}
if (res.data.cardFavorableAmount){
@@ -1990,7 +1779,7 @@
if(!this.isOilStorageCard) {
_this.fullReduction += res.data.activeFavorableAmount
_this.checkAll1 = true
- this.checkedCities1.push(discount.oilName)
+ this.checkedCities1.push(discount.gunName)
}
}
// }
@@ -2392,7 +2181,7 @@
}
// 校验油罐内油是否足够
- await getOilTank(this.form.tankId).then(res => {
+ await getOilTank(this.form.tankId).then(async res => {
if (res.data.storedQuantity-this.form.liters<0){
this.$modal.msgError("所加油的升数大于油罐内的升数,请重新选择加油升数")
return;
@@ -2425,7 +2214,10 @@
if (this.balance>0){
this.checkAll4 = true
}
- this.getOilCoupon()
+ await this.getGrade(this.member.id,this.member.gradeId)
+ if (!this.isFixingLevel){
+ await this.getOilCoupon()
+ }
}
}
})
@@ -2672,6 +2464,7 @@
_this.oilPreferentialData[i].oilPreferential.cardFavorableId = _this.cardFavorableId
usePaymentActive(_this.oilPreferentialData[i].oilPreferential).then(res => {})
}
+ _this.printLocally()
return;
}
}
@@ -2682,6 +2475,7 @@
_this.seekZero = 0
_this.amount = 0
_this.resetting1()
+ _this.printLocally()
return;
}
}
@@ -2801,6 +2595,7 @@
_this.isQuery = false;
_this.amount = 0
+ _this.printLocally()
_this.loading = false;
if (response.data.oilOrderAmount>0){
for (let i =0;i<_this.oilPreferentialData.length;i++){
@@ -3276,6 +3071,14 @@
/*color: white;*/
}
+ .box-center{
+ width: 100%;
+ //height: 10px;
+ background-color: white;
+ margin: 10px auto;
+ box-sizing: border-box;
+ overflow: auto;
+ }
.center-left-bottom{
width: 100%;
background-color: white;
@@ -3315,6 +3118,20 @@
margin: 15px 10px ;
}
+ .input-box{
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ margin: 5px 0px;
+ }
+ .box-title{
+ font-size: 18px;
+ text-align: center;
+ align-items: center;
+ margin-top: 15px;
+ }
.bottom-price{
font-size: 26px;
font-weight: bold;
diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue
index 3045d2098..f056ddb7c 100644
--- a/gasStation-uni/pages/index/index.vue
+++ b/gasStation-uni/pages/index/index.vue
@@ -86,9 +86,9 @@
{{store.name}}{{store.description ? "("+store.description+")" : ""}}
-
+
@@ -184,7 +184,8 @@ import { callWithErrorHandling } from "vue"
},
onLoad(query) {
if (query.storeId) {
- uni.setStorageSync("y_storeId", query.storeId)
+ // uni.setStorageSync("y_storeId", query.storeId)
+ uni.setStorageSync("storeId", query.storeId)
}
if (query.type) {
uni.setStorageSync("y_type", query.type)
@@ -216,9 +217,6 @@ import { callWithErrorHandling } from "vue"
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
- uni.showLoading({
- title: uni.getStorageSync("storeId") + "++" + uni.getStorageSync("inviteStaffId") + q
- })
this.getUserAuthority();
this.getOilType();
} else {
@@ -404,9 +402,7 @@ import { callWithErrorHandling } from "vue"
})
}
}).catch((res) => {
- uni.showLoading({
- title: res + "---" + 1
- })
+
})
},
// 获取当前位置
@@ -440,6 +436,7 @@ import { callWithErrorHandling } from "vue"
uni.setStorageSync("storeId", response.data.store.id)
uni.setStorageSync("chainStoreId", response.data.store
.chainStoreId)
+ console.log(uni.getStorageSync("chainStoreId"));
let welfare = response.data.store.welfare
if (welfare) {
if (welfare.includes(",")) {
diff --git a/gasStation-uni/pagesLogin/login/login.vue b/gasStation-uni/pagesLogin/login/login.vue
index 0380fcd65..5ba0aa001 100644
--- a/gasStation-uni/pagesLogin/login/login.vue
+++ b/gasStation-uni/pagesLogin/login/login.vue
@@ -86,13 +86,13 @@
method: 'post',
data: {
authCode: authCode,
- storeId: 0,
+ storeId: uni.getStorageSync("storeId"),
staffId: "",
phone: "18457621459",
encryptedData: encryptedData,
},
}).then((resp) => {
- console.log(resp)
+ // console.log(resp)
if (resp.code == 200) {
uni.setStorageSync('App-Token', resp.data.token);
@@ -210,7 +210,8 @@
url: "clientApi/sign/alipayLogin/getUserid",
method: 'post',
data: {
- storeId: uni.getStorageSync("y_storeId"),
+ storeId: uni.getStorageSync("storeId"),
+ // storeId: uni.getStorageSync("y_storeId"),
type: uni.getStorageSync("y_type"),
userId: uni.getStorageSync("y_userId"),
},
diff --git a/gasStation-uni/pagesMy/comment/comment.vue b/gasStation-uni/pagesMy/comment/comment.vue
index 2f850f8ec..d7b0b2159 100644
--- a/gasStation-uni/pagesMy/comment/comment.vue
+++ b/gasStation-uni/pagesMy/comment/comment.vue
@@ -13,20 +13,21 @@
您对工作人员满意吗
-
+
+
- username(13583017106)
+ {{user.name?user.name:"未填写"}}({{user.mobile}})
-
+
@@ -38,13 +39,14 @@