退款处理

This commit is contained in:
wangh 2024-01-16 16:10:28 +08:00
parent 4cddc769d1
commit 82a739ce75
14 changed files with 243 additions and 61 deletions

View File

@ -12,5 +12,8 @@ public class LJGoodsDto extends LJGoods {
// 变动原因 // 变动原因
private String document; private String document;
private String oddNumber;
} }

View File

@ -257,6 +257,7 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
stockTrack.setStoreId(goods.getStoreId()); stockTrack.setStoreId(goods.getStoreId());
stockTrack.setDocument(goods.getDocument()); stockTrack.setDocument(goods.getDocument());
stockTrack.setChangeNumber(goods.getNumberOfChanges()); stockTrack.setChangeNumber(goods.getNumberOfChanges());
stockTrack.setOddNumber(goods.getOddNumber());
int i = trackService.insertStockTrack(stockTrack); int i = trackService.insertStockTrack(stockTrack);
return i>0; return i>0;
} }

View File

@ -71,4 +71,9 @@ public class AllOrderInfoController extends BaseController {
public ResponseObject refund(@RequestBody Map<String,String> map){ public ResponseObject refund(@RequestBody Map<String,String> map){
return getSuccessResult(allOrderInfoService.refund(map)); return getSuccessResult(allOrderInfoService.refund(map));
} }
@GetMapping("/getOrderInfo")
public ResponseObject getOrderInfo(String orderNo, String type) {
return getSuccessResult(allOrderInfoService.getOrderInfo(orderNo,type));
}
} }

View File

@ -60,4 +60,7 @@ public interface AllOrderInfoService {
public int getOrderNum(Integer StoreId); public int getOrderNum(Integer StoreId);
Integer getOrderInfo(String orderNo, String type);
} }

View File

