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

+ 37 - 4
src/views/collect/collect1.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-show="userLogo.add">申请提用</el-button>
           </div>
           <!--表格 -->
           <div class="table">
@@ -59,9 +59,9 @@
               <el-table-column label="操作" width="200">
                 <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)">删除</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)" v-show="userLogo.audit">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)" v-show="userLogo.edit">编辑</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'||row.status==='待审核'||row.status==='审核不通过'" @click="delData(row.id)" v-show="userLogo.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -91,6 +91,12 @@ export default {
   components: { TabList },
   data () {
     return {
+      userLogo: {
+        add: true, // 申请/归还
+        edit: true, // 编辑
+        audit: true, // 审核
+        del: true// 删除
+      },
       total: 0,
       myData: {
         endTime: '', // 结束时间
@@ -311,6 +317,33 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_audit') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 保管部主任
+      if (temp2 === 'sys_edit') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 保管部成员
+      if (temp2 === 'sys_look') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 其他部门人员
+      if (temp2 === 'sys_collect') {
+        this.userLogo.del = false
+      } // 征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 9 - 1
src/views/collect/collect1_look.vue

@@ -41,7 +41,7 @@
         <!-- 表格 -->
         <div class="table">
           <div class="title">
-            <h3>藏品信息<el-button @click="goodsReturn">归 还</el-button></h3>
+            <h3>藏品信息<el-button @click="goodsReturn" v-if="userAlso">归 还</el-button></h3>
           </div>
           <el-table
             @selection-change="handleSelectionChange"
@@ -94,6 +94,7 @@ export default {
   data () {
     // 这里存放数据
     return {
+      userAlso: true,
       myData: {},
       // 服务器初始地址前缀
       baseURL: '',
@@ -183,6 +184,13 @@ export default {
     // 从第一层拿到传过来的数据
     this.myData = this.$route.query
     this.getDetailById()
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_audit' || temp2 === 'sys_edit' || temp2 === 'sys_look') this.userAlso = false // 其他部门人员--征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 37 - 4
src/views/collect/collect2.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="userLogo.add">申请注销</el-button
             >
           </div>
           <!--表格 -->
@@ -57,9 +57,9 @@
               <el-table-column label="操作" width="200">
                 <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)">删除</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)" v-show="userLogo.audit">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)" v-show="userLogo.edit">编辑</el-button>
+                  <el-button type="text" v-if="row.status!=='已完成'" @click="delOne(row.id)" v-show="userLogo.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -91,6 +91,12 @@ export default {
   data () {
     // 这里存放数据
     return {
+      userLogo: {
+        add: true, // 申请/归还
+        edit: true, // 编辑
+        audit: true, // 审核
+        del: true// 删除
+      },
       total: 0,
       // 选择状态的变量
       stateInd: 0,
@@ -308,6 +314,33 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_audit') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 保管部主任
+      if (temp2 === 'sys_edit') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 保管部成员
+      if (temp2 === 'sys_look') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 其他部门人员
+      if (temp2 === 'sys_collect') {
+        this.userLogo.del = false
+      } // 征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 31 - 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-show="userLogo.add">新增</el-button>
           </div>
           <!--表格 -->
           <div class="table">
@@ -89,18 +89,21 @@
                     >查看</el-button
                   >
                   <el-button
+                    v-show="userLogo.add"
                     type="text"
                     v-if="row.status === '待办理' || row.status === '待办理'"
                     @click="editH0(row)"
                     >编辑</el-button
                   >
                   <el-button
+                    v-show="userLogo.audit"
                     type="text"
                     v-if="row.status === '待审核'"
                     @click="auditH0(row)"
                     >审核</el-button
                   >
                   <el-button
+                    v-show="userLogo.del"
                     type="text"
                     @click="removeH0(row.id)"
                     v-if="row.status !== '已完成'"
@@ -137,6 +140,12 @@ export default {
   },
   data () {
     return {
+      userLogo: {
+        add: true,
+        edit: true,
+        audit: true,
+        del: true
+      },
       // 选择状态的变量
       stateInd: 0,
       stateArr: [
@@ -365,6 +374,27 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_audit') this.userLogo.del = false // 保管部主任
+      if (temp2 === 'sys_edit') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+      } // 保管部成员
+      if (temp2 === 'sys_look') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+      } // 其他部门人员
+      if (temp2 === 'sys_collect') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+      } // 征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 33 - 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-show="userLogo.add">申请入库</el-button>
           </div>
           <!--表格 -->
           <div class="table">
@@ -59,9 +59,9 @@
               <el-table-column label="操作" width="195">
                 <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)">删除</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)" v-show="userLogo.audit">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)" v-show="userLogo.edit">编辑</el-button>
+                  <el-button type="text" v-if="row.status!=='已完成'" @click="delData(row.id)" v-show="userLogo.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -91,6 +91,12 @@ export default {
   components: { TabList },
   data () {
     return {
+      userLogo: {
+        add: true, // 申请
+        edit: true, // 编辑
+        audit: true, // 审核
+        del: true// 删除
+      },
       total: 0,
       myData: {
         endTime: '', // 结束时间
@@ -299,6 +305,29 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_audit') this.userLogo.del = false // 保管部主任
+      if (temp2 === 'sys_edit') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+      } // 保管部成员
+      if (temp2 === 'sys_look') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 其他部门人员
+      if (temp2 === 'sys_collect') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 33 - 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-show="userLogo.add">申请出库</el-button>
           </div>
           <!--表格 -->
           <div class="table">
@@ -59,9 +59,9 @@
               <el-table-column label="操作" width="200">
                 <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)">删除</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)" v-show="userLogo.audit">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)" v-show="userLogo.edit">编辑</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'||row.status==='待审核'||row.status==='审核不通过'" @click="delData(row.id)" v-show="userLogo.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -91,6 +91,12 @@ export default {
   components: { TabList },
   data () {
     return {
+      userLogo: {
+        add: true, // 申请/归还
+        edit: true, // 编辑
+        audit: true, // 审核
+        del: true// 删除
+      },
       total: 0,
       myData: {
         endTime: '', // 结束时间
@@ -311,6 +317,29 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_audit') this.userLogo.del = false // 保管部主任
+      if (temp2 === 'sys_edit') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+      } // 保管部成员
+      if (temp2 === 'sys_look') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 其他部门人员
+      if (temp2 === 'sys_collect') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

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

@@ -41,7 +41,7 @@
         <!-- 表格 -->
         <div class="table">
           <div class="title">
-            <h3>藏品信息<el-button @click="goodsReturn">归 还</el-button></h3>
+            <h3>藏品信息<el-button @click="goodsReturn" v-if="userAlso">归 还</el-button></h3>
           </div>
           <el-table
             @selection-change="handleSelectionChange"
@@ -94,6 +94,7 @@ export default {
   data () {
     // 这里存放数据
     return {
+      userAlso: true,
       myData: {},
       // 服务器初始地址前缀
       baseURL: '',
@@ -183,6 +184,13 @@ export default {
     // 从第一层拿到传过来的数据
     this.myData = this.$route.query
     this.getDetailById()
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_look' || temp2 === 'sys_collect') this.userAlso = false // 其他部门人员--征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 33 - 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-show="userLogo.add">申请注销</el-button
             >
           </div>
           <!--表格 -->
@@ -57,9 +57,9 @@
               <el-table-column label="操作" width="200">
                 <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)">删除</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)" v-show="userLogo.audit">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)" v-show="userLogo.edit">编辑</el-button>
+                  <el-button type="text" v-if="row.status!=='已完成'" @click="delOne(row.id)" v-show="userLogo.del">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -91,6 +91,12 @@ export default {
   data () {
     // 这里存放数据
     return {
+      userLogo: {
+        add: true, // 申请/归还
+        edit: true, // 编辑
+        audit: true, // 审核
+        del: true// 删除
+      },
       total: 0,
       // 选择状态的变量
       stateInd: 0,
@@ -308,6 +314,29 @@ export default {
     this.stateArr[2].num = num2
     this.stateArr[3].num = num3
     this.stateArr[4].num = num4
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_audit') this.userLogo.del = false // 保管部主任
+      if (temp2 === 'sys_edit') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+      } // 保管部成员
+      if (temp2 === 'sys_look') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 其他部门人员
+      if (temp2 === 'sys_collect') {
+        this.userLogo.del = false
+        this.userLogo.audit = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 7 - 0
src/views/layout/index.vue

@@ -231,6 +231,13 @@ export default {
     // 进来显示用户信息
     const userData = localStorage.getItem('daliCK')
     this.userData = JSON.parse(userData).user
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 !== 'sys_admin') this.tabList.pop() // 不是超级管理员
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前

+ 35 - 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-show="userLogo.add">新建库区</el-button>
+            <el-button type="danger" @click="delOne" v-show="userLogo.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-show="userLogo.add"></i>
+              <i class="el-icon-edit tiny" @click="editOne(item)" v-show="userLogo.edit"></i>
             </div>
             <ul class="area" v-show="arrowsShow === index">
               <li
@@ -46,9 +46,9 @@
           <div class="title">
             <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-show="userLogo.add"></i>
+            <i class="el-icon-edit" @click="editTow" v-show="userLogo.edit"></i>
+            <i class="el-icon-delete" @click="delTow" v-show="userLogo.del"></i>
           </div>
           <!-- 表格 -->
           <div class="table">
@@ -74,8 +74,8 @@
               ></el-table-column>
               <el-table-column label="操作" width="150">
                 <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-show="userLogo.edit"></i>
+                  <i class="el-icon-delete" @click="delThree(row.id)" v-show="userLogo.del"></i>
                 </template>
               </el-table-column>
             </el-table>
@@ -134,6 +134,11 @@ export default {
   data () {
     // 这里存放数据
     return {
+      userLogo: {
+        add: true, // 新增
+        edit: true, // 编辑
+        del: true// 删除
+      },
       myId: null,
       // 第一层:箭头的显示隐藏
       arrowsShow: 0,
@@ -401,6 +406,27 @@ export default {
         this.tableData = this.towList.children
       }, 100)
     })
+    // 获取用户角色权限标识
+    let temp = localStorage.getItem('daliCK')
+    temp = JSON.parse(temp)
+    if (temp) {
+      const temp2 = temp.role[0]
+      if (temp2 === 'sys_edit') {
+        this.userLogo.del = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 保管部成员
+      if (temp2 === 'sys_look') {
+        this.userLogo.del = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 其他部门人员
+      if (temp2 === 'sys_collect') {
+        this.userLogo.del = false
+        this.userLogo.add = false
+        this.userLogo.edit = false
+      } // 征集部主任
+    }
   },
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeMount () {}, // 生命周期 - 挂载之前