feat:退款完成待测试
This commit is contained in:
1 parent
ca11691c03
commit
af8e6df1c0
3 files changed
+31
-14
No files matched your search
@@ -90,7 +90,12 @@ const validate = async () => {
|
|||||||
return form
|
return form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resetFields = async () => {
|
||||||
|
await dataFormRef.value.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
validate,
|
validate,
|
||||||
|
resetFields
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -56,10 +56,14 @@ const state = reactive<any>({
|
|||||||
const openDialog = (id: string) => {
|
const openDialog = (id: string) => {
|
||||||
visible.value = true
|
visible.value = true
|
||||||
state.orderId = id
|
state.orderId = id
|
||||||
|
|
||||||
|
nextTick(() => {
|
||||||
|
refundTableRef.value?.getCarList(state.orderId)
|
||||||
|
refundFormRef.value?.resetFields()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function tabClick(e: any) {
|
function tabClick(e: any) {
|
||||||
console.log("tabClick", e);
|
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<el-table-column label="商品图片" align="center" prop="code">
|
<el-table-column label="商品图片" align="center" prop="code">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<preview-image v-if="row.productPic" :src="row.productPic" />
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品价格" align="center" prop="productPrice">
|
<el-table-column label="商品价格" align="center" prop="productPrice">
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<el-table-column label="商品图片" align="center" prop="code">
|
<el-table-column label="商品图片" align="center" prop="code">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<preview-image v-if="row.productPic" :src="row.productPic" />
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品价格" align="center" prop="productPrice">
|
<el-table-column label="商品价格" align="center" prop="productPrice">
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<el-table-column label="商品图片" align="center" prop="code">
|
<el-table-column label="商品图片" align="center" prop="code">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<preview-image v-if="row.productPic" :src="row.productPic" />
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品价格" align="center" prop="productPrice">
|
<el-table-column label="商品价格" align="center" prop="productPrice">
|
||||||
@@ -76,16 +76,16 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="退款商品数量" align="center" prop="refundProductCount">
|
<el-table-column label="退款商品数量" align="center" prop="refundProductCount">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div>
|
<div class="w-full h-full">
|
||||||
<div v-if="row.refundProductCount == row.productCount" class="color-danger text-sm">
|
<el-input-number size="small" v-if="row.productNature == 2"
|
||||||
该商品已全部退款
|
v-model="row.refundProductCount" :min="0" :max="row.productCount" :step="0.1"
|
||||||
</div>
|
@change="handleRefundProductCount($event, row)" />
|
||||||
<div v-else>
|
<el-input-number size="small" v-else v-model="row.refundProductCount" :min="0"
|
||||||
<el-input-number size="small" v-if="row.productNature == 2"
|
:max="row.productCount" @change="handleRefundProductCount($event, row)" />
|
||||||
v-model="row.refundProductCount" :min="0" :max="row.productCount" :step="0.1"
|
<div class="h-4">
|
||||||
@change="handleRefundProductCount($event, row)" />
|
<div v-if="row.productCount <= row.refundProductCount" class="color-danger text-xs">
|
||||||
<el-input-number size="small" v-else v-model="row.refundProductCount" :min="0"
|
该商品已全部退款
|
||||||
:max="row.productCount" @change="handleRefundProductCount($event, row)" />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -132,6 +132,14 @@ const getCarList = async (orderId: string) => {
|
|||||||
// 获取已退款的商品
|
// 获取已退款的商品
|
||||||
const { data } = await hardCar.refundCar({ orderId })
|
const { data } = await hardCar.refundCar({ orderId })
|
||||||
if (!data || !data.length) {
|
if (!data || !data.length) {
|
||||||
|
disposeDataList.value = state.dataList.map((item) => {
|
||||||
|
if (!item) return null
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
refundProductCount: 0,
|
||||||
|
refundTotalPrice: 0,
|
||||||
|
}
|
||||||
|
}).filter(Boolean)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
refundSuccessList.value = data
|
refundSuccessList.value = data
|
||||||
|
|||||||
Reference in new issue
Block a user