@ -24,7 +24,9 @@ import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.order.service.*; import com.fuint.business.order.service.*;
import com.fuint.business.order.vo.AllOrderInfoVo; import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.OrderGoodsVo; import com.fuint.business.order.vo.OrderGoodsVo;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import com.fuint.business.petrolStationManagement.entity.OilTracking; import com.fuint.business.petrolStationManagement.entity.OilTracking;
import com.fuint.business.petrolStationManagement.service.OilGunService;
import com.fuint.business.petrolStationManagement.service.OilTankService; import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.business.petrolStationManagement.service.OilTrackingService; import com.fuint.business.petrolStationManagement.service.OilTrackingService;
import com.fuint.repository.mapper.MtOpenGiftMapper; import com.fuint.repository.mapper.MtOpenGiftMapper;
@ -32,6 +34,7 @@ import com.fuint.repository.model.MtOrderGoods;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -133,28 +136,29 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
@Resource @Resource
OilTrackingService oilTrackingService; OilTrackingService oilTrackingService;
@Override @Override
@Transactional
public int refund(Map<String, String> map) { public int refund(Map<String, String> map) {
Map<String, String> refund = null; Map<String, String> refund = new HashMap<>();
try { try {
AllOrderInfo allOrderInfo = selectAllOrderInfoByOrderNo(map.get("orderNo")); AllOrderInfo allOrderInfo = selectAllOrderInfoByOrderNo(map.get("orderNo"));
if (ObjectUtil.isEmpty(map.get("type"))) { if (ObjectUtil.isEmpty(map.get("type"))) {
throw new RuntimeException("该订单不支持退款,无退款类别!"); throw new RuntimeException("该订单不支持退款,无退款类别!");
}else if ("oilOrder".equals(map.get("type")) || "goodsOrder".equals(map.get("type"))) { }else if ("canRefund".equals(map.get("type"))) {
// 根据订单号查询订单 // 根据订单号查询订单
if ("APPLET_CODE".equals(allOrderInfo.getPayType())) { // 储值卡不支持退款 if ("APPLET_CODE".equals(allOrderInfo.getPayType())) { // 储值卡不支持退款
throw new RuntimeException("该订单不支持退款!"); throw new RuntimeException("该订单不支持退款!");
} }
// 判断是否有退款金额 // 判断是否有退款金额 && ObjectUtil.isNotEmpty(map.get("refundAmt") // 目前全退
if (ObjectUtil.isNotEmpty(allOrderInfo.getPayMoney()) && ObjectUtil.isNotEmpty(map.get("refundAmt"))) { if (ObjectUtil.isNotEmpty(allOrderInfo.getPayMoney())) {
// 总金额金钱的传值需要×100 // 总金额金钱的传值需要×100
BigDecimal payMoneyBig = new BigDecimal(allOrderInfo.getPayMoney().toString()); BigDecimal payMoneyBig = new BigDecimal(allOrderInfo.getPayMoney().toString());
BigDecimal payMoneyBefBig = payMoneyBig.multiply(new BigDecimal("100")); BigDecimal payMoneyBefBig = payMoneyBig.multiply(new BigDecimal("100"));
// 退款金额(暂不支持部分退款) // 退款金额(暂不支持部分退款)
// BigDecimal refundAmtBig = new BigDecimal(map.get("refundAmt")); // BigDecimal refundAmtBig = new BigDecimal(map.get("refundAmt"));
// BigDecimal refundAmtBefBig = refundAmtBig.multiply(new BigDecimal("100")); // BigDecimal refundAmtBefBig = refundAmtBig.multiply(new BigDecimal("100"));
map.put("totalAmt",payMoneyBefBig.toString()); map.put("totalAmt",payMoneyBefBig.stripTrailingZeros().toString());
map.put("refundAmt",payMoneyBefBig.toString()); map.put("refundAmt",payMoneyBefBig.stripTrailingZeros().toString());
map.put("orderNo",allOrderInfo.getOrderNo()); map.put("orderNo",allOrderInfo.getOrderNo());
map.put("payType",allOrderInfo.getPayType()); map.put("payType",allOrderInfo.getPayType());
@ -169,15 +173,20 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
throw new RuntimeException("该订单类型不支持退款!"); throw new RuntimeException("该订单类型不支持退款!");
} }
if (!"CASH".equals(allOrderInfo.getPayType())) {
refund = fyPayService.refund(map); refund = fyPayService.refund(map);
}else {
// 现金退款处理
refund.put("result_msg","SUCCESS");
}
// 处理退款结果 // 处理退款结果
if (ObjectUtil.isNotEmpty(refund.get("result_msg"))) { if (ObjectUtil.isNotEmpty(refund.get("result_msg"))) {
if ("SUCCESS".equals(refund.get("result_msg"))) { if ("SUCCESS".equals(refund.get("result_msg"))) {
// 修改该总订单的数据 // 修改该总订单的数据
allOrderInfo.setPayType("refund"); allOrderInfo.setStatus("refund");
// allOrderInfo.setReasonRefund("refund"); allOrderInfo.setReasonRefund(map.get("refundRemark"));
// allOrderInfo.setRefOrderNo("refund"); allOrderInfo.setRefOrderNo(map.get("refundOrderNo"));
baseMapper.updateById(allOrderInfo); baseMapper.updateById(allOrderInfo);
// 处理油品订单 // 处理油品订单
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(map.get("orderNo")); OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(map.get("orderNo"));
@ -190,19 +199,17 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
cashierOrderService.updateById(orderNo); cashierOrderService.updateById(orderNo);
} }
if (ObjectUtil.isNotEmpty(oilOrder)) { if (ObjectUtil.isNotEmpty(oilOrder)) {
disposeOil(oilOrder); disposeOil(oilOrder,map.get("refundOrderNo"));
} }
if (ObjectUtil.isNotEmpty(ljOrder)) { if (ObjectUtil.isNotEmpty(ljOrder)) {
disposeGoods(ljOrder); disposeGoods(ljOrder,map.get("refundOrderNo"));
} }
}else { }else {
throw new RuntimeException("退款失败"); throw new RuntimeException("退款失败");
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("退款失败"); throw new RuntimeException("退款失败");
} }
log.info("refund{}",refund); log.info("refund{}",refund);
@ -224,8 +231,11 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
return map; return map;
} }
@Resource
OilGunService oilGunService;
// 处理油品 // 处理油品
private void disposeOil(OilOrder oilOrder) { private void disposeOil(OilOrder oilOrder,String refundOrderNo) {
// 处理订单状态 // 处理订单状态
oilOrder.setOrderStatus("refund"); oilOrder.setOrderStatus("refund");
oilOrderService.updateById(oilOrder); oilOrderService.updateById(oilOrder);
@ -234,23 +244,22 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
List<OilOrder> oilOrders = oilOrderService.selectOilOrder(oilOrder.getOrderNo()); List<OilOrder> oilOrders = oilOrderService.selectOilOrder(oilOrder.getOrderNo());
// 获取油罐数据 // 获取油罐数据
for (OilOrder order : oilOrders) { for (OilOrder order : oilOrders) {
OilGun oilGun = oilGunService.queryById(Integer.valueOf(order.getOilGunNum()));
// 处理库存 // 处理库存
oilTankService.addStoredQuantity(order.getTankId(),order.getOilNum()); oilTankService.addStoredQuantity(oilGun.getTankId(),order.getOilNum());
// 处理库存跟踪 // 处理库存跟踪
OilTracking oilTracking = new OilTracking(); OilTracking oilTracking = new OilTracking();
oilTracking.setDocument("油品退款"); oilTracking.setDocument("油品退款");
oilTracking.setQuantityChange(-order.getOilNum()); oilTracking.setQuantityChange(order.getOilNum());
oilTracking.setStoreId(order.getStoreId()); oilTracking.setStoreId(order.getStoreId());
oilTracking.setTankId(order.getTankId()); oilTracking.setTankId(oilGun.getTankId());
oilTracking.setOrderNumber(refundOrderNo);
OilTracking insert = oilTrackingService.insert(oilTracking); OilTracking insert = oilTrackingService.insert(oilTracking);
} }
/**
* todo
* 油品总价计算
*/
} }
// 处理商品 // 处理商品
private void disposeGoods(LJOrder ljOrder) { private void disposeGoods(LJOrder ljOrder,String refundOrderNo) {
// 处理订单状态 // 处理订单状态
ljOrder.setStatus("refund"); ljOrder.setStatus("refund");
ljOrderService.updateById(ljOrder); ljOrderService.updateById(ljOrder);
@ -261,11 +270,33 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
LJGoodsDto goods = new LJGoodsDto(); LJGoodsDto goods = new LJGoodsDto();
goods.setId(orderGoodsVo.getOrderId()); goods.setId(orderGoodsVo.getOrderId());
goods.setNumberOfChanges(ljOrder.getGoodsNum()); goods.setNumberOfChanges(ljOrder.getGoodsNum());
goods.setDocument("商品退款");
goods.setOddNumber(refundOrderNo);
ljGoodsService.editGoodsInventory(goods); ljGoodsService.editGoodsInventory(goods);
} }
} }
/**
* 查询退款提醒
*/
public Integer getOrderInfo(String orderNo, String type) {
// 处理油品订单
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo);
// 处理商品订单
LJOrder ljOrder = ljOrderService.selectGoodsOrder(orderNo);
if ("oil".equals(type)) {
if (ObjectUtil.isNotEmpty(ljOrder)) {
return 1;
}
}else if ("goods".equals(type)) {
if (ObjectUtil.isNotEmpty(oilOrder)) {
return 1;
}
}
return 0;
}
} }

View File

@ -86,7 +86,7 @@ public interface OilTankMapper {
* @return 影响行数 * @return 影响行数
*/ */
int update(OilTank oilTank); int update(OilTank oilTank);
int addStoredQuantityByLock(@Param("tankId") Integer tankId,@Param("changeNum") Double changeNum,Double totalAmount,Double discountedPrice); int addStoredQuantityByLock(@Param("tankId") Integer tankId,@Param("changeNum") Double changeNum,@Param("totalAmount") Double totalAmount, @Param("discountedPrice")Double discountedPrice);
int subtractStoredQuantityByLock(@Param("tankId") Integer tankId,@Param("changeNum") Double changeNum); int subtractStoredQuantityByLock(@Param("tankId") Integer tankId,@Param("changeNum") Double changeNum);

View File

@ -429,7 +429,7 @@
total_price = total_price + #{totalAmount}, total_price = total_price + #{totalAmount},
</if> </if>
<if test="discountedPrice != null and discountedPrice != ''"> <if test="discountedPrice != null and discountedPrice != ''">
discounted_price = #{discountedPrice} discounted_price = #{discountedPrice},
</if> </if>
update_time = NOW() update_time = NOW()
where id = #{tankId} where id = #{tankId}

View File

@ -196,7 +196,7 @@ public class OilTankServiceImpl implements OilTankService {
// 单价*油量 // 单价*油量
BigDecimal disPrice = new BigDecimal(oilTank.getDiscountedPrice().toString()); BigDecimal disPrice = new BigDecimal(oilTank.getDiscountedPrice().toString());
BigDecimal multiply = disPrice.multiply(new BigDecimal(changeNum)); BigDecimal multiply = disPrice.multiply(new BigDecimal(changeNum));
return this.oilTankDao.addStoredQuantityByLock(tankId, changeNum, multiply.doubleValue(),null) >0 ; return this.oilTankDao.addStoredQuantityByLock(tankId, changeNum, Double.valueOf(multiply.toString()),null) >0 ;
} }
/** /**

View File

@ -8,3 +8,10 @@ export function refundApi(data) {
data: data data: data
}) })
} }
export function getOrderInfoApi(data) {
return request({
url: '/business/allOrderInfo/getOrderInfo',
method: 'get',
params: data
})
}

View File

@ -110,8 +110,9 @@
<el-table-column prop="payUser" label="付款用户"> </el-table-column> <el-table-column prop="payUser" label="付款用户"> </el-table-column>
<el-table-column prop="status" label="状态"> <el-table-column prop="status" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status == 'unpaid'">未支付</el-tag> <el-tag v-if="scope.row.status === 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status == 'paid'">已支付</el-tag> <el-tag type="success" v-else-if="scope.row.status === 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status === 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag> <el-tag type="danger" v-else>支付失败</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -129,6 +130,7 @@
@click="patchwork(scope.row)" @click="patchwork(scope.row)"
type="primary" plain round>补打</el-button> type="primary" plain round>补打</el-button>
<el-button style="width: 60px" size="mini" <el-button style="width: 60px" size="mini"
v-if = "scope.row.status !== 'refund'"
@click="handleRefund(scope.row.id)" @click="handleRefund(scope.row.id)"
type="danger" plain round>退款</el-button> type="danger" plain round>退款</el-button>
</template> </template>
@ -356,23 +358,48 @@ import {refundApi} from "@/api/cashier/refund";
}, },
// 退 // 退
handleRefund(id){ handleRefund(id){
//退
this.$confirm('是否将该收银台下的订单全部退款, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dialogRefund = true; this.dialogRefund = true;
cashierOrder(id).then( response => { cashierOrder(id).then( response => {
this.cashierOrder = response.data this.cashierOrder = response.data
if (response.data.status === "refund") {
this.$message({
type: 'info',
message: '该订单已经退款'
});
this.dialogRefund = false;
}
}) })
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}, },
refundConfirmed() { refundConfirmed() {
this.dialogRefund = false; this.dialogRefund = false;
// 退
// cashierOrder
console.log("cashierOrder",this.cashierOrder) console.log("cashierOrder",this.cashierOrder)
let map={ let map={
orderNo: this.cashierOrder.orderNo, orderNo: this.cashierOrder.orderNo,
storeId: this.cashierOrder.storeId, storeId: this.cashierOrder.storeId,
type: "cashierOrder" refundRemark:this.radio1 +"-"+ this.refundRemark,
type: "canRefund"
} }
refundApi(map).then(res=>{ refundApi(map).then(res=>{
this.$message({
type: 'info',
message: '退款成功'
});
this.getList();
this.getOrderStatistics();
this.getStaffList();
}) })
}, },

View File

@ -140,6 +140,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status == 'unpaid'">未支付</el-tag> <el-tag v-if="scope.row.status == 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status == 'paid'">已支付</el-tag> <el-tag type="success" v-else-if="scope.row.status == 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status === 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag> <el-tag type="danger" v-else>支付失败</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -154,17 +155,14 @@
<span>{{ parseTime(scope.row.payTime) }}</span> <span>{{ parseTime(scope.row.payTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">--> <template slot-scope="scope">
<!-- <template slot-scope="scope">--> <el-button style="width: 60px" size="mini"
<!-- <el-button--> v-if = "scope.row.status !== 'refund'"
<!-- size="mini"--> @click="handleRefund(scope.row.id)"
<!-- type="text"--> type="danger" plain round>退款</el-button>
<!-- icon="el-icon-edit"--> </template>
<!-- >更多操作</el-button>--> </el-table-column>
<!-- </template>-->
<!-- </el-table-column>-->
</el-table> </el-table>
</div> </div>
@ -225,10 +223,12 @@
</template> </template>
<script> <script>
import {getOrderGoods, listOrder,orderStatisticsApi} from "@/api/cashier/goodsorder"; import {getGoodsOrder, getOrderGoods, listOrder, orderStatisticsApi} from "@/api/cashier/goodsorder";
import {queryStaffs} from "@/api/cashier/staff"; import {queryStaffs} from "@/api/cashier/staff";
import {getDicts} from "@/api/dict/data"; import {getDicts} from "@/api/dict/data";
import { exportExcelGoodsOrderApi } from "@/api/order/exportExcel"; import { exportExcelGoodsOrderApi } from "@/api/order/exportExcel";
import {cashierOrder} from "@/api/cashier/cashierorder";
import {refundApi, getOrderInfoApi} from "@/api/cashier/refund";
export default { export default {
name: "order_Cashier", name: "order_Cashier",
@ -262,6 +262,7 @@ export default {
page: 1, page: 1,
pageSize: 10, pageSize: 10,
}, },
orderGoods:'',
// //
payList:[], payList:[],
dialogRefund: false, dialogRefund: false,
@ -299,6 +300,65 @@ export default {
this.orderStatistics = res.data; this.orderStatistics = res.data;
}) })
}, },
// 退
async handleRefund(id){
let title = '是否将该收银台下的订单全部退款'
await getOrderInfoApi().then(res=>{
if (res.code === 200) {
if (res.data === 1) {
title = '该订单下有其它油品订单,是否一并退款'
}
}
});
this.$confirm(title+', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dialogRefund = true;
getGoodsOrder({"id":id}).then( response => {
this.goods = response.data
if (response.data.status === "refund") {
this.$message({
type: 'info',
message: '该订单已经退款'
});
this.dialogRefund = false;
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
this.dialogRefund = false;
});
},
// 退
refundConfirmed() {
this.dialogRefund = false;
console.log("cashierOrder",this.goods)
let map={
orderNo: this.goods.orderNo,
storeId: this.goods.storeId,
refundRemark:this.radio1 +"-"+ this.refundRemark,
type: "canRefund"
}
refundApi(map).then(res=>{
if (res.code === 200){
this.$message({
type: 'info',
message: '退款成功'
});
this.created()
}
})
},
// id // id
queryStaf(list,id){ queryStaf(list,id){
let name = ""; let name = "";

View File

@ -187,8 +187,9 @@
</el-table-column> </el-table-column>
<el-table-column prop="orderStatus" label="付款状态" align="center" width="120"> <el-table-column prop="orderStatus" label="付款状态" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.orderStatus == 'unpaid'">未支付</el-tag> <el-tag v-if="scope.row.orderStatus === 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.orderStatus == 'paid'">已支付</el-tag> <el-tag type="success" v-else-if="scope.row.orderStatus === 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.orderStatus === 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag> <el-tag type="danger" v-else>支付失败</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -208,6 +209,7 @@
type="primary" plain round>补打</el-button> type="primary" plain round>补打</el-button>
<el-button style="width: 60px" size="mini" <el-button style="width: 60px" size="mini"
@click="handleRefund(scope.row.id)" @click="handleRefund(scope.row.id)"
v-if = "scope.row.status !== 'refund'"
type="danger" plain round>退款</el-button> type="danger" plain round>退款</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -251,7 +253,7 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogRefund = false"> </el-button> <el-button @click="dialogRefund = false"> </el-button>
<el-button type="primary" @click="dialogRefund = false"> </el-button> <el-button type="primary" @click="refundConfirmed()"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -265,6 +267,8 @@
import {getUser, queryUsers} from "@/api/cashier/user/user"; import {getUser, queryUsers} from "@/api/cashier/user/user";
import {oilNumberList, oilNumbers} from "@/api/cashier/oilnumber"; import {oilNumberList, oilNumbers} from "@/api/cashier/oilnumber";
import {getOilGuns, getOilNumberGun} from "@/api/cashier/oilGuns"; import {getOilGuns, getOilNumberGun} from "@/api/cashier/oilGuns";
import {cashierOrder} from "@/api/cashier/cashierorder";
import {getOrderInfoApi, refundApi} from "@/api/cashier/refund";
export default { export default {
name: "order_Cashier", name: "order_Cashier",
@ -363,11 +367,52 @@
}).catch(() => {}); }).catch(() => {});
}, },
// 退 // 退
handleRefund(id){ async handleRefund(id){
let title = '是否将该收银台下的订单全部退款'
await getOrderInfoApi().then(res=>{
if (res.code === 200) {
if (res.data === 1) {
title = '该订单下有其它商品订单,是否一并退款'
}
}
});
//退
this.$confirm(title+', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dialogRefund = true; this.dialogRefund = true;
oilOrderInfo(id).then( response => { oilOrderInfo(id).then( response => {
this.oilOrder = response.data this.oilOrder = response.data
}) })
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
refundConfirmed() {
this.dialogRefund = false;
console.log("cashierOrder",this.cashierOrder)
let map={
orderNo: this.oilOrder.orderNo,
storeId: this.oilOrder.storeId,
refundRemark:this.radio1 +"-"+ this.refundRemark,
type: "canRefund"
}
refundApi(map).then(res=>{
this.$message({
type: 'info',
message: '退款成功'
});
this.created()
})
}, },
// id // id
queryStaf(list,id){ queryStaf(list,id){

View File

@ -152,9 +152,9 @@
<el-button style="width: 60px" size="mini" <el-button style="width: 60px" size="mini"
@click="patchwork(scope.row)" @click="patchwork(scope.row)"
type="primary" plain round>补打</el-button> type="primary" plain round>补打</el-button>
<el-button style="width: 60px" size="mini" <!-- <el-button style="width: 60px" size="mini"-->
@click="handleRefund(scope.row.id)" <!-- @click="handleRefund(scope.row.id)"-->
type="danger" plain round>退款</el-button> <!-- type="danger" plain round>退款</el-button>-->
</template> </template>
</el-table-column> </el-table-column>

View File

@ -167,9 +167,9 @@
<el-button style="width: 60px" size="mini" <el-button style="width: 60px" size="mini"
@click="patchwork(scope.row)" @click="patchwork(scope.row)"
type="primary" plain round>补打</el-button> type="primary" plain round>补打</el-button>
<el-button style="width: 60px" size="mini" <!-- <el-button style="width: 60px" size="mini"-->
@click="handleRefund(scope.row.id)" <!-- @click="handleRefund(scope.row.id)"-->
type="danger" plain round>退款</el-button> <!-- type="danger" plain round>退款</el-button>-->
</template> </template>
</el-table-column> </el-table-column>