浏览代码

文件上传的bug

zhuliu 1 年之前
父节点
当前提交
d6039a801d

+ 11 - 3
src/utils/model/upload/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="myUpload">
-    <div class="myUpload1">
+    <div class="myUpload1" v-if="show">
       <div class="myDemo">
         <el-upload
           class="upload-demo"
@@ -182,12 +182,16 @@ export default {
       exist2:[],
       showExist:false,
       dialogVisible:false,
+      show : false
     };
   },
   watch: {},
   computed: {},
-  created() {},
-  mounted() {},
+  created() {
+    this.show = true
+  },
+  mounted() {
+  },
   methods: {
     // 双击已上传的文件
     ondblclick(file) {
@@ -214,6 +218,7 @@ export default {
           this.open()
         }
       });
+      debugger
       //审核上传文件类型
       if (this.accept) {
         var arr = this.accept.split(/,|,/g);
@@ -303,6 +308,9 @@ export default {
     },
  
   },
+  destroyed(){
+    this.show = false
+  },
 };
 </script>
 <style lang="scss">

+ 5 - 4
src/views/report/InvalidResponse/components/dialog/editEvidence.vue

@@ -15,7 +15,7 @@
                     </el-form-item>
                     <el-form-item  label="附件">
                         <template>
-                            <div> 
+                            <div v-if="showDialog"> 
                                 <myUpload :file-list="form.systemFile?[form.systemFile]:[]" :limit="1" :autoUpload="true" @on-change="onChange" @on-remove="onRemove"></myUpload>
                             </div>
                         </template>
@@ -23,7 +23,7 @@
                 </div>
             </template>
             <template v-else>
-                <div>
+                <div >
                     <el-form-item  label="专利号" prop="name">
                         <el-input  v-model="form.literatureNo" autocomplete="off" placeholder="请输入专利号"></el-input>
                     </el-form-item>
@@ -75,11 +75,12 @@ export default {
     },
     //切换文件
     onChange(file, fileList){
-        this.form.systemFile=file.raw
+        this.$set(this.form,'systemFile',null)
+        this.$set(this.form,'systemFile',file.raw)
     },
     //移除文件
     onRemove(file, fileList){
-        this.form.systemFile=null
+        this.$set(this.form,'systemFile',null)
     },
     //提交
     submit(){

+ 1 - 1
src/views/report/components/details/components/basicMessage.vue

@@ -214,7 +214,7 @@ export default {
         if (valid) {
           this.form.type = 2//项目类型(1专利数据库 2报告 3专利挖掘项目)
           // 判断文件是否都上传完毕
-          var guids = this.$commonJS.checkUploadFile(this.form.systemFile)
+          var guids = this.$commonJS.checkUploadFile(this.form.systemFileList)
             if(!guids){
                 return false
             }

+ 1 - 1
src/views/report/components/dialog/addAndEditReport.vue

@@ -961,7 +961,7 @@ export default {
           }
           this.form.type = 2//项目类型(1专利数据库 2报告 3专利挖掘项目)
           // 判断文件是否都上传完毕
-          var guids = this.$commonJS.checkUploadFile(this.form.systemFile)
+          var guids = this.$commonJS.checkUploadFile(this.form.systemFileList)
             if(!guids){
                 return false
             }

+ 1 - 1
src/views/report/components/dialog/cronConclusion.vue

@@ -96,7 +96,7 @@ export default {
         submitForm(){
             this.form.type = 2//项目类型(1专利数据库 2报告 3专利挖掘项目)
           // 判断文件是否都上传完毕
-          var guids = this.$commonJS.checkUploadFile(this.form.systemFile)
+          var guids = this.$commonJS.checkUploadFile(this.form.systemFileList)
             if(!guids){
                 return false
             }