This commit is contained in:
cun-nan 2024-01-24 14:35:00 +08:00
parent cf631ad033
commit 819624e4e8
12 changed files with 320 additions and 607 deletions

View File

@ -294,11 +294,11 @@
<dict-tag :options="dict.type.yes_or_no" :value="scope.row.growthValueRule"/>
</template>
</el-table-column>
<el-table-column label="优惠券" align="center" prop="couponRule">
<template slot-scope="scope">
<dict-tag :options="dict.type.yes_or_no" :value="scope.row.couponRule"/>
</template>
</el-table-column>
<!-- <el-table-column label="优惠券" align="center" prop="couponRule">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.yes_or_no" :value="scope.row.couponRule"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="储值优惠" align="center" prop="storeValue">
<template slot-scope="scope">
<dict-tag :options="dict.type.yes_or_no" :value="scope.row.storeValue"/>
@ -745,21 +745,21 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="优惠券参与" prop="couponRule">
<el-radio-group v-model="form.couponRule">
<el-radio label="yes">参与</el-radio>
<el-radio label="no">不参与</el-radio>
</el-radio-group>
<div>
<div style="color: grey;font-size: 12px;height: 18px">
如用户有优惠券,消费是否可以直接使用优惠券抵用优惠设置不参与用户消费无法使用优惠券
</div>
</div>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="优惠券参与" prop="couponRule">-->
<!-- <el-radio-group v-model="form.couponRule">-->
<!-- <el-radio label="yes">参与</el-radio>-->
<!-- <el-radio label="no">不参与</el-radio>-->
<!-- </el-radio-group>-->
<!-- <div>-->
<!-- <div style="color: grey;font-size: 12px;height: 18px">-->
<!-- 如用户有优惠券,消费是否可以直接使用优惠券抵用优惠设置不参与用户消费无法使用优惠券-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="24">
<el-form-item label="储值优惠参与" prop="storeValue">
@ -1167,6 +1167,15 @@ export default {
this.form = response.data;
this.open = true;
this.title = "编辑固定等级类型";
if (response.data.gasolineRule){
this.gasolinePreferential = JSON.parse(response.data.gasolineRule)
}
if (response.data.dieselRule){
this.dieselPreferential = JSON.parse(response.data.dieselRule)
}
if (response.data.naturalGasRule){
this.naturalGasPreferential = JSON.parse(response.data.naturalGasRule)
}
});
},
//
@ -1208,22 +1217,30 @@ export default {
this.form.naturalGasRule = JSON.stringify(this.naturalGasPreferential)
if (this.form.id) {
updateFixingLevel(this.form).then(response => {
this.$modal.msgSuccess("认证类型更新成功");
this.open = false;
this.getList();
if (response.data==1){
this.$modal.msgSuccess("认证类型更新成功");
this.open = false;
this.getList();
}else {
this.$modal.msgError("认证类型失败,固定等级名称不可重复");
}
});
} else {
queryFixingLevel({name:this.form.name}).then( response => {
if(response.data!=null){
this.$modal.msgError("固定等级名称不可重复");
}else {
// queryFixingLevel({name:this.form.name}).then( response => {
// if(response.data!=null){
// this.$modal.msgError("");
// }else {
addFixingLevel(this.form).then(response => {
this.$modal.msgSuccess("认证类型创建成功");
this.open = false;
this.getList();
if (response.data==1) {
this.$modal.msgSuccess("认证类型创建成功");
this.open = false;
this.getList();
}else {
this.$modal.msgError("固定等级名称不可重复");
}
});
}
})
// }
// })
}
}
});

View File

@ -264,4 +264,14 @@ public class OilOrderController extends BaseController {
String orderNo = map.get("orderNo");
return getSuccessResult(orderService.selectOilOrderDescByOrderNo(orderNo));
}
/**
* 根据订单id查询油品订单信息小程序
* @param id
* @return
*/
@GetMapping("oilOrderId/{id}")
public ResponseObject getOilOrderInfo(@PathVariable Integer id){
return getSuccessResult(orderService.selectOilOrderDescByOrderId(id));
}
}

