Browse Source

前端路由标签退出登录清空,获取所有角色

gjy 2 years ago
parent
commit
88a8b17e3a

+ 3 - 0
src/global.js

@@ -25,6 +25,9 @@ export default {
         alert('当前浏览器不支持websocket')
       }
   },
+  allRoles:function(){
+    console.log(localStorage.getItem('winseaview-userInfo'))
+  },
   initWebSocket: function() {
     // 连接错误
     this.websocket.onerror =evt => {

+ 1 - 0
src/store/modules/user.js

@@ -210,6 +210,7 @@ const actions = {
           commit('SET_COMPANY', '')
           // commit('SET_TRAIN', '')
           commit('SET_ROLES', [])
+          commit('SET_OPEN_ROUTE', [])
           commit('SET_GUIDE_INFO', [])
           commit('permission/SET_ROUTES', [], { root: true }) // 清空路由,因为有权限管理
           localStorage.removeItem('wf-pf_admin-token')

+ 17 - 0
src/utils/util.js

@@ -20,6 +20,23 @@ export const loadStyle = (url, callback) => {
   }
 };
 
+export const allRoles=()=>{
+  var currectRole={
+    roleName:'',
+    roles:[]
+  }
+  var roles=JSON.parse(localStorage.getItem('winseaview-userInfo')).content.roles
+  currectRole.roles=roles
+  for (let i = 0; i < roles.length; i++) {
+    if(currectRole.roleName==''){
+      currectRole.roleName=roles[i].roleName
+    }else{
+      currectRole.roleName=currectRole.roleName+','+roles[i].roleName
+    }
+  }
+  return currectRole
+  console.log(roles)
+};
 /**
  * 动态插入js
  */

+ 2 - 0
src/views/contractManagement/purchaseContract.vue

@@ -268,6 +268,7 @@ import {
 import {
   downloadFile
 } from '@/utils/batchDown'
+import { allRoles } from '@/utils/util'
 import { hasPermission } from '../../utils/getHasPermission'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -412,6 +413,7 @@ export default {
     }
   },
   activated() {
+    console.log(allRoles())
     this.applstatus = hasPermission('contractManagement.buyContract.buyContractInfo.appl')
     this.jiesuanstatus = hasPermission('contractManagement.buyContract.buyContractInfo.jiedan')
     this.fapiaostatus = hasPermission('contractManagement.buyContract.buyContractInfo.fapiao')

+ 2 - 0
src/views/contractManagement/purchaseContractAdd.vue

@@ -635,6 +635,8 @@ import { isUndefined } from 'xe-utils/methods'
           .toPromise()
           .then((response) => {
             this.deptBudgetList = response
+            this.newSelectedOptions=  this.deptBudgetList.sourceProvince +'/'+this.deptBudgetList.sourceCity +'/'+this.deptBudgetList.sourceArea 
+          this.newSelectedOptions1 = this.deptBudgetList.deliveryProvince +'/'+this.deptBudgetList.deliveryCity +'/'+this.deptBudgetList.deliveryArea
             if(this.deptBudgetList.personPhone){
               this.deptBudgetList.personPhone=this.deptBudgetList.personPhone.split(',')
             }

+ 2 - 0
src/views/contractManagement/salesContractAdd.vue

@@ -588,6 +588,8 @@
           .toPromise()
           .then((response) => {
             this.deptBudgetList = response
+            this.newSelectedOptions=  this.deptBudgetList.sourceProvince +'/'+this.deptBudgetList.sourceCity +'/'+this.deptBudgetList.sourceArea 
+          this.newSelectedOptions1 = this.deptBudgetList.deliveryProvince +'/'+this.deptBudgetList.deliveryCity +'/'+this.deptBudgetList.deliveryArea
             if(this.deptBudgetList.personPhone){
               this.deptBudgetList.personPhone=this.deptBudgetList.personPhone.split(',')
             }

+ 1 - 1
src/views/houseSelfCollect/inspectionManagementNew.vue

@@ -897,7 +897,7 @@ export default {
               managementType: 1,
               statusType: that.statusType,
               serviceManagementType: that.serviceManagementType,
-              loadingstatus: 1,
+              // loadingstatus: 1,
             })
               .toPromise()
               .then((response) => {

+ 2 - 2
src/views/outboundManagement/weighingManagementNew.vue

@@ -782,7 +782,7 @@
                   warehouseName: that.warehouseName,
                   managementType: 3,
                   statusType: that.statusType,
-                  loadingstatus: 1,
+                  // loadingstatus: 1,
                 })
                 .toPromise()
                 .then((response) => {
@@ -2345,7 +2345,7 @@
         //合同编号
         xialaNo({
             compId: localStorage.getItem('ws-pf_compId'),
-            loadingstatus: 1,
+            // loadingstatus: 1,
             flag: 5,
           })
           .toPromise()

+ 3 - 1
src/views/profitable/expensemanagementdetails.vue

@@ -292,6 +292,7 @@
   </div>
 </template>
 <script>
+import { allRoles } from '@/utils/util'
 import WsUpload from '@/components/WsUpload'
 import {
   getInOutDetailed,
@@ -681,7 +682,8 @@ export default {
       }
     },
     allotaduit(row) {
-      if (localStorage.getItem('ws-pf_roleName') == '单证中心主任') {
+      var role=allRoles()
+      if (role.roleName.indexOf('单证中心主任') != -1) {
         localStorage.setItem(
           'expenseqr',
           JSON.stringify(row.expenseAllocationInfoList)

+ 2 - 0
src/views/taskManagement/tranManagementTransportAdd.vue

@@ -600,6 +600,7 @@ export default {
           //终到地 终到地详细地址  默认第一运输阶段的收货地区(需求)
           this.handleChange1(tmp)
           this.endDetailedAddressChange()
+          this.$forceUpdate()
         }
       }
     },
@@ -818,6 +819,7 @@ export default {
     endDetailedAddressChange(){
       //终到地详细地址  默认第一运输阶段的收货地详细地址(需求)
      this.deptBudgetList.tranProcessInfoList[0].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
+     this.$forceUpdate()
     },
     handleChange3(value, index) {
       this.deptBudgetList.tranProcessInfoList[index].sendPrivate =

+ 17 - 16
src/views/tranManagement/component/routers/route.js

@@ -12,6 +12,22 @@ const tranManagementRouter = {
     icon: '-yunshu2'
   },
   children: [
+    //汽运调度
+    {
+      path: 'vehicleDispatching',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/tranManagement/tranManagementVehicle'),
+      name: 'vehicleDispatching',
+      meta: {
+        title: 'tranManagementVehicle',
+        shortcutEntrance: 'tranManagement',
+        module: 'tranManager.vehicleDispatching',
+        permissicon: [],
+        keepAlive: true,
+        _title:'汽运调度'
+      },
+
+    },
 
     //火运调度
     {
@@ -109,22 +125,7 @@ const tranManagementRouter = {
     //   },
     //   hidden: true
     // },
-    //汽运调度
-    {
-      path: 'vehicleDispatching',
-      component: () =>
-        import(/* webpackChunkName: "applDetail" */ '@/views/tranManagement/tranManagementVehicle'),
-      name: 'vehicleDispatching',
-      meta: {
-        title: 'tranManagementVehicle',
-        shortcutEntrance: 'tranManagement',
-        module: 'tranManager.vehicleDispatching',
-        permissicon: [],
-        keepAlive: true,
-        _title:'汽运调度'
-      },
-
-    },
+    
     //船运调度
     {
       path: 'shippingDispatching',

+ 6 - 6
src/views/tranManagement/tranManagementVehicleDispatching.vue

@@ -106,20 +106,20 @@
               <el-input v-else v-model="deptBudgetList.tranPriceIngCar" maxlength="70" />
             </el-form-item>
             <div class="input-item-margin">
-              <div v-if="deptBudgetList.priceStatus=='审核中'&&pricetype==1">
+              <div style="display:inline-block;" v-if="deptBudgetList.priceStatus=='审核中'&&pricetype==1">
                 <el-button type="primary" v-hasPermission="`tranManager.vehicleDispatching.reprice`" size="small"
-                  @click="examine(1)">审核中
+                  @click="examine(1)">{{deptBudgetList.approveStatus}}
                 </el-button>
               </div>
               <el-button v-if="deptBudgetList.priceStatus!='审核中'&&pricetype==1" type="primary" @click="priceSubmit(1)">提交</el-button>
-              <el-button v-else-if="deptBudgetList.priceStatus=='审核中'&&pricetype==1" type="primary">{{deptBudgetList.approveStatus}}</el-button>
-              <div v-if="deptBudgetList.priceStatusCar=='审核中'&&pricetype==2">
+              <!-- <el-button @click="examine(1)" v-else-if="deptBudgetList.priceStatus=='审核中'&&pricetype==1" type="primary">{{deptBudgetList.approveStatus}}</el-button> -->
+              <div style="display:inline-block;" v-if="deptBudgetList.priceStatusCar=='审核中'&&pricetype==2">
                 <el-button type="primary" v-hasPermission="`tranManager.vehicleDispatching.reprice`" size="small"
-                  @click="examine(2)">审核中
+                  @click="examine(2)">{{deptBudgetList.approveStatus}}
                 </el-button>
               </div>
               <el-button v-if="deptBudgetList.priceStatusCar!='审核中'&&pricetype==2" type="primary" @click="priceSubmit(2)">提交</el-button>
-              <el-button v-else-if="deptBudgetList.priceStatus=='审核中'&&pricetype==2" type="primary">{{deptBudgetList.approveStatus}}</el-button>
+              <!-- <el-button @click="examine(2)" v-else-if="deptBudgetList.priceStatus=='审核中'&&pricetype==2" type="primary">{{deptBudgetList.approveStatus}}</el-button> -->
             </div>
           </div>
           <div class="content3" v-for="(item, index) in driverlist" :key="index">