diff --git a/src/views/data/index.vue b/src/views/data/index.vue index c415b90..3150866 100644 --- a/src/views/data/index.vue +++ b/src/views/data/index.vue @@ -702,9 +702,13 @@ export default { */ async geiShopList() { try { - let res = await ShopApi.getBranchList() - this.branchList = res; - this.shopId = res[0].shopId + if (this.shopInfo.isHeadShop) { + let res = await ShopApi.getBranchList() + this.branchList = res; + this.shopId = res[0].shopId + } else { + this.shopId = this.shopInfo.id + } } catch (error) { console.log('获取分店列表===', error); } diff --git a/src/views/data/sales.vue b/src/views/data/sales.vue index 8dd6991..9400d7b 100644 --- a/src/views/data/sales.vue +++ b/src/views/data/sales.vue @@ -248,9 +248,13 @@ export default { * 获取分店列表 */ async geiShopList() { - let res = await ShopApi.getBranchList() - this.branchList = res; - this.shopId = res[0].shopId + if (this.shopInfo.isHeadShop) { + let res = await ShopApi.getBranchList() + this.branchList = res; + this.shopId = res[0].shopId + } else { + this.shopId = this.shopInfo.id + } }, totalfilter(item, d) { let num = item + d; diff --git a/src/views/data/table.vue b/src/views/data/table.vue index a360083..8cab45b 100644 --- a/src/views/data/table.vue +++ b/src/views/data/table.vue @@ -151,9 +151,13 @@ export default { * 获取分店列表 */ async geiShopList() { - let res = await ShopApi.getBranchList() - this.branchList = res; - this.shopId = res[0].shopId + if (this.shopInfo.isHeadShop) { + let res = await ShopApi.getBranchList() + this.branchList = res; + this.shopId = res[0].shopId + } else { + this.shopId = this.shopInfo.id + } }, //携带table id跳转到订单列表页面 toTableOrderList(data) {