feat(manager): 优化列表操作列规范、会员分组统计、漏斗图重构与订单交互

1. 订单交互:移除 orderList 缓存机制修复默认带入订单号问题,支持 query 联动;

2. 会员模块:会员分组新增人数统计与联动,全量规范会员提现、充值、日志等操作列样式;

3. 商品与销量:虚拟销量优化首列缩略图与对齐方式,规范品牌与商品分组操作;

4. 数据统计:重构交易转化漏斗图为自适应 SVG 渐变图与指标卡片;

5. 系统与营销:统一菜单/部门操作列样式,优化 OSS 模块、营销活动与首页待办对齐。
This commit is contained in:
pikachu1995@126.com
2026-10-30 06:51:48 +08:00
parent 2563f122fc
commit c0cc8d8598
39 changed files with 16121 additions and 6705 deletions

View File

@@ -1,47 +1,82 @@
<template>
<div class="search">
<el-card>
<div class="brand-manage-page search">
<!-- 顶部筛选表单 -->
<el-card shadow="never" class="filter-card">
<el-form
ref="searchFormRef"
:model="searchForm"
inline
label-width="70px"
label-width="76px"
class="search-form"
@keyup.enter="handleSearch"
>
<el-form-item label="品牌名称">
<el-form-item label="品牌名称" prop="name">
<el-input
v-model="searchForm.name"
placeholder="请输入品牌名称"
clearable
style="width: 240px"
style="width: 220px"
@clear="handleSearch"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">搜索</el-button>
<el-form-item class="form-actions">
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
<el-button @click="resetSearch">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="mt_10">
<div class="operation padding-row" style="margin-bottom: 10px;">
<el-button type="primary" @click="add">添加</el-button>
</div>
<!-- 品牌数据表格卡片 -->
<el-card shadow="never" class="table-card mt_10">
<template #header>
<div class="card-header-bar">
<div class="header-title">
<span>商品品牌列表</span>
</div>
<div class="header-actions">
<el-button size="small" @click="getDataList">刷新</el-button>
<el-button type="primary" size="small" @click="add">添加品牌</el-button>
</div>
</div>
</template>
<el-table ref="table" v-loading="loading" border :data="data" style="width: 100%">
<el-table-column prop="name" label="品牌名称" width="200" />
<el-table-column label="品牌图标" align="left">
<el-table
ref="table"
v-loading="loading"
border
stripe
:data="data"
style="width: 100%"
class="custom-brand-table"
>
<!-- 品牌ID -->
<el-table-column prop="id" label="品牌ID" min-width="190" show-overflow-tooltip />
<!-- 品牌图标 -->
<el-table-column label="品牌图标" width="96" align="center">
<template #default="{ row }">
<img
v-if="row"
:src="row.logo || ''"
alt="加载图片失败"
style="cursor: pointer; width: 80px; height: 60px; margin: 10px 0; object-fit: contain"
/>
<div v-if="row && row.logo" class="logo-box">
<el-image
:src="row.logo"
fit="contain"
preview-teleported
:preview-src-list="[row.logo]"
class="brand-logo-img"
>
<template #error>
<div class="logo-slot">无图</div>
</template>
</el-image>
</div>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="状态" align="left" width="150">
<!-- 品牌名称 -->
<el-table-column prop="name" label="品牌名称" min-width="180" show-overflow-tooltip />
<!-- 状态 -->
<el-table-column label="状态" width="110" align="center">
<template #default="{ row }">
<el-switch
v-if="row"
@@ -53,8 +88,12 @@
/>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="170" show-overflow-tooltip />
<el-table-column label="操作" width="230" align="center" fixed="right">
<!-- 创建时间 -->
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center" show-overflow-tooltip />
<!-- 操作栏 -->
<el-table-column label="操作" width="200" align="center" fixed="right">
<template #default="{ row }">
<template v-if="row">
<a class="link-text" @click="edit(row)">编辑</a>
@@ -67,7 +106,8 @@
</el-table-column>
</el-table>
<div class="mt_10" style="display: flex; justify-content: flex-end">
<!-- 底部分页 -->
<div class="pagination-wrap mt_10">
<el-pagination
v-model:current-page="searchForm.pageNumber"
v-model:page-size="searchForm.pageSize"
@@ -81,24 +121,31 @@
</div>
</el-card>
<!-- 添加 / 编辑品牌弹窗 -->
<el-dialog
v-model="modalVisible"
:title="modalTitle"
width="500px"
width="520px"
:close-on-click-modal="false"
destroy-on-close
>
<el-form ref="formRef" :model="form" label-width="100px" :rules="formValidate">
<el-form ref="formRef" :model="form" label-width="90px" :rules="formValidate">
<el-form-item v-if="modalType === 1 && form.id" label="品牌ID">
<span class="font-mono text-dark">{{ form.id }}</span>
</el-form-item>
<el-form-item label="品牌名称" prop="name">
<el-input v-model="form.name" style="width: 100%" />
<el-input v-model="form.name" placeholder="请输入品牌名称" style="width: 100%" />
</el-form-item>
<el-form-item label="品牌图标" prop="logo">
<div style="display: flex; align-items: center; gap: 8px">
<img
:src="form.logo || defaultPic"
alt=""
style="width: 60px; height: 60px; object-fit: contain; border: 1px solid #dcdfe6; border-radius: 4px"
/>
<el-button type="primary" link @click="openLogoPicker">修改</el-button>
<div class="dialog-logo-picker">
<div class="logo-preview-box">
<img
:src="form.logo || defaultPic"
alt="品牌图标"
class="dialog-logo-img"
/>
</div>
<el-button type="primary" link @click="openLogoPicker">上传/选择图标</el-button>
</div>
</el-form-item>
</el-form>
@@ -108,7 +155,8 @@
</template>
</el-dialog>
<el-dialog v-model="picModelFlag" width="1200px" :show-close="true">
<!-- OSS 图片选择组件弹窗 -->
<el-dialog v-model="picModelFlag" width="1200px" title="选择品牌图标" :show-close="true">
<ossManage
ref="ossManageRef"
:is-component="true"
@@ -117,13 +165,15 @@
/>
</el-dialog>
<!-- 关联分类弹窗 -->
<el-dialog
v-model="categoryModalVisible"
:title="categoryModalTitle"
width="700px"
width="680px"
:close-on-click-modal="false"
destroy-on-close
>
<div v-loading="categoryTreeLoading" style="position: relative; max-height: 520px; overflow: auto">
<div v-loading="categoryTreeLoading" class="category-tree-wrap">
<el-tree
ref="categoryTree"
:key="categoryTreeKey"
@@ -139,7 +189,7 @@
<template #footer>
<el-button @click="categoryModalVisible = false">取消</el-button>
<el-button type="primary" :loading="categorySubmitLoading" @click="submitBrandCategory">
提交
提交关联
</el-button>
</template>
</el-dialog>
@@ -299,7 +349,7 @@ function handleStatusSwitchChange(row, checked) {
}
function delBrand(row) {
ElMessageBox.confirm("您确认要删除 " + row.name + " ?", "确认删除", { type: "warning" }).then(() => {
ElMessageBox.confirm("您确认要删除品牌 " + row.name + " ?", "确认删除", { type: "warning" }).then(() => {
return delBrandApi(row.id).then((res) => {
if (res.success) {
ElMessage.success("品牌删除成功!");
@@ -339,7 +389,7 @@ function handleSubmit() {
function add() {
modalType.value = 0;
modalTitle.value = "添加";
modalTitle.value = "添加品牌";
formRef.value?.resetFields();
delete form.value.id;
modalVisible.value = true;
@@ -347,7 +397,7 @@ function add() {
function edit(v) {
modalType.value = 1;
modalTitle.value = "编辑";
modalTitle.value = "编辑品牌";
formRef.value?.resetFields();
for (const attr in v) {
if (v[attr] === null) {
@@ -360,13 +410,129 @@ function edit(v) {
</script>
<style lang="scss" scoped>
.link-text {
color: #409eff;
cursor: pointer;
text-decoration: none;
.brand-manage-page {
.filter-card {
.search-form {
display: flex;
align-items: center;
flex-wrap: wrap;
margin-bottom: 0;
:deep(.el-form-item) {
margin-bottom: 0;
margin-right: 16px;
}
.form-actions {
margin-left: auto;
}
}
}
.card-header-bar {
display: flex;
justify-content: space-between;
align-items: center;
.header-title {
display: flex;
align-items: center;
gap: 10px;
font-size: 15px;
font-weight: 600;
color: #303133;
}
.header-actions {
display: flex;
align-items: center;
gap: 8px;
}
}
.font-mono {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.font-semibold {
font-weight: 600;
}
.text-dark {
color: #303133;
}
.text-placeholder {
color: #c0c4cc;
}
.time-text {
font-size: 12px;
color: #909399;
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.custom-brand-table {
.logo-box {
width: 52px;
height: 40px;
margin: 0 auto;
border: 1px solid #ebeef5;
border-radius: 4px;
background: #fafafa;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
.brand-logo-img {
width: 48px;
height: 36px;
}
.logo-slot {
font-size: 11px;
color: #c0c4cc;
}
}
}
.pagination-wrap {
display: flex;
justify-content: flex-end;
}
}
.op-split {
margin: 0 8px;
color: #dcdee2;
.dialog-logo-picker {
display: flex;
align-items: center;
gap: 12px;
.logo-preview-box {
width: 64px;
height: 48px;
border: 1px solid #dcdfe6;
border-radius: 4px;
background: #fafafa;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
.dialog-logo-img {
width: 100%;
height: 100%;
object-fit: contain;
}
}
}
.category-tree-wrap {
position: relative;
max-height: 520px;
overflow: auto;
border: 1px solid #ebeef5;
border-radius: 4px;
padding: 10px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,84 @@
<template>
<div class="search">
<el-card>
<div class="operation padding-row">
<el-button type="primary" @click="openAdd">添加分组</el-button>
<div class="goods-group-page search">
<!-- 顶部筛选与操作栏 -->
<el-card shadow="never" class="filter-card">
<div class="card-toolbar">
<el-form inline :model="searchForm" class="filter-form" @keyup.enter="handleSearch">
<el-form-item label="分组名称">
<el-input
v-model="searchForm.groupName"
placeholder="请输入分组名称"
clearable
style="width: 220px"
@clear="handleSearch"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">搜索</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<div class="toolbar-right">
<el-button type="primary" @click="openAdd">添加分组</el-button>
</div>
</div>
</el-card>
<el-table ref="table" v-loading="loading" :data="data" border class="mt_10" style="width: 100%">
<!-- 分组数据表格卡片 -->
<el-card shadow="never" class="table-card mt_10">
<template #header>
<div class="card-header-bar">
<div class="header-title">
<span>商品分组列表</span>
</div>
<div class="header-actions">
<el-button size="small" @click="getData">刷新</el-button>
</div>
</div>
</template>
<el-table
ref="table"
v-loading="loading"
:data="data"
border
stripe
style="width: 100%"
class="custom-group-table"
>
<!-- 分组ID -->
<el-table-column prop="id" label="分组ID" min-width="190" show-overflow-tooltip />
<!-- 分组名称 -->
<el-table-column prop="groupName" label="分组名称" min-width="160" show-overflow-tooltip />
<el-table-column prop="description" label="分组描述" min-width="240" show-overflow-tooltip />
<el-table-column prop="createTime" label="创建时间" width="180" />
<el-table-column prop="updateTime" label="更新时间" width="180" />
<el-table-column label="操作" width="200" align="center" fixed="right">
<!-- 分组描述 -->
<el-table-column prop="description" label="分组描述" min-width="240" show-overflow-tooltip>
<template #default="{ row }">
<div v-if="row" class="ops" style="display: flex; justify-content: center">
{{ row ? row.description || "-" : "-" }}
</template>
</el-table-column>
<!-- 创建时间 -->
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center" />
<!-- 更新时间 -->
<el-table-column prop="updateTime" label="更新时间" min-width="170" align="center" />
<!-- 操作栏 -->
<el-table-column label="操作" width="140" align="center" fixed="right">
<template #default="{ row }">
<template v-if="row">
<a class="link-text" @click="openEdit(row)">编辑</a>
<span class="op-split">|</span>
<a class="link-text" @click="remove(row)">删除</a>
</div>
</template>
</template>
</el-table-column>
</el-table>
<div class="mt_10" style="display: flex; justify-content: flex-end">
<!-- 底部分页 -->
<div class="pagination-wrap mt_10">
<el-pagination
v-model:current-page="searchForm.pageNumber"
v-model:page-size="searchForm.pageSize"
@@ -35,13 +92,32 @@
</div>
</el-card>
<el-dialog v-model="addFlag" title="添加商品分组" width="500px" :close-on-click-modal="false" destroy-on-close>
<!-- 添加商品分组弹窗 -->
<el-dialog
v-model="addFlag"
title="添加商品分组"
width="520px"
:close-on-click-modal="false"
destroy-on-close
>
<el-form ref="addFormRef" :model="formAdd" :rules="rulesAdd" label-width="90px">
<el-form-item label="分组名称" prop="groupName" style="width: 90%">
<el-input v-model="formAdd.groupName" maxlength="30" placeholder="请输入分组名称" />
<el-form-item label="分组名称" prop="groupName">
<el-input
v-model="formAdd.groupName"
maxlength="30"
show-word-limit
placeholder="请输入分组名称"
/>
</el-form-item>
<el-form-item label="分组描述" prop="description" style="width: 90%">
<el-input v-model="formAdd.description" maxlength="200" placeholder="请输入分组描述" />
<el-form-item label="分组描述" prop="description">
<el-input
v-model="formAdd.description"
type="textarea"
:rows="3"
maxlength="200"
show-word-limit
placeholder="请输入分组描述信息"
/>
</el-form-item>
</el-form>
<template #footer>
@@ -50,14 +126,35 @@
</template>
</el-dialog>
<el-dialog v-model="editFlag" title="编辑商品分组" width="500px" :close-on-click-modal="false" destroy-on-close>
<!-- 编辑商品分组弹窗 -->
<el-dialog
v-model="editFlag"
title="编辑商品分组"
width="520px"
:close-on-click-modal="false"
destroy-on-close
>
<el-form ref="editFormRef" :model="formEdit" :rules="rulesEdit" label-width="90px">
<el-input v-model="formEdit.id" style="display: none" />
<el-form-item label="分组名称" prop="groupName" style="width: 90%">
<el-input v-model="formEdit.groupName" maxlength="30" placeholder="请输入分组名称" />
<el-form-item label="分组ID">
<span>{{ formEdit.id }}</span>
</el-form-item>
<el-form-item label="分组描述" prop="description" style="width: 90%">
<el-input v-model="formEdit.description" maxlength="200" placeholder="请输入分组描述" />
<el-form-item label="分组名称" prop="groupName">
<el-input
v-model="formEdit.groupName"
maxlength="30"
show-word-limit
placeholder="请输入分组名称"
/>
</el-form-item>
<el-form-item label="分组描述" prop="description">
<el-input
v-model="formEdit.description"
type="textarea"
:rows="3"
maxlength="200"
show-word-limit
placeholder="请输入分组描述信息"
/>
</el-form-item>
</el-form>
<template #footer>
@@ -79,6 +176,7 @@ const loading = ref(true);
const searchForm = reactive({
pageNumber: 1,
pageSize: 20,
groupName: "",
});
const data = ref([]);
const total = ref(0);
@@ -86,18 +184,22 @@ const addFlag = ref(false);
const editFlag = ref(false);
const submitAddLoading = ref(false);
const submitEditLoading = ref(false);
const formAdd = ref({
groupName: "",
description: "",
});
const formEdit = ref({
id: "",
groupName: "",
description: "",
});
const rulesAdd = reactive({
groupName: [{ required: true, message: "请输入分组名称", trigger: "blur" }],
});
const rulesEdit = reactive({
groupName: [{ required: true, message: "请输入分组名称", trigger: "blur" }],
});
@@ -105,7 +207,14 @@ const rulesEdit = reactive({
const addFormRef = ref(null);
const editFormRef = ref(null);
function init() {
function handleSearch() {
searchForm.pageNumber = 1;
getData();
}
function handleReset() {
searchForm.pageNumber = 1;
searchForm.groupName = "";
getData();
}
@@ -216,36 +325,78 @@ function submitEdit() {
}
function remove(row) {
ElMessageBox.confirm("确定删除该分组?", "提示", { type: "warning" }).then(() => {
return API_Goods.deleteGoodsGroup(row.id)
.then((res) => {
if (res && res.success) {
ElMessage.success("删除成功");
getData();
} else if (res && res.message) {
ElMessage.error(res.message);
}
})
.catch(() => {
ElMessage.error("删除失败,请检查权限或后端接口");
});
}).catch(() => {});
ElMessageBox.confirm(`确定删除分组 "${row.groupName || "该分组"}" 吗?`, "提示", {
type: "warning",
confirmButtonText: "确定删除",
cancelButtonText: "取消",
})
.then(() => {
return API_Goods.deleteGoodsGroup(row.id)
.then((res) => {
if (res && res.success) {
ElMessage.success("删除成功");
getData();
} else if (res && res.message) {
ElMessage.error(res.message);
}
})
.catch(() => {
ElMessage.error("删除失败,请检查权限或后端接口");
});
})
.catch(() => {});
}
onMounted(() => {
init();
getData();
});
</script>
<style scoped>
.ops a {
color: #2d8cf0;
cursor: pointer;
text-decoration: none;
}
.ops span {
display: inline-block;
margin: 0 8px;
color: #dcdee2;
<style scoped lang="scss">
.goods-group-page {
.card-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 12px;
.filter-form {
display: flex;
align-items: center;
flex-wrap: wrap;
margin-bottom: 0;
:deep(.el-form-item) {
margin-bottom: 0;
margin-right: 16px;
}
}
.toolbar-right {
display: flex;
align-items: center;
}
}
.card-header-bar {
display: flex;
justify-content: space-between;
align-items: center;
.header-title {
display: flex;
align-items: center;
gap: 10px;
font-size: 15px;
font-weight: 600;
color: #303133;
}
}
.pagination-wrap {
display: flex;
justify-content: flex-end;
}
}
</style>

View File

@@ -51,7 +51,6 @@
<el-card class="mt_10">
<el-alert
type="info"
show-icon
:closable="false"
title="支持按规格逐条设置虚拟销量,列表总销量 = 真实销量 + 虚拟销量。"
style="margin-bottom: 10px"
@@ -71,55 +70,65 @@
ref="tableRef"
v-loading="loading"
:data="data"
border
class="mt_10"
style="width: 100%"
@sort-change="changeSort"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="id" label="SKU ID" width="180" show-overflow-tooltip />
<el-table-column prop="goodsId" label="SPU编码" width="180" show-overflow-tooltip />
<el-table-column label="商品信息" min-width="360">
<el-table-column label="商品信息" min-width="320">
<template #default="{ row }">
<div v-if="row" class="goods-info">
<img
v-if="row.thumbnail"
:src="row.thumbnail"
class="goods-thumbnail"
alt=""
/>
<div class="goods-thumb-box">
<el-image
v-if="row.thumbnail"
:src="row.thumbnail"
fit="cover"
preview-teleported
:preview-src-list="[row.thumbnail]"
class="goods-thumbnail"
>
<template #error>
<div class="thumb-slot">无图</div>
</template>
</el-image>
<div v-else class="thumb-slot">无图</div>
</div>
<div class="goods-text">
<div class="div-zoom">{{ row.goodsName }}</div>
<div v-if="row.simpleSpecs" class="sub-title">
<div class="goods-title" :title="row.goodsName">{{ row.goodsName || "-" }}</div>
<div v-if="row.simpleSpecs" class="goods-specs">
规格:{{ row.simpleSpecs.trim() || "-" }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="真实销量" width="110">
<el-table-column prop="goodsId" label="SPU编码" width="160" show-overflow-tooltip />
<el-table-column prop="id" label="SKU ID" width="160" show-overflow-tooltip />
<el-table-column label="真实销量" width="110" align="right">
<template #default="{ row }">
<span v-if="row">{{ row.buyCount || 0 }}</span>
</template>
</el-table-column>
<el-table-column label="虚拟销量" width="110">
<el-table-column label="虚拟销量" width="110" align="right">
<template #default="{ row }">
<span v-if="row">{{ row.virtualSalesInput || 0 }}</span>
</template>
</el-table-column>
<el-table-column label="总销量" width="110">
<el-table-column label="总销量" width="110" align="right">
<template #default="{ row }">
<span v-if="row">{{ getTotalSales(row) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" width="100">
<el-table-column label="状态" width="90" align="center">
<template #default="{ row }">
<el-tag v-if="row" :type="row.marketEnable === 'UPPER' ? 'success' : 'warning'">
<span v-if="row">
{{ row.marketEnable === "UPPER" ? "上架" : "下架" }}
</el-tag>
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center" fixed="right">
<el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="{ row, $index }">
<a
v-if="row"
@@ -445,32 +454,63 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
.sub-title {
margin-top: 6px;
color: #808695;
font-size: 12px;
}
.goods-info {
display: flex;
align-items: center;
margin: 5px 0;
padding: 10px 0;
padding: 4px 0;
}
.goods-thumb-box {
width: 44px;
height: 44px;
min-width: 44px;
margin-right: 12px;
border-radius: 4px;
overflow: hidden;
border: 1px solid #ebeef5;
background-color: #f8f9fa;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.goods-thumbnail {
width: 50px;
height: 50px;
margin-right: 12px;
object-fit: cover;
flex-shrink: 0;
width: 44px;
height: 44px;
display: block;
}
.thumb-slot {
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
color: #909399;
background-color: #f5f7fa;
}
.goods-text {
min-width: 0;
flex: 1;
}
.div-zoom {
.goods-title {
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-break: break-all;
font-weight: normal;
}
.goods-specs {
margin-top: 4px;
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -493,11 +533,28 @@ onMounted(() => {
.sku-info-label {
width: 90px;
color: #808695;
flex-shrink: 0;
}
.mt_10 {
margin-top: 10px;
}
.link-text {
color: #2d8cf0;
cursor: pointer;
text-decoration: none;
font-size: 14px;
line-height: 1;
display: inline-block;
&:hover {
color: #57a3f3;
}
&.disabled {
color: #c5c8ce;
cursor: not-allowed;
}
}
</style>