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"
@click="handleSwitchChange(scope.row)"></el-switch>
</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">
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
@click="handleSwitchChangeTwo(scope.row)"></el-switch>
@@ -92,10 +96,10 @@
{{ haocaiData.name }}
</el-form-item></el-col>
<el-col :span="12">
<el-form-item label="退款退回库存">
<!-- <el-form-item label="退款退回库存">
<el-switch v-model="haocaiData.isRefundStock" :active-value="1" :inactive-value="0"
@click="handleSwitchhaocai(haocaiData.isRefundStock)"></el-switch>
</el-form-item>
</el-form-item> -->
</el-col>
</el-row>
<el-table :data="haocaiData.consList" border>
@@ -247,10 +251,20 @@ function handleSwitchChangeTwo(data: any) {
};
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) {
let res = await UserAPI.refundToStock({ isReturn: row, id: haocaiData.value.id })
let res = await UserAPI.refundToStock({ isReturn: row.isRefundStock, id: row.id })
ElMessage.success('成功')
handleResetClick()
// myDialogRefhaocai.value.close()
}

View File

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