From fe200990e07b999b2e1b96ca2ef25389f1c0296e Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Mon, 15 Dec 2025 14:56:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=202.=E5=A2=9E=E5=8A=A0=E6=96=B0=E7=89=88?= =?UTF-8?q?=E7=A7=81=E5=9F=9F=E5=BC=95=E6=B5=81=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 - .../role/components/roleTemplateDialog.vue | 5 +- src/views/admin/system/role/index.vue | 2 +- src/views/data/index.vue | 16 +- src/views/data/sales.vue | 20 ++- src/views/data/table.vue | 20 ++- src/views/marketing_center/drainage/index.vue | 169 +++++++++++++++--- src/views/marketing_center/list.vue | 35 ++-- 8 files changed, 225 insertions(+), 44 deletions(-) diff --git a/.env.development b/.env.development index 5dae739..2ce64d6 100644 --- a/.env.development +++ b/.env.development @@ -18,7 +18,5 @@ VITE_APP_BASE_API=/dev-api VITE_APP_WS_ENDPOINT=ws://192.168.1.42:2348 # 本地 # VITE_APP_API_PHP_URL=https://newblockwlx.sxczgkj.cn #php抖音美团正式环境 - - # 启用 Mock 服务 VITE_MOCK_DEV_SERVER=false diff --git a/src/views/admin/system/role/components/roleTemplateDialog.vue b/src/views/admin/system/role/components/roleTemplateDialog.vue index e06a5a6..de1d6db 100644 --- a/src/views/admin/system/role/components/roleTemplateDialog.vue +++ b/src/views/admin/system/role/components/roleTemplateDialog.vue @@ -52,13 +52,16 @@ async function roleTemplateListAjax() { el.cehcked = false }); list.value = res + + if (list.value.length > 0) { + visible.value = true + } } catch (error) { console.log(error); } } function show() { - visible.value = true roleTemplateListAjax() } diff --git a/src/views/admin/system/role/index.vue b/src/views/admin/system/role/index.vue index 8ba51d0..9d7a154 100644 --- a/src/views/admin/system/role/index.vue +++ b/src/views/admin/system/role/index.vue @@ -247,7 +247,7 @@ function handleQuery() { total.value = data.totalRow; if (data.records.length == 0) { - roleTemplateDialogRef?.value.show() + roleTemplateDialogRef.value.show() } }) .finally(() => { diff --git a/src/views/data/index.vue b/src/views/data/index.vue index c415b90..464b92b 100644 --- a/src/views/data/index.vue +++ b/src/views/data/index.vue @@ -650,6 +650,13 @@ export default { }, }, mounted() { + let shopInfo = JSON.parse(localStorage.getItem('userInfo')) + if (shopInfo.isHeadShop) { + this.shopId = shopInfo.id + } else { + this.shopId = localStorage.getItem('shopId') + } + // 增加首页提示是否账号30天过期 let date = dayjs(localStorage.getItem("expireDate")).diff(dayjs().format("YYYY-MM-DD"), "day"); if (date <= 30 && date >= 0) { @@ -702,9 +709,12 @@ export default { */ async geiShopList() { try { - let res = await ShopApi.getBranchList() - this.branchList = res; - this.shopId = res[0].shopId + let shopInfo = JSON.parse(localStorage.getItem('userInfo')) + if (shopInfo.isHeadShop) { + let res = await ShopApi.getBranchList() + this.branchList = res; + this.shopId = res[0].shopId + } } catch (error) { console.log('获取分店列表===', error); } diff --git a/src/views/data/sales.vue b/src/views/data/sales.vue index 8dd6991..7e8a77b 100644 --- a/src/views/data/sales.vue +++ b/src/views/data/sales.vue @@ -238,6 +238,13 @@ export default { }, }, mounted() { + let shopInfo = JSON.parse(localStorage.getItem('userInfo')) + if (shopInfo.isHeadShop) { + this.shopId = shopInfo.id + } else { + this.shopId = localStorage.getItem('shopId') + } + this.resetQuery = { ...this.query }; this.getTableData(); this.getCategory(); @@ -248,9 +255,16 @@ export default { * 获取分店列表 */ async geiShopList() { - let res = await ShopApi.getBranchList() - this.branchList = res; - this.shopId = res[0].shopId + try { + let shopInfo = JSON.parse(localStorage.getItem('userInfo')) + if (shopInfo.isHeadShop) { + let res = await ShopApi.getBranchList() + this.branchList = res; + this.shopId = res[0].shopId + } + } catch (error) { + console.log('获取分店列表===', error); + } }, totalfilter(item, d) { let num = item + d; diff --git a/src/views/data/table.vue b/src/views/data/table.vue index a360083..9c281cb 100644 --- a/src/views/data/table.vue +++ b/src/views/data/table.vue @@ -142,6 +142,13 @@ export default { }, }, mounted() { + let shopInfo = JSON.parse(localStorage.getItem('userInfo')) + if (shopInfo.isHeadShop) { + this.shopId = shopInfo.id + } else { + this.shopId = localStorage.getItem('shopId') + } + this.resetQuery = { ...this.query }; this.getTableData(); this.geiShopList(); @@ -151,9 +158,16 @@ export default { * 获取分店列表 */ async geiShopList() { - let res = await ShopApi.getBranchList() - this.branchList = res; - this.shopId = res[0].shopId + try { + let shopInfo = JSON.parse(localStorage.getItem('userInfo')) + if (shopInfo.isHeadShop) { + let res = await ShopApi.getBranchList() + this.branchList = res; + this.shopId = res[0].shopId + } + } catch (error) { + console.log('获取分店列表===', error); + } }, //携带table id跳转到订单列表页面 toTableOrderList(data) { diff --git a/src/views/marketing_center/drainage/index.vue b/src/views/marketing_center/drainage/index.vue index 6806938..9ee30f8 100644 --- a/src/views/marketing_center/drainage/index.vue +++ b/src/views/marketing_center/drainage/index.vue @@ -2,10 +2,10 @@ - +