View File

@ -114,4 +114,11 @@ public interface OilOrderMapper extends BaseMapper<OilOrder> {
Map<String, String> orderStatistics( @Param("order") OilOrder order);
OilOrderVo selectOilOrderDescByOrderNo(@Param("orderNo") String orderNo);
/**
* 根据订单id查询订单详情信息
* @param orderId
* @return
*/
OilOrderVo selectOilOrderDescByOrderId(@Param("orderId") Integer orderId);
}

View File

@ -66,6 +66,7 @@
<include refid="selectOrders"></include>
<where>
user_id = #{order.userId}
and terminal = 'applet'
<if test="order.storeId != null and order.storeId != ''">
and store_id = #{order.storeId}
</if>
@ -529,4 +530,15 @@
od.order_no = #{orderNo}
</where>
</select>
<select id="selectOilOrderDescByOrderId" resultType="com.fuint.business.order.vo.OilOrderVo"
parameterType="java.lang.Integer">
select od.*,ona.oil_name,og.gun_name,sta.real_name,sto.name storeName,sto.description from oil_order od
left join oil_name ona on od.oils = ona.id
left join oil_gun og on od.oil_gun_num = og.id
left join mt_staff sta on od.staff_id = sta.id
left join mt_store sto on od.store_id = sto.id
<where>
od.id = #{orderId}
</where>
</select>
</mapper>

View File

@ -144,6 +144,17 @@ public interface OilOrderService extends IService<OilOrder> {
*/
Map<String, String> orderStatistics(OilOrder order);
/**
* 根据订单号查询订单详情信息
* @param orderNo
* @return
*/
OilOrderVo selectOilOrderDescByOrderNo(String orderNo);
/**
* 根据订单id查询订单详情信息
* @param orderId
* @return
*/
OilOrderVo selectOilOrderDescByOrderId(Integer orderId);
}

View File

