shaogen1995 4 лет назад
Родитель
Сommit
492af3fa26

+ 1 - 0
src/components/tabLeft3.vue

@@ -45,6 +45,7 @@ export default {
         if ((this.tabList.filter(p => p.ip === v.id))[0]) tempList1.push((this.tabList.filter(p => p.ip === v.id))[0])
       }
     })
+    tempList1.push({ name: '统计报表', id: 1, ip: 99999 })
     this.tabList = tempList1
   }
 }

+ 16 - 1
src/views/holding/holding0.vue

@@ -52,7 +52,7 @@
             <el-button style="margin-left: 20px" @click="inquire"
               >查询</el-button
             >
-            <el-button type="primary" @click="addOne()">新增</el-button>
+            <el-button type="primary" @click="addOne()" v-if="userLimits.edit">新增</el-button>
           </div>
           <!--表格 -->
           <div class="table">
@@ -89,18 +89,21 @@
                     >查看</el-button
                   >
                   <el-button
+                    v-show="userLimits.edit"
                     type="text"
                     v-if="row.status === '待办理' || row.status === '待办理'"
                     @click="editH0(row)"
                     >编辑</el-button
                   >
                   <el-button
+                    v-show="userLimits.audit"
                     type="text"
                     v-if="row.status === '待审核'"
                     @click="auditH0(row)"
                     >审核</el-button
                   >
                   <el-button
+                    v-show="userLimits.del"
                     type="text"
                     @click="removeH0(row.id,row.status)"
                     v-if="row.status !== '已完成'"
