This commit is contained in:
cun-nan 2024-05-17 16:08:44 +08:00
parent 9e2a581288
commit 7b5d47d115
15 changed files with 243 additions and 167 deletions

View File

@ -218,10 +218,10 @@
<span v-if="oilInfo.length>0">{{ oilInfo[0].balanceAmount }}</span>
<span v-else>0</span>
</el-descriptions-item>
<el-descriptions-item label="囤油卡消费升数">
<span v-if="oilInfo.length>0">{{ oilInfo[0].oilCardAmount }}</span>
<span v-else>0</span>
</el-descriptions-item>
<!-- <el-descriptions-item label="囤油卡消费升数">-->
<!-- <span v-if="oilInfo.length>0">{{ oilInfo[0].oilCardAmount }}</span>-->
<!-- <span v-else>0</span>-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="找零金额">{{ cashierOrder.seekZero }}</el-descriptions-item>
<el-descriptions-item label="付款方式">
<span v-if="cashierOrder.payType == 'CASH'">现金</span>

View File

@ -198,7 +198,7 @@
<el-table-column label="付款信息" align="center">
<el-table-column prop="payAmount" label="实付金额" align="center"> </el-table-column>
<el-table-column prop="balanceAmount" label="储值卡付款金额" align="center" width="115"/>
<el-table-column prop="oilCardAmount" label="囤油卡付款升数" align="center" width="115"/>
<!-- <el-table-column prop="oilCardAmount" label="囤油卡付款升数" align="center" width="115"/>-->
<el-table-column prop="payUser" label="付款用户" align="center" width="110" > </el-table-column>
<el-table-column prop="payType" label="付款方式" align="center">
<template slot-scope="scope">

View File

