feat:扫一扫的退款(没有购物车的退款)

This commit is contained in:
dzc committed 2025-09-01 15:25:35 +08:00
1 parent 25013139ab
commit 31ccf613a4
3 files changed
+14 -6

No files matched your search

@@ -1,5 +1,5 @@
<template> <template>
<el-dialog title="后台退款" v-model="visible" width="50%" :close-on-click-modal="false" draggable> <el-dialog title="后台退款" v-model="visible" width="70%" :close-on-click-modal="false" draggable>
<el-tabs v-model="state.currentTab" class="demo-tabs" @tab-click="tabClick"> <el-tabs v-model="state.currentTab" class="demo-tabs" @tab-click="tabClick">
<el-tab-pane v-for="(v) in data.tabs" :key="v.name" :label="v.label" :name="v.name" /> <el-tab-pane v-for="(v) in data.tabs" :key="v.name" :label="v.label" :name="v.name" />
</el-tabs> </el-tabs>
@@ -161,6 +161,7 @@ const { getDataList, sortChangeHandle, tableStyle } = useTable(state)
const getCarList = async (orderId: string) => { const getCarList = async (orderId: string) => {
state.queryForm.orderId = orderId state.queryForm.orderId = orderId
try {
// 获取订单商品列表 // 获取订单商品列表
await getDataList() await getDataList()
if (!state.dataList || !state.dataList.length) { if (!state.dataList || !state.dataList.length) {
@@ -197,7 +198,10 @@ const getCarList = async (orderId: string) => {
refundTotalPrice: 0, refundTotalPrice: 0,
} }
}).filter(Boolean) }).filter(Boolean)
console.log("disposeDataList:", disposeDataList.value); } catch (error: any) {
state.dataList = []
disposeDataList.value = []
}
} }
@@ -220,8 +224,6 @@ const handleAllRefund = () => {
v.refundTotalPrice = target.totalPrice v.refundTotalPrice = target.totalPrice
} }
console.log("全部:", _list);
disposeDataList.value = _list disposeDataList.value = _list
} }
@@ -248,6 +250,11 @@ const getSummaries = (param: any) => {
// 提交 // 提交
const validate = async () => { const validate = async () => {
// 如果购物车为空直接返回true
if (!state.dataList || !state.dataList.length) {
return []
}
let valid = false let valid = false
for (const v of disposeDataList.value) { for (const v of disposeDataList.value) {
if (v.refundProductCount > 0 || v.refundProductWeight > 0) { if (v.refundProductCount > 0 || v.refundProductWeight > 0) {
+3 -2
View File
@@ -80,7 +80,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200px" prop="paymentInformation" label="付款信息"> <el-table-column width="220px" prop="paymentInformation" label="付款信息">
<template #default="{ row }"> <template #default="{ row }">
<div class="flex justify-between items-start"> <div class="flex justify-between items-start">
<div class="w-[200px] h-[25px]"> <div class="w-[200px] h-[25px]">
@@ -229,7 +229,8 @@
v-auth="'hard_hardwareOrder_edit'" @click="formDialogRef.openDialog(row.id)"> v-auth="'hard_hardwareOrder_edit'" @click="formDialogRef.openDialog(row.id)">
编辑 编辑
</el-button> </el-button>
<el-button v-if="row.orderType !== '5' && !['5', '6', '8'].includes(row.payType)" <el-button
v-if="row.orderType !== '5' && !['5', '6', '8'].includes(row.payType) && row.refundPrice != row.payPrice"
icon="stamp" text type="primary" v-auth="'hard_hardAfterSale_adminRefund'" icon="stamp" text type="primary" v-auth="'hard_hardAfterSale_adminRefund'"
@click="adminRefundDailogRef.openDialog(row.id)"> @click="adminRefundDailogRef.openDialog(row.id)">
退款 退款