@ -385,7 +385,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (payType.equals("CASH")){
cashierOrder.setPayAmount(Double.valueOf(map.get("authCode")));
cashierOrder.setPayTime(new Date());
this.insertAllOrderInfo(orderNo,storeId,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
this.insertAllOrderInfo(orderNo,storeId,oilAmount+goodsAmount,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
}else {
cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
}
@ -697,7 +697,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setSeekZero(0.0);
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, map.get("payType"), userId, "PC", "1", status);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, map.get("payType"), userId, "PC", "1", status);
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"1",orderNo);
res.put("success","success");
}
@ -762,7 +762,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,oilAmount,map.get("payType"),userId,"PC","1","paid");
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"1",orderNo);
// this.insertCardBalance(oilAmount,userId,storeId);
res.put("success","success");
@ -780,7 +780,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
/**
* 添加所有订单信息
*/
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,String payType,Integer userId,String payChannel,String type,String status){
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,Double payAmount,String payType,Integer userId,String payChannel,String type,String status){
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(orderNo);
allOrderInfo.setType(type);
@ -791,7 +791,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
allOrderInfo.setPayChannel(payChannel);
allOrderInfo.setStatus(status);
if (status.equals("paid")){
allOrderInfo.setPayMoney(goodsMoney);
allOrderInfo.setPayMoney(payAmount);
allOrderInfo.setPayTime(new Date());
}
if (type.equals("1")){
@ -914,7 +914,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrder.setOrderStatus("unpaid");
oilOrder.setOrderType("主订单");
oilOrder.setInvoicing("未开票");
oilOrder.setRemark("未评价");
oilOrder.setUserId(nowAccountInfo.getId());
// 判断当前店铺是否存在此用户的会员信息没有的话进行添加
LJStore store = storeService.selectStoreByStoreId(oilOrder.getStoreId());
@ -926,22 +925,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
LJUserVo userVo = userService.selectUserById(oilOrder.getUserId(),oilOrder.getStoreId());
oilOrder.setPayUser(userVo.getMobile());
baseMapper.insert(oilOrder);
// 添加收银台订单信息
CashierOrder cashierOrder = new CashierOrder();
cashierOrder.setStaffId(oilOrder.getStaffId());
cashierOrder.setStoreId(oilOrder.getStoreId());
cashierOrder.setPayUser(oilOrder.getPayUser());
cashierOrder.setAmount(oilOrder.getOrderAmount());
cashierOrder.setPayAmount(oilOrder.getPayAmount());
cashierOrder.setStatus("unpaid");
cashierOrder.setOrderNo(orderNo);
cashierOrder.setOilOrderAmount(oilOrder.getOrderAmount());
cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
cashierOrder.setTerminal(oilOrder.getTerminal());
cashierOrder.setSeekZero(0.0);
cashierOrder.setPayType(oilOrder.getPayType());
cashierOrderService.insertCashierOrder(cashierOrder);
return orderNo;
}
@ -982,7 +965,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (ObjectUtil.isEmpty(storedQuantity) || storedQuantity - oilOrder.getOilNum() <=0){
// throw new RuntimeException("油罐容量不足!");
applet.put("error","油罐容量不足!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
// this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
if (isUseChildCard.equals("true")){
@ -992,7 +975,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
userId = userVo.getId();
if (!isUseChild.equals("yes")){
applet.put("error","不可使用子卡消费!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0, oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
}
@ -1003,7 +986,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (balanceAmount.equals("0") && map.get("payAmount").equals("0")) {
if (Double.compare(oilCardLiters,oilOrder.getOilNum())!=0){
applet.put("error","囤油卡消费升数不对!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0, oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
}else {
@ -1011,7 +994,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Double residueAmount = useLiters * oilNumber.getOilPrice();
if ((Double.valueOf(map.get("payAmount"))+Double.valueOf(balanceAmount)-residueAmount)>=0.05){
applet.put("error","消费总金额不对!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0, oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
}
@ -1021,7 +1004,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Double realAmount = Double.valueOf(map.get("payAmount")) + Double.valueOf(balanceAmount) + Double.valueOf(map.get("discountAmount"));
if (Double.compare(realAmount,oilOrder.getOrderAmount())!=0){
applet.put("error","消费总金额不对!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0, oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
}
@ -1038,7 +1021,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
// 判断是否需要调起支付
if (!map.get("payAmount").equals("0")) {
if (!map.get("payAmount").equals("0") && !map.get("payAmount").equals("0.0") && !map.get("payAmount").equals("0.00")) {
// 调用支付接口
// 判断是否开启支付规则
// List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
@ -1080,6 +1063,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
this.updateGrowthValue(oilOrder.getOrderAmount(),payAmount,userId, Integer.valueOf(oilOrder.getOils()),oilCardAmount,oilOrder.getStoreId(),orderNo);
this.addOilTracks(oilOrder,oilOrder.getStoreId());
this.insertCardOrder(oilOrder.getUserId(),oilOrder.getStoreId(),orderNo,oilOrder.getOrderAmount(),"paid", Double.valueOf(balanceAmount),payAmount);
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),payAmount,oilOrder.getPayType(),oilOrder.getUserId(),"applet","1","paid");
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getOrderAmount(),oilOrder.getOilNum(),"1",orderNo);
oilOrder.setPayAmount(payAmount);
oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
@ -1152,17 +1136,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
this.updateGrowthValue(oilOrder.getOrderAmount(),oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
this.addOilTracks(oilOrder,oilOrder.getStoreId());
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"1",orderNo);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
if (ObjectUtil.isNotEmpty(cashierOrder)){
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrder.setPayTime(new Date());
cashierOrder.setStatus("paid");
cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
cashierOrder.setPayAmount(oilOrder.getPayAmount());
cashierOrder.setSeekZero(0.0);
cashierOrderService.updateCashierOrder(cashierOrder);
}
}
row = baseMapper.updateById(oilOrder);
}
@ -1638,4 +1611,9 @@ return stringDoubleMap;
public OilOrderVo selectOilOrderDescByOrderNo(String orderNo) {
return baseMapper.selectOilOrderDescByOrderNo(orderNo);
}
@Override
public OilOrderVo selectOilOrderDescByOrderId(Integer orderId) {
return baseMapper.selectOilOrderDescByOrderId(orderId);
}
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -77,7 +78,9 @@ public class FixingLevelServiceImpl extends ServiceImpl<FixingLevelMapper, Fixin
*/
@Override
public FixingLevel selectFixingLevelByName(String name) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
queryWrapper.eq("name",name);
FixingLevel fixingLevel = baseMapper.selectOne(queryWrapper);
return fixingLevel;
@ -100,10 +103,16 @@ public class FixingLevelServiceImpl extends ServiceImpl<FixingLevelMapper, Fixin
*/
@Override
public int insertFixingLevel(FixingLevel fixingLevel) {
int row = 0;
FixingLevel fixingLevel1 = this.selectFixingLevelByName(fixingLevel.getName());
if (ObjectUtil.isNotEmpty(fixingLevel1)){
row = 0;
return row;
}
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
fixingLevel.setStoreId(storeId);
int row = baseMapper.insert(fixingLevel);
row = baseMapper.insert(fixingLevel);
return row;
}
@ -114,7 +123,15 @@ public class FixingLevelServiceImpl extends ServiceImpl<FixingLevelMapper, Fixin
*/
@Override
public int updateFixingLevel(FixingLevel fixingLevel) {
int row = baseMapper.updateById(fixingLevel);
int row = 0;
List<FixingLevel> fixingLevels = this.selectFixingLevels();
for (FixingLevel level : fixingLevels) {
if (level.getName().equals(fixingLevel.getName()) && level.getId()!=fixingLevel.getId()){
row = 0;
return row;
}
}
row = baseMapper.updateById(fixingLevel);
return row;
}
}

View File

@ -752,6 +752,7 @@
</span>
</el-dialog>
<!-- 支付成功后小票打印内容-->
<div id="reportSuccess" ref="report" class="box-center" v-show="false">
<div class="box-title">订单统计</div>
<div class="box-ge">
@ -1064,6 +1065,8 @@
isExistOilOrder:false,
//
isFixingLevel:false,
//
isFixingBalance:false,
//
preferentialData:{
userId:"",
@ -1358,7 +1361,9 @@
this.countAmountFull();
this.isUseBalance = false;
}
this.getOilCoupon()
if (!this.isFixingLevel){
this.getOilCoupon()
}
},
handleCheckAllChange5(val) {
if (val){
@ -1493,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
@ -1501,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 == "柴油") {
@ -1649,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();
})
},
//
@ -1970,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;
@ -2010,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){
@ -2029,7 +1779,7 @@
if(!this.isOilStorageCard) {
_this.fullReduction += res.data.activeFavorableAmount
_this.checkAll1 = true
this.checkedCities1.push(discount.oilName)
this.checkedCities1.push(discount.gunName)
}
}
// }
@ -2431,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;
@ -2464,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()
}
}
}
})

View File

@ -23,11 +23,11 @@
</view>
</view>
</view>
<view class="wrap-box">
<!-- <view class="wrap-box">
<view class="w-box" v-for="(item,index) in textlist" :key="index" @click="textindex">
{{item.text || "下次还来"}}
</view>
</view>
</view> -->
<u--textarea v-model="value1" placeholder="请输入内容"></u--textarea>
</view>
<view class="anniu">
@ -45,7 +45,7 @@
return {
title: '',
description: '您的宝贵建议,就是我们前进的动力~动动手指,帮助我们做得更好~~',
count: 10,
count: 5,
value: 0,
value1: '',
textlist: [{

View File

@ -9,49 +9,58 @@
</view>
<!-- 顶部区域 -->
<view class="top-size">
<view style="font-weight: bold;margin-bottom: 5px;">已支付订单</view>
<view class="">如果有疑问请向客户进行资讯</view>
<!-- <view style="font-weight: bold;margin-bottom: 5px;">已支付订单</view> -->
<view style="font-weight: bold;margin-bottom: 5px;" v-if="oilOrder.orderStatus=='paid'">已支付订单</view>
<view style="font-weight: bold;margin-bottom: 5px;" v-else-if="oilOrder.orderStatus=='payFail'">支付失败订单</view>
<view style="font-weight: bold;margin-bottom: 5px;" v-else-if="oilOrder.orderStatus=='refund'">已退款订单</view>
<view style="font-weight: bold;margin-bottom: 5px;" v-else-if="oilOrder.orderStatus=='refunding'">退款中订单</view>
<view style="font-weight: bold;margin-bottom: 5px;" v-else>未支付订单</view>
<view class="">如果有疑问请向商家进行咨询</view>
</view>
<view class="centen-box">
<view class="box-title">订单信息</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">92#/1号枪</view>
<view class="hui-size">油站名称</view>
<view class="">{{oilOrder.storeName}}{{oilOrder.description ? "("+oilOrder.description+")" : ""}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">加油员工</view>
<view class="">{{oilOrder.realName}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">92#/1号枪</view>
<view class="">{{oilOrder.oilName}}/{{oilOrder.gunName}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">92#/1号枪</view>
</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">92#/1号枪</view>
<view class="hui-size">油品单价</view>
<view class="">{{oilPrice}}/L</view>
</view>
<view class="box-title">加油信息</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">92#/1号枪</view>
<view class="hui-size">加油金额</view>
<view class="">{{oilOrder.orderAmount}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">92#/1号枪</view>
</view>
<view class="box-title">优惠信息</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">92#/1号枪</view>
<view class="hui-size">实付金额</view>
<view class="">{{oilOrder.payAmount}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">92#/1号枪</view>
<view class="hui-size">储值卡或囤油卡消费金额</view>
<view class="">{{oilOrder.orderAmount - oilOrder.discountAmount - oilOrder.payAmount}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">加油数量</view>
<view class="">{{oilOrder.oilNum}}</view>
</view>
<!-- <view class="box-title">优惠信息</view> -->
<view class="dis-fx" v-if="oilOrder.discountAmount>0">
<view class="hui-size">优惠金额</view>
<view class="">{{oilOrder.discountAmount}}</view>
</view>
</view>
<view class="anniu" @click="gocomment()">
<text>评价有礼</text>
<view class="anniu" v-if="oilOrder.orderStatus=='paid' && oilOrder.remark" @click="gocomment()">
<text>评价</text>
</view>
@ -60,21 +69,50 @@
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
title: '',
orderId:"",
oilOrder:{},
oilPrice:"",
}
},
onLoad(e) {
this.orderId = e.orderId
this.getOilOrder()
},
components: {
},
methods: {
//
getOilOrder() {
request({
url: "business/oilOrder/oilOrderId/" + this.orderId,
method: 'get',
}).then((res) => {
if(res.data){
this.oilOrder = res.data
this.getOilNumber(res.data.storeId)
}
})
},
//
getOilNumber(storeId) {
let _this = this;
request({
url: "business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId,
method: 'get',
}).then((res) => {
res.data.forEach(item => {
if (item.oilName == _this.oilOrder.oils) {
_this.oilPrice = item.oilPrice;
}
})
})
},
gocomment() {
uni.navigateTo({
url: '/pagesMy/comment/comment'

View File

@ -28,7 +28,7 @@
@scrolltolower="scrolltolower">
<!-- 油品订单列表 -->
<view class="box-order" v-for="(item,index) in list" :key="index">
<view class="or-box-top" @click="goOrderInfo">
<view class="or-box-top" @click="goOrderInfo(item.id)">
<view class="">{{getStoreName(storeList,item.storeId)}}</view>
<!-- <view class="chengg">{{getPayName(payList,item.orderStatus)}}</view> -->
<view class="chengg" v-if="item.orderStatus=='paid'">已支付</view>
@ -42,22 +42,22 @@
<view class="huis">订单类型</view>
<view class="">油品订单</view>
</view> -->
<view class="but-box" @click="goOrderInfo">
<view class="but-box" @click="goOrderInfo(item.id)">
<view class="huis">订单金额</view>
<view class="">{{item.orderAmount}}</view>
</view>
<view class="but-box" @click="goOrderInfo">
<view class="but-box" @click="goOrderInfo(item.id)">
<view class="huis">优惠合计</view>
<view class="reds">{{item.discountAmount}}</view>
</view>
<view class="but-box" @click="goOrderInfo">
<view class="but-box" @click="goOrderInfo(item.id)">
<view class="huis">订单时间</view>
<view class="" v-if="item.orderStatus=='paid'">{{parseTime(item.payTime)}}</view>
<view class="" v-else>{{item.createTime}}</view>
</view>
<view v-if="item.orderStatus=='paid'" class="end-box" @click="goComment()">
<view v-if="item.orderStatus=='paid' && item.remark" class="end-box" @click="goComment()">
<view class="anniu">
<text>评价有礼</text>
<text>评价</text>
</view>
</view>
<view v-else-if="item.orderStatus=='unpaid'" class="end-box" @click="goPayment(item.orderNo)">
@ -391,7 +391,7 @@
pageSize: 10,
storeId: "",
orderStatus: "paid",
remark: "",
remark: "1",
payType:uni.getStorageSync("appltType")
}
this.getMyOrder()

View File

@ -98,7 +98,7 @@
</view>
</view>
<view class="desc" v-if="preferentialData.memberFavorableAmount">
<view class="desc" v-if="gradeRedece>0">
<view style="display: flex;">
会员等级优惠
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
@ -246,11 +246,13 @@
memberFavorableAmount: "",
type: "",
},
//
isFixingLevel:false,
}
},
onLoad(e) {
this.orderNo = e.orderNo
// this.orderNo = "23452024012011401299130f"
// this.orderNo = "234520240124103747dec173"
},
onShow() {
this.getOilOrder();
@ -279,7 +281,9 @@
};
}else{
this.oilCardRedece = 0
this.getPaymentPreferential(this.user.gradeId)
if (!this.isFixingLevel){
this.getPaymentPreferential(this.user.gradeId)
}
}
},
@ -320,7 +324,7 @@
title:res.data.error,
icon:"none"
})
_this.goBack()
// _this.goBack()
return;
}
if(res.data.success == "ok"){
@ -462,7 +466,9 @@
// this.chooseGrade(this.user.id,this.user.gradeId)
}
if (this.oilCardRedece==0){
this.getPaymentPreferential(this.user.gradeId)
if (!this.isFixingLevel){
this.getPaymentPreferential(this.user.gradeId)
}
}
},
// 使
@ -518,18 +524,18 @@
if (res.data.fixingLevel.gasolineDiscount == "满减优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
if (that.oilOrder.orderAmount >= gasolineRule[i - 1].gasolineRule1 && that.oilOrder.orderAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
}
@ -538,20 +544,20 @@
if (res.data.fixingLevel.gasolineDiscount == "每升优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
if (that.oilOrder.orderAmount >= gasolineRule[i - 1].gasolineRule1 && that.oilOrder.orderAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
@ -563,18 +569,18 @@
if (res.data.fixingLevel.dieselDiscount == "满减优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
if (that.oilOrder.orderAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
if (that.oilOrder.orderAmount >= dieselRule[i - 1].dieselRule1 && that.oilOrder.orderAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = dieselRule[i - 1].dieselRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
if (that.oilOrder.orderAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
}
@ -583,20 +589,20 @@
if (res.data.fixingLevel.dieselDiscount == "每升优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
if (that.oilOrder.orderAmount >= dieselRule[dieselRule.length-1].dieselRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
if (that.oilOrder.orderAmount >= dieselRule[i - 1].dieselRule1 && that.oilOrder.orderAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
if (that.oilOrder.orderAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
@ -608,18 +614,18 @@
if (res.data.fixingLevel.naturalGasDiscount == "满减优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
if (that.oilOrder.orderAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
if (that.oilOrder.orderAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.oilOrder.orderAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
if (that.oilOrder.orderAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
}
@ -628,172 +634,32 @@
if (res.data.fixingLevel.naturalGasDiscount == "每升优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
if (that.oilOrder.orderAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
if (that.oilOrder.orderAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.oilOrder.orderAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
if (that.oilOrder.orderAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
}
}else{
if(res.data.userGrade){
that.userGrade = res.data.userGrade
that.chooseFullOrCoupon();
if (res.data.userGrade.preferential== "自定义优惠"){
if (that.oilType == "汽油"){
//
let gasolineRule = JSON.parse(res.data.userGrade.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
if (res.data.userGrade.gasolineDiscount == "满减优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
that.isGradePreferential = true
}
}
}
if (res.data.userGrade.gasolineDiscount == "每升优惠"){
if (gasolineRule.length > 1){
for (let i = 1; i<gasolineRule.length; i++){
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
if (that.oilType == "柴油"){
//
let dieselRule = JSON.parse(res.data.userGrade.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
if (res.data.userGrade.dieselDiscount == "满减优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = dieselRule[i - 1].dieselRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
that.isGradePreferential = true
}
}
}
if (res.data.userGrade.dieselDiscount == "每升优惠"){
if (dieselRule.length > 1){
for (let i = 1; i<dieselRule.length; i++){
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
if (that.oilType == "天然气"){
//
let naturalGasRule = JSON.parse(res.data.userGrade.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
if (res.data.userGrade.naturalGasDiscount == "满减优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
that.isGradePreferential = true
}
}
}
if (res.data.userGrade.naturalGasDiscount == "每升优惠"){
if (naturalGasRule.length > 1){
for (let i = 1; i<naturalGasRule.length; i++){
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
//
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
break;
}
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}else{
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
that.isGradePreferential = true
}
}
}
}
}
}
that.isFixingLevel = true
// if (res.data.fixingLevel.storeValue=="no" && that.balanceRedece>0){
// that.gradeRedece = 0
// }
}
that.countPayMent()
}
})
},
@ -841,7 +707,7 @@
},
// id
getUser(id){
async getUser(id){
let _this = this;
request({
url: "business/userManager/user/storeUser",
@ -855,14 +721,18 @@
}
_this.user = res.data.userVo;
_this.user = res.data.userVo;
_this.chooseGrade(_this.user.id,_this.user.gradeId);
if (res.data.userVo.refuelMoney && res.data.userVo.refuelMoney!='null'){
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
_this.chooseRefuelMoney()
}else{
_this.chooseCardBalance(0)
_this.getPaymentPreferential(this.user.gradeId)
if (!this.isFixingLevel){
_this.getPaymentPreferential(this.user.gradeId)
}
}
console.log("afterGrade");
// _this.chooseGrade(res.data.userVo.id,res.data.userVo.gradeId)
})
},
@ -962,7 +832,7 @@
}).then((res) => {
res.data.forEach(item => {
if (item.oilName == _this.oilOrder.oils) {
_this.oilPrice = item.gbPrice;
_this.oilPrice = item.oilPrice;
_this.oilName = item.oilNames;
_this.oilNameId = item.oilName;
_this.oilType = item.oilType;