@ -189,6 +189,7 @@ public class FyPayServiceImpl implements FyPayService {
oilOrder.setOrderStatus("paid");
oilOrder.setPayTime(date);
oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(),oilOrder.getUserId(),oilOrder.getActiveId(),oilOrder.getCouponId(),oilOrder.getActiveType(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(), Integer.valueOf(oilOrder.getOils()));
oilOrderService.insertFavorable(oilOrder, Double.valueOf(map1.get("oilCardAmount")));
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId())) staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),"1",orderNo);
// 修改油罐容量
List<JSONObject> jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class);
@ -213,6 +214,7 @@ public class FyPayServiceImpl implements FyPayService {
// 商品订单
goodsOrder.setStatus("paid");
goodsOrder.setPayTime(date);
goodsOrderService.insertFavorable(goodsOrder);
Boolean isMember = false;
if (goodsOrder.getUserId()!=null){
isMember = true;

View File

@ -217,9 +217,9 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
queryWrapper.eq(CardFuelRecord::getStoreId,cardFuelRecordDTO.getStoreId());
queryWrapper.eq(CardFuelRecord::getMtUserId,cardFuelRecordDTO.getMtUserId());
List<CardFuelRecord> cardFuelRecords = cardFuelRecordMapper.selectList(queryWrapper);
if (ObjectUtils.isNotEmpty(cardFuelRecords)){
Integer cardFuelId = cardFuelRecords.get(0).getCardFuelId();
CardFuelDiesel cardFuelDiesel = cardFuelDieselService.getById(cardFuelId);
Optional<CardFuelRecord> max = cardFuelRecords.stream().min(Comparator.comparing(CardFuelRecord::getLockupPrice));
CardFuelRecord cardFuelRecord = max.get();
CardFuelDiesel cardFuelDiesel = cardFuelDieselService.getById(cardFuelRecord.getCardFuelId());
if ("2".equals(cardFuelDiesel.getActiveTime())){
cardFuelRecordDTO.setExpireTime(cardFuelDiesel.getEndTime());
}else {
@ -230,7 +230,6 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
Date from = Date.from(instant1);
cardFuelRecordDTO.setExpireTime(from);
}
}

View File

@ -78,6 +78,17 @@ public class FavorableRecordsController extends BaseController {
return getSuccessResult(this.favorableRecordsService.insert(favorableRecords));
}
/**
* 新增数据
*
* @param favorableRecords 实体对象
* @return 新增结果
*/
@PostMapping("/insert")
public ResponseObject insert1(@RequestBody FavorableRecords favorableRecords) {
return getSuccessResult(this.favorableRecordsService.insert1(favorableRecords));
}
/**
* 修改数据
*

View File

@ -17,6 +17,8 @@ public interface FavorableRecordsService extends IService<FavorableRecords> {
boolean insert(FavorableRecords favorableRecords);
boolean insert1(FavorableRecords favorableRecords);
IPage selectList(Page page, FavorableRecords favorableRecords);
Map<String,Object> selectCount(FavorableRecords favorableRecords);

View File

@ -7,10 +7,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.favorableRecords.mapper.FavorableRecordsMapper;
import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRecords;
import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.sun.org.apache.bcel.internal.generic.NEW;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -26,6 +29,9 @@ import java.util.Map;
@Service("favorableRecordsService")
public class FavorableRecordsServiceImpl extends ServiceImpl<FavorableRecordsMapper, FavorableRecords> implements FavorableRecordsService {
@Autowired
private ILJStoreService storeService;
@Override
public boolean insert(FavorableRecords favorableRecords) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@ -34,6 +40,13 @@ public class FavorableRecordsServiceImpl extends ServiceImpl<FavorableRecordsMap
return save(favorableRecords);
}
@Override
public boolean insert1(FavorableRecords favorableRecords) {
LJStore store = storeService.selectStoreByStoreId(favorableRecords.getStoreId());
favorableRecords.setChainStoreId(store.getChainStoreId());
return save(favorableRecords);
}
@Override
public IPage selectList(Page page, FavorableRecords favorableRecords) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();

View File

@ -3,7 +3,9 @@ package com.fuint.business.order.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRecords;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.entity.OilOrder;
import com.fuint.business.order.vo.LJOrderVo;
import org.springframework.transaction.annotation.Transactional;
@ -58,6 +60,9 @@ public interface LJOrderService extends IService<LJOrder> {
*/
public int updateGoodOrder(LJOrder order);
// 添加优惠记录
void insertFavorable(LJOrder order);
Map<String, String> orderStatistics(LJOrder order);
LJOrder getStatisticsByTime(Date time ,Integer goodsId, String payType);

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRecords;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.entity.OilOrder;
import com.fuint.business.order.vo.OilOrderVo;
@ -83,6 +84,12 @@ public interface OilOrderService extends IService<OilOrder> {
*/
public Map<String,Object> insertOilOrder(Map<String ,String> map) throws Exception;
/**
* 添加优惠记录信息
* @param order
*/
void insertFavorable(OilOrder order,Double oilCardAmount);
/**
* 消费有礼调用接口
* @param storeId 店铺id

View File

@ -8,7 +8,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRecords;
import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.entity.OilOrder;
import com.fuint.business.order.entity.OrderGoods;
import com.fuint.business.order.mapper.LJOrderMapper;
import com.fuint.business.order.service.LJOrderService;
@ -21,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -33,6 +37,8 @@ public class LJOrderServiceImpl extends ServiceImpl<LJOrderMapper, LJOrder> impl
@Autowired
@Lazy
private OrderGoodsService orderGoodsService;
@Resource
private FavorableRecordsService favorableRecordsService;
@Override
public IPage<LJOrder> selectOrderList(Page page, LJOrder order) {
@ -104,6 +110,21 @@ public class LJOrderServiceImpl extends ServiceImpl<LJOrderMapper, LJOrder> impl
return row;
}
// 添加优惠记录
@Override
public void insertFavorable(LJOrder order) {
FavorableRecords favorableRecords = new FavorableRecords();
favorableRecords.setStoreId(order.getStoreId());
favorableRecords.setOrderNo(order.getOrderNo());
favorableRecords.setFavConsumptionType("商品消费");
favorableRecords.setFavFrom("收银台");
favorableRecords.setFavType("商品消费");
if (order.getDiscount()>0.0){
favorableRecords.setFavMoney(order.getDiscount());
favorableRecordsService.insert1(favorableRecords);
}
}
@Override
public Map<String, String> orderStatistics(LJOrder order) {
//商品笔数

View File

@ -39,6 +39,8 @@ import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
import com.fuint.business.marketingActivity.cardValue.mapper.CardValueRecordMapper;
import com.fuint.business.marketingActivity.cardValueChildrens.entity.CardValudChildrens;
import com.fuint.business.marketingActivity.cardValueChildrens.service.CardValudChildrensService;
import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRecords;
import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService;
import com.fuint.business.member.mapper.LJStaffMapper;
import com.fuint.business.order.entity.*;
import com.fuint.business.order.mapper.LJOrderMapper;
@ -130,6 +132,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private IntegralSettingsService integralSettingsService;
@Resource
private OilGunService oilGunService;
@Resource
private FavorableRecordsService favorableRecordsService;
@Override
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
@ -287,6 +291,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
log.info("11111111111111111111111285:",map.get("levelAmount"));
Double levelAmount = Double.valueOf(map.get("levelAmount"));
Double activeAmount = Double.valueOf(map.get("activeAmount"));
Double oilCardAmount1 = Double.valueOf(map.get("oilCardAmount1"));
// 优惠券id
Integer cardFavorableId = null;
if (StringUtils.isNotEmpty(map.get("cardFavorableId"))){
@ -496,11 +501,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setPayTime(new Date());
order.setOrderStatus("paid");
}
if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){
baseMapper.updateById(order);
}else {
// if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){
// baseMapper.updateById(order);
// }else {
baseMapper.insert(order);
}
// }
oilOrder1 = this.selectOilOrderByOrderNo(orderNo);
}
}
@ -559,6 +564,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
map1.put("oilOrder",map.get("oilOrder"));
map1.put("tankId",map.get("oilOrder"));
map1.put("storeId",storeId.toString());
map1.put("oilCardAmount",oilCardAmount1.toString());
// 调用支付接口
try {
@ -578,11 +584,13 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (oilOrder2.getOrderStatus().equals("paid")){
cashierOrder.setPayTime(new Date());
if (ObjectUtil.isNotEmpty(oilOrder2.getUserId())) integralSettingsService.refuelPoints(oilOrder2);
insertFavorable(oilOrder2,oilCardAmount1);
}
cashierOrder.setOilOrderId(oilOrder2.getId());
}
if (!ObjectUtil.isEmpty(goodsOrder1)){
orders.put("goodsOrder",goodsOrder1);
if (goodsOrder1.getStatus().equals("paid")) orderService.insertFavorable(goodsOrder1);
cashierOrder.setGoodsOrderId(goodsOrder1.getId());
}
orders.put("orderNo",orderNo);
@ -590,6 +598,31 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
return orders;
}
// 添加优惠记录
@Override
public void insertFavorable(OilOrder order,Double oilCardAmount) {
FavorableRecords favorableRecords = new FavorableRecords();
favorableRecords.setStoreId(order.getStoreId());
favorableRecords.setOrderNo(order.getOrderNo());
favorableRecords.setFavConsumptionType("油品消费");
favorableRecords.setFavFrom("收银台");
if (oilCardAmount>0.0){
favorableRecords.setFavType("囤油卡消费");
favorableRecords.setFavMoney(oilCardAmount);
favorableRecordsService.insert1(favorableRecords);
}
if (order.getLevelAmount()>0.0){
favorableRecords.setFavType("等级消费");
favorableRecords.setFavMoney(order.getLevelAmount());
favorableRecordsService.insert1(favorableRecords);
}
if (order.getActiveAmount()>0.0){
favorableRecords.setFavType("营销活动消费");
favorableRecords.setFavMoney(order.getActiveAmount());
favorableRecordsService.insert1(favorableRecords);
}
}
// 调用消费有礼接口
public void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Double payAmount,Integer oilId) throws Exception {
if (ObjectUtil.isNotEmpty(userId)){

View File

@ -85,3 +85,12 @@ export function getOilOrderAllAmount(id) {
method: 'get',
})
}
// 新增优惠记录信息
export function addFavorable(data) {
return request({
url: '/business/marketingActivity/favorableRecords/insert',
method: 'post',
data: data
})
}

View File

@ -54,6 +54,21 @@
<div class="hj-box" style="justify-content: flex-end">合计: {{ (oilAmount + goodsAmount).toFixed(2) }}</div>
</div>
<div style="overflow-y: scroll;height: 42vh">
<div class="center-left-hj" v-show="isMember && refuelMoney && refuelMoney.length>0">
<div>
<!-- <el-checkbox-->
<!-- style="color: black;font-size: 16px"-->
<!-- v-model="checkAll3" @change="handleCheckAllChange3">-->
<!-- </el-checkbox>-->
囤油卡
<div style="margin: 5px 0" v-for="(item,index) in refuelMoney" :key="index">
{{ item.type }}
锁价{{ item.lockupPrice ? item.lockupPrice : 0.00 }}/L
<!-- 余额{{ item.refuelMoney ? item.refuelMoney : 0.00 }}L-->
</div>
</div>
<div v-if="oilCardAmount>0">- {{ oilCardAmount }}</div>
</div>
<div class="center-left-hj">
<div>
<el-popover
@ -121,21 +136,6 @@
</div>
<div>-{{ oilDiscount.toFixed(2) }}</div>
</div>
<div class="center-left-hj" v-show="isMember && refuelMoney && refuelMoney.length>0">
<div>
<el-checkbox
style="color: black;font-size: 16px"
v-model="checkAll3" @change="handleCheckAllChange3">
</el-checkbox><!--:indeterminate="isIndeterminate3"-->
囤油卡
<div style="margin: 5px 0" v-for="(item,index) in refuelMoney" :key="index">
{{ item.type }}
<!-- <span style="color: #00afff">{{ item.oilType }}</span>-->
余额{{ item.refuelMoney ? item.refuelMoney : 0.00 }}L
</div>
</div>
<div>- {{ consumeRefuelMoney }}L</div>
</div>
<div class="center-left-hj" v-show="isMember">
<div>
<el-checkbox style="color: black;font-size: 16px" :disabled="balance==0"
@ -574,13 +574,13 @@
<span style="font-weight: bold">{{member.cardBalance ? member.cardBalance : "0"}}</span>
</template>
<el-descriptions-item label="账户余额">{{member.cardBalance ? member.cardBalance : 0}}</el-descriptions-item>
<el-descriptions-item label="囤油卡余额" v-if="refuelMoney">
<div style="margin: 5px 0" v-for="(item,index) in refuelMoney" :key="index">
{{ item.type }}
<!-- <span style="color: #00afff">{{ item.oilType }}</span>-->
余额{{ item.refuelMoney ? item.refuelMoney : 0.00 }}L
</div>
</el-descriptions-item>
<!-- <el-descriptions-item label="囤油卡余额" v-if="refuelMoney">-->
<!-- <div style="margin: 5px 0" v-for="(item,index) in refuelMoney" :key="index">-->
<!-- {{ item.type }}-->
<!-- &lt;!&ndash; <span style="color: #00afff">{{ item.oilType }}</span>&ndash;&gt;-->
<!-- 余额{{ item.refuelMoney ? item.refuelMoney : 0.00 }}L-->
<!-- </div>-->
<!-- </el-descriptions-item>-->
</el-descriptions>
</el-row>
<span slot="footer" class="dialog-footer">
@ -732,7 +732,7 @@
v-for="(item,index) in cardFuelDieselList" :key="index"
:class="activeKey === index ? 'select2' : ''"
@click="recharge(index)">
<div class="top1"><span class="amount1">{{ item.incomeLitres }}</span>L</div>
<!-- <div class="top1"><span class="amount1">{{ item.incomeLitres }}</span>L</div>-->
<div style="font-size: 14px">售价<span style="color: #00afff;">{{ item.rechargeBalance }}</span></div>
<div style="font-size: 14px">锁价<span style="color: #00afff;">{{ item.lockupPrice }}</span>/</div>
</div>
@ -1242,9 +1242,9 @@
import {getDicts} from "@/api/dict/data";
import {getOilNameList, getOilNumGun, listOilNumGun} from "@/api/cashier/oilnumgun";
import {listgoods} from "@/api/cashier/ljgoods";
import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {getRecord, getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {queryStaffList, queryStaffs, staffInfo} from "@/api/cashier/staff";
import {addLJGoods, goodsOrder, oilOrder, scanAppletQrCode} from "@/api/cashier/oilorder";
import {addFavorable, addLJGoods, goodsOrder, oilOrder, scanAppletQrCode} from "@/api/cashier/oilorder";
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
import {getOilGun, getOilTank} from "@/api/cashier/oilGuns";
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
@ -1378,6 +1378,8 @@
},
//
consumeAmount:0,
//
oilCardAmount:0,
//
balance:0,
//
@ -1854,9 +1856,9 @@
await getUserInfoMobile({mobile:this.member.mobile}).then(res => {
if (res.data){
this.member = res.data
if (res.data.refuelMoney){
this.refuelMoney = JSON.parse(res.data.refuelMoney)
}
// if (res.data.refuelMoney){
// this.refuelMoney = JSON.parse(res.data.refuelMoney)
// }
this.rechargeBalCard = false
this.rechargeOilCard = false
}
@ -2484,11 +2486,11 @@
getUserInfoMobile({mobile:mobile}).then( response => {
if (response.data){
this.member = response.data
if (response.data.refuelMoney){
this.refuelMoney = JSON.parse(response.data.refuelMoney)
}else {
this.refuelMoney = null
}
// if (response.data.refuelMoney){
// this.refuelMoney = JSON.parse(response.data.refuelMoney)
// }else {
// this.refuelMoney = null
// }
this.storeId = response.data.storeId
this.isSure = true
}
@ -2600,7 +2602,7 @@
this.map.authCode = this.authCode;
this.map.allAmount = +this.oilActualPay + +this.goodsActualPay
this.map.consumeAmount = 0.0;
this.map.refuelMoney = JSON.stringify(this.refuelMoney)
// this.map.refuelMoney = JSON.stringify(this.refuelMoney)
this.map.couponId = this.useCouponIds
if (this.staff){
this.map.staffId = this.staff.id
@ -3136,12 +3138,10 @@
this.map.userId = data.id;
this.balance = this.member.cardBalance;
await this.getGrade(this.member.id,this.member.gradeId)
if (data.refuelMoney){
// 使
this.refuelMoney = JSON.parse(data.refuelMoney)
await this.changeRefuelMoney();
}
if (this.balance>0 && this.oilAmount>0 && !this.isOilStorageCard){
if (this.balance>0 && this.oilAmount>0 || this.isOilStorageCard){
this.checkAll4 = true
if (this.goodsOrder.length==0){
this.payType = "balance"
@ -3235,7 +3235,7 @@
}
}
// }
if(!this.isOilStorageCard){
if(this.isOilStorageCard){
this.countAmountFull()
}
if (type==1){
@ -3363,15 +3363,15 @@
// this.checkAll4 = true
// }
if (this.checkAll4) {
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction)) {
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction - this.oilCardAmount)) {
this.oilActualPay = 0
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction - this.oilCardAmount
} else {
this.oilActualPay = this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction - this.balance
this.oilActualPay = this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction - this.oilCardAmount - this.balance
this.consumeAmount = this.balance
}
}else {
this.oilActualPay = this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction
this.oilActualPay = this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction - this.oilCardAmount
this.consumeAmount = 0
}
}else {
@ -3495,11 +3495,11 @@
handleChoose(data) {
this.isSure = true;
this.member = data;
if (data.refuelMoney){
this.refuelMoney = JSON.parse(data.refuelMoney)
}else {
this.refuelMoney = null
}
// if (data.refuelMoney){
// this.refuelMoney = JSON.parse(data.refuelMoney)
// }else {
// this.refuelMoney = null
// }
this.dialogVisibleMember = false;
},
//
@ -3798,9 +3798,9 @@
this.checkAll4 = false;
this.isExistOilOrder = false
if (this.member.refuelMoney!=null){
this.refuelMoney = JSON.parse(this.member.refuelMoney)
}
// if (this.member.refuelMoney!=null){
// this.refuelMoney = JSON.parse(this.member.refuelMoney)
// }
this.amount = 0;
},
//
@ -3853,11 +3853,11 @@
if (this.isMember){
await this.getGrade(this.member.id,this.member.gradeId)
if (this.refuelMoney){
// if (this.refuelMoney){
// 使
await this.changeRefuelMoney();
}
if (this.balance>0 && this.oilAmount>0 && !this.isOilStorageCard){
// }
if (this.balance>0 && this.oilAmount>0 || !this.isOilStorageCard){
this.checkAll4 = true
if (this.goodsOrder.length==0) {
this.payType = "balance"
@ -3873,60 +3873,31 @@
},
//
changeRefuelMoney(){
this.oilDiscount = 0
this.couponAmount = 0
this.fullReduction = 0
let _this = this;
_this.consumeRefuelMoney = 0;
_this.oilActualPay = 0;
_this.hoardAmount = 0;
_this.oilAmount = 0;
_this.refuelMoney1 = []
let hoardAmount1 = 0;
let index = 0
let lastMoney=0;;
_this.oilOrder.forEach(item => {
let conRefMon = 0;
let hoardAmount = 0;
getRecord({mtUserId:this.member.id}).then(res => {
this.oilCardAmount = 0
let oilAmount = 0
this.refuelMoney = res.data
//
this.oilOrder.forEach(item => {
let amount = 0;
let amount1 = 0;
let id = ""
if (_this.refuelMoney){
let innerFlag = 0;
for (let i = 0;i < _this.refuelMoney.length;i++){
//
if (_this.refuelMoney[i].oilType==item.oilName && _this.refuelMoney[i].refuelMoney>0&&_this.consumeRefuelMoney<_this.refuelMoney[i].refuelMoney){
_this.refuelMoney1.push(item)
id = item.id
_this.isOilStorageCard = true
console.log(_this.refuelMoney[i].refuelMoney , item.liters,1547)
if(item.liters<=_this.refuelMoney[i].refuelMoney- _this.consumeRefuelMoney){
conRefMon= item.liters
let flag = false;
this.refuelMoney.forEach(i => {
if (item.oilName==i.oilType){
item.lockupPrice = i.lockupPrice
amount = item.lockupPrice * item.liters
this.isOilStorageCard = true
flag = false
}else {
conRefMon = _this.refuelMoney[i].refuelMoney - _this.consumeRefuelMoney
//
let lastOil = item.liters - conRefMon
hoardAmount = lastOil * item.oilPrice
flag = true
}
lastMoney += +hoardAmount
innerFlag =1;
}
}
if(innerFlag ==0){
lastMoney += +item.amount
}
}else {
lastMoney += +item.amount
}
_this.consumeRefuelMoney += +conRefMon
console.log(hoardAmount,1254)
_this.hoardAmount = +lastMoney.toFixed(2)
_this.oilAmount += +item.amount
})
_this.isDefaultUseCard();
// oilCardAmount
if (flag) amount = item.oilPrice * item.liters
oilAmount += amount
})
this.oilCardAmount = this.oilAmount - oilAmount
this.countAmountFull()
})
},
changeBalance(hoardAmount,id){
if (this.balance>0 && id != ""){
@ -4001,11 +3972,11 @@
getUserInfoMobile({mobile:this.userNo}).then( response => {
if (response.data){
this.member = response.data
if (response.data.refuelMoney){
this.refuelMoney = JSON.parse(response.data.refuelMoney)
}else {
this.refuelMoney = null
}
// if (response.data.refuelMoney){
// this.refuelMoney = JSON.parse(response.data.refuelMoney)
// }else {
// this.refuelMoney = null
// }
this.storeId = response.data.storeId
this.isSure = true
}else {
@ -4088,18 +4059,19 @@
this.map.goodsAmount = this.goodsAmount;
this.map.oilActualPay = this.oilActualPay;
this.map.goodsActualPay = this.goodsActualPay;
this.map.oilDiscount = (this.oilDiscount + this.fullReduction + this.couponAmount).toFixed(2) ;
this.map.oilDiscount = (this.oilDiscount + this.fullReduction + this.couponAmount + this.oilCardAmount).toFixed(2) ;
this.map.goodsDiscount = this.goodsDiscount;
this.map.goodsNum = this.goodsTotal;
this.map.balanceAmount = this.consumeAmount;
this.map.oilCardAmount = this.consumeRefuelMoney;
this.map.oilCardAmount1 = this.oilCardAmount;
this.map.oilOrder = JSON.stringify(this.oilOrder);
this.map.goodsOrder = JSON.stringify(this.goodsOrder);
this.map.authCode = this.authCode;
this.map.allAmount = +this.oilActualPay + +this.goodsActualPay
this.map.consumeAmount = this.consumeAmount;
if (this.consumeRefuelMoney>0) this.updateRefuelMoney();
this.map.refuelMoney = JSON.stringify(this.refuelMoney)
// if (this.consumeRefuelMoney>0) this.updateRefuelMoney();
// this.map.refuelMoney = JSON.stringify(this.refuelMoney)
this.map.couponId = this.useCouponIds
if (this.staff) {
this.map.staffId = this.staff.id
@ -4143,7 +4115,7 @@
let isPaySuccess = false;
await addLJGoods(_this.map).then( response => {
await addLJGoods(_this.map).then( async response => {
_this.orderNo = response.data.orderNo;
if (response.data.oilOrder != null) {
if (response.data.oilOrder.orderStatus == "paid") {
@ -4152,6 +4124,7 @@
isPaySuccess = true
_this.isPay = true;
_this.loading = false;
_this.printLocally()
_this.oilOrderReport()
@ -4208,6 +4181,7 @@
_this.consumeRefuelMoney = 0;
_this.oilTotal = 0;
_this.goodsTotal = 0;
_this.oilCardAmount = 0;
_this.isMember = false;
_this.isSure = false;
_this.oilOrder = []
@ -5068,9 +5042,9 @@
}
.mon2 {
width: 20%;
height: 75px;
height: 70px;
border: 0.5px #dadfe6 solid;
line-height: 25px;
line-height: 35px;
border-radius: 5px;
text-align: center;
margin: 0 10px;

View File

@ -229,10 +229,10 @@
<span v-if="oilInfo.length>0">{{ oilInfo[0].balanceAmount }}</span>
<span v-else>0</span>
</el-descriptions-item>
<el-descriptions-item label="囤油卡消费升数">
<span v-if="oilInfo.length>0">{{ oilInfo[0].oilCardAmount }}</span>
<span v-else>0</span>
</el-descriptions-item>
<!-- <el-descriptions-item label="囤油卡消费升数">-->
<!-- <span v-if="oilInfo.length>0">{{ oilInfo[0].oilCardAmount }}</span>-->
<!-- <span v-else>0</span>-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="找零金额">{{ cashierOrder.seekZero }}</el-descriptions-item>
<el-descriptions-item label="付款方式">
<span v-if="cashierOrder.payType == 'CASH'">现金</span>

View File

@ -199,7 +199,7 @@
<el-table-column label="付款信息" align="center">
<el-table-column prop="payAmount" label="实付金额" align="center"> </el-table-column>
<el-table-column prop="balanceAmount" label="储值卡付款金额" align="center" width="115"/>
<el-table-column prop="oilCardAmount" label="囤油卡付款升数" align="center" width="115"/>
<!-- <el-table-column prop="oilCardAmount" label="囤油卡付款升数" align="center" width="115"/>-->
<el-table-column prop="payUser" label="付款用户" align="center" width="110"> </el-table-column>
<el-table-column prop="payType" label="付款方式" align="center">
<template slot-scope="scope">
@ -325,10 +325,10 @@
<div>储值卡付款金额</div>
<div>{{ oilOrder.balanceAmount }}</div>
</div>
<div class="input-box" v-if="oilOrder.oilCardAmount>0">
<div>囤油卡付款升数</div>
<div>{{ oilOrder.oilCardAmount }}</div>
</div>
<!-- <div class="input-box" v-if="oilOrder.oilCardAmount>0">-->
<!-- <div>囤油卡付款升数</div>-->
<!-- <div>{{ oilOrder.oilCardAmount }}</div>-->
<!-- </div>-->
<div class="input-box">
<div>实付款</div>
<div>{{ oilOrder.payAmount }}</div>