From a126437701fbced43ed676774516cb32d684c042 Mon Sep 17 00:00:00 2001 From: Xulinchuan <2026734208@qq.com> Date: Wed, 11 Jun 2025 14:34:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=AC=E5=85=B1=E5=93=81=E7=89=8C?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=AE=8C=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/brand/index.js | 44 +- src/layout/components/Sidebar/Logo.vue | 3 +- src/router/index.js | 26 +- src/views/brand/applicationReview/index.vue | 396 +++++++++++++++- .../brand/informationManagement/index.vue | 180 +++---- src/views/brand/management/index.vue | 445 +++++++++++++++++- src/views/brand/renewal/index.vue | 345 +++++++++++++- 7 files changed, 1324 insertions(+), 115 deletions(-) diff --git a/src/api/brand/index.js b/src/api/brand/index.js index 0c29081..91b5ce6 100644 --- a/src/api/brand/index.js +++ b/src/api/brand/index.js @@ -1,6 +1,6 @@ import request from "@/utils/request"; -// 获取商品管理列表 +// 获取品牌管理列表 export function getBrandbaseList(query) { return request({ url: "/brand/brandbase/page", @@ -27,7 +27,7 @@ export function updateBrand(data) { // 删除品牌 export function deleteBrand(id) { return request({ - url: `/brand/brandbase/del/${id}`, + url: '/brand/brandbase/del?ids=' + id, method: "delete", }); } @@ -39,3 +39,43 @@ export function getBrandInfo(id) { method: "get", }); } +export function updateStatusBrand(data) { + return request({ + url: "brand/brandbase/updateStatus", + method: "post", + data: data, + }); +} +// 获取品牌审核列表 +export function applicationrecord(query) { + return request({ + url: "/brand/applicationrecord/page", + method: "get", + params: query, + }); +} +// 品牌审核驳回 +export function rejectBrand(data) { + return request({ + url: "/brand/applicationrecord/approve", + method: "post", + data: data, + }); +} + +// 获取续期列表 +export function applicationrecordList(query) { + return request({ + url: "/brand/applicationrenewal/page", + method: "get", + params: query, + }); +} +// 续期审核驳回 +export function applicationrenewalApprove(data) { + return request({ + url: "/brand/applicationrenewal/approve", + method: "post", + data: data, + }); +} diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue index dba707a..089ae8f 100644 --- a/src/layout/components/Sidebar/Logo.vue +++ b/src/layout/components/Sidebar/Logo.vue @@ -116,7 +116,8 @@ getUser(); & .sidebar-title { display: inline-block; margin: 0; - color: v-bind(getLogoTextColor); + // color: v-bind(getLogoTextColor); + color: #000; font-weight: 600; line-height: 50px; font-size: 14px; diff --git a/src/router/index.js b/src/router/index.js index 9e783c2..6e83c75 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -366,25 +366,25 @@ export const constantRoutes = [ component: () => import('@/views/brand/renewal/index'), hidden: false, meta: { - title: "续期", + title: "申请续期", icon: "", noCache: false, link: null, }, name: "renewal", }, - { - path: 'brand/management', - component: () => import('@/views/brand/management/index'), - hidden: false, - meta: { - title: "管理制度上传", - icon: "", - noCache: false, - link: null, - }, - name: "management", - }, + // { + // path: 'brand/management', + // component: () => import('@/views/brand/management/index'), + // hidden: false, + // meta: { + // title: "品牌使用管理", + // icon: "", + // noCache: false, + // link: null, + // }, + // name: "management", + // }, ], }, ] diff --git a/src/views/brand/applicationReview/index.vue b/src/views/brand/applicationReview/index.vue index bc61ff2..c9765a9 100644 --- a/src/views/brand/applicationReview/index.vue +++ b/src/views/brand/applicationReview/index.vue @@ -1,6 +1,396 @@ - \ No newline at end of file + + diff --git a/src/views/brand/informationManagement/index.vue b/src/views/brand/informationManagement/index.vue index b9d149e..4841902 100644 --- a/src/views/brand/informationManagement/index.vue +++ b/src/views/brand/informationManagement/index.vue @@ -122,8 +122,8 @@ @@ -156,9 +156,9 @@ import { ref, reactive, computed, onMounted, onBeforeUnmount } from "vue"; import tableComponent from "@/components/tableComponent.vue"; import myUploadImage from "@/components/myUploadImage.vue"; import Mock from "mockjs"; -import {getBrandbaseList,addBrand,updateBrand,deleteBrand,getBrandInfo} from "@/api/brand/index"; +import {getBrandbaseList,addBrand,updateBrand,deleteBrand,getBrandInfo,updateStatusBrand} from "@/api/brand/index"; import { id } from "element-plus/es/locales.mjs"; -import { ElMessage } from "element-plus"; +import { ElMessage,ElMessageBox } from "element-plus"; const formInline = reactive({ id: "", @@ -246,79 +246,25 @@ const resetForm = () => { // 表格数据 const tableData = ref([]); +const selectedIds = ref([]); +const btnStatus = computed(() => { + return selectedIds.value.length <= 0; +}); const tableLoading = ref(false); const tableTotal = ref(0); let nowClickRow = ref({}); // 列配置 const columns = ref([ { prop: "id", label: "ID" }, - { prop: "imgPath", label: "商品图片", slotName:'imgPath', width: "120", align: "left" }, - { prop: "title", label: "商品名称" }, - { prop: "code", label: "商品编码", width: "120" }, + { prop: "imgPath", label: "品牌LOGO", slotName:'imgPath', width: "120", align: "left" }, + { prop: "title", label: "品牌名称" }, + { prop: "code", label: "品牌编码", width: "120" }, { prop: "createTime", label: "时间", width: "120" }, { prop: "applicationNum", label: "申请数量" }, { prop: "useNum", label: "使用数量" }, - { prop: "status", label: "状态", slotName: "status" }, + { prop: "status", label: "状态", slotName: "status", width: "140"}, { prop: "action", label: "操作", slotName: "action",width: "140",align: "center" }, ]); - -// 生成食物主题昵称 -const generateFoodNickname = () => { - // 形容词(情绪/风格) - const adjectives = [ - "暴躁的", - "快乐的", - "忧郁的", - "疯狂的", - "安静的", - "慵懒的", - "甜甜的", - "咸咸的", - "酸酸的", - "辣辣的", - ]; - - // 食物名词(仅限食物) - const foods = [ - "辣椒", - "西瓜", - "土豆", - "番茄", - "黄瓜", - "苹果", - "蛋糕", - "面包", - "披萨", - "冰淇淋", - "奶茶", - "咖啡", - "啤酒", - "炸鸡", - ]; - - // 随机组合:形容词 + 食物 - return Mock.mock(`@pick(${adjectives})`) + Mock.mock(`@pick(${foods})`); -}; -// 生成模拟数据 -const generateMockData = () => { - return Mock.mock({ - "list|10": [ - { - "id|+1": 10000, - nickname: () => generateFoodNickname(), //昵称 - userName: "@cname", //姓名 - accountNumber: Mock.mock("@id").toString().slice(0, 10), //账号 - phoneNumber: "@integer(13000000000, 18999999999)", //手机号 - sex: '@pick(["男", "女"])', //性别 - "status|1": [0, 1], //0异常 1正常 - "userCategory|1": - '@pick(["活跃/低消费", "活跃/中消费", "活跃/高消费"])', //用户分类 - unitPrice: "@float(10, 200, 2, 2)", //客单价 - ordersNums: "@integer(10, 200)", - }, - ], - }).list; -}; // 自定义表头类名,也可以在columns指定列中添加headerClassName: 'custom-header' const getHeaderClass = ({ column }) => { return "custom-header"; @@ -332,11 +278,38 @@ const handlePaginationChange = ({ page, pageSize }) => { // 多选框变化 const handleSelectionChange = (selection) => { console.log("选中项:", selection); + selectedIds.value = []; + selection.forEach(element => { + selectedIds.value.push(element.id); + }); +}; + +// 批量删除 +const batchDelete = async () => { + // deleteGoods(selectedIds.value.join(",")); + deleteGoods(selectedIds.value); +}; +const deleteGoods = async (param) => { + console.log("批量删除参数:", param); + + try { + tableLoading.value = true; + let res = await deleteBrand(param); + tableLoading.value = false; + if (res.code == 200) { + ElMessage.success("删除成功"); + loadData(); + } else { + ElMessage.error(res.msg); + } + } catch (error) { + tableLoading.value = false; + } }; // 添加商品 const handleAdd = () => { -// console.log("handleAdd!"); +resetDlg(); dialogTitle.value = "添加品牌"; isADD.value = true; dialogFormVisible.value = true; @@ -369,45 +342,72 @@ const onSaveCategory = async () => { } } }); - - +}; + +//启用停用 +const startStop = async (row) => { + let status = row.status == 1 ? 0 : 1; + let params = { id: row.id, status: status }; + let response = await updateStatusBrand(params); + if (response.code === 200) { + ElMessage.success("操作成功!"); + loadData(); + } else { + ElMessage.error(response.message); + } }; // 编辑操作 const handleEdit = async(row) => { + resetDlg(); isADD.value = false; - dialogFormVisible.value = true; - let response = await getBrandInfo(row.id); - if (response.code === 200) { - dialogForm = response.data; - dialogTitle.value = "编辑品牌"; - } else { - ElMessage.error(response.message); - } + dialogFormVisible.value = true; + let response = await getBrandInfo(row.id); + if (response.code === 200) { + Object.assign(dialogForm, response.data); // 保持响应性 + dialogTitle.value = "编辑品牌"; + } else { + ElMessage.error(response.message); + } }; // 删除操作 const handleDelete = async(row) => { - let response = await deleteBrand(row.id); - if (response.code === 200) { + //提示一下是否确定删除 + ElMessageBox.confirm("确定要删除吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(async () => { + let response = await deleteBrand(row.id); + if (response.code === 200) { ElMessage.success("品牌删除成功!"); loadData(); - } else { + } else { ElMessage.error(response.message); - } + } + }) + .catch(() => { + ElMessage.info("已取消删除"); + }) + }; //取消弹框 const cancelDialog = () => { - dialogRef.value.resetFields(); - dialogFormVisible.value = false; - dialogTitle.value = ""; - dialogForm.title = ""; - dialogForm.imgPath = ""; - dialogForm.id = ""; - dialogForm.code = ""; - console.log('dialogForm',dialogForm); - + resetDlg(); }; +const resetDlg= () => { + dialogRef.value?.resetFields(); // 重置表单验证状态 + Object.assign(dialogForm, { // 保持响应性,手动清空字段 + id: "", + title: "", + imgPath: "", + code: "" + }); + dialogFormVisible.value = false; +} + const titleRef = ref(null); const searchBarRef = ref(null); const tableViewportHeight = ref(0); diff --git a/src/views/brand/management/index.vue b/src/views/brand/management/index.vue index bc61ff2..915375d 100644 --- a/src/views/brand/management/index.vue +++ b/src/views/brand/management/index.vue @@ -1,6 +1,445 @@ - \ No newline at end of file + + diff --git a/src/views/brand/renewal/index.vue b/src/views/brand/renewal/index.vue index bc61ff2..c5224cc 100644 --- a/src/views/brand/renewal/index.vue +++ b/src/views/brand/renewal/index.vue @@ -1,6 +1,345 @@ - \ No newline at end of file + + From 8ed4518be46224d964702d309b84423fc5932eaa Mon Sep 17 00:00:00 2001 From: "2090205686@qq.com" Date: Wed, 11 Jun 2025 14:35:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BA=E5=AE=9A=E5=88=97=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=EF=BC=8C=E5=95=86=E5=93=81=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=90=8E=E8=B7=B3=E8=BD=AC=E4=B8=BB=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/custom.scss | 1 + src/components/tableComponent.vue | 3 ++- src/views/goods/goodsCategory/index.vue | 2 +- src/views/goods/goodsManage/addGoods.vue | 1 + src/views/goods/goodsManage/editGoods.vue | 1 + src/views/goods/goodsManage/seeDetails.vue | 5 ++--- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/assets/styles/custom.scss b/src/assets/styles/custom.scss index 1495537..8b51175 100644 --- a/src/assets/styles/custom.scss +++ b/src/assets/styles/custom.scss @@ -218,6 +218,7 @@ height: 100%; left: 0; right: 0; + min-width: 1000px; } // 表格组件中的各插槽元素自定义样式 .custom-tooltip-content { diff --git a/src/components/tableComponent.vue b/src/components/tableComponent.vue index 983144c..7392864 100644 --- a/src/components/tableComponent.vue +++ b/src/components/tableComponent.vue @@ -59,6 +59,7 @@ :label="column.label" :width="column.width" :align="column.align || 'center'" + :fixed="column.fixed ?? false" :sortable="column.sortable" :header-class-name="column.headerClassName" > @@ -340,7 +341,7 @@ onBeforeUnmount(() => { /* 自定义鼠标悬停颜色 */ :deep(.el-table__body tr:hover > td) { - background-color: rgba(37, 191, 130, 0.1) !important; + background-color: rgba(237 255 248) !important; } /* 自定义表头样式 */ diff --git a/src/views/goods/goodsCategory/index.vue b/src/views/goods/goodsCategory/index.vue index a6759b2..721472d 100644 --- a/src/views/goods/goodsCategory/index.vue +++ b/src/views/goods/goodsCategory/index.vue @@ -171,7 +171,7 @@ const columns1 = ref([ { prop: "level", label: "分类级别", slotName: "level" }, { prop: "createTime", label: "添加时间" }, { prop: "status", label: "状态", slotName: "status" }, - { prop: "action", label: "操作", slotName: "action", width: 150 }, + { prop: "action", label: "操作", slotName: "action", width: 150,fixed: "right" }, ]); // 生成食物主题昵称 diff --git a/src/views/goods/goodsManage/addGoods.vue b/src/views/goods/goodsManage/addGoods.vue index 320c81f..df0b064 100644 --- a/src/views/goods/goodsManage/addGoods.vue +++ b/src/views/goods/goodsManage/addGoods.vue @@ -564,6 +564,7 @@ const onGoodSave = async (params) => { if (response.code === 200) { ElMessage.success("新增成功!"); formRef.value.resetFields(); + router.go(-1); } else { ElMessage.error(response.message); } diff --git a/src/views/goods/goodsManage/editGoods.vue b/src/views/goods/goodsManage/editGoods.vue index ddebca7..e629540 100644 --- a/src/views/goods/goodsManage/editGoods.vue +++ b/src/views/goods/goodsManage/editGoods.vue @@ -554,6 +554,7 @@ const onGoodSave = async (params) => { if (response.code === 200) { ElMessage.success("编辑成功!"); formRef.value.resetFields(); + router.go(-1); } else { ElMessage.error(response.message); } diff --git a/src/views/goods/goodsManage/seeDetails.vue b/src/views/goods/goodsManage/seeDetails.vue index 0de9d37..e3c6761 100644 --- a/src/views/goods/goodsManage/seeDetails.vue +++ b/src/views/goods/goodsManage/seeDetails.vue @@ -209,7 +209,7 @@ - 返回 + 返回 @@ -530,8 +530,7 @@ const changeCategory3 = (id) => { formInline.categoryId = id; }; -//审核/驳回 -const approved = async () => { +const goBack = async () => { router.go(-1); };