Merge branch 'master' of https://gitee.com/nny_1/oilSystem
This commit is contained in:
commit
e423293f5c
@ -91,7 +91,7 @@ export default {
|
||||
}).then((AMap) => {
|
||||
this.map = new AMap.Map("container", {
|
||||
viewMode: "2D", //是否为3D地图模式
|
||||
zoom: 11, //初始化地图级别
|
||||
zoom: 16, //初始化地图级别
|
||||
center: [_this.form.lng, _this.form.lat], //初始化地图中心点位置
|
||||
});
|
||||
// console.log(this.map.center)
|
||||
|
@ -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("固定等级名称不可重复");
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -633,7 +633,9 @@ export default {
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.auditPrem = this.form.auditPrem.toString();
|
||||
if (this.form.auditPrem){
|
||||
this.form.auditPrem = this.form.auditPrem.toString();
|
||||
}
|
||||
if (!this.form.id) {
|
||||
queryStaff({mobile:this.form.mobile}).then( response => {
|
||||
if(response.data!=null){
|
||||
@ -676,7 +678,7 @@ export default {
|
||||
this.form.refundPassword = '123456'
|
||||
this.open = true;
|
||||
this.title = "编辑员工信息";
|
||||
if (this.form.auditPrem.length > 0){
|
||||
if (this.form.auditPrem && this.form.auditPrem.length > 0){
|
||||
// this.form.auditPrem = this.form.auditPrem.split(",");
|
||||
this.auditPrem = []
|
||||
this.auditPrem = this.form.auditPrem.split(",");
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,11 @@ import com.alipay.api.response.AlipaySystemOauthTokenResponse;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
@ -38,6 +42,10 @@ public class AlipayController extends BaseController {
|
||||
private LJUserService userService;
|
||||
@Autowired
|
||||
private ILJStoreService iljStoreService;
|
||||
@Autowired
|
||||
private UserBalanceService userBalanceService;
|
||||
@Autowired
|
||||
private LJUserGradeService ljUserGradeService;
|
||||
|
||||
/**
|
||||
* 获取支付宝userId
|
||||
@ -80,6 +88,25 @@ public class AlipayController extends BaseController {
|
||||
userService.addUser(ljUser);
|
||||
}
|
||||
LJUser ljUser = userService.selectUserByMobile(mobile);
|
||||
// 根据userid和连锁店id查询是否存在对应的余额信息
|
||||
UserBalance userBalance = userBalanceService.selectUserBalance(ljUser.getId(), ljStore.getChainStoreId());
|
||||
if (ObjectUtil.isEmpty(userBalance)) {
|
||||
// 新增余额信息
|
||||
UserBalance userBalanceAdd = new UserBalance();
|
||||
userBalanceAdd.setMtUserId(ljUser.getId());
|
||||
userBalanceAdd.setStoreId(Integer.parseInt(storeId));
|
||||
userBalanceAdd.setChainStoreId(ljStore.getChainStoreId());
|
||||
userBalanceAdd.setCardBalance(0.0);
|
||||
userBalanceAdd.setPoints(0);
|
||||
userBalanceAdd.setGrowthValue(0);
|
||||
userBalanceAdd.setConsumeNum(0);
|
||||
LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeByStoreId(Integer.parseInt(storeId));
|
||||
if (ObjectUtil.isNotEmpty(ljUserGrade) && ObjectUtil.isNotEmpty(ljUserGrade.getId())) {
|
||||
userBalanceAdd.setGradeId(ljUserGrade.getId());
|
||||
}
|
||||
// 新增会员余额信息
|
||||
userBalanceService.insertUserBalance(userBalanceAdd);
|
||||
}
|
||||
|
||||
String userAgent = request.getHeader("user-agent");
|
||||
AccountInfo accountInfo = new AccountInfo();
|
||||
|
@ -446,7 +446,7 @@
|
||||
¥{{ +oilActualPay + (+goodsActualPay) }}
|
||||
</div>
|
||||
<div style="text-align: center;margin-bottom: 10px">
|
||||
合计金额:{{ oilAmount + goodsAmount }}元、优惠合计{{ oilDiscount + goodsDiscount + fullReduction + couponAmount }}元
|
||||
合计金额:{{ (oilAmount + goodsAmount).toFixed(2) }}元、优惠合计{{ (oilDiscount + goodsDiscount + fullReduction + couponAmount).toFixed(2) }}元
|
||||
</div>
|
||||
<div v-if="map.payType != 'CASH'">
|
||||
<div>
|
||||
@ -751,6 +751,38 @@
|
||||
<el-button type="primary" @click="addCredit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 支付成功后小票打印内容-->
|
||||
<div id="reportSuccess" ref="report" class="box-center" v-show="false">
|
||||
<div class="box-title">订单统计</div>
|
||||
<div class="box-ge">
|
||||
<div class="input-box" v-for="(item,index) in oilOrder" :key="index">
|
||||
<div>{{ getName(oilNameList,item.oilName) }}_{{getName1(gunList,item.gunName)}}</div>
|
||||
<div>¥{{ item.amount }}</div>
|
||||
</div>
|
||||
<div class="input-box" v-for="(item,index) in goodsOrder" :key="index">
|
||||
<div>{{ item.name }}</div>
|
||||
<div v-if="isMember == false">{{ item.retailPrice }}</div>
|
||||
<div v-else>{{ item.memberPrice }}</div>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<div>合计</div>
|
||||
<div>¥{{ oilAmount+(+goodsAmount) }}</div>
|
||||
</div>
|
||||
<div class="input-box" v-if="(oilDiscount + goodsDiscount + fullReduction + couponAmount)>0">
|
||||
<div>优惠合计</div>
|
||||
<div>¥{{ oilDiscount + goodsDiscount + fullReduction + couponAmount }}</div>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<div>实付款</div>
|
||||
<div>¥{{ (+oilActualPay)+(+goodsActualPay) }}</div>
|
||||
</div>
|
||||
<div class="input-box" v-if="seekZero>0">
|
||||
<div>找零</div>
|
||||
<div>¥{{ seekZero }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -1033,6 +1065,8 @@
|
||||
isExistOilOrder:false,
|
||||
// 是否存在固定等级会员优惠
|
||||
isFixingLevel:false,
|
||||
// 是否为
|
||||
isFixingBalance:false,
|
||||
// 查询优惠活动信息所需参数
|
||||
preferentialData:{
|
||||
userId:"",
|
||||
@ -1085,6 +1119,14 @@
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
async printLocally() {
|
||||
const printHTML = document.querySelector('#reportSuccess').innerHTML
|
||||
// 将打印的区域赋值,进行打印
|
||||
window.document.body.innerHTML = printHTML
|
||||
window.print() // 调用window打印方法
|
||||
window.location.reload() // 打印完成后重新加载页面
|
||||
|
||||
},
|
||||
clear(){
|
||||
this.dialogVisiblej = false
|
||||
this.seekZero = 0
|
||||
@ -1319,7 +1361,9 @@
|
||||
this.countAmountFull();
|
||||
this.isUseBalance = false;
|
||||
}
|
||||
this.getOilCoupon()
|
||||
if (!this.isFixingLevel){
|
||||
this.getOilCoupon()
|
||||
}
|
||||
},
|
||||
handleCheckAllChange5(val) {
|
||||
if (val){
|
||||
@ -1454,7 +1498,7 @@
|
||||
_this.gradeDiscount = [];
|
||||
if (response.data) {
|
||||
_this.oilOrder.forEach(item => {
|
||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||
let discount = {type:"",discount:0,oilName:item.oilName,gunName:item.gunName}
|
||||
if (item.type == "汽油") {
|
||||
if (response.data.fixingLevel){
|
||||
_this.isFixingLevel = true
|
||||
@ -1462,145 +1506,60 @@
|
||||
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||
if (response.data.fixingLevel.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
discount.discount = gasolineDiscount
|
||||
} else if (response.data.fixingLevel.gasolineDiscount == "每升优惠") {
|
||||
discount.type = "每升优惠"
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
discount.discount = gasolineDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
if (response.data.userGrade) {
|
||||
let gasolineRule = JSON.parse(response.data.userGrade.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
|
||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
||||
if (response.data.userGrade.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else if (response.data.userGrade.gasolineDiscount == "每升优惠") {
|
||||
discount.type = "每升优惠"
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
|
||||
// _this.oilDiscount = 0
|
||||
// _this.checkAll4 = false
|
||||
// console.log(111)
|
||||
// }else {
|
||||
_this.oilDiscount += discount.discount
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkAll2 = true
|
||||
_this.checkedCities2.push(discount.gunName)
|
||||
// console.log(222)
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (item.type == "柴油") {
|
||||
@ -1610,300 +1569,127 @@
|
||||
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||
if (response.data.fixingLevel.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
discount.discount = dieselDiscount
|
||||
} else if (response.data.fixingLevel.dieselDiscount == "每升优惠") {
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
discount.discount = dieselDiscount
|
||||
} else {
|
||||
dieselDiscount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
if (response.data.userGrade) {
|
||||
let dieselRule = JSON.parse(response.data.userGrade.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
|
||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
||||
if (response.data.userGrade.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else if (response.data.userGrade.dieselDiscount == "每升优惠") {
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else {
|
||||
dieselDiscount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
|
||||
// _this.oilDiscount = 0
|
||||
// _this.checkAll4 = false
|
||||
// }else {
|
||||
_this.oilDiscount += discount.discount
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkAll2 = true
|
||||
_this.checkedCities2.push(discount.gunName)
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (item.type == "天然气") {
|
||||
if (response.data.fixingLevel){
|
||||
_this.isFixingLevel = true
|
||||
let naturalGasRule = JSON.parse(response.data.fixingLevel.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||
let naturalGasRule = JSON.parse(response.data.fixingLevel.naturalGasRule).sort((a, b) => a.naturalGas1 - b.naturalGas1);
|
||||
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||
if (response.data.fixingLevel.naturalGasDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGas1) {
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGas2;
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGas1 && item.amount < naturalGasRule[i].naturalGas1) {
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGas2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGas1) {
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGas2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
discount.discount = naturalGasDiscount
|
||||
} else if (response.data.fixingLevel.naturalGasDiscount == "每单位优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGas1) {
|
||||
oilDiscount = (item.liters * naturalGasRule[naturalGasRule.length - 1].naturalGas3).toFixed(2)
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGas1 && item.amount < naturalGasRule[i].naturalGas1) {
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGas3).toFixed(2)
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGas1) {
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGas3).toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
discount.discount = naturalGasDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
if (response.data.userGrade.userGrade) {
|
||||
let naturalGasRule = JSON.parse(response.data.userGrade.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
||||
if (response.data.userGrade.naturalGasDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else if (response.data.userGrade.naturalGasDiscount == "每单位优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
|
||||
// _this.oilDiscount = 0
|
||||
// _this.checkAll4 = false
|
||||
// }else {
|
||||
_this.oilDiscount += discount.discount
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkAll2 = true
|
||||
_this.checkedCities2.push(discount.gunName)
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||
_this.checkAll2 = true;
|
||||
_this.isDefaultUseCard();
|
||||
// _this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||
// _this.checkAll2 = true;
|
||||
// _this.isDefaultUseCard();
|
||||
})
|
||||
},
|
||||
// 选择会员
|
||||
@ -1931,7 +1717,10 @@
|
||||
if (this.balance>0){
|
||||
this.checkAll4 = true
|
||||
}
|
||||
await this.getOilCoupon()
|
||||
await this.getGrade(this.member.id,this.member.gradeId)
|
||||
if (!this.isFixingLevel){
|
||||
await this.getOilCoupon()
|
||||
}
|
||||
},
|
||||
getOilCoupon(){
|
||||
let type = 0;
|
||||
@ -1971,7 +1760,7 @@
|
||||
if(!this.isOilStorageCard) {
|
||||
_this.oilDiscount += res.data.memberFavorableAmount
|
||||
_this.checkAll2 = true
|
||||
this.checkedCities2.push(discount.oilName)
|
||||
this.checkedCities2.push(discount.gunName)
|
||||
}
|
||||
}
|
||||
if (res.data.cardFavorableAmount){
|
||||
@ -1990,7 +1779,7 @@
|
||||
if(!this.isOilStorageCard) {
|
||||
_this.fullReduction += res.data.activeFavorableAmount
|
||||
_this.checkAll1 = true
|
||||
this.checkedCities1.push(discount.oilName)
|
||||
this.checkedCities1.push(discount.gunName)
|
||||
}
|
||||
}
|
||||
// }
|
||||
@ -2392,7 +2181,7 @@
|
||||
}
|
||||
|
||||
// 校验油罐内油是否足够
|
||||
await getOilTank(this.form.tankId).then(res => {
|
||||
await getOilTank(this.form.tankId).then(async res => {
|
||||
if (res.data.storedQuantity-this.form.liters<0){
|
||||
this.$modal.msgError("所加油的升数大于油罐内的升数,请重新选择加油升数")
|
||||
return;
|
||||
@ -2425,7 +2214,10 @@
|
||||
if (this.balance>0){
|
||||
this.checkAll4 = true
|
||||
}
|
||||
this.getOilCoupon()
|
||||
await this.getGrade(this.member.id,this.member.gradeId)
|
||||
if (!this.isFixingLevel){
|
||||
await this.getOilCoupon()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -2672,6 +2464,7 @@
|
||||
_this.oilPreferentialData[i].oilPreferential.cardFavorableId = _this.cardFavorableId
|
||||
usePaymentActive(_this.oilPreferentialData[i].oilPreferential).then(res => {})
|
||||
}
|
||||
_this.printLocally()
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2682,6 +2475,7 @@
|
||||
_this.seekZero = 0
|
||||
_this.amount = 0
|
||||
_this.resetting1()
|
||||
_this.printLocally()
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2801,6 +2595,7 @@
|
||||
_this.isQuery = false;
|
||||
_this.amount = 0
|
||||
|
||||
_this.printLocally()
|
||||
_this.loading = false;
|
||||
if (response.data.oilOrderAmount>0){
|
||||
for (let i =0;i<_this.oilPreferentialData.length;i++){
|
||||
@ -3276,6 +3071,14 @@
|
||||
/*color: white;*/
|
||||
}
|
||||
|
||||
.box-center{
|
||||
width: 100%;
|
||||
//height: 10px;
|
||||
background-color: white;
|
||||
margin: 10px auto;
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
}
|
||||
.center-left-bottom{
|
||||
width: 100%;
|
||||
background-color: white;
|
||||
@ -3315,6 +3118,20 @@
|
||||
margin: 15px 10px ;
|
||||
}
|
||||
|
||||
.input-box{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
margin: 5px 0px;
|
||||
}
|
||||
.box-title{
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.bottom-price{
|
||||
font-size: 26px;
|
||||
font-weight: bold;
|
||||
|
@ -86,9 +86,9 @@
|
||||
|
||||
<view class="station-title" style="display: flex;justify-content: space-between;">
|
||||
{{store.name}}{{store.description ? "("+store.description+")" : ""}}
|
||||
<!-- <view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
|
||||
<view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
|
||||
<view>切换位置 <uni-icons type="right" color="#304fff" size="16"></uni-icons> </view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view><!--顺通石化加油站(工业南路站)-->
|
||||
<view style="display: flex;">
|
||||
<view class="bule-icon" v-if="welfare.length!=0" v-for="(item,index) in welfare" :key="index">
|
||||
@ -184,7 +184,8 @@ import { callWithErrorHandling } from "vue"
|
||||
},
|
||||
onLoad(query) {
|
||||
if (query.storeId) {
|
||||
uni.setStorageSync("y_storeId", query.storeId)
|
||||
// uni.setStorageSync("y_storeId", query.storeId)
|
||||
uni.setStorageSync("storeId", query.storeId)
|
||||
}
|
||||
if (query.type) {
|
||||
uni.setStorageSync("y_type", query.type)
|
||||
@ -216,9 +217,6 @@ import { callWithErrorHandling } from "vue"
|
||||
uni.setStorageSync("inviteStaffId", staffId)
|
||||
this.storeId = uni.getStorageSync("storeId")
|
||||
this.staffId = uni.getStorageSync("inviteStaffId")
|
||||
uni.showLoading({
|
||||
title: uni.getStorageSync("storeId") + "++" + uni.getStorageSync("inviteStaffId") + q
|
||||
})
|
||||
this.getUserAuthority();
|
||||
this.getOilType();
|
||||
} else {
|
||||
@ -404,9 +402,7 @@ import { callWithErrorHandling } from "vue"
|
||||
})
|
||||
}
|
||||
}).catch((res) => {
|
||||
uni.showLoading({
|
||||
title: res + "---" + 1
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
// 获取当前位置
|
||||
@ -440,6 +436,7 @@ import { callWithErrorHandling } from "vue"
|
||||
uni.setStorageSync("storeId", response.data.store.id)
|
||||
uni.setStorageSync("chainStoreId", response.data.store
|
||||
.chainStoreId)
|
||||
console.log(uni.getStorageSync("chainStoreId"));
|
||||
let welfare = response.data.store.welfare
|
||||
if (welfare) {
|
||||
if (welfare.includes(",")) {
|
||||
|
@ -86,13 +86,13 @@
|
||||
method: 'post',
|
||||
data: {
|
||||
authCode: authCode,
|
||||
storeId: 0,
|
||||
storeId: uni.getStorageSync("storeId"),
|
||||
staffId: "",
|
||||
phone: "18457621459",
|
||||
encryptedData: encryptedData,
|
||||
},
|
||||
}).then((resp) => {
|
||||
console.log(resp)
|
||||
// console.log(resp)
|
||||
if (resp.code == 200) {
|
||||
|
||||
uni.setStorageSync('App-Token', resp.data.token);
|
||||
@ -210,7 +210,8 @@
|
||||
url: "clientApi/sign/alipayLogin/getUserid",
|
||||
method: 'post',
|
||||
data: {
|
||||
storeId: uni.getStorageSync("y_storeId"),
|
||||
storeId: uni.getStorageSync("storeId"),
|
||||
// storeId: uni.getStorageSync("y_storeId"),
|
||||
type: uni.getStorageSync("y_type"),
|
||||
userId: uni.getStorageSync("y_userId"),
|
||||
},
|
||||
|
@ -13,20 +13,21 @@
|
||||
<view class="c-box-top">您对工作人员满意吗</view>
|
||||
<view class="dis">
|
||||
<view class="touxiang">
|
||||
<image src="../../static/imgs/myx.png" mode="aspectFit"></image>
|
||||
<image v-if="user.avatar" :src="baseUrl + user.avatar" mode="aspectFit"></image>
|
||||
<image v-else src="../../static/imgs/myx.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="username">username(13583017106)</view>
|
||||
<view class="username">{{user.name?user.name:"未填写"}}({{user.mobile}})</view>
|
||||
<view class="">
|
||||
<u-rate active-color="#ffd74e" :count="count" v-model="value"></u-rate>
|
||||
</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">
|
||||
@ -38,13 +39,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "../../utils/request";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
description: '您的宝贵建议,就是我们前进的动力~动动手指,帮助我们做得更好~~',
|
||||
count: 10,
|
||||
value: 2,
|
||||
count: 5,
|
||||
value: 0,
|
||||
value1: '',
|
||||
textlist: [{
|
||||
text: '外瑞古德'
|
||||
@ -67,16 +69,30 @@
|
||||
{
|
||||
text: ''
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
],
|
||||
user:{},
|
||||
// url信息
|
||||
baseUrl: this.$baseUrl,
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.getUser()
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 查询当前登录用户信息
|
||||
getUser(){
|
||||
request({
|
||||
url: 'business/userManager/user/getUser',
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
if (res.data) {
|
||||
this.user = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
goback() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
@ -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,19 +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'
|
||||
|
@ -28,7 +28,7 @@
|
||||
@scrolltolower="scrolltolower">
|
||||
<!-- 油品订单列表 -->
|
||||
<view class="box-order" v-for="(item,index) in list" :key="index">
|
||||
<view class="or-box-top">
|
||||
<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">
|
||||
<view class="but-box" @click="goOrderInfo(item.id)">
|
||||
<view class="huis">订单金额</view>
|
||||
<view class="">¥{{item.orderAmount}}</view>
|
||||
</view>
|
||||
<view class="but-box">
|
||||
<view class="but-box" @click="goOrderInfo(item.id)">
|
||||
<view class="huis">优惠合计</view>
|
||||
<view class="reds">¥{{item.discountAmount}}</view>
|
||||
</view>
|
||||
<view class="but-box">
|
||||
<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()
|
||||
@ -408,6 +408,11 @@
|
||||
url: '/pagesRefuel/orderDetail/index?orderNo=' + orderNo,
|
||||
})
|
||||
},
|
||||
goOrderInfo(orderId){
|
||||
uni.navigateTo({
|
||||
url: '/pagesMy/details/details?orderId=' + orderId,
|
||||
})
|
||||
},
|
||||
goComment() {
|
||||
uni.navigateTo({
|
||||
url: "/pagesMy/comment/comment"
|
||||
|
@ -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,6 +324,7 @@
|
||||
title:res.data.error,
|
||||
icon:"none"
|
||||
})
|
||||
// _this.goBack()
|
||||
return;
|
||||
}
|
||||
if(res.data.success == "ok"){
|
||||
@ -461,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)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 查看是否有可使用的储值卡金额
|
||||
@ -517,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
|
||||
}
|
||||
@ -537,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
|
||||
}
|
||||
}
|
||||
@ -562,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
|
||||
}
|
||||
@ -582,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
|
||||
}
|
||||
}
|
||||
@ -607,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
|
||||
}
|
||||
@ -627,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()
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -840,7 +707,7 @@
|
||||
},
|
||||
|
||||
// 根据店铺id查询用户信息
|
||||
getUser(id){
|
||||
async getUser(id){
|
||||
let _this = this;
|
||||
request({
|
||||
url: "business/userManager/user/storeUser",
|
||||
@ -854,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)
|
||||
})
|
||||
},
|
||||
@ -961,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;
|
||||
|
Loading…
Reference in New Issue
Block a user