From 32a95699e59c5c65e18c08643266c9cbfa380ee4 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 07 六月 2024 09:56:05 +0800
Subject: [PATCH] 优化设备明细、检验任务附件权限

---
 src/components/do/b1-inspect-order-plan/Inspection.vue |   33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 995db09..e0ddd8e 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -356,7 +356,7 @@
       :data="{
         orderId:id
       }"
-      v-show="state==1"
+      v-show="state==1&&fileAdd"
       :on-success="handleSuccessUp" :show-file-list="false"
         accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" :on-change="beforeUpload"
         :on-error="onError" ref='upload'>
@@ -475,6 +475,7 @@
     },
     data() {
       return {
+        fileAdd:false,
         sampleVisible: false,
         taskVisible: false,
         submitLoading: false,
@@ -520,6 +521,11 @@
           init:false,
           do: [
           {
+						id: 'handleDown',
+						font: '涓嬭浇',
+						type: 'text',
+						method: 'handleDown'
+					},{
 						id: 'delete',
 						font: '鍒犻櫎',
 						type: 'text',
@@ -527,12 +533,7 @@
             disabFun: (row, index) => {
 								return this.state!=1
 							}
-					}, {
-						id: 'handleDown',
-						font: '涓嬭浇',
-						type: 'text',
-						method: 'handleDown'
-					},
+					}
           ],
           isPage: false,
           linkEvent: {},
@@ -618,6 +619,7 @@
       this.getComparisonList()
       this.getAuthorizedPerson()
       this.scrollInit()
+      this.getPower()
     },
     watch: {
       id(val) {
@@ -681,6 +683,23 @@
       }
     },
     methods: {
+      getPower(){
+        let power = JSON.parse(sessionStorage.getItem('power'))
+        let fileDel = false
+        let fileAdd = false
+        for (var i = 0; i < power.length; i++) {
+					if (power[i].menuMethod == 'uploadFile') {
+						fileAdd = true
+					}
+					if (power[i].menuMethod == 'delfile') {
+						fileDel = true
+					}
+				}
+        if (!fileDel) {
+					this.componentData0.do.splice(1, 1)
+				}
+        this.fileAdd = fileAdd
+      },
       async getCurrentProduct(id,type){
         this.tableLoading = true;
         let res = await this.$axios.post(this.$api.insOrderPlan.getInsProduct+'?id='+id+'&type='+type+'&laboratory='+this.sonLaboratory)

--
Gitblit v1.9.3