4
0
Kaynağa Gözat

动物样本源审核权限

shihang 6 yıl önce
ebeveyn
işleme
a4224cca70

+ 35 - 6
src/dashoo.cn/frontend_animal/src/pages/biobank/source/_opera/operationb.vue

@@ -25,11 +25,11 @@
 
           <!--审核模块 暂未进行任何修改版本-->
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="auditorshow"
-                     :disabled="samplesForm.AuditorStatus != 0">审核</el-button>
+            v-if="permissions[permissionscode.srapprove] && service_flag == 'editsource'" :disabled="samplesForm.AuditorStatus != 0">审核</el-button>
           <!--审核模块结束-->
 
           <el-button type="primary" style="margin-left: 8px" class="el-button--mini" @click="savedata"
-                     :disabled="samplesForm.AuditorStatus != 0">保存</el-button>
+            :disabled="samplesForm.AuditorStatus != 0">保存</el-button>
           <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px"
             onclick="window.history.go(-1)">返回</el-button>
         </span>
@@ -327,6 +327,12 @@
         dialogVisible: false,
         ID: '',
         pid: 0,
+        permissionscode: {
+          srapprove: 'biobank.sourceAnimal.approve',
+        },
+        permissions: {
+          'biobank.sourceAnimal.approve': false,
+        },
       }
     },
     created() {
@@ -344,6 +350,7 @@
       _this.getsampetypeunit()
       _this.getProjectlist()
       _this.getDictOptions()
+      _this.getPermissions()
     },
     methods: {
       savedata() {
@@ -496,10 +503,10 @@
       auditor() {
         let _this = this
         _this.$confirm("确定审核该样本来源?审核后所有信息将不可修改!", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             if (_this.shenheForm.SuccessStatus == 1) {
               _this.samplesForm.AuditorStatus = 1
@@ -736,6 +743,28 @@
           }
         }
       },
+      //获取权限
+      getPermissions() {
+        let _this = this
+        // request
+        let params = {
+          percodes: `'${this.permissionscode.srapprove}'`
+        }
+        this.$axios.get('/permissions/isauths', {
+            params
+          })
+          .then(res => {
+            if (res.data instanceof Array && res.data.length > 0) {
+              res.data.forEach(element => {
+                _this.permissions[element.Code] = element.Isperm
+              });
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
     },
   }