退款
This commit is contained in:
parent
a0629a80fa
commit
e804dff7d5
@ -192,7 +192,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
throw new RuntimeException("该订单类型不支持退款!");
|
||||
}
|
||||
boolean flag = false;
|
||||
if (!"CASH".equals(allOrderInfo.getPayType()) ) {
|
||||
if (!"CASH".equals(allOrderInfo.getPayType()) && Double.valueOf(map.get("refundAmt")) > 0) {
|
||||
try {
|
||||
refund = fyPayService.refund(map);
|
||||
} catch (Exception e) {
|
||||
@ -213,16 +213,18 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
baseMapper.updateById(allOrderInfo);
|
||||
// 处理油品订单
|
||||
OilOrder oilOrder = new OilOrder();
|
||||
if (ObjectUtil.isNotEmpty(map.get("isGoods")) && "true".equals(map.get("isGoods"))) {
|
||||
if (ObjectUtil.isNotEmpty(map.get("isOil")) && "true".equals(map.get("isOil"))) {
|
||||
oilOrder = oilOrderService.selectOilOrderByOrderNo(map.get("orderNo"));
|
||||
|
||||
}
|
||||
|
||||
// 处理商品订单
|
||||
LJOrder ljOrder = new LJOrder();
|
||||
if (ObjectUtil.isNotEmpty(map.get("isOil")) && "true".equals(map.get("isOil"))) {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(map.get("isGoods")) && "true".equals(map.get("isGoods"))) {
|
||||
ljOrder = ljOrderService.selectGoodsOrder(map.get("orderNo"));
|
||||
}
|
||||
|
||||
|
||||
// 处理收银台订单
|
||||
CashierOrder orderNo = new CashierOrder();
|
||||
|
||||
@ -233,12 +235,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(oilOrder)) {
|
||||
// 判断是否推掉优惠卷
|
||||
boolean ifVou = false;
|
||||
if (ObjectUtil.isNotEmpty(map.get("isOilVouchers")) && "true".equals(map.get("isOilVouchers"))) {
|
||||
ifVou = true;
|
||||
}
|
||||
|
||||
disposeOil(oilOrder,map.get("refundOrderNo"),ifVou);
|
||||
disposeOil(oilOrder,map);
|
||||
commissionRecordService.addRefundRecord(oilOrder.getOrderNo(),"1",oilOrder.getStaffId(),oilOrder.getStoreId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(ljOrder)) {
|
||||
@ -300,7 +297,10 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
CardFavorableRecordService cardFavorableRecordService;
|
||||
|
||||
// 处理油品
|
||||
private void disposeOil(OilOrder oilOrder,String refundOrderNo, boolean ifVou) {
|
||||
private void disposeOil(OilOrder oilOrder,Map<String, String> map) {
|
||||
|
||||
// map.get("refundOrderNo")
|
||||
// map.get("isOilVouchers")
|
||||
// 处理订单状态
|
||||
oilOrder.setOrderStatus("refund");
|
||||
oilOrderService.updateById(oilOrder);
|
||||
@ -321,7 +321,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
oilTracking.setQuantityChange(order.getOilNum());
|
||||
oilTracking.setStoreId(order.getStoreId());
|
||||
oilTracking.setTankId(oilGun.getTankId());
|
||||
oilTracking.setOrderNumber(refundOrderNo);
|
||||
oilTracking.setOrderNumber(map.get("refundOrderNo"));
|
||||
OilTracking insert = oilTrackingService.insert(oilTracking);
|
||||
|
||||
// 处理储值卡
|
||||
@ -333,9 +333,12 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
userBalanceService.addUserOil(order.getOils(),order.getUserId(),nowAccountInfo.getChainStoreId(),order.getOilCardAmount());
|
||||
}
|
||||
// 处理优惠券
|
||||
if (ObjectUtil.isNotEmpty(order.getCouponId()) && ifVou) {
|
||||
if (ObjectUtil.isNotEmpty(map.get("isOilVouchers")) && "true".equals(map.get("isOilVouchers"))) {
|
||||
if (ObjectUtil.isNotEmpty(order.getCouponId())) {
|
||||
cardFavorableRecordService.updateStatus(order.getCouponId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -337,8 +337,19 @@
|
||||
|
||||
|
||||
<span>油品:</span>
|
||||
<el-checkbox v-model="isOil">¥{{cashierOrder.oilPayAmount}}</el-checkbox>
|
||||
<el-checkbox v-model="isOilVouchers">优惠卷</el-checkbox>
|
||||
<template >
|
||||
<el-checkbox v-if="oilInfo.length > 0" v-model="isOil">
|
||||
|
||||
<span v-if="oilInfo[0].payAmount && oilInfo[0].payAmount!='0.00'"> ¥{{cashierOrder.oilPayAmount}}</span>
|
||||
<span v-if="oilInfo[0].balanceAmount>0">储值卡:{{oilInfo[0].balanceAmount}} </span>
|
||||
<span v-if="oilInfo[0].oilCardAmount>0">屯油卡:{{ oilInfo[0].oilCardAmount}} </span>
|
||||
</el-checkbox>
|
||||
<el-checkbox v-if="oilInfo.length > 0 && oilInfo[0].couponId" v-model="isOilVouchers">优惠卷</el-checkbox>
|
||||
|
||||
<!-- <el-checkbox v-if="oilInfo.length > 0 && oilInfo[0].balanceAmount>0" v-model="isOilCard">储值卡:{{oilInfo[0].balanceAmount}}</el-checkbox>-->
|
||||
<!-- <el-checkbox v-if="oilInfo.length > 0 && oilInfo[0].oilCardAmount>0" v-model="isOilFuel">屯油卡:{{ oilInfo[0].oilCardAmount }}</el-checkbox>-->
|
||||
</template>
|
||||
|
||||
|
||||
<div style="margin: 10px 0">
|
||||
退款原因<br/>
|
||||
@ -351,7 +362,7 @@
|
||||
<div>
|
||||
<el-input placeholder="请输入退款原因" v-model="refundRemark"></el-input>
|
||||
<br/>
|
||||
<span style="color: grey;font-size: 12px">退款仅支持全额退款,退款金额将按照支付信息原路退回、优惠券、储值卡等原路退回处理</span>
|
||||
<!-- <span style="color: grey;font-size: 12px">退款仅支持全额退款,退款金额将按照支付信息原路退回、优惠券、储值卡等原路退回处理</span>-->
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogRefund = false">取 消</el-button>
|
||||
@ -433,9 +444,11 @@ import {refundApi} from "@/api/cashier/refund";
|
||||
import {getLodop} from "@/api/LodopFuncs";
|
||||
import {getOilNumberGun} from "@/api/cashier/oilGuns";
|
||||
import {formatDate} from "@/utils";
|
||||
import ScanPayCodeDialog from "@/views/cashier/components/scanPayCodeDialog.vue";
|
||||
|
||||
export default {
|
||||
name: "order_Cashier",
|
||||
components: {ScanPayCodeDialog},
|
||||
data(){
|
||||
return{
|
||||
// 退款备注
|
||||
@ -462,6 +475,8 @@ import {formatDate} from "@/utils";
|
||||
isOilVouchers:false,
|
||||
isGoods: false,
|
||||
isOil: false,
|
||||
isOilCard: false, // 是否推掉油卡
|
||||
isOilFuel: false, //是否推掉储值卡
|
||||
// 是否为当天时间
|
||||
isSysDate:false,
|
||||
// 收银台订单列表
|
||||
@ -634,10 +649,13 @@ import {formatDate} from "@/utils";
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 退款
|
||||
handleRefund(id){
|
||||
async handleRefund(id){
|
||||
this.dialogRefund = true;
|
||||
cashierOrder(id).then( response => {
|
||||
await cashierOrder(id).then( response => {
|
||||
this.cashierOrder = response.data
|
||||
|
||||
//
|
||||
this.getOilList(response.data.orderNo)
|
||||
if (response.data.status === "refund") {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
@ -675,7 +693,21 @@ import {formatDate} from "@/utils";
|
||||
this.dialogRefund = false;
|
||||
this.loading = true;
|
||||
console.log("cashierOrder",this.cashierOrder)
|
||||
// 计算退款总价
|
||||
let refundAmt = 0
|
||||
if (this.isGoods) {
|
||||
refundAmt += this.cashierOrder.goodsPayAmount
|
||||
}
|
||||
if (this.isOil && this.cashierOrder.oilPayAmount > 0) {
|
||||
refundAmt += this.cashierOrder.oilPayAmount
|
||||
}
|
||||
|
||||
// if (this.isOilCard || this.isOilFuel) {
|
||||
// this.isOil = true
|
||||
// }
|
||||
|
||||
let map={
|
||||
|
||||
orderNo: this.cashierOrder.orderNo,
|
||||
storeId: this.cashierOrder.storeId,
|
||||
refundRemark:this.radio1 +"-"+ this.refundRemark,
|
||||
@ -683,6 +715,9 @@ import {formatDate} from "@/utils";
|
||||
isOilVouchers:this.isOilVouchers,
|
||||
isGoods: this.isGoods,
|
||||
isOil: this.isOil,
|
||||
isOilCard: this.isOilCard, // 是否推掉油卡
|
||||
isOilFuel: this.isOilFuel, //是否推掉储值卡
|
||||
refundAmt: refundAmt
|
||||
}
|
||||
await refundApi(map).then(res=>{
|
||||
this.$message({
|
||||
|
Loading…
Reference in New Issue
Block a user