Browse Source

fix: 权限改成缓存

master
zhang_li 6 months ago
parent
commit
5f1c156f05
  1. 7
      src/App.vue
  2. 4
      src/main.ts
  3. 10
      src/pages/deviceReport/index.vue
  4. 6
      src/pages/index.vue
  5. 4
      src/pages/overhaulOrder/detail.vue
  6. 3
      src/pages/overhaulOrder/index.vue
  7. 13
      src/pages/repairOrder/detail.vue
  8. 3
      src/pages/repairOrder/index.vue
  9. 5
      src/pages/sparePartsApplication/detail.vue
  10. 5
      src/pages/sparePartsApplication/index.vue
  11. 5
      src/pages/sparePartsApplicationApprove/index.vue
  12. 3
      src/pages/spotCheckOrder/detail.vue
  13. 3
      src/pages/spotCheckOrder/index.vue
  14. 7
      src/pages/upkeepOrder/detail.vue
  15. 12
      src/plugins/auth.js
  16. 4
      src/store/modules/countStore.ts

7
src/App.vue

@ -5,6 +5,7 @@
onHide onHide
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import { import {
@ -15,7 +16,6 @@
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
onLaunch(async () => { onLaunch(async () => {
@ -91,7 +91,10 @@
// #endif // #endif
if (getAccessToken()) { if (getAccessToken()) {
await store.GetPermissionInfo().then(res => { await store.GetPermissionInfo().then(res => {
}).catch(() => { }) uni.setStorageSync('permissionInfo',res.permissions)
uni.setStorageSync('roles',res.roles)
}).catch(() => {
})
await store.GetInfo().then(res => { await store.GetInfo().then(res => {
}).catch(() => { }) }).catch(() => { })
} }

4
src/main.ts

@ -9,7 +9,7 @@ import App from './App.vue'
import tab from './plugins/tab' import tab from './plugins/tab'
import modal from './plugins/modal' import modal from './plugins/modal'
import time from './plugins/time' import time from './plugins/time'
// import auth from './plugins/auth' import auth from './plugins/auth'
// 权限 // 权限
import { setupAuth } from '@/directives' import { setupAuth } from '@/directives'
@ -34,7 +34,7 @@ export function createApp() {
app.config.globalProperties.$modal = modal app.config.globalProperties.$modal = modal
// 时间对象 // 时间对象
app.config.globalProperties.$time = time app.config.globalProperties.$time = time
// app.config.globalProperties.$auth = auth app.config.globalProperties.$auth = auth

10
src/pages/deviceReport/index.vue

@ -4,7 +4,7 @@
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
:title="title"> :title="title">
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(type=='DEVICE'&&auth.hasPermi('eam:device-repair-request:createAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-repair-request:createAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-repair-request:createAPP'))"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(type=='DEVICE'&&$auth.hasPermi('eam:device-repair-request:createAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-repair-request:createAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-repair-request:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<view class="list"> <view class="list">
@ -44,9 +44,9 @@
</view> </view>
<view class="button"> <view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" @click="cancle(item)" <u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" @click="cancle(item)"
v-if="((type=='DEVICE'&&auth.hasPermi('eam:device-repair-request:cancelAPP')) v-if="((type=='DEVICE'&&$auth.hasPermi('eam:device-repair-request:cancelAPP'))
||(type=='MOLD'&&auth.hasPermi('eam:mold-repair-request:cancelAPP')) ||(type=='MOLD'&&$auth.hasPermi('eam:mold-repair-request:cancelAPP'))
||(type=='TECH'&&auth.hasPermi('eam:tech-repair-request:cancelAPP')))&& ||(type=='TECH'&&$auth.hasPermi('eam:tech-repair-request:cancelAPP')))&&
item.isCancel == 0 && item.isCancel == 0 &&
item.declarer == store.id" item.declarer == store.id"
>撤销</u-button> >撤销</u-button>
@ -72,7 +72,7 @@
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as reportApi from "@/api/report.js" import * as reportApi from "@/api/report.js"
import auth from '@/plugins/auth'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()

6
src/pages/index.vue

@ -97,9 +97,9 @@
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
console.log(proxy.$plugins)
// store // store
const store = useCountStore() const store = useCountStore()
console.log(99,store)
const bgOpacity = ref(0) const bgOpacity = ref(0)
@ -144,7 +144,6 @@
async function sparePartsApplicationApprovePage(){ async function sparePartsApplicationApprovePage(){
await sparePartsApplicationApproveApi.sparePartsApplicationApprovePage(params.value).then((res) => { await sparePartsApplicationApproveApi.sparePartsApplicationApprovePage(params.value).then((res) => {
number1.value = res.data.total number1.value = res.data.total
console.log(res.data.total)
}).catch(() => { }).catch(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
}) })
@ -162,7 +161,6 @@
await proxy.$onLaunched; await proxy.$onLaunched;
if (getAccessToken()) { if (getAccessToken()) {
meaus.value = store.meaus meaus.value = store.meaus
console.log(meaus.value)
let isHave = meaus.value.find (item=>item.path == 'parePartsManagement') let isHave = meaus.value.find (item=>item.path == 'parePartsManagement')
let isHaveIndex = meaus.value.findIndex (item=>item.path == 'parePartsManagement') let isHaveIndex = meaus.value.findIndex (item=>item.path == 'parePartsManagement')
if(isHave&&isHave.children){ if(isHave&&isHave.children){
@ -174,8 +172,6 @@
}) })
await sparePartsApplicationApprovePage() await sparePartsApplicationApprovePage()
await sparePartsApplicationApprovePage1() await sparePartsApplicationApprovePage1()
console.log(isShowItemApprove1.value)
console.log(isShowItemApprove2.value)
// //
if(isShowItemApprove1.value && !isShowItemApprove2.value){ if(isShowItemApprove1.value && !isShowItemApprove2.value){
number.value =number1.value number.value =number1.value

4
src/pages/overhaulOrder/detail.vue

@ -131,10 +131,10 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClickFinish" :loading='loading' <u-button type="primary" v-if="data.status == 'PECEIVED'&&((type=='DEVICE'&&$auth.hasPermi('eam:device-inspection-job-main:orderClickFinishAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-inspection-job-main:orderClickFinishAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-inspection-job-main:orderClickFinishAPP')))" @click="orderClickFinish" :loading='loading'
:disabled='loading'>完成</u-button> :disabled='loading'>完成</u-button>
</view> </view>
<view class="btns" v-if="(data.status == 'COMPLETED')"> <view class="btns" v-if="(data.status == 'COMPLETED')&&((type=='DEVICE'&&$auth.hasPermi('eam:device-inspection-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-inspection-job-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-inspection-job-main:orderClickVerifyAPP')))">
<u-button type="primary" @click="orderClickVerify()" :loading='loading' <u-button type="primary" @click="orderClickVerify()" :loading='loading'
:disabled='loading'>验证完结</u-button> :disabled='loading'>验证完结</u-button>
</view> </view>

3
src/pages/overhaulOrder/index.vue

@ -5,7 +5,7 @@
title="检修工单"> title="检修工单">
<!-- <template v-slot:right v-if="isEngineer"> --> <!-- <template v-slot:right v-if="isEngineer"> -->
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&auth.hasPermi('eam:device-inspection-job-main:createAPP'))||(params.type=='MOLD'&&auth.hasPermi('eam:mold-inspection-job-main:createAPP'))||(params.type=='TECH'&&auth.hasPermi('eam:tech-inspection-job-main:createAPP'))"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-inspection-job-main:createAPP'))||(params.type=='MOLD'&&$auth.hasPermi('eam:mold-inspection-job-main:createAPP'))||(params.type=='TECH'&&$auth.hasPermi('eam:tech-inspection-job-main:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<!-- <Search @search='search' @screen='screen'/> --> <!-- <Search @search='search' @screen='screen'/> -->
@ -71,7 +71,6 @@
} from 'vue' } from 'vue'
import * as overhaulOrderApi from "@/api/overhaulOrder.js" import * as overhaulOrderApi from "@/api/overhaulOrder.js"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import auth from '@/plugins/auth'
const store = useCountStore() const store = useCountStore()
const isEngineer = ref(false) const isEngineer = ref(false)
if(store.roles.some(item=>item.indexOf('Engineer')>-1)){// if(store.roles.some(item=>item.indexOf('Engineer')>-1)){//

13
src/pages/repairOrder/detail.vue

@ -9,7 +9,7 @@
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办
</view> --> </view> -->
<view @click="transfer" <view @click="transfer"
v-if="data.status == 'PECEIVED'&&((type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:turnToAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:turnToAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:turnToAPP')))"> v-if="data.status == 'PECEIVED'&&((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:turnToAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:turnToAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:turnToAPP')))">
转办 转办
</view> </view>
</view> </view>
@ -207,23 +207,23 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns" <view class="btns"
v-if="data.status == 'PENDING'&&((type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:orderClickAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:orderClickAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:orderClickAPP')))"> v-if="data.status == 'PENDING'&&((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickAPP')))">
<u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button> <u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button>
</view> </view>
<view class="btns" v-if="data.status == 'PECEIVED'"> <view class="btns" v-if="data.status == 'PECEIVED'">
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm" <u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm"
:disabled='loading1' v-if="(type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:updateAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:updateAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:updateAPP'))">修改工单</u-button> :disabled='loading1' v-if="(type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:updateAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:updateAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:updateAPP'))">修改工单</u-button>
<u-button type="primary" @click="orderClickSuccess()" :loading='loading' :disabled='loading' <u-button type="primary" @click="orderClickSuccess()" :loading='loading' :disabled='loading'
v-if="(type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:orderClickFinishAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:orderClickFinishAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:orderClickFinishAPP'))">完成</u-button> v-if="(type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickFinishAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickFinishAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickFinishAPP'))">完成</u-button>
</view> </view>
<view class="btns" <view class="btns"
v-if="((data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')) && ((type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:orderClickVerifyAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:orderClickVerifyAPP')))"> v-if="((data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')) && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickVerifyAPP')))">
<u-button type="primary" @click="verify()" :loading='loading' :disabled='loading'>验证</u-button> <u-button type="primary" @click="verify()" :loading='loading' :disabled='loading'>验证</u-button>
</view> </view>
<view class="btns" <view class="btns"
v-if="(data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id)&& ((type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:orderClickConfirmAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:orderClickConfirmAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:orderClickConfirmAPP')))"> v-if="(data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id)&& ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickConfirmAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickConfirmAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickConfirmAPP')))">
<u-button type="primary" @click="orderClickApply()" :loading='loading' <u-button type="primary" @click="orderClickApply()" :loading='loading'
:disabled='loading'>维修确认</u-button> :disabled='loading'>维修确认</u-button>
</view> </view>
@ -287,7 +287,6 @@
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict.js"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder.js"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store

3
src/pages/repairOrder/index.vue

@ -4,7 +4,7 @@
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
:title="params.flag == 2 ? '报修确认' : '维修工单'"> :title="params.flag == 2 ? '报修确认' : '维修工单'">
<template v-slot:right v-if="params.flag!='2'"> <template v-slot:right v-if="params.flag!='2'">
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&auth.hasPermi('eam:device-maintenance-job-main:createAPP'))||(params.type==='MOLD'&&auth.hasPermi('eam:mold-maintenance-job-main:createAPP'))||(params.type==='TECH'&&auth.hasPermi('eam:tech-maintenance-job-main:createAPP'))"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:createAPP'))||(params.type==='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:createAPP'))||(params.type==='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<view class="list"> <view class="list">
@ -71,7 +71,6 @@
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder.js"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store

5
src/pages/sparePartsApplication/detail.vue

@ -38,8 +38,8 @@
</view> </view>
<view class="footer" v-if="from == 3 || from == 2"> <view class="footer" v-if="from == 3 || from == 2">
<view class="btns"> <view class="btns">
<button class="reset" @click="reject" v-if="(from==2&&auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&auth.hasPermi('eam:item-apply-request-main:role1APP'))">驳回</button> <button class="reset" @click="reject" v-if="(from==2&&$auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&$auth.hasPermi('eam:item-apply-request-main:role1APP'))">驳回</button>
<button class="sure" @click="agree" :loading='loading' :disabled='loading' v-if="(from==2&&auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&auth.hasPermi('eam:item-apply-request-main:role1APP'))">通过</button> <button class="sure" @click="agree" :loading='loading' :disabled='loading' v-if="(from==2&&$auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&$auth.hasPermi('eam:item-apply-request-main:role1APP'))">通过</button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
@ -56,7 +56,6 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import auth from '@/plugins/auth'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()

5
src/pages/sparePartsApplication/index.vue

@ -4,7 +4,7 @@
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="备件领用申请"> title="备件领用申请">
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="auth.hasPermi('eam:item-apply-request-main:createAPP')"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="$auth.hasPermi('eam:item-apply-request-main:createAPP')"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<!-- <Search @search='search' @screen='screen' /> --> <!-- <Search @search='search' @screen='screen' /> -->
@ -41,7 +41,7 @@
</view> </view>
<view class="button"> <view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" <u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;"
v-if="item.status==0&&auth.hasPermi('eam:item-apply-request-main:cancelAPP')" @click="cancle(item)">撤回</u-button> v-if="item.status==0&&$auth.hasPermi('eam:item-apply-request-main:cancelAPP')" @click="cancle(item)">撤回</u-button>
</view> </view>
</view> </view>
@ -62,7 +62,6 @@
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,

5
src/pages/sparePartsApplicationApprove/index.vue

@ -38,9 +38,9 @@
</view> </view>
<view class="button"> <view class="button">
<u-button shape="circle" size="mini" style="min-width: 120rpx;" <u-button shape="circle" size="mini" style="min-width: 120rpx;"
v-if="item.status==0&&((from==2&&auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&auth.hasPermi('eam:item-apply-request-main:role1APP')))" @click="reject(item)">驳回</u-button> v-if="item.status==0&&((from==2&&$auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&$auth.hasPermi('eam:item-apply-request-main:role1APP')))" @click="reject(item)">驳回</u-button>
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;margin-left: 20rpx;" <u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;margin-left: 20rpx;"
v-if="item.status==0&&((from==2&&auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&auth.hasPermi('eam:item-apply-request-main:role1APP')))" @click="agree(item)">通过</u-button> v-if="item.status==0&&((from==2&&$auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&$auth.hasPermi('eam:item-apply-request-main:role1APP')))" @click="agree(item)">通过</u-button>
</view> </view>
</view> </view>
@ -60,7 +60,6 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import auth from '@/plugins/auth'
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({

3
src/pages/spotCheckOrder/detail.vue

@ -95,7 +95,7 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns" <view class="btns"
v-if="data.status == 'COMPLETED'&& ((type=='DEVICE'&&auth.hasPermi('eam:device-spot-inspection-record-main:orderClickVerifyAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-spot-inspection-record-main:orderClickVerifyAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-spot-inspection-record-main:orderClickVerifyAPP')))"> v-if="data.status == 'COMPLETED'&& ((type=='DEVICE'&&$auth.hasPermi('eam:device-spot-inspection-record-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-spot-inspection-record-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-spot-inspection-record-main:orderClickVerifyAPP')))">
<u-button type="primary" @click="orderClickVerify()" :loading='loading' <u-button type="primary" @click="orderClickVerify()" :loading='loading'
:disabled='loading'>验证</u-button> :disabled='loading'>验证</u-button>
</view> </view>
@ -133,7 +133,6 @@
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder.js"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js" import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store

3
src/pages/spotCheckOrder/index.vue

@ -4,7 +4,7 @@
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="点检工单"> title="点检工单">
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&auth.hasPermi('eam:device-spot-inspection-record-main:createAPP'))||(params.type=='MOLD'&&auth.hasPermi('eam:mold-spot-inspection-record-main:createAPP'))||(params.type=='TECH'&&auth.hasPermi('eam:tech-spot-inspection-record-main:createAPP'))"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-spot-inspection-record-main:createAPP'))||(params.type=='MOLD'&&$auth.hasPermi('eam:mold-spot-inspection-record-main:createAPP'))||(params.type=='TECH'&&$auth.hasPermi('eam:tech-spot-inspection-record-main:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<view class="list"> <view class="list">
@ -70,7 +70,6 @@
getCurrentInstance, getCurrentInstance,
nextTick nextTick
} from 'vue' } from 'vue'
import auth from '@/plugins/auth'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js" import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'

7
src/pages/upkeepOrder/detail.vue

@ -142,13 +142,13 @@
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<u-button type="primary" <u-button type="primary"
v-if="data.status == 'PENDING' && ((type=='DEVICE'&&auth.hasPermi('eam:device-maintain-job-main:orderClickAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintain-job-main:orderClickAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintain-job-main:orderClickAPP')))" v-if="data.status == 'PENDING' && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintain-job-main:orderClickAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintain-job-main:orderClickAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintain-job-main:orderClickAPP')))"
@click="orderClick()" :loading='loading' :disabled='loading'>接单</u-button> @click="orderClick()" :loading='loading' :disabled='loading'>接单</u-button>
<u-button type="primary" <u-button type="primary"
v-if="data.status == 'PECEIVED' && ((type=='DEVICE'&&auth.hasPermi('eam:device-maintain-job-main:orderClickFinishAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintain-job-main:orderClickFinishAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintain-job-main:orderClickFinishAPP')))" v-if="data.status == 'PECEIVED' && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintain-job-main:orderClickFinishAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintain-job-main:orderClickFinishAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintain-job-main:orderClickFinishAPP')))"
@click="orderClickFinish()" :loading='loading' :disabled='loading'>完成</u-button> @click="orderClickFinish()" :loading='loading' :disabled='loading'>完成</u-button>
<u-button type="primary" <u-button type="primary"
v-if="data.status == 'COMPLETED' && ((type=='DEVICE'&&auth.hasPermi('eam:device-maintain-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&auth.hasPermi('eam:mold-maintain-job-main:orderClickVerifyAPP'))||(type=='TECH'&&auth.hasPermi('eam:tech-maintain-job-main:orderClickVerifyAPP')))" v-if="data.status == 'COMPLETED' && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintain-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintain-job-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintain-job-main:orderClickVerifyAPP')))"
@click="verify()" :loading='loading' :disabled='loading'>验证</u-button> @click="verify()" :loading='loading' :disabled='loading'>验证</u-button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
@ -179,7 +179,6 @@
} from 'vue' } from 'vue'
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold.js"
import * as upkeepOrderApi from "@/api/upkeepOrder.js" import * as upkeepOrderApi from "@/api/upkeepOrder.js"
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const list = ref([{ const list = ref([{
name: '设备信息' name: '设备信息'

12
src/plugins/auth.js

@ -1,12 +1,12 @@
// import store from '@/store' // import store from '@/store'
import { // import {
useCountStore // useCountStore
} from '@/store' // } from '@/store'
const store = useCountStore() // const store = useCountStore()
function authPermission(permission) { function authPermission(permission) {
const all_permission = "*:*:*" const all_permission = "*:*:*"
const permissions = store && store.permissions const permissions = uni.getStorageSync('permissionInfo')
if (permission && permission.length > 0) { if (permission && permission.length > 0) {
return permissions.some(v => { return permissions.some(v => {
return all_permission === v || v === permission return all_permission === v || v === permission
@ -18,7 +18,7 @@ function authPermission(permission) {
function authRole(role) { function authRole(role) {
const super_admin = "admin" const super_admin = "admin"
const roles = store && store.roles const roles = uni.getStorageSync('roles')
if (role && role.length > 0) { if (role && role.length > 0) {
return roles.some(v => { return roles.some(v => {
return super_admin === v || v === role return super_admin === v || v === role

4
src/store/modules/countStore.ts

@ -61,6 +61,8 @@ const useStore = defineStore('storeId', {
this.roles = res.roles this.roles = res.roles
this.role = res.roles.filter(item => item == 'all_approve' || item == 'normal_approve')[0] this.role = res.roles.filter(item => item == 'all_approve' || item == 'normal_approve')[0]
this.permissions = res.permissions this.permissions = res.permissions
uni.setStorageSync('permissionInfo',res.permissions)
uni.setStorageSync('roles',res.roles)
let menus = [] let menus = []
res.menus.forEach(item => { res.menus.forEach(item => {
if (item.path == '/APP') { if (item.path == '/APP') {
@ -114,6 +116,8 @@ const useStore = defineStore('storeId', {
this.post = '' this.post = ''
this.dept = '' this.dept = ''
removeToken() removeToken()
uni.removeStorageSync('permissionInfo')
uni.removeStorageSync('roles')
resolve(res) resolve(res)
}).catch(error => { }).catch(error => {
reject(error) reject(error)

Loading…
Cancel
Save