feat:退款完成待测试

This commit is contained in:
dzc committed 2025-08-27 20:34:11 +08:00
1 parent ca11691c03
commit af8e6df1c0
3 files changed
+31 -14

No files matched your search

@@ -90,7 +90,12 @@ const validate = async () => {
return form
}
const resetFields = async () => {
await dataFormRef.value.resetFields()
}
defineExpose({
validate,
resetFields
})
</script>
@@ -56,10 +56,14 @@ const state = reactive<any>({
const openDialog = (id: string) => {
visible.value = true
state.orderId = id
nextTick(() => {
refundTableRef.value?.getCarList(state.orderId)
refundFormRef.value?.resetFields()
})
}
function tabClick(e: any) {
console.log("tabClick", e);
nextTick(async () => {
loading.value = true
try {
@@ -9,7 +9,7 @@
<el-table-column label="商品图片" align="center" prop="code">
<template #default="{ row }">
<preview-image v-if="row.productPic" :src="row.productPic" />
<div v-else class="w-[50px] h-[50px]" />
<div v-else class="w-[60px] h-[60px]" />
</template>
</el-table-column>
<el-table-column label="商品价格" align="center" prop="productPrice">
@@ -36,7 +36,7 @@
<el-table-column label="商品图片" align="center" prop="code">
<template #default="{ row }">
<preview-image v-if="row.productPic" :src="row.productPic" />
<div v-else class="w-[50px] h-[50px]" />
<div v-else class="w-[60px] h-[60px]" />
</template>
</el-table-column>
<el-table-column label="商品价格" align="center" prop="productPrice">
@@ -66,7 +66,7 @@
<el-table-column label="商品图片" align="center" prop="code">
<template #default="{ row }">
<preview-image v-if="row.productPic" :src="row.productPic" />
<div v-else class="w-[50px] h-[50px]" />
<div v-else class="w-[60px] h-[60px]" />
</template>
</el-table-column>
<el-table-column label="商品价格" align="center" prop="productPrice">
@@ -76,16 +76,16 @@
</el-table-column>
<el-table-column label="退款商品数量" align="center" prop="refundProductCount">
<template #default="{ row }">
<div>
<div v-if="row.refundProductCount == row.productCount" class="color-danger text-sm">
该商品已全部退款
</div>
<div v-else>
<el-input-number size="small" v-if="row.productNature == 2"
v-model="row.refundProductCount" :min="0" :max="row.productCount" :step="0.1"
@change="handleRefundProductCount($event, row)" />
<el-input-number size="small" v-else v-model="row.refundProductCount" :min="0"
:max="row.productCount" @change="handleRefundProductCount($event, row)" />
<div class="w-full h-full">
<el-input-number size="small" v-if="row.productNature == 2"
v-model="row.refundProductCount" :min="0" :max="row.productCount" :step="0.1"
@change="handleRefundProductCount($event, row)" />
<el-input-number size="small" v-else v-model="row.refundProductCount" :min="0"
:max="row.productCount" @change="handleRefundProductCount($event, row)" />
<div class="h-4">
<div v-if="row.productCount <= row.refundProductCount" class="color-danger text-xs">
该商品已全部退款
</div>
</div>
</div>
</template>
@@ -132,6 +132,14 @@ const getCarList = async (orderId: string) => {
// 获取已退款的商品
const { data } = await hardCar.refundCar({ orderId })
if (!data || !data.length) {
disposeDataList.value = state.dataList.map((item) => {
if (!item) return null
return {
...item,
refundProductCount: 0,
refundTotalPrice: 0,
}
}).filter(Boolean)
return
}
refundSuccessList.value = data