@@ -137,6 +140,11 @@ export default {
   },
   data () {
     return {
+      userLimits: {
+        edit: false,
+        del: false,
+        audit: false
+      },
       // 选择状态的变量
       stateInd: 0,
       stateArr: [
@@ -370,6 +378,13 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits.edit = temp2[0].children[0].authority
+    this.userLimits.del = temp2[0].children[1].authority
+    this.userLimits.audit = temp2[0].children[2].authority
+    // console.log(999, temp2)
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 17 - 4
src/views/holding/holding1.vue

@@ -34,7 +34,7 @@
             >
             </el-date-picker>
             <el-button style="margin-left: 20px" @click="inquire">查询</el-button>
-            <el-button type="primary" @click="enterBank">申请入库</el-button>
+            <el-button type="primary" @click="enterBank" v-if="userLimits.edit">申请入库</el-button>
           </div>
           <!--表格 -->
           <div class="table">
@@ -59,9 +59,9 @@
               <el-table-column label="操作" width="195" :resizable="false">
                 <template #default='{row}'>
                   <el-button type="text" v-if="row.status==='已完成'||row.status==='待入库'||row.status==='审核不通过'" @click="myLook(row)">查看</el-button>
-                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)">审核</el-button>
-                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)">编辑</el-button>
-                  <el-button type="text" v-if="row.status!=='已完成'" @click="delData(row.id,row.status)">删除</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)" v-show="userLimits.audit">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)" v-show="userLimits.edit">编辑</el-button>
+                  <el-button type="text" v-if="row.status!=='已完成'" @click="delData(row.id,row.status)" v-show="userLimits.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -91,6 +91,12 @@ export default {
   components: { TabList },
   data () {
     return {
+      // 用户权限数据
+      userLimits: {
+        edit: false,
+        del: false,
+        audit: false
+      },
       total: 0,
       myData: {
         endTime: '', // 结束时间
@@ -308,6 +314,13 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits.edit = temp2[2].children[0].authority
+    this.userLimits.del = temp2[2].children[1].authority
+    this.userLimits.audit = temp2[2].children[2].authority
+    // console.log(999, temp2[2])
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 16 - 4
src/views/holding/holding2.vue

@@ -34,7 +34,7 @@
             >
             </el-date-picker>
             <el-button style="margin-left: 20px" @click="inquire">查询</el-button>
-            <el-button type="primary" @click="enterBank">申请出库</el-button>
+            <el-button type="primary" @click="enterBank" v-if="userLimits.edit">申请出库</el-button>
           </div>
           <!--表格 -->
           <div class="table">
@@ -61,9 +61,9 @@
               <el-table-column label="操作" width="140" :resizable="false">
                 <template #default='{row}'>
                   <el-button type="text" v-if="row.status==='待归还'||row.status==='已归还'||row.status==='审核不通过'" @click="myLook(row)">查看</el-button>
-                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)">审核</el-button>
-                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)">编辑</el-button>
-                  <el-button type="text" v-if="row.status==='待办理'||row.status==='待审核'||row.status==='审核不通过'" @click="delData(row.id,row.status)">删除</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)" v-show="userLimits.audit">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)" v-show="userLimits.edit">编辑</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'||row.status==='待审核'||row.status==='审核不通过'" @click="delData(row.id,row.status)" v-show="userLimits.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -93,6 +93,11 @@ export default {
   components: { TabList },
   data () {
     return {
+      userLimits: {
+        edit: false,
+        del: false,
+        audit: false
+      }, // 用户权限数据
       total: 0,
       myData: {
         endTime: '', // 结束时间
@@ -326,6 +331,13 @@ export default {
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
     this.stateArr[5].num = num5
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits.edit = temp2[3].children[0].authority
+    this.userLimits.del = temp2[3].children[1].authority
+    this.userLimits.audit = temp2[3].children[2].authority
+    // console.log(999, temp2[3])
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 7 - 1
src/views/holding/holding2_look.vue

@@ -41,7 +41,7 @@
         <div class="table">
           <div class="title">
             <h3>
-              藏品信息<el-button @click="goodsReturn"
+              藏品信息<el-button @click="goodsReturn" v-if="userLimits"
                 >归 还</el-button
               >
             </h3>
@@ -227,6 +227,8 @@ export default {
   data () {
     // 这里存放数据
     return {
+      // 用户权限数据
+      userLimits: false,
       myData: {},
       // 服务器初始地址前缀
       baseURL: '',
@@ -340,6 +342,10 @@ export default {
     // 从第一层拿到传过来的数据
     this.myData = this.$route.query
     this.getDetailById()
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits = temp2[3].children[3].authority
+    // console.log(999, temp2[3])
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 22 - 2
src/views/holding/holding3_look.vue

@@ -156,12 +156,13 @@
       <div class="conten">
         <div class="daochu">
           <el-button
+            v-if="userLimits.edit"
             type="primary"
             size="small"
             @click="begEdit"
             >申请编辑</el-button
           >
-          <el-button type="primary" size="small" @click="applyMove" v-if="myObj.storageId"
+          <el-button type="primary" size="small" @click="applyMove" v-if="myObj.storageId" v-show="userLimits.move"
             >申请移库</el-button
           >
           <el-button size="small" @click="record">操作记录</el-button>
@@ -487,6 +488,11 @@ export default {
   data () {
     // 这里存放数据
     return {
+      userLimits: {
+        move: false,
+        edit: false
+      },
+      // 用户权限数据
       tempIds: '',
       moveValue: null,
       moveDialog: false,
@@ -555,12 +561,14 @@ export default {
       const res = await getRecord(data)
       this.total = res.data.total
       this.gridData = res.data.list
+      // console.log(999999, this.gridData)
       this.gridData.forEach((v) => {
         if (v.moduleType === 'register') v.tempType = '藏品登记'
         else if (v.moduleType === 'storageIn') v.tempType = '藏品入库'
         else if (v.moduleType === 'storageOut') v.tempType = '藏品出库'
         // else if (v.moduleType === 'collectOut') v.tempType = '征集品提用'
         else if (v.moduleType === 'ledgerEdit') v.tempType = '藏品修改'
+        else if (v.moduleType === 'ledgerMove') v.tempType = '藏品移库'
         // else if (v.moduleType === 'collectEdit') v.tempType = '征集品修改'
       })
     },
@@ -583,7 +591,7 @@ export default {
     // 点击操作记录里面的查看
     async lookRZ (val) {
       const res = await getRecordDetail(val.moduleType, val.moduleId)
-      // console.log(9999, res)
+      console.log(9999, res)
       let temp = ''
       let obj = {}
       // 藏品登记
@@ -611,6 +619,12 @@ export default {
         obj = res.data.data.entity
         obj.status = '已完成'
       }
+      // 移库
+      if (val.moduleType === 'ledgerMove') {
+        temp = '/layout/statistics2_look'
+        obj = res.data.data
+        obj.status = '已完成'
+      }
       const { href } = this.$router.resolve({
         path: temp,
         query: obj
@@ -676,6 +690,12 @@ export default {
     }
     // 调用获取附件方法
     this.getFileList()
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits.edit = temp2[1].children[0].authority
+    this.userLimits.move = temp2[1].children[1].authority
+    // console.log(999, temp2[1])
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 16 - 6
src/views/holding/holding4.vue

@@ -50,19 +50,19 @@
             >
               <el-table-column prop="name" label="藏品名称" :resizable="false">
               </el-table-column>
-              <el-table-column prop="num" label="总登记号" width="280" :resizable="false">
+              <el-table-column prop="num" label="总登记号"  :resizable="false">
               </el-table-column>
-              <el-table-column prop="realName" label="编辑登记人" width="200" :resizable="false">
+              <el-table-column prop="realName" label="编辑登记人" width="150" :resizable="false">
               </el-table-column>
               <el-table-column prop="updateTime" label="编辑日期" width="200" :resizable="false">
               </el-table-column>
-              <el-table-column prop="status" label="状态" width="230" :resizable="false">
+              <el-table-column prop="status" label="状态" width="120" :resizable="false">
               </el-table-column>
-              <el-table-column label="操作" width="295" :resizable="false">
+              <el-table-column label="操作" width="150" :resizable="false">
                 <template #default='{row}'>
                   <el-button type="text"  @click="myLook(row)" v-if="row.status!=='待审核'">查看</el-button>
-                  <el-button type="text"  @click="audit(row)" v-if="row.status==='待审核'">审核</el-button>
-                  <el-button type="text"  @click="delData(row.id,row.status)" v-if="row.status!=='已完成'">删除</el-button>
+                  <el-button type="text"  @click="audit(row)" v-if="row.status==='待审核'" v-show="userLimits.audit">审核</el-button>
+                  <el-button type="text"  @click="delData(row.id,row.status)" v-if="row.status!=='已完成'" v-show="userLimits.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -92,6 +92,10 @@ export default {
   components: { TabList },
   data () {
     return {
+      userLimits: {
+        del: false,
+        audit: false
+      }, // 用户权限数据
       total: 0,
       myData: {
         type: 'name',
@@ -286,6 +290,12 @@ export default {
     this.stateArr[1].num = num1
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits.del = temp2[4].children[0].authority
+    this.userLimits.audit = temp2[4].children[1].authority
+    // console.log(999, temp2)
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 16 - 4
src/views/holding/holding5.vue

@@ -33,7 +33,7 @@
             >
             </el-date-picker>
             <el-button style="margin-left: 20px" @click="inquire">查询</el-button>
-            <el-button type="primary" @click="cancel">申请注销</el-button
+            <el-button type="primary" @click="cancel" v-if="userLimits.edit">申请注销</el-button
             >
           </div>
           <!--表格 -->
@@ -57,9 +57,9 @@
               <el-table-column label="操作" width="200" :resizable="false">
                 <template #default='{row}'>
                   <el-button type="text" v-if="row.status==='已完成'||row.status==='审核不通过'" @click="myLook(row)">查看</el-button>
-                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)">审核</el-button>
-                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)">编辑</el-button>
-                  <el-button type="text" v-if="row.status!=='已完成'" @click="delOne(row.id,row.status)">删除</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)" v-show="userLimits.audit">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)" v-show="userLimits.edit">编辑</el-button>
+                  <el-button type="text" v-if="row.status!=='已完成'" @click="delOne(row.id,row.status)" v-show="userLimits.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -91,6 +91,11 @@ export default {
   data () {
     // 这里存放数据
     return {
+      userLimits: {
+        edit: false,
+        del: false,
+        audit: false
+      }, // 用户权限数据
       total: 0,
       // 选择状态的变量
       stateInd: 0,
@@ -313,6 +318,13 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits.edit = temp2[5].children[0].authority
+    this.userLimits.del = temp2[5].children[1].authority
+    this.userLimits.audit = temp2[5].children[2].authority
+    // console.log(999, temp2[5])
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 42 - 17
src/views/home/index.vue

@@ -25,18 +25,20 @@
             >
               <el-carousel-item>
                 <ul class="info" @mouseleave='myInd=null'>
-                  <li v-for="(item,index) in info1" :key="item.inoc" @click="skip(item)" @mouseenter='myInd=index'>
+                  <li v-for="(item,index) in info1" :key="item.inoc" @click="skip(item)" @mouseenter='myInd=index' :class="{active:!item.authority}">
+                  <!-- <template v-if="item.authority"> -->
                     <div class="ico">
           <img :src="require('@/assets/inco/'+item.inoc+'ac.png')" alt="" v-if="myInd===index">
           <img :src="require('@/assets/inco/'+item.inoc+'.png')" alt="" v-else>
                     </div>
                     <p>{{ item.name }}</p>
+                  <!-- </template> -->
                   </li>
                 </ul>
               </el-carousel-item>
               <el-carousel-item>
                 <ul class="info" @mouseleave='myInd=null'>
-                  <li v-for="(item,index) in info2" :key="item.inoc" @click="skip(item)" @mouseenter='myInd=index'>
+                  <li v-for="(item,index) in info2" :key="item.inoc" @click="skip(item)" @mouseenter='myInd=index' :class="{active:!item.authority}">
                     <div class="ico">
           <img :src="require('@/assets/inco/'+item.inoc+'ac.png')" alt="" v-if="myInd===index">
           <img :src="require('@/assets/inco/'+item.inoc+'.png')" alt="" v-else>
@@ -65,9 +67,10 @@
         <div class="title">
           <h3>待办提醒</h3>
         </div>
-        <div class="dingdong" v-for="(item,index) in dingdong" :key="index" @click="skip(item)">
+        <div class="dingdong" v-for="(item,index) in dingdong" :key="index" @click="skip(item)" :class="{active:!item.authority}">
             <p>{{item.name}}</p>
-            <span>共有 <i> {{item.inoc}} </i> 代办事项</span>
+            <span v-if="!item.authority">暂无权限</span>
+            <span v-else>共有 <i> {{item.inoc}} </i> 代办事项</span>
         </div>
 
       </div>
@@ -103,25 +106,27 @@ export default {
       // 用户信息
       userData: {},
       info1: [
-        { name: '藏品登记', inoc: 'holding0', push: '/layout/holding0' },
-        { name: '藏品总账', inoc: 'holding3', push: '/layout/holding3' },
-        { name: '藏品注销', inoc: 'holding5', push: '/layout/holding5' }
+        { name: '藏品登记', inoc: 'holding0', push: '/layout/holding0', authority: false },
+        { name: '藏品总账', inoc: 'holding3', push: '/layout/holding3', authority: false },
+        { name: '藏品修改', inoc: 'holding4', push: '/layout/holding4', authority: false },
+        { name: '藏品注销', inoc: 'holding5', push: '/layout/holding5', authority: false }
       ],
       info2: [
-        { name: '入库管理', inoc: 'holding1', push: '/layout/holding1' },
-        { name: '出库管理', inoc: 'holding2', push: '/layout/holding2' },
-        { name: '藏品移库', inoc: 'statistics2', push: '/layout/statistics2' }
+        { name: '入库管理', inoc: 'holding1', push: '/layout/holding1', authority: false },
+        { name: '出库管理', inoc: 'holding2', push: '/layout/holding2', authority: false },
+        { name: '藏品移库', inoc: 'statistics2', push: '/layout/statistics2', authority: false },
+        { name: '库房设置', inoc: 'statistics0', push: '/layout/statistics0', authority: false }
         // { name: '征集品总账', inoc: 'collect0', push: '/layout/collect0' },
         // { name: '征集品提用', inoc: 'collect1', push: '/layout/collect1' },
         // { name: '征集品注销', inoc: 'collect2', push: '/layout/collect2' }
       ],
       dingdong: [
-        { name: '藏品登记', inoc: 0, push: '/layout/holding0' },
-        { name: '入库管理', inoc: 0, push: '/layout/holding1' },
-        { name: '出库管理', inoc: 0, push: '/layout/holding2' },
-        { name: '藏品修改', inoc: 0, push: '/layout/holding4' },
-        { name: '藏品注销', inoc: 0, push: '/layout/holding5' },
-        { name: '藏品移库', inoc: 0, push: '/layout/statistics2' }
+        { name: '藏品登记', inoc: 0, push: '/layout/holding0', authority: false },
+        { name: '入库管理', inoc: 0, push: '/layout/holding1', authority: false },
+        { name: '出库管理', inoc: 0, push: '/layout/holding2', authority: false },
+        { name: '藏品修改', inoc: 0, push: '/layout/holding4', authority: false },
+        { name: '藏品注销', inoc: 0, push: '/layout/holding5', authority: false },
+        { name: '藏品移库', inoc: 0, push: '/layout/statistics2', authority: false }
         // { name: '征集品提用', inoc: 0, push: '/layout/collect1' },
         // { name: '征集品修改', inoc: 0, push: '/layout/collect3' },
         // { name: '征集品注销', inoc: 0, push: '/layout/collect2' }
@@ -149,7 +154,20 @@ export default {
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created () {
-
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    console.log(999, temp2)
+    temp2.forEach(v => {
+      if (v.authority && v.id === 100) this.info1[0].authority = this.dingdong[0].authority = true // 藏品登记
+      if (v.authority && v.id === 300) this.info2[0].authority = this.dingdong[1].authority = true // 入库管理
+      if (v.authority && v.id === 400) this.info2[1].authority = this.dingdong[2].authority = true // 出库管理
+      if (v.authority && v.id === 500) this.info1[2].authority = this.dingdong[3].authority = true // 藏品修改
+      if (v.authority && v.id === 600) this.info1[3].authority = this.dingdong[4].authority = true // 藏品注销
+      if (v.authority && v.id === 800) this.info2[2].authority = this.dingdong[5].authority = true // 藏品移库
+      if (v.authority && v.id === 200) this.info1[1].authority = true // 藏品总账
+      if (v.authority && v.id === 700) this.info2[3].authority = true // 库房设置
+    })
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   async mounted () {
@@ -325,6 +343,10 @@ export default {
               }
             }
           }
+          .active {
+            pointer-events:none;
+            display: none;
+          }
         }
       }
     }
@@ -411,6 +433,9 @@ export default {
           color: black;
         }
       }
+      .active {
+        pointer-events:none;
+      }
     }
   }
 }

+ 23 - 10
src/views/layout/index.vue

@@ -148,16 +148,16 @@ export default {
             { name: '统计报表', id: 1, ip: 99999 },
             { name: '藏品移库', id: 2, ip: 800 }
           ]
-        },
-        {
-          name: '系统管理',
-          push: '/layout/system',
-          son: [
-            { name: '用户管理', id: 2 },
-            { name: '角色管理', id: 3 },
-            { name: '系统日志', id: 1 }
-          ]
         }
+        // {
+        //   name: '系统管理',
+        //   push: '/layout/system',
+        //   son: [
+        //     { name: '用户管理', id: 2 },
+        //     { name: '角色管理', id: 3 },
+        //     { name: '系统日志', id: 1 }
+        //   ]
+        // }
       ],
       rules: {
         checkPass: [
@@ -246,7 +246,19 @@ export default {
     temp = JSON.parse(temp)
     if (temp) {
       const temp2 = temp.role[0]
-      if (temp2 !== 'sys_admin') this.tabList.pop() // 不是超级管理员
+      if (temp2 === 'sys_admin' || temp2 === 'sys_base_admin') {
+        this.tabList.push(
+          {
+            name: '系统管理',
+            push: '/layout/system',
+            son: [
+              { name: '用户管理', id: 2 },
+              { name: '角色管理', id: 3 },
+              { name: '系统日志', id: 1 }
+            ]
+          }
+        )
+      } // 不是超级管理员和系统管理员
     }
     // 获取用户权限数据
     let temp2 = localStorage.getItem('daliCK_limits')
@@ -261,6 +273,7 @@ export default {
       }
     })
     this.tabList[1].son = tempList1
+    tempList2.push({ name: '统计报表', id: 1, ip: 99999 })
     this.tabList[2].son = tempList2
     // console.log(999, temp2)
   },

+ 19 - 9
src/views/statistics/statistics0.vue

@@ -13,8 +13,8 @@
       <div class="conten">
         <div class="conten_left">
           <div class="btn">
-            <el-button type="primary" @click="addOne">新建库区</el-button>
-            <el-button type="danger" @click="delOne">删除</el-button>
+            <el-button type="primary" @click="addOne" v-if="userLimits.edit">新建库区</el-button>
+            <el-button type="danger" @click="delOne" v-if="userLimits.del">删除</el-button>
           </div>
           <div class="box" v-for="(item, index) in allList" :key="item.id">
             <div class="title" :style="arrowsShow === index?'background-color: #f2f2f2;':''">
@@ -27,8 +27,8 @@
                 @click="arrowsShowClick(index)"
               ></i>
               <span @click="arrowsShowClick(index)">{{ item.name }}</span>
-              <i class="el-icon-plus tiny" @click="addTow(item.id)"></i>
-              <i class="el-icon-edit tiny" @click="editOne(item)"></i>
+              <i class="el-icon-plus tiny" @click="addTow(item.id)" v-if="userLimits.edit"></i>
+              <i class="el-icon-edit tiny" @click="editOne(item)" v-if="userLimits.edit"></i>
             </div>
             <ul class="area" v-show="arrowsShow === index">
               <li
@@ -46,9 +46,9 @@
           <div class="title" v-show="towList.name">
             <b>{{ towList.name }}</b>
             <span>仓库编号:{{ towList.num }}</span>
-            <i class="el-icon-plus" @click="addThree"></i>
-            <i class="el-icon-edit" @click="editTow"></i>
-            <i class="el-icon-delete" @click="delTow"></i>
+            <i class="el-icon-plus" @click="addThree" v-if="userLimits.edit"></i>
+            <i class="el-icon-edit" @click="editTow" v-if="userLimits.edit"></i>
+            <i class="el-icon-delete" @click="delTow" v-if="userLimits.del"></i>
           </div>
           <!-- 表格 -->
           <div class="table" v-if="towList.name">
@@ -77,8 +77,8 @@
               ></el-table-column>
               <el-table-column label="操作" width="150" :resizable="false">
                 <template #default='{row}'>
-                  <i class="el-icon-edit" @click="editThree(row)"></i>
-                  <i class="el-icon-delete" @click="delThree(row.id)"></i>
+                  <i class="el-icon-edit" @click="editThree(row)" v-if="userLimits.edit"></i>
+                  <i class="el-icon-delete" @click="delThree(row.id)" v-if="userLimits.del"></i>
                 </template>
               </el-table-column>
             </el-table>
@@ -138,6 +138,10 @@ export default {
   data () {
     // 这里存放数据
     return {
+      userLimits: {
+        edit: false,
+        del: false
+      }, // 用户权限数据
       myId: null,
       // 第一层:箭头的显示隐藏
       arrowsShow: 0,
@@ -425,6 +429,12 @@ export default {
         this.tableData = this.towList.children
       }, 100)
     })
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits.edit = temp2[6].children[0].authority
+    this.userLimits.del = temp2[6].children[1].authority
+    // console.log(999, temp2[6])
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 12 - 2
src/views/statistics/statistics2.vue

@@ -61,8 +61,8 @@
               <el-table-column label="操作" width="295" :resizable="false">
                 <template #default='{row}'>
                   <el-button type="text"  @click="myLook(row)" v-if="row.status!=='待审核'">查看</el-button>
-                  <el-button type="text"  @click="audit(row)" v-if="row.status==='待审核'">审核</el-button>
-                  <el-button type="text"  @click="delData(row.id,row.status)" v-if="row.status!=='已完成'">删除</el-button>
+                  <el-button type="text"  @click="audit(row)" v-if="row.status==='待审核'" v-show="userLimits.audit">审核</el-button>
+                  <el-button type="text"  @click="delData(row.id,row.status)" v-if="row.status!=='已完成'" v-show="userLimits.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -92,6 +92,10 @@ export default {
   components: { TabList },
   data () {
     return {
+      userLimits: {
+        del: false,
+        audit: false
+      }, // 用户权限数据
       total: 0,
       myData: {
         type: 'name',
@@ -286,6 +290,12 @@ export default {
     this.stateArr[1].num = num1
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
+    // 获取角色权限树
+    let temp2 = localStorage.getItem('daliCK_limits')
+    temp2 = JSON.parse(temp2)
+    this.userLimits.del = temp2[7].children[0].authority
+    this.userLimits.audit = temp2[7].children[1].authority
+    // console.log(999, temp2[7])
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前