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 | 40 +++++++++++++++++++++++++++++----------- 1 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue index c7450e9..e0ddd8e 100644 --- a/src/components/do/b1-inspect-order-plan/Inspection.vue +++ b/src/components/do/b1-inspect-order-plan/Inspection.vue @@ -356,11 +356,11 @@ :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'> - <el-button size="small" type="primary" :loading="upLoading">闄勪欢涓婁紶</el-button></el-upload> + <el-button size="small" type="primary">闄勪欢涓婁紶</el-button></el-upload> <ValueTable class="value-table" ref="fileList" :url="$api.insOrderPlan.getFileList" :componentData="componentData0" :delUrl="$api.insOrderPlan.delfile" @@ -475,6 +475,7 @@ }, data() { return { + fileAdd:false, sampleVisible: false, taskVisible: false, submitLoading: false, @@ -516,11 +517,15 @@ isIndex: true, showSelect: false, select: false, - selectMethod: '', sort: false, init:false, do: [ { + id: 'handleDown', + font: '涓嬭浇', + type: 'text', + method: 'handleDown' + },{ id: 'delete', font: '鍒犻櫎', type: 'text', @@ -528,12 +533,7 @@ disabFun: (row, index) => { return this.state!=1 } - }, { - id: 'handleDown', - font: '涓嬭浇', - type: 'text', - method: 'handleDown' - }, + } ], isPage: false, linkEvent: {}, @@ -619,6 +619,7 @@ this.getComparisonList() this.getAuthorizedPerson() this.scrollInit() + this.getPower() }, watch: { id(val) { @@ -682,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) @@ -1780,10 +1798,10 @@ if (res.code === 200) { let url = ''; if(res.data.type==1){ - url = this.javaApi+'/img/'+res.data.url + url = this.javaApi+'/img/'+res.data.fileUrl file.downloadIamge(url,row.fileName) }else{ - url = this.javaApi+'/word/'+res.data.url + url = this.javaApi+'/word/'+res.data.fileUrl const link = document.createElement('a'); link.href = url; link.download = row.fileName; -- Gitblit v1.9.3