Procházet zdrojové kódy

附件组件修改

lizhenhao před 2 roky
rodič
revize
603eb96dd2

+ 18 - 4
src/views/common/UpLoadComponent.vue

@@ -12,7 +12,7 @@
                :on-change="changes"
                :on-progress="uploadVideoProcess"
                :file-list="fileList">
-      <el-button type="info" size="mini" :slot="auth==='view'?'tip':'trigger'" :disabled="auth==='view'">点击上传</el-button>
+      <el-button type="info" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" :disabled="auth==='view'">点击上传</el-button>
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -46,7 +46,7 @@
         <el-table-column label="操作" width="200px" fixed="right" align="center">
           <template  scope="scope">
             <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)" :disabled="false">下载</el-button>
-            <el-button type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'">删除</el-button>
+            <el-button type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -87,7 +87,9 @@
         maxValue: 300,
         tableKey: '',
         fileLoading: true,
-        dividerName: ''
+        dividerName: '',
+        uploadFlag: false,
+        delFlag: false
       }
     },
     watch: {
@@ -124,8 +126,14 @@
        *    注:值为空时,默认值为300MB
        * @param dividerName  组件中divider的名称
        *    注:值为空时,默认值为‘附件’
+       * @param uploadFlag  ‘上传文件’按钮是否禁用
+       *    注:值为空时,默认值为false
+       *    auth=view&&uploadFlag=false ‘上传文件’按钮禁用
+       * @param delFlag  ‘删除’按钮是否禁用
+       *    注:值为空时,默认值为false
+       *    auth=view&&delFlag=false ‘删除’按钮禁用
        */
-      async newUpload (auth, fileList, directory, maxValue, dividerName) {
+      async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag) {
         await this.fileLoadingFalse()
         if (this.commonJS.isEmpty(dividerName)) {
           this.dividerName = '附件'
@@ -143,6 +151,12 @@
           this.maxValue = 300
         }
         this.auth = auth
+        if (this.commonJS.isEmpty(uploadFlag)) {
+          this.uploadFlag = false
+        }
+        if (this.commonJS.isEmpty(delFlag)) {
+          this.delFlag = false
+        }
         if (this.commonJS.isEmpty(fileList)) {
           this.fileLoading = true
         }

+ 7 - 7
src/views/modules/program/registered/ProjectList.vue

@@ -289,7 +289,7 @@
         return JSON.parse(localStorage.getItem('user'))
       },
       userId () {
-        return  JSON.parse(localStorage.getItem('user')).id
+        return JSON.parse(localStorage.getItem('user')).id
       }
     },
     methods: {
@@ -542,8 +542,8 @@
               query: {
                 isShow: 'false',
                 readOnly: true,
-                title: '项目登记' + '流程详情',
-                formTitle: '项目登记' + '流程详情',
+                title: '一级校审' + '流程详情',
+                formTitle: '一级校审' + '流程详情',
                 businessId: row.auditId1,
                 status: 'reback',
                 ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
@@ -621,8 +621,8 @@
               query: {
                 isShow: 'false',
                 readOnly: true,
-                title: '项目登记' + '流程详情',
-                formTitle: '项目登记' + '流程详情',
+                title: '二级校审' + '流程详情',
+                formTitle: '二级校审' + '流程详情',
                 businessId: row.auditId2,
                 status: 'reback',
                 ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
@@ -700,8 +700,8 @@
               query: {
                 isShow: 'false',
                 readOnly: true,
-                title: '项目登记' + '流程详情',
-                formTitle: '项目登记' + '流程详情',
+                title: '三级校审' + '流程详情',
+                formTitle: '三级校审' + '流程详情',
                 businessId: row.auditId3,
                 status: 'reback',
                 ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')

+ 7 - 4
src/views/modules/program/registered/ProjectThreeAuditForm.vue

@@ -272,9 +272,7 @@
             if (this.commonJS.isNotEmpty(this.inputForm.workOpinion)) {
               this.$refs.contents4Editor.init(this.inputForm.workOpinion)
             }
-            // if (this.formReadOnly === true) {
-            //   method = 'view'
-            // }
+
             if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
               this.inputForm.workAttachmentDtoList = []
             }
@@ -291,7 +289,12 @@
             } else {
               this.inputForm.auditPeopleList = ''
             }
-            this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentDtoList, 'program_audit_first')
+            if (this.formReadOnly === true && this.status === 'audit') {
+              this.$refs.uploadComponent.newUpload('view', this.inputForm.workAttachmentDtoList, 'program_audit', null, null, true)
+            }
+            if (this.formReadOnly === true && this.status !== 'audit') {
+              this.$refs.uploadComponent.newUpload('view', this.inputForm.workAttachmentDtoList, 'program_audit')
+            }
             this.loading = false
           })
         })