feat: 商品上架优化

This commit is contained in:
duan 2025-03-06 10:09:55 +08:00
parent 8838df65fb
commit a8a8a58cad
4 changed files with 14 additions and 5 deletions

View File

@ -3,8 +3,8 @@
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="耗材分类">
<el-select v-model="formInline.region" placeholder="请选择耗材分类" clearable>
<el-option label="Zone one" value="shanghai" />
<el-option label="Zone two" value="beijing" />
<el-option label="Zonesne" value="shanghai" />
<el-option label="Zonestwo" value="beijing" />
</el-select>
</el-form-item>
<el-form-item label="耗材名称">

View File

@ -10,7 +10,7 @@
</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<el-table-column prop="status" align="center" label="状态">
<template #default="scope">
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">{{ scope.row.status === 1 ? '上架' : '下架'
}}</el-tag>

View File

@ -22,6 +22,10 @@
<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>
<template #mobile="scope">
<el-text>{{ scope.row[scope.prop] }}</el-text>
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
@ -103,6 +107,11 @@ 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 });
}
//
async function handleEditClick(row: IObject) {
router.push({ name: 'addgoods', query: { goods_id: row.id } });

View File

@ -43,7 +43,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
id: data.id,
isSale: data.value
}
// return UserAPI.onOff(obj);
return UserAPI.onOff(obj);
},
deleteAction: UserAPI.deleteByIds,
importsAction(data) {
@ -82,7 +82,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
{
label: "上架",
align: "center",
prop: "isSale",
prop: "status",
templet: "switch",
slotName: "status",
},