feat: 解决上架问题

This commit is contained in:
duan
2025-03-07 18:30:30 +08:00
parent 8e52613f08
commit 0bd38e29c5
5 changed files with 30 additions and 25 deletions

View File

@@ -11,20 +11,20 @@
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
<template #status="scope">
<!-- <template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
</el-tag>
</template>
</template> -->
<template #type="scope">
{{ typeFilter(scope.row[scope.prop]) }}
</template>
<template #gender="scope">
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
</template>
<template #switchs="scope">
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0" active-text="启用"
inactive-text="禁用" @change="handleSwitchChange"></el-switch>
<template #shangjia="scope">
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
@click="handleSwitchChange(scope.row)"></el-switch>
</template>
<template #mobile="scope">
<el-text>{{ scope.row[scope.prop] }}</el-text>
@@ -56,13 +56,13 @@
</MyDialog>
</template>
<template v-else>
<page-content ref="contentRef" :content-config="contentConfig2" @operat-click="handleOperatClick">
<!-- <page-content ref="contentRef" :content-config="contentConfig2" @operat-click="handleOperatClick">
<template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
</el-tag>
</template>
</page-content>
</page-content> -->
</template>
</div>
</template>
@@ -108,9 +108,14 @@ async function handleAddClick() {
// addModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
}
// 上架
function handleSwitchChange(val: boolean, row: IObject) {
console.log(val, row);
// UserAPI.updateById({ id: row.id, isSale: val ? 1 : 0 });
function handleSwitchChange(data: any) {
console.log(data, '条似乎22222')
let obj = {
type: data.isGrounding ? 'sku' : 'product',
id: data.id,
isSale: data.status
}
UserAPI.onOff(obj);
}
// 编辑
async function handleEditClick(row: IObject) {