diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java index c54bc0b56..24d21682f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java @@ -157,7 +157,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl map) { Map refund = new HashMap<>(); // try { - AllOrderInfo allOrderInfo = selectAllOrderInfoByOrderNo(map.get("orderNo")); + AllOrderInfo allOrderInfo = selectAllOrderInfoByOrderNo(map.get("orderNo")); if (ObjectUtil.isEmpty(map.get("type"))) { throw new RuntimeException("该订单不支持退款,无退款类别!"); @@ -192,7 +192,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl 0) { try { refund = fyPayService.refund(map); } catch (Exception e) { @@ -213,16 +213,18 @@ public class AllOrderInfoServiceImpl extends ServiceImpl map) { + +// map.get("refundOrderNo") +// map.get("isOilVouchers") // 处理订单状态 oilOrder.setOrderStatus("refund"); oilOrderService.updateById(oilOrder); @@ -321,7 +321,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl油品: - ¥{{cashierOrder.oilPayAmount}} - 优惠卷 + +
退款原因
@@ -351,7 +362,7 @@

- 退款仅支持全额退款,退款金额将按照支付信息原路退回、优惠券、储值卡等原路退回处理 +
取 消 @@ -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,17 +649,20 @@ 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 - if (response.data.status === "refund") { - this.$message({ - type: 'info', - message: '该订单已经退款' - }); - this.dialogRefund = false; - } + + // + this.getOilList(response.data.orderNo) + if (response.data.status === "refund") { + this.$message({ + type: 'info', + message: '该订单已经退款' + }); + this.dialogRefund = false; + } }) //退款确定 // this.$confirm('是否将该收银台下的订单全部退款, 是否继续?', '提示', { @@ -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({