pay:示例订单,增加发起退款的操作

This commit is contained in:
YunaiV
2023-02-15 22:40:56 +08:00
parent 333adc989f
commit eb660ca619
9 changed files with 98 additions and 12 deletions

View File

@ -25,3 +25,11 @@ export function getDemoOrderPage(query) {
params: query
})
}
// 退款示例订单
export function refundDemoOrder(id) {
return request({
url: '/pay/demo-order/refund?id=' + id,
method: 'put'
})
}

View File

@ -48,6 +48,8 @@
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handlePay(scope.row)"
v-if="!scope.row.payed">前往支付</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleRefund(scope.row)"
v-if="scope.row.payed && !scope.row.payRefundId">发起退款</el-button>
</template>
</el-table-column>
</el-table>
@ -76,7 +78,8 @@
</template>
<script>
import { createDemoOrder, getDemoOrderPage } from "@/api/pay/demo";
import {createDemoOrder, getDemoOrderPage, refundDemoOrder} from "@/api/pay/demo";
import {deleteMerchant} from "@/api/pay/merchant";
export default {
name: "PayDemoOrder",
@ -195,6 +198,16 @@ export default {
id: row.payOrderId
}
})
},
/** 退款按钮操作 */
handleRefund(row) {
const id = row.id;
this.$modal.confirm('是否确认退款编号为"' + id + '"的示例订单?').then(function() {
return refundDemoOrder(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("退款成功");
}).catch(() => {});
}
}
};