提交 46b10351 编写于 作者: kadycui's avatar kadycui 💻

ADD: 商品管理界面

上级 5a9ead8d
...@@ -28,47 +28,59 @@ ...@@ -28,47 +28,59 @@
<el-table v-loading="loading" element-loading-text="加载中..." element-loading-spinner="el-icon-loading" <el-table v-loading="loading" element-loading-text="加载中..." element-loading-spinner="el-icon-loading"
:data="tableData" stripe style="width: 100%"> :data="tableData" stripe style="width: 300%">
<el-table-column label="管理员" width="200"> <el-table-column label="商品" width="300">
<template #default="{ row }"> <template #default="{ row }">
<div class="flex items-center"> <div class="flex">
<el-avatar :size="40" :src="row.avatar"> <el-image class="mr-3 rounded" :src="row.cover" fit="cover" :lazy="true"
<img src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" /> style="width: 50px; height: 50px;"></el-image>
</el-avatar> <div class="flex-1">
<div class="ml-3"> <p> {{ row.title }}</p>
<h6> {{ row.username }}</h6> <div>
<small>ID:{{ row.id }}</small> <span class="text-rose-500">{{ row.min_price }}</span>
<el-divider direction="vertical"></el-divider>
<span class="text-gray-500 text-xs">{{ row.min_oprice }}</span>
</div>
<p class="text-gray-400 text-xs mb-1">分类:{{ row.category ? row.category.name : "未分类" }}</p>
<p class="text-gray-400 text-xs">创建时间: {{ row.create_time }} </p>
</div> </div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所属角色" align="center"> <el-table-column label="实际销量" width="90" prop="sale_count" align="center" />
<el-table-column label="商品状态" width="120" align="center">
<template #default="{ row }"> <template #default="{ row }">
{{ row.role?.name || "_" }} <el-tag :type="row.status ? 'success' : 'danger'" size="small">
{{ row.status ? '上架' : '仓库' }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" width="120">
<el-table-column v-if="searchForm.tab != 'delete'" label="审核状态" width="120" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-switch :modelValue="row.status" :active-value="1" :inactive-value="0" <div class="flex flex-col" v-if="row.ischeck == 0">
:loading="row.statusLoading" :disabled="row.super == 1" <el-button type="success" size="small" plain>审核通过</el-button>
@change="handleStatusChange($event, row)"> <el-button class="mt-2 !ml-0" type="danger" size="small" plain>审核拒绝</el-button>
</el-switch> </div>
<span>{{ row.ischeck == 1 ? '通过' : '拒绝' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="总库存" width="90" prop="stock" align="center" />
<el-table-column label="操作" align="center">
<el-table-column label="操作" width="180" align="center">
<template #default="scope"> <template #default="scope">
<small v-if="scope.row.super == 1" class="text-sm text-gray-500">暂无操作</small> <div v-if="searchForm.tab != 'delete'">
<div v-else> <el-button class="px-1" type="primary" size="small" text>修改</el-button>
<el-button type="primary" size="small" text @click="handleEdit(scope.row)">修改</el-button> <el-button class="px-1" type="primary" size="small" text>商品规格</el-button>
<el-popconfirm title="是否删除该管理员?" confirm-button-text="确认" cancel-button-text="取消" <el-button class="px-1" type="primary" size="small" text>设置轮播图</el-button>
<el-button class="px-1" type="primary" size="small" text>商品详情</el-button>
<el-popconfirm title="是否删除该商品?" confirm-button-text="确认" cancel-button-text="取消"
@confirm="handleDelete(scope.row.id)"> @confirm="handleDelete(scope.row.id)">
<template #reference> <template #reference>
<el-button text type="primary" size="small">删除</el-button> <el-button class="px-1" text type="primary" size="small">删除</el-button>
</template> </template>
</el-popconfirm> </el-popconfirm>
</div> </div>
<span v-else>暂无操作</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -187,23 +199,23 @@ const { ...@@ -187,23 +199,23 @@ const {
const tabbars = [{ const tabbars = [{
key:"all", key: "all",
name:"全部" name: "全部"
},{ }, {
key:"checking", key: "checking",
name:"审核中" name: "审核中"
},{ }, {
key:"saling", key: "saling",
name:"出售中" name: "出售中"
},{ }, {
key:"off", key: "off",
name:"已下架" name: "已下架"
},{ }, {
key:"min_stock", key: "min_stock",
name:"库存预警" name: "库存预警"
},{ }, {
key:"delete", key: "delete",
name:"回收站" name: "回收站"
}] }]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册