|
@@ -75,7 +75,18 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column type="index" min-width="80" />
|
|
<el-table-column type="index" min-width="80" />
|
|
<el-table-column label="订单号" prop="number" show-overflow-tooltip></el-table-column>
|
|
<el-table-column label="订单号" prop="number" show-overflow-tooltip></el-table-column>
|
|
- <el-table-column label="订单金额" prop="amount"></el-table-column>
|
|
|
|
|
|
+ <el-table-column label="支付金额" min-width="160" prop="amount">
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
+ <div>
|
|
|
|
+ <div style="text-decoration: line-through;">订单金额:¥{{row.amount}}</div>
|
|
|
|
+ <div style="color: #f01414;">实付金额:¥{{row.payAmount || row.amount}}</div>
|
|
|
|
+ <div v-if="row.ticketNo" class="refund-info">
|
|
|
|
+ <div style="font-size: 12px;">抵扣券券号:{{ row.ticketNo }}</div>
|
|
|
|
+ <div style="font-size: 12px;">抵扣券金额:¥{{ row.ticketAmount }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="桌号" prop="deskName"></el-table-column>
|
|
<el-table-column label="桌号" prop="deskName"></el-table-column>
|
|
<el-table-column label="备注" prop="remark"></el-table-column>
|
|
<el-table-column label="备注" prop="remark"></el-table-column>
|
|
<el-table-column label="类型" prop="type"
|
|
<el-table-column label="类型" prop="type"
|
|
@@ -83,10 +94,11 @@
|
|
<el-table-column label="状态" min-width="160" prop="status" >
|
|
<el-table-column label="状态" min-width="160" prop="status" >
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<div>
|
|
<div>
|
|
- {{ row.status == 4 ? '退款成功' : row.status == 2 ? '已完成' : row.status == 0 ? '待下单' : row.status == 1 ? '待支付' : '已取消' }}
|
|
|
|
- <div v-if="row.status == 4" class="refund-info">
|
|
|
|
- <div>退款时间:{{ row.refundTime }}</div>
|
|
|
|
- <div>退款金额:¥{{ row.refundAmount }}</div>
|
|
|
|
|
|
+ {{ row.status == 4 ? '退款成功' : row.status == 2 ? '已完成' : row.status == 0 ? '待下单'
|
|
|
|
+ : row.status == 1 ? '待支付' : row.status == 5 ? '退款中' : '已取消' }}
|
|
|
|
+ <div v-if="row.refundStatus=='SUCCESS'" class="refund-info">
|
|
|
|
+ <div>退款时间:{{ row.refundTime }}</div>
|
|
|
|
+ <div>退款金额:¥{{ row.refundAmount }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -96,7 +108,7 @@
|
|
<el-table-column label="操作" width="200" fixed="right">
|
|
<el-table-column label="操作" width="200" fixed="right">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<el-button type="primary" link @click="showDetail(row)">查看已点菜品</el-button>
|
|
<el-button type="primary" link @click="showDetail(row)">查看已点菜品</el-button>
|
|
- <el-button v-if="row.type == 1 && row.status=='2'" type="danger" link @click="refund(row)">退款</el-button>
|
|
|
|
|
|
+ <el-button v-if="row.type == 1 && row.status=='2' && !row.refundAmount" type="danger" link @click="refund(row)">退款</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -175,11 +187,16 @@
|
|
const refundDialogVisible = ref(false)
|
|
const refundDialogVisible = ref(false)
|
|
const refundAmount = ref(0)
|
|
const refundAmount = ref(0)
|
|
var refundOrder: {
|
|
var refundOrder: {
|
|
|
|
+ refundTime: string;
|
|
|
|
+ refundAmount: number;
|
|
|
|
+ payAmount: number;
|
|
|
|
+ amount: number;
|
|
status: number; id: any;
|
|
status: number; id: any;
|
|
};
|
|
};
|
|
// 修改refund函数
|
|
// 修改refund函数
|
|
const refund = async (row: any) => {
|
|
const refund = async (row: any) => {
|
|
refundDialogVisible.value = true
|
|
refundDialogVisible.value = true
|
|
|
|
+ refundAmount.value = 0
|
|
refundOrder = row;
|
|
refundOrder = row;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -188,13 +205,18 @@
|
|
if(!refundAmount.value || refundAmount.value<=0){
|
|
if(!refundAmount.value || refundAmount.value<=0){
|
|
return feedback.msgError('退款金额不合法')
|
|
return feedback.msgError('退款金额不合法')
|
|
}
|
|
}
|
|
- if(refundAmount.value > refundOrder.amount){
|
|
|
|
- return feedback.msgError('退款金额不能大于订单总金额')
|
|
|
|
|
|
+ if(refundAmount.value > (refundOrder.payAmount || refundOrder.amount)){
|
|
|
|
+ return feedback.msgError('退款金额不能大于订单实付金额')
|
|
}
|
|
}
|
|
- const res = await refundReq({ orderId: refundOrder.id, amount: refundAmount.value })
|
|
|
|
|
|
+ const res = await refundReq({ orderId: refundOrder.id, payAmount: refundAmount.value })
|
|
if (res) {
|
|
if (res) {
|
|
feedback.msgSuccess('退款成功')
|
|
feedback.msgSuccess('退款成功')
|
|
- refundOrder.status = 4;
|
|
|
|
|
|
+ refundOrder.status = 5;
|
|
|
|
+ // refundOrder.refundAmount = refundAmount.value;
|
|
|
|
+ // refundOrder.refundTime = "待处理";
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ getLists();
|
|
|
|
+ },200)
|
|
} else {
|
|
} else {
|
|
feedback.msgError('退款失败')
|
|
feedback.msgError('退款失败')
|
|
}
|
|
}
|