feat:后台退款

This commit is contained in:
dzc committed 2025-01-22 19:54:02 +08:00
1 parent 8292325f02
commit bba6c00070
2 files changed
+36 -2

No files matched your search

+8
View File
@@ -1,5 +1,13 @@
import request from "/@/utils/request"
export function adminRefund(query?: Object) {
return request({
url: "/hard/hard-invoice/admin-refund",
method: "get",
params: query,
})
}
export function print(query?: Object) {
return request({
url: "/hard/hard-invoice/print",
+28 -2
View File
@@ -180,7 +180,7 @@
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template #default="{ row }">
<div class="grid grid-cols-2">
<div class="grid grid-cols-2 gap-4 justify-between">
<el-button icon="Printer" text type="primary" @click="print(row)" v-auth="'hard_hardInvoice_admin_print'">
打印发票
</el-button>
@@ -207,8 +207,17 @@
type="primary"
v-auth="'hard_hardwareOrder_edit'"
@click="formDialogRef.openDialog(row.id)"
>编辑</el-button
>编辑
</el-button>
<el-button
icon="stamp"
text
type="primary"
v-auth="'hard_hardAfterSale_adminRefund'"
@click="adminRefund(row)"
>
退款
</el-button>
<el-button
v-if="false"
icon="delete"
@@ -318,6 +327,23 @@ const print = async (row: any) => {
}
}
const adminRefund = async (row: any) => {
let loading: any = null
try {
await useMessage().delConfirm("是否同意退款?")
loading = ElLoading.service({
lock: true,
text: "提交中",
background: "rgba(0, 0, 0, 0.7)",
})
await hardInvoice.adminRefund({ id: row.id })
useMessage().success("操作成功")
getDataList()
} finally {
setTimeout(() => loading.close(), 500)
}
}
// 导出excel
const exportExcel = () => {
downBlobFile("/hard/hardwareOrder/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardwareOrder.xlsx")