diff --git a/pages/work/land/index.vue b/pages/work/land/index.vue index a890dd6..be7b503 100644 --- a/pages/work/land/index.vue +++ b/pages/work/land/index.vue @@ -114,8 +114,12 @@ created() { this.windowHeight = uni.getSystemInfoSync().windowHeight; }, - onLoad(){ - this.getCompanyTree(); + onLoad() { + let companyId = null; + if (getApp().ijs.land) { + companyId = getApp().ijs.land.companyGroup.companyId + } + this.getCompanyTree(companyId); }, onShow() { if (this.paging != null) { @@ -125,7 +129,7 @@ }, methods: { /** 查询公司下拉树结构 */ - getCompanyTree() { + getCompanyTree(companyId) { const obj = { status: 0, delFlag: "0", @@ -136,9 +140,8 @@ .then(res => { this.treeList = res.data; if (this.treeList && this.treeList.length) { - let cache_companyId = uni.getStorageSync("app_companyId") - if (cache_companyId) { - this.defaultCheckedKeys = cache_companyId + ""; + if (companyId) { + this.defaultCheckedKeys = companyId + ""; } else { let companyList = this.treeList[0].children.filter(x => x.id != 100); if (companyList && companyList.length) { @@ -206,9 +209,6 @@ handleTreeChange(values, currentItem) { this.query.companyGroupIds = ""; this.companyGroupId = values; - if (!this.isFirst) { - uni.setStorageSync("app_companyId", this.companyGroupId) - } this.isFirst = false; this.selectCompanyObj = currentItem; if (this.all) { diff --git a/pages/work/user/index.vue b/pages/work/user/index.vue index 5d4d290..f63d3d9 100644 --- a/pages/work/user/index.vue +++ b/pages/work/user/index.vue @@ -1,13 +1,13 @@