bug
This commit is contained in:
parent
cf631ad033
commit
819624e4e8
@ -294,11 +294,11 @@
|
|||||||
<dict-tag :options="dict.type.yes_or_no" :value="scope.row.growthValueRule"/>
|
<dict-tag :options="dict.type.yes_or_no" :value="scope.row.growthValueRule"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="优惠券" align="center" prop="couponRule">
|
<!-- <el-table-column label="优惠券" align="center" prop="couponRule">-->
|
||||||
<template slot-scope="scope">
|
<!-- <template slot-scope="scope">-->
|
||||||
<dict-tag :options="dict.type.yes_or_no" :value="scope.row.couponRule"/>
|
<!-- <dict-tag :options="dict.type.yes_or_no" :value="scope.row.couponRule"/>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</el-table-column>
|
<!-- </el-table-column>-->
|
||||||
<el-table-column label="储值优惠" align="center" prop="storeValue">
|
<el-table-column label="储值优惠" align="center" prop="storeValue">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.yes_or_no" :value="scope.row.storeValue"/>
|
<dict-tag :options="dict.type.yes_or_no" :value="scope.row.storeValue"/>
|
||||||
@ -745,21 +745,21 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<!-- <el-row>-->
|
||||||
<el-col :span="24">
|
<!-- <el-col :span="24">-->
|
||||||
<el-form-item label="优惠券参与" prop="couponRule">
|
<!-- <el-form-item label="优惠券参与" prop="couponRule">-->
|
||||||
<el-radio-group v-model="form.couponRule">
|
<!-- <el-radio-group v-model="form.couponRule">-->
|
||||||
<el-radio label="yes">参与</el-radio>
|
<!-- <el-radio label="yes">参与</el-radio>-->
|
||||||
<el-radio label="no">不参与</el-radio>
|
<!-- <el-radio label="no">不参与</el-radio>-->
|
||||||
</el-radio-group>
|
<!-- </el-radio-group>-->
|
||||||
<div>
|
<!-- <div>-->
|
||||||
<div style="color: grey;font-size: 12px;height: 18px">
|
<!-- <div style="color: grey;font-size: 12px;height: 18px">-->
|
||||||
如用户有优惠券,消费是否可以直接使用优惠券抵用优惠、设置不参与、用户消费无法使用优惠券
|
<!-- 如用户有优惠券,消费是否可以直接使用优惠券抵用优惠、设置不参与、用户消费无法使用优惠券-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
</el-row>
|
<!-- </el-row>-->
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="储值优惠参与" prop="storeValue">
|
<el-form-item label="储值优惠参与" prop="storeValue">
|
||||||
@ -1167,6 +1167,15 @@ export default {
|
|||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "编辑固定等级类型";
|
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)
|
this.form.naturalGasRule = JSON.stringify(this.naturalGasPreferential)
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
updateFixingLevel(this.form).then(response => {
|
updateFixingLevel(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("认证类型更新成功");
|
if (response.data==1){
|
||||||
this.open = false;
|
this.$modal.msgSuccess("认证类型更新成功");
|
||||||
this.getList();
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}else {
|
||||||
|
this.$modal.msgError("认证类型失败,固定等级名称不可重复");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
queryFixingLevel({name:this.form.name}).then( response => {
|
// queryFixingLevel({name:this.form.name}).then( response => {
|
||||||
if(response.data!=null){
|
// if(response.data!=null){
|
||||||
this.$modal.msgError("固定等级名称不可重复");
|
// this.$modal.msgError("固定等级名称不可重复");
|
||||||
}else {
|
// }else {
|
||||||
addFixingLevel(this.form).then(response => {
|
addFixingLevel(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("认证类型创建成功");
|
if (response.data==1) {
|
||||||
this.open = false;
|
this.$modal.msgSuccess("认证类型创建成功");
|
||||||
this.getList();
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}else {
|
||||||
|
this.$modal.msgError("固定等级名称不可重复");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -264,4 +264,14 @@ public class OilOrderController extends BaseController {
|
|||||||
String orderNo = map.get("orderNo");
|
String orderNo = map.get("orderNo");
|
||||||
return getSuccessResult(orderService.selectOilOrderDescByOrderNo(orderNo));
|
return getSuccessResult(orderService.selectOilOrderDescByOrderNo(orderNo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单id查询油品订单信息(小程序)
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("oilOrderId/{id}")
|
||||||
|
public ResponseObject getOilOrderInfo(@PathVariable Integer id){
|
||||||
|
return getSuccessResult(orderService.selectOilOrderDescByOrderId(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,4 +114,11 @@ public interface OilOrderMapper extends BaseMapper<OilOrder> {
|
|||||||
Map<String, String> orderStatistics( @Param("order") OilOrder order);
|
Map<String, String> orderStatistics( @Param("order") OilOrder order);
|
||||||
|
|
||||||
OilOrderVo selectOilOrderDescByOrderNo(@Param("orderNo") String orderNo);
|
OilOrderVo selectOilOrderDescByOrderNo(@Param("orderNo") String orderNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单id查询订单详情信息
|
||||||
|
* @param orderId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
OilOrderVo selectOilOrderDescByOrderId(@Param("orderId") Integer orderId);
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
<include refid="selectOrders"></include>
|
<include refid="selectOrders"></include>
|
||||||
<where>
|
<where>
|
||||||
user_id = #{order.userId}
|
user_id = #{order.userId}
|
||||||
|
and terminal = 'applet'
|
||||||
<if test="order.storeId != null and order.storeId != ''">
|
<if test="order.storeId != null and order.storeId != ''">
|
||||||
and store_id = #{order.storeId}
|
and store_id = #{order.storeId}
|
||||||
</if>
|
</if>
|
||||||
@ -529,4 +530,15 @@
|
|||||||
od.order_no = #{orderNo}
|
od.order_no = #{orderNo}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
@ -144,6 +144,17 @@ public interface OilOrderService extends IService<OilOrder> {
|
|||||||
*/
|
*/
|
||||||
Map<String, String> orderStatistics(OilOrder order);
|
Map<String, String> orderStatistics(OilOrder order);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单号查询订单详情信息
|
||||||
|
* @param orderNo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
OilOrderVo selectOilOrderDescByOrderNo(String orderNo);
|
OilOrderVo selectOilOrderDescByOrderNo(String orderNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单id查询订单详情信息
|
||||||
|
* @param orderId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
OilOrderVo selectOilOrderDescByOrderId(Integer orderId);
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
if (payType.equals("CASH")){
|
if (payType.equals("CASH")){
|
||||||
cashierOrder.setPayAmount(Double.valueOf(map.get("authCode")));
|
cashierOrder.setPayAmount(Double.valueOf(map.get("authCode")));
|
||||||
cashierOrder.setPayTime(new Date());
|
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 {
|
}else {
|
||||||
cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
|
cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
|
||||||
}
|
}
|
||||||
@ -697,7 +697,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cashierOrder.setSeekZero(0.0);
|
cashierOrder.setSeekZero(0.0);
|
||||||
cashierOrder.setPayType(map.get("payType"));
|
cashierOrder.setPayType(map.get("payType"));
|
||||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
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);
|
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"1",orderNo);
|
||||||
res.put("success","success");
|
res.put("success","success");
|
||||||
}
|
}
|
||||||
@ -762,7 +762,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cashierOrder.setPayType(map.get("payType"));
|
cashierOrder.setPayType(map.get("payType"));
|
||||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||||
this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
|
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);
|
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"1",orderNo);
|
||||||
// this.insertCardBalance(oilAmount,userId,storeId);
|
// this.insertCardBalance(oilAmount,userId,storeId);
|
||||||
res.put("success","success");
|
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 allOrderInfo = new AllOrderInfo();
|
||||||
allOrderInfo.setOrderNo(orderNo);
|
allOrderInfo.setOrderNo(orderNo);
|
||||||
allOrderInfo.setType(type);
|
allOrderInfo.setType(type);
|
||||||
@ -791,7 +791,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
allOrderInfo.setPayChannel(payChannel);
|
allOrderInfo.setPayChannel(payChannel);
|
||||||
allOrderInfo.setStatus(status);
|
allOrderInfo.setStatus(status);
|
||||||
if (status.equals("paid")){
|
if (status.equals("paid")){
|
||||||
allOrderInfo.setPayMoney(goodsMoney);
|
allOrderInfo.setPayMoney(payAmount);
|
||||||
allOrderInfo.setPayTime(new Date());
|
allOrderInfo.setPayTime(new Date());
|
||||||
}
|
}
|
||||||
if (type.equals("1")){
|
if (type.equals("1")){
|
||||||
@ -914,7 +914,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
oilOrder.setOrderStatus("unpaid");
|
oilOrder.setOrderStatus("unpaid");
|
||||||
oilOrder.setOrderType("主订单");
|
oilOrder.setOrderType("主订单");
|
||||||
oilOrder.setInvoicing("未开票");
|
oilOrder.setInvoicing("未开票");
|
||||||
oilOrder.setRemark("未评价");
|
|
||||||
oilOrder.setUserId(nowAccountInfo.getId());
|
oilOrder.setUserId(nowAccountInfo.getId());
|
||||||
// 判断当前店铺是否存在此用户的会员信息,没有的话进行添加
|
// 判断当前店铺是否存在此用户的会员信息,没有的话进行添加
|
||||||
LJStore store = storeService.selectStoreByStoreId(oilOrder.getStoreId());
|
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());
|
LJUserVo userVo = userService.selectUserById(oilOrder.getUserId(),oilOrder.getStoreId());
|
||||||
oilOrder.setPayUser(userVo.getMobile());
|
oilOrder.setPayUser(userVo.getMobile());
|
||||||
baseMapper.insert(oilOrder);
|
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;
|
return orderNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -982,7 +965,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
if (ObjectUtil.isEmpty(storedQuantity) || storedQuantity - oilOrder.getOilNum() <=0){
|
if (ObjectUtil.isEmpty(storedQuantity) || storedQuantity - oilOrder.getOilNum() <=0){
|
||||||
// throw new RuntimeException("油罐容量不足!");
|
// throw new RuntimeException("油罐容量不足!");
|
||||||
applet.put("error","油罐容量不足!");
|
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;
|
result = true;
|
||||||
}
|
}
|
||||||
if (isUseChildCard.equals("true")){
|
if (isUseChildCard.equals("true")){
|
||||||
@ -992,7 +975,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
userId = userVo.getId();
|
userId = userVo.getId();
|
||||||
if (!isUseChild.equals("yes")){
|
if (!isUseChild.equals("yes")){
|
||||||
applet.put("error","不可使用子卡消费!");
|
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;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1003,7 +986,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
if (balanceAmount.equals("0") && map.get("payAmount").equals("0")) {
|
if (balanceAmount.equals("0") && map.get("payAmount").equals("0")) {
|
||||||
if (Double.compare(oilCardLiters,oilOrder.getOilNum())!=0){
|
if (Double.compare(oilCardLiters,oilOrder.getOilNum())!=0){
|
||||||
applet.put("error","囤油卡消费升数不对!");
|
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;
|
result = true;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
@ -1011,7 +994,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
Double residueAmount = useLiters * oilNumber.getOilPrice();
|
Double residueAmount = useLiters * oilNumber.getOilPrice();
|
||||||
if ((Double.valueOf(map.get("payAmount"))+Double.valueOf(balanceAmount)-residueAmount)>=0.05){
|
if ((Double.valueOf(map.get("payAmount"))+Double.valueOf(balanceAmount)-residueAmount)>=0.05){
|
||||||
applet.put("error","消费总金额不对!");
|
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;
|
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"));
|
Double realAmount = Double.valueOf(map.get("payAmount")) + Double.valueOf(balanceAmount) + Double.valueOf(map.get("discountAmount"));
|
||||||
if (Double.compare(realAmount,oilOrder.getOrderAmount())!=0){
|
if (Double.compare(realAmount,oilOrder.getOrderAmount())!=0){
|
||||||
applet.put("error","消费总金额不对!");
|
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;
|
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();
|
// 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.updateGrowthValue(oilOrder.getOrderAmount(),payAmount,userId, Integer.valueOf(oilOrder.getOils()),oilCardAmount,oilOrder.getStoreId(),orderNo);
|
||||||
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
||||||
this.insertCardOrder(oilOrder.getUserId(),oilOrder.getStoreId(),orderNo,oilOrder.getOrderAmount(),"paid", Double.valueOf(balanceAmount),payAmount);
|
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);
|
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getOrderAmount(),oilOrder.getOilNum(),"1",orderNo);
|
||||||
oilOrder.setPayAmount(payAmount);
|
oilOrder.setPayAmount(payAmount);
|
||||||
oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
|
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.updateGrowthValue(oilOrder.getOrderAmount(),oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
|
||||||
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
||||||
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"1",orderNo);
|
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);
|
row = baseMapper.updateById(oilOrder);
|
||||||
}
|
}
|
||||||
@ -1638,4 +1611,9 @@ return stringDoubleMap;
|
|||||||
public OilOrderVo selectOilOrderDescByOrderNo(String orderNo) {
|
public OilOrderVo selectOilOrderDescByOrderNo(String orderNo) {
|
||||||
return baseMapper.selectOilOrderDescByOrderNo(orderNo);
|
return baseMapper.selectOilOrderDescByOrderNo(orderNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OilOrderVo selectOilOrderDescByOrderId(Integer orderId) {
|
||||||
|
return baseMapper.selectOilOrderDescByOrderId(orderId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.business.userManager.service.impl;
|
package com.fuint.business.userManager.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@ -77,7 +78,9 @@ public class FixingLevelServiceImpl extends ServiceImpl<FixingLevelMapper, Fixin
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public FixingLevel selectFixingLevelByName(String name) {
|
public FixingLevel selectFixingLevelByName(String name) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
|
||||||
queryWrapper.eq("name",name);
|
queryWrapper.eq("name",name);
|
||||||
FixingLevel fixingLevel = baseMapper.selectOne(queryWrapper);
|
FixingLevel fixingLevel = baseMapper.selectOne(queryWrapper);
|
||||||
return fixingLevel;
|
return fixingLevel;
|
||||||
@ -100,10 +103,16 @@ public class FixingLevelServiceImpl extends ServiceImpl<FixingLevelMapper, Fixin
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertFixingLevel(FixingLevel fixingLevel) {
|
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();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
Integer storeId = nowAccountInfo.getStoreId();
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
fixingLevel.setStoreId(storeId);
|
fixingLevel.setStoreId(storeId);
|
||||||
int row = baseMapper.insert(fixingLevel);
|
row = baseMapper.insert(fixingLevel);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +123,15 @@ public class FixingLevelServiceImpl extends ServiceImpl<FixingLevelMapper, Fixin
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateFixingLevel(FixingLevel fixingLevel) {
|
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;
|
return row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -752,6 +752,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 支付成功后小票打印内容-->
|
||||||
<div id="reportSuccess" ref="report" class="box-center" v-show="false">
|
<div id="reportSuccess" ref="report" class="box-center" v-show="false">
|
||||||
<div class="box-title">订单统计</div>
|
<div class="box-title">订单统计</div>
|
||||||
<div class="box-ge">
|
<div class="box-ge">
|
||||||
@ -1064,6 +1065,8 @@
|
|||||||
isExistOilOrder:false,
|
isExistOilOrder:false,
|
||||||
// 是否存在固定等级会员优惠
|
// 是否存在固定等级会员优惠
|
||||||
isFixingLevel:false,
|
isFixingLevel:false,
|
||||||
|
// 是否为
|
||||||
|
isFixingBalance:false,
|
||||||
// 查询优惠活动信息所需参数
|
// 查询优惠活动信息所需参数
|
||||||
preferentialData:{
|
preferentialData:{
|
||||||
userId:"",
|
userId:"",
|
||||||
@ -1358,7 +1361,9 @@
|
|||||||
this.countAmountFull();
|
this.countAmountFull();
|
||||||
this.isUseBalance = false;
|
this.isUseBalance = false;
|
||||||
}
|
}
|
||||||
this.getOilCoupon()
|
if (!this.isFixingLevel){
|
||||||
|
this.getOilCoupon()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleCheckAllChange5(val) {
|
handleCheckAllChange5(val) {
|
||||||
if (val){
|
if (val){
|
||||||
@ -1493,7 +1498,7 @@
|
|||||||
_this.gradeDiscount = [];
|
_this.gradeDiscount = [];
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
_this.oilOrder.forEach(item => {
|
_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 (item.type == "汽油") {
|
||||||
if (response.data.fixingLevel){
|
if (response.data.fixingLevel){
|
||||||
_this.isFixingLevel = true
|
_this.isFixingLevel = true
|
||||||
@ -1501,145 +1506,60 @@
|
|||||||
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||||
if (response.data.fixingLevel.gasolineDiscount == "满减优惠") {
|
if (response.data.fixingLevel.gasolineDiscount == "满减优惠") {
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
discount.type = "满减优惠"
|
|
||||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||||
// 将满减条件加入等级优惠列表
|
// 将满减条件加入等级优惠列表
|
||||||
if (gasolineRule.length > 1) {
|
if (gasolineRule.length > 1) {
|
||||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
|
||||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
|
||||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
|
||||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (discount.reduce != 0) {
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('满减优惠')
|
|
||||||
}
|
|
||||||
gasolineDiscount += +oilDiscount
|
gasolineDiscount += +oilDiscount
|
||||||
|
discount.discount = gasolineDiscount
|
||||||
} else if (response.data.fixingLevel.gasolineDiscount == "每升优惠") {
|
} else if (response.data.fixingLevel.gasolineDiscount == "每升优惠") {
|
||||||
discount.type = "每升优惠"
|
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||||
// 将满减条件加入等级优惠列表
|
// 将满减条件加入等级优惠列表
|
||||||
if (gasolineRule.length > 1) {
|
if (gasolineRule.length > 1) {
|
||||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
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);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
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)
|
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 {
|
} else {
|
||||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
|
||||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
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
|
gasolineDiscount += +oilDiscount
|
||||||
|
discount.discount = gasolineDiscount
|
||||||
} else {
|
} else {
|
||||||
gasolineDiscount = 0;
|
gasolineDiscount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//
|
||||||
}else {
|
// if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
|
||||||
if (response.data.userGrade) {
|
// _this.oilDiscount = 0
|
||||||
let gasolineRule = JSON.parse(response.data.userGrade.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
|
// _this.checkAll4 = false
|
||||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
// console.log(111)
|
||||||
if (response.data.userGrade.gasolineDiscount == "满减优惠") {
|
// }else {
|
||||||
let oilDiscount = 0;
|
_this.oilDiscount += discount.discount
|
||||||
discount.type = "满减优惠"
|
_this.gradeDiscount.push(discount)
|
||||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
_this.checkAll2 = true
|
||||||
// 将满减条件加入等级优惠列表
|
_this.checkedCities2.push(discount.gunName)
|
||||||
if (gasolineRule.length > 1) {
|
// console.log(222)
|
||||||
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 (item.type == "柴油") {
|
if (item.type == "柴油") {
|
||||||
@ -1649,300 +1569,127 @@
|
|||||||
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||||
if (response.data.fixingLevel.dieselDiscount == "满减优惠") {
|
if (response.data.fixingLevel.dieselDiscount == "满减优惠") {
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
discount.type = "满减优惠"
|
|
||||||
for (let i = 1; i <= dieselRule.length; i++) {
|
for (let i = 1; i <= dieselRule.length; i++) {
|
||||||
// 将满减条件加入等级优惠列表
|
// 将满减条件加入等级优惠列表
|
||||||
if (dieselRule.length > 1) {
|
if (dieselRule.length > 1) {
|
||||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
|
||||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||||
discount.full = dieselRule[i - 1].dieselRule1
|
|
||||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
discount.full = dieselRule[i - 1].dieselRule1
|
|
||||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (discount.reduce != 0) {
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('满减优惠')
|
|
||||||
}
|
|
||||||
dieselDiscount += +oilDiscount
|
dieselDiscount += +oilDiscount
|
||||||
|
discount.discount = dieselDiscount
|
||||||
} else if (response.data.fixingLevel.dieselDiscount == "每升优惠") {
|
} else if (response.data.fixingLevel.dieselDiscount == "每升优惠") {
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
for (let i = 1; i <= dieselRule.length; i++) {
|
for (let i = 1; i <= dieselRule.length; i++) {
|
||||||
discount.type = "每升优惠"
|
|
||||||
// 将满减条件加入等级优惠列表
|
// 将满减条件加入等级优惠列表
|
||||||
if (dieselRule.length > 1) {
|
if (dieselRule.length > 1) {
|
||||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
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);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
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)
|
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 {
|
} else {
|
||||||
discount.full = dieselRule[i - 1].dieselRule1
|
|
||||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
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
|
dieselDiscount += +oilDiscount
|
||||||
|
discount.discount = dieselDiscount
|
||||||
} else {
|
} else {
|
||||||
dieselDiscount = 0;
|
dieselDiscount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
// if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
|
||||||
if (response.data.userGrade) {
|
// _this.oilDiscount = 0
|
||||||
let dieselRule = JSON.parse(response.data.userGrade.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
|
// _this.checkAll4 = false
|
||||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
// }else {
|
||||||
if (response.data.userGrade.dieselDiscount == "满减优惠") {
|
_this.oilDiscount += discount.discount
|
||||||
let oilDiscount = 0;
|
_this.gradeDiscount.push(discount)
|
||||||
discount.type = "满减优惠"
|
_this.checkAll2 = true
|
||||||
for (let i = 1; i <= dieselRule.length; i++) {
|
_this.checkedCities2.push(discount.gunName)
|
||||||
// 将满减条件加入等级优惠列表
|
// }
|
||||||
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 (item.type == "天然气") {
|
if (item.type == "天然气") {
|
||||||
if (response.data.fixingLevel){
|
if (response.data.fixingLevel){
|
||||||
_this.isFixingLevel = true
|
_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.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||||
if (response.data.fixingLevel.naturalGasDiscount == "满减优惠") {
|
if (response.data.fixingLevel.naturalGasDiscount == "满减优惠") {
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
discount.type = "满减优惠"
|
|
||||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||||
// 将满减条件加入等级优惠列表
|
// 将满减条件加入等级优惠列表
|
||||||
if (naturalGasRule.length > 1) {
|
if (naturalGasRule.length > 1) {
|
||||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGas1) {
|
||||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGas2;
|
||||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
|
||||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
if (item.amount >= naturalGasRule[i - 1].naturalGas1 && item.amount < naturalGasRule[i].naturalGas1) {
|
||||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
oilDiscount = naturalGasRule[i - 1].naturalGas2
|
||||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
|
||||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
if (item.amount >= naturalGasRule[i - 1].naturalGas1) {
|
||||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
oilDiscount = naturalGasRule[i - 1].naturalGas2
|
||||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
|
||||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (discount.reduce != 0) {
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('满减优惠')
|
|
||||||
}
|
|
||||||
naturalGasDiscount += +oilDiscount
|
naturalGasDiscount += +oilDiscount
|
||||||
|
discount.discount = naturalGasDiscount
|
||||||
} else if (response.data.fixingLevel.naturalGasDiscount == "每单位优惠") {
|
} else if (response.data.fixingLevel.naturalGasDiscount == "每单位优惠") {
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
discount.type = "每单位优惠"
|
|
||||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||||
// 将满减条件加入等级优惠列表
|
// 将满减条件加入等级优惠列表
|
||||||
if (naturalGasRule.length > 1) {
|
if (naturalGasRule.length > 1) {
|
||||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGas1) {
|
||||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
oilDiscount = (item.liters * naturalGasRule[naturalGasRule.length - 1].naturalGas3).toFixed(2)
|
||||||
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;
|
break;
|
||||||
}
|
}
|
||||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
if (item.amount >= naturalGasRule[i - 1].naturalGas1 && item.amount < naturalGasRule[i].naturalGas1) {
|
||||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGas3).toFixed(2)
|
||||||
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 {
|
} else {
|
||||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
if (item.amount >= naturalGasRule[i - 1].naturalGas1) {
|
||||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGas3).toFixed(2)
|
||||||
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
|
naturalGasDiscount += +oilDiscount
|
||||||
|
discount.discount = naturalGasDiscount
|
||||||
} else {
|
} else {
|
||||||
naturalGasDiscount = 0;
|
naturalGasDiscount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
// if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
|
||||||
if (response.data.userGrade.userGrade) {
|
// _this.oilDiscount = 0
|
||||||
let naturalGasRule = JSON.parse(response.data.userGrade.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
|
// _this.checkAll4 = false
|
||||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
// }else {
|
||||||
if (response.data.userGrade.naturalGasDiscount == "满减优惠") {
|
_this.oilDiscount += discount.discount
|
||||||
let oilDiscount = 0;
|
_this.gradeDiscount.push(discount)
|
||||||
discount.type = "满减优惠"
|
_this.checkAll2 = true
|
||||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
_this.checkedCities2.push(discount.gunName)
|
||||||
// 将满减条件加入等级优惠列表
|
// }
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
// _this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||||
_this.checkAll2 = true;
|
// _this.checkAll2 = true;
|
||||||
_this.isDefaultUseCard();
|
// _this.isDefaultUseCard();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 选择会员
|
// 选择会员
|
||||||
@ -1970,7 +1717,10 @@
|
|||||||
if (this.balance>0){
|
if (this.balance>0){
|
||||||
this.checkAll4 = true
|
this.checkAll4 = true
|
||||||
}
|
}
|
||||||
await this.getOilCoupon()
|
await this.getGrade(this.member.id,this.member.gradeId)
|
||||||
|
if (!this.isFixingLevel){
|
||||||
|
await this.getOilCoupon()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getOilCoupon(){
|
getOilCoupon(){
|
||||||
let type = 0;
|
let type = 0;
|
||||||
@ -2010,7 +1760,7 @@
|
|||||||
if(!this.isOilStorageCard) {
|
if(!this.isOilStorageCard) {
|
||||||
_this.oilDiscount += res.data.memberFavorableAmount
|
_this.oilDiscount += res.data.memberFavorableAmount
|
||||||
_this.checkAll2 = true
|
_this.checkAll2 = true
|
||||||
this.checkedCities2.push(discount.oilName)
|
this.checkedCities2.push(discount.gunName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (res.data.cardFavorableAmount){
|
if (res.data.cardFavorableAmount){
|
||||||
@ -2029,7 +1779,7 @@
|
|||||||
if(!this.isOilStorageCard) {
|
if(!this.isOilStorageCard) {
|
||||||
_this.fullReduction += res.data.activeFavorableAmount
|
_this.fullReduction += res.data.activeFavorableAmount
|
||||||
_this.checkAll1 = true
|
_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){
|
if (res.data.storedQuantity-this.form.liters<0){
|
||||||
this.$modal.msgError("所加油的升数大于油罐内的升数,请重新选择加油升数")
|
this.$modal.msgError("所加油的升数大于油罐内的升数,请重新选择加油升数")
|
||||||
return;
|
return;
|
||||||
@ -2464,7 +2214,10 @@
|
|||||||
if (this.balance>0){
|
if (this.balance>0){
|
||||||
this.checkAll4 = true
|
this.checkAll4 = true
|
||||||
}
|
}
|
||||||
this.getOilCoupon()
|
await this.getGrade(this.member.id,this.member.gradeId)
|
||||||
|
if (!this.isFixingLevel){
|
||||||
|
await this.getOilCoupon()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -23,11 +23,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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">
|
<view class="w-box" v-for="(item,index) in textlist" :key="index" @click="textindex">
|
||||||
{{item.text || "下次还来"}}
|
{{item.text || "下次还来"}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<u--textarea v-model="value1" placeholder="请输入内容"></u--textarea>
|
<u--textarea v-model="value1" placeholder="请输入内容"></u--textarea>
|
||||||
</view>
|
</view>
|
||||||
<view class="anniu">
|
<view class="anniu">
|
||||||
@ -45,7 +45,7 @@
|
|||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
description: '您的宝贵建议,就是我们前进的动力~动动手指,帮助我们做得更好~~',
|
description: '您的宝贵建议,就是我们前进的动力~动动手指,帮助我们做得更好~~',
|
||||||
count: 10,
|
count: 5,
|
||||||
value: 0,
|
value: 0,
|
||||||
value1: '',
|
value1: '',
|
||||||
textlist: [{
|
textlist: [{
|
||||||
|
@ -9,49 +9,58 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 顶部区域 -->
|
<!-- 顶部区域 -->
|
||||||
<view class="top-size">
|
<view class="top-size">
|
||||||
<view style="font-weight: bold;margin-bottom: 5px;">已支付订单</view>
|
<!-- <view style="font-weight: bold;margin-bottom: 5px;">已支付订单</view> -->
|
||||||
<view class="">如果有疑问请向客户进行资讯</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>
|
||||||
<view class="centen-box">
|
<view class="centen-box">
|
||||||
<view class="box-title">订单信息</view>
|
<view class="box-title">订单信息</view>
|
||||||
<view class="dis-fx">
|
<view class="dis-fx">
|
||||||
<view class="hui-size">油号油枪</view>
|
<view class="hui-size">油站名称</view>
|
||||||
<view class="">92#/1号枪</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>
|
||||||
<view class="dis-fx">
|
<view class="dis-fx">
|
||||||
<view class="hui-size">油号油枪</view>
|
<view class="hui-size">油号油枪</view>
|
||||||
<view class="">92#/1号枪</view>
|
<view class="">{{oilOrder.oilName}}/{{oilOrder.gunName}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="dis-fx">
|
<view class="dis-fx">
|
||||||
<view class="hui-size">油号油枪</view>
|
<view class="hui-size">油品单价</view>
|
||||||
<view class="">92#/1号枪</view>
|
<view class="">¥{{oilPrice}}/L</view>
|
||||||
</view>
|
|
||||||
<view class="dis-fx">
|
|
||||||
<view class="hui-size">油号油枪</view>
|
|
||||||
<view class="">92#/1号枪</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="box-title">加油信息</view>
|
<view class="box-title">加油信息</view>
|
||||||
<view class="dis-fx">
|
<view class="dis-fx">
|
||||||
<view class="hui-size">油号油枪</view>
|
<view class="hui-size">加油金额</view>
|
||||||
<view class="">92#/1号枪</view>
|
<view class="">{{oilOrder.orderAmount}}元</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="dis-fx">
|
<view class="dis-fx">
|
||||||
<view class="hui-size">油号油枪</view>
|
<view class="hui-size">实付金额</view>
|
||||||
<view class="">92#/1号枪</view>
|
<view class="">{{oilOrder.payAmount}}元</view>
|
||||||
</view>
|
|
||||||
<view class="box-title">优惠信息</view>
|
|
||||||
<view class="dis-fx">
|
|
||||||
<view class="hui-size">油号油枪</view>
|
|
||||||
<view class="">92#/1号枪</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="dis-fx">
|
<view class="dis-fx">
|
||||||
<view class="hui-size">油号油枪</view>
|
<view class="hui-size">储值卡或囤油卡消费金额</view>
|
||||||
<view class="">92#/1号枪</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>
|
</view>
|
||||||
<view class="anniu" @click="gocomment()">
|
<view class="anniu" v-if="oilOrder.orderStatus=='paid' && oilOrder.remark" @click="gocomment()">
|
||||||
<text>评价有礼</text>
|
<text>去评价</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@ -60,21 +69,50 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import request from '../../utils/request'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
orderId:"",
|
orderId:"",
|
||||||
|
oilOrder:{},
|
||||||
|
oilPrice:"",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.orderId = e.orderId
|
this.orderId = e.orderId
|
||||||
|
this.getOilOrder()
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
gocomment() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/comment/comment'
|
url: '/pagesMy/comment/comment'
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
@scrolltolower="scrolltolower">
|
@scrolltolower="scrolltolower">
|
||||||
<!-- 油品订单列表 -->
|
<!-- 油品订单列表 -->
|
||||||
<view class="box-order" v-for="(item,index) in list" :key="index">
|
<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="">{{getStoreName(storeList,item.storeId)}}</view>
|
||||||
<!-- <view class="chengg">{{getPayName(payList,item.orderStatus)}}</view> -->
|
<!-- <view class="chengg">{{getPayName(payList,item.orderStatus)}}</view> -->
|
||||||
<view class="chengg" v-if="item.orderStatus=='paid'">已支付</view>
|
<view class="chengg" v-if="item.orderStatus=='paid'">已支付</view>
|
||||||
@ -42,22 +42,22 @@
|
|||||||
<view class="huis">订单类型</view>
|
<view class="huis">订单类型</view>
|
||||||
<view class="">油品订单</view>
|
<view class="">油品订单</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="but-box" @click="goOrderInfo">
|
<view class="but-box" @click="goOrderInfo(item.id)">
|
||||||
<view class="huis">订单金额</view>
|
<view class="huis">订单金额</view>
|
||||||
<view class="">¥{{item.orderAmount}}</view>
|
<view class="">¥{{item.orderAmount}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="but-box" @click="goOrderInfo">
|
<view class="but-box" @click="goOrderInfo(item.id)">
|
||||||
<view class="huis">优惠合计</view>
|
<view class="huis">优惠合计</view>
|
||||||
<view class="reds">¥{{item.discountAmount}}</view>
|
<view class="reds">¥{{item.discountAmount}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="but-box" @click="goOrderInfo">
|
<view class="but-box" @click="goOrderInfo(item.id)">
|
||||||
<view class="huis">订单时间</view>
|
<view class="huis">订单时间</view>
|
||||||
<view class="" v-if="item.orderStatus=='paid'">{{parseTime(item.payTime)}}</view>
|
<view class="" v-if="item.orderStatus=='paid'">{{parseTime(item.payTime)}}</view>
|
||||||
<view class="" v-else>{{item.createTime}}</view>
|
<view class="" v-else>{{item.createTime}}</view>
|
||||||
</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">
|
<view class="anniu">
|
||||||
<text>评价有礼</text>
|
<text>去评价</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else-if="item.orderStatus=='unpaid'" class="end-box" @click="goPayment(item.orderNo)">
|
<view v-else-if="item.orderStatus=='unpaid'" class="end-box" @click="goPayment(item.orderNo)">
|
||||||
@ -391,7 +391,7 @@
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
storeId: "",
|
storeId: "",
|
||||||
orderStatus: "paid",
|
orderStatus: "paid",
|
||||||
remark: "",
|
remark: "1",
|
||||||
payType:uni.getStorageSync("appltType")
|
payType:uni.getStorageSync("appltType")
|
||||||
}
|
}
|
||||||
this.getMyOrder()
|
this.getMyOrder()
|
||||||
|
@ -98,7 +98,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="desc" v-if="preferentialData.memberFavorableAmount">
|
<view class="desc" v-if="gradeRedece>0">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
会员等级优惠
|
会员等级优惠
|
||||||
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
|
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
|
||||||
@ -246,11 +246,13 @@
|
|||||||
memberFavorableAmount: "",
|
memberFavorableAmount: "",
|
||||||
type: "",
|
type: "",
|
||||||
},
|
},
|
||||||
|
// 是否为固定等级会员
|
||||||
|
isFixingLevel:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.orderNo = e.orderNo
|
this.orderNo = e.orderNo
|
||||||
// this.orderNo = "23452024012011401299130f"
|
// this.orderNo = "234520240124103747dec173"
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getOilOrder();
|
this.getOilOrder();
|
||||||
@ -279,7 +281,9 @@
|
|||||||
};
|
};
|
||||||
}else{
|
}else{
|
||||||
this.oilCardRedece = 0
|
this.oilCardRedece = 0
|
||||||
this.getPaymentPreferential(this.user.gradeId)
|
if (!this.isFixingLevel){
|
||||||
|
this.getPaymentPreferential(this.user.gradeId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -320,7 +324,7 @@
|
|||||||
title:res.data.error,
|
title:res.data.error,
|
||||||
icon:"none"
|
icon:"none"
|
||||||
})
|
})
|
||||||
_this.goBack()
|
// _this.goBack()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(res.data.success == "ok"){
|
if(res.data.success == "ok"){
|
||||||
@ -462,7 +466,9 @@
|
|||||||
// this.chooseGrade(this.user.id,this.user.gradeId)
|
// this.chooseGrade(this.user.id,this.user.gradeId)
|
||||||
}
|
}
|
||||||
if (this.oilCardRedece==0){
|
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 (res.data.fixingLevel.gasolineDiscount == "满减优惠"){
|
||||||
if (gasolineRule.length > 1){
|
if (gasolineRule.length > 1){
|
||||||
for (let i = 1; i<gasolineRule.length; i++){
|
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.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
break;
|
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.gradeRedece = gasolineRule[i - 1].gasolineRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}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.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
@ -538,20 +544,20 @@
|
|||||||
if (res.data.fixingLevel.gasolineDiscount == "每升优惠"){
|
if (res.data.fixingLevel.gasolineDiscount == "每升优惠"){
|
||||||
if (gasolineRule.length > 1){
|
if (gasolineRule.length > 1){
|
||||||
for (let i = 1; i<gasolineRule.length; i++){
|
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
|
that.isGradePreferential = true
|
||||||
break;
|
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 = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
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
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -563,18 +569,18 @@
|
|||||||
if (res.data.fixingLevel.dieselDiscount == "满减优惠"){
|
if (res.data.fixingLevel.dieselDiscount == "满减优惠"){
|
||||||
if (dieselRule.length > 1){
|
if (dieselRule.length > 1){
|
||||||
for (let i = 1; i<dieselRule.length; i++){
|
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.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
break;
|
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.gradeRedece = dieselRule[i - 1].dieselRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}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.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
@ -583,20 +589,20 @@
|
|||||||
if (res.data.fixingLevel.dieselDiscount == "每升优惠"){
|
if (res.data.fixingLevel.dieselDiscount == "每升优惠"){
|
||||||
if (dieselRule.length > 1){
|
if (dieselRule.length > 1){
|
||||||
for (let i = 1; i<dieselRule.length; i++){
|
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
|
that.isGradePreferential = true
|
||||||
break;
|
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 = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
|
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
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
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -608,18 +614,18 @@
|
|||||||
if (res.data.fixingLevel.naturalGasDiscount == "满减优惠"){
|
if (res.data.fixingLevel.naturalGasDiscount == "满减优惠"){
|
||||||
if (naturalGasRule.length > 1){
|
if (naturalGasRule.length > 1){
|
||||||
for (let i = 1; i<naturalGasRule.length; i++){
|
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.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
break;
|
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.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}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.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
@ -628,172 +634,32 @@
|
|||||||
if (res.data.fixingLevel.naturalGasDiscount == "每升优惠"){
|
if (res.data.fixingLevel.naturalGasDiscount == "每升优惠"){
|
||||||
if (naturalGasRule.length > 1){
|
if (naturalGasRule.length > 1){
|
||||||
for (let i = 1; i<naturalGasRule.length; i++){
|
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
|
that.isGradePreferential = true
|
||||||
break;
|
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 = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
that.gradeRedece = (that.oilOrder.orderAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
that.isGradePreferential = true
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
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
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
that.isFixingLevel = true
|
||||||
if(res.data.userGrade){
|
// if (res.data.fixingLevel.storeValue=="no" && that.balanceRedece>0){
|
||||||
that.userGrade = res.data.userGrade
|
// that.gradeRedece = 0
|
||||||
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.countPayMent()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -841,7 +707,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 根据店铺id查询用户信息
|
// 根据店铺id查询用户信息
|
||||||
getUser(id){
|
async getUser(id){
|
||||||
let _this = this;
|
let _this = this;
|
||||||
request({
|
request({
|
||||||
url: "business/userManager/user/storeUser",
|
url: "business/userManager/user/storeUser",
|
||||||
@ -855,14 +721,18 @@
|
|||||||
}
|
}
|
||||||
_this.user = res.data.userVo;
|
_this.user = res.data.userVo;
|
||||||
_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'){
|
if (res.data.userVo.refuelMoney && res.data.userVo.refuelMoney!='null'){
|
||||||
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
||||||
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
|
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
|
||||||
_this.chooseRefuelMoney()
|
_this.chooseRefuelMoney()
|
||||||
}else{
|
}else{
|
||||||
_this.chooseCardBalance(0)
|
_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)
|
// _this.chooseGrade(res.data.userVo.id,res.data.userVo.gradeId)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -962,7 +832,7 @@
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
if (item.oilName == _this.oilOrder.oils) {
|
if (item.oilName == _this.oilOrder.oils) {
|
||||||
_this.oilPrice = item.gbPrice;
|
_this.oilPrice = item.oilPrice;
|
||||||
_this.oilName = item.oilNames;
|
_this.oilName = item.oilNames;
|
||||||
_this.oilNameId = item.oilName;
|
_this.oilNameId = item.oilName;
|
||||||
_this.oilType = item.oilType;
|
_this.oilType = item.oilType;
|
||||||
|
Loading…
Reference in New Issue
Block a user