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..09011e7 100644 --- a/src/views/marketing_center/drainage/index.vue +++ b/src/views/marketing_center/drainage/index.vue @@ -2,10 +2,10 @@ - +