diff --git a/pages/exitMaterial/exitMaterial.vue b/pages/exitMaterial/exitMaterial.vue index f1024bf..d1fce36 100644 --- a/pages/exitMaterial/exitMaterial.vue +++ b/pages/exitMaterial/exitMaterial.vue @@ -220,7 +220,8 @@ import { basePath } from '../../public' backPerson: '', remark: '' }, - fetchedList: [] + fetchedList: [], + ableRoleArr: ['admin', 'em04', 'me02', 'dm03'] } }, methods: { @@ -341,7 +342,24 @@ import { basePath } from '../../public' } }, onNavigationBarButtonTap() { - this.$refs.popup.open() + let that = this + let nowRole = uni.getStorageSync('roles') + let found = false + console.log(nowRole); + for (let role of nowRole) { + if (that.ableRoleArr.includes(role)) { + found = true; + break; + } + } + if (!found) { + uni.showToast({ + icon: 'none', + title: '当前角色没有申请权限!' + }) + } else { + that.$refs.popup.open() + } }, onShow() { let that = this diff --git a/pages/index/index.vue b/pages/index/index.vue index b9540ec..b058666 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -196,14 +196,19 @@ import { authPath, basePath, publicPath, systemPath } from '../../public'; console.log(err); }) // 获取公司名称 - that.$api.index.fetchCompanyName({ - ancestors: uni.getStorageSync('userInfo').sysUser.dept.ancestors - }).then(res => { - console.log(res); - if (res.data.code == 200) uni.setStorageSync('companyName', res.data.msg) - }).catch(err => { - console.log(err); - }) + let dept = uni.getStorageSync('userInfo').sysUser.dept.ancestors + if (dept == null) { + uni.setStorageSync('companyName', '') + } else { + that.$api.index.fetchCompanyName({ + ancestors: dept + }).then(res => { + console.log(res); + if (res.data.code == 200) uni.setStorageSync('companyName', res.data.msg) + }).catch(err => { + console.log(err); + }) + } }, onNavigationBarButtonTap(e) { console.log(e); diff --git a/pages/workSpace/workSpace.vue b/pages/workSpace/workSpace.vue index 746ed07..c4456e7 100644 --- a/pages/workSpace/workSpace.vue +++ b/pages/workSpace/workSpace.vue @@ -161,7 +161,7 @@ } .upper-search{ width: 85%; - margin: 5vh auto; + margin: 6vh auto; color: #fff; h4{ margin-bottom: 1vh;