feat: 商品列表修改退回退款到表格

This commit is contained in:
duan
2025-03-17 18:28:14 +08:00
parent d89eda96a9
commit c410e752dd
2 changed files with 24 additions and 3 deletions

View File

@@ -25,6 +25,10 @@
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0" <el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
@click="handleSwitchChange(scope.row)"></el-switch> @click="handleSwitchChange(scope.row)"></el-switch>
</template> </template>
<template #tuikuantuihui="scope">
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
@click="handleSwitchhaocai(scope.row)"></el-switch>
</template>
<template #sellOut="scope"> <template #sellOut="scope">
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0" <el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
@click="handleSwitchChangeTwo(scope.row)"></el-switch> @click="handleSwitchChangeTwo(scope.row)"></el-switch>
@@ -92,10 +96,10 @@
{{ haocaiData.name }} {{ haocaiData.name }}
</el-form-item></el-col> </el-form-item></el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="退款退回库存"> <!-- <el-form-item label="退款退回库存">
<el-switch v-model="haocaiData.isRefundStock" :active-value="1" :inactive-value="0" <el-switch v-model="haocaiData.isRefundStock" :active-value="1" :inactive-value="0"
@click="handleSwitchhaocai(haocaiData.isRefundStock)"></el-switch> @click="handleSwitchhaocai(haocaiData.isRefundStock)"></el-switch>
</el-form-item> </el-form-item> -->
</el-col> </el-col>
</el-row> </el-row>
<el-table :data="haocaiData.consList" border> <el-table :data="haocaiData.consList" border>
@@ -247,10 +251,20 @@ function handleSwitchChangeTwo(data: any) {
}; };
UserAPI.markIsSoldOut(obj); UserAPI.markIsSoldOut(obj);
} }
function handleSwitchChangethree(data: any) {
let obj = {
type: data.type == "sku" ? "sku" : "product",
id: data.id,
isSoldOut: data.isSoldStock,
};
UserAPI.markIsSoldOut(obj);
}
// 退款退回 // 退款退回
async function handleSwitchhaocai(row: IObject) { async function handleSwitchhaocai(row: IObject) {
let res = await UserAPI.refundToStock({ isReturn: row, id: haocaiData.value.id }) let res = await UserAPI.refundToStock({ isReturn: row.isRefundStock, id: row.id })
ElMessage.success('成功') ElMessage.success('成功')
handleResetClick()
// myDialogRefhaocai.value.close() // myDialogRefhaocai.value.close()
} }

View File

@@ -92,6 +92,13 @@ const contentConfig: IContentConfig<UserPageQuery> = {
templet: "custom", templet: "custom",
slotName: "sellOut", slotName: "sellOut",
}, },
{
label: "退款退回库存",
align: "center",
prop: "isRefundStock",
templet: "custom",
slotName: "tuikuantuihui",
},
{ {
label: "操作", label: "操作",
align: "center", align: "center",