Explorar el Código

Merge branch 'hcb' of SH-Arbitrate/Mediation-Frontend into dev

hanchaobo hace 2 años
padre
commit
becf73e3ec
Se han modificado 1 ficheros con 67 adiciones y 1 borrados
  1. 67
    1
      src/views/caseManagement/components/addCase.vue

+ 67
- 1
src/views/caseManagement/components/addCase.vue Ver fichero

70
                             </el-select>
70
                             </el-select>
71
                         </el-form-item>
71
                         </el-form-item>
72
                     </el-col>
72
                     </el-col>
73
+                    <el-col :span="12">
74
+                        <el-form-item label="申请人案件证据资料上传:" prop="applicantEvidence">
75
+                            <el-upload class="upload-demo" ref="fileupload" accept=".png,.jpg,.doc,.docx,.txt,.pdf"
76
+                                :action="UploadUrl()" :on-success="handlSuccess" :on-remove="handleRemove"
77
+                                :on-preview="handlePreview" :before-remove="beforeRemove" :data="filedata"
78
+                                :headers="headers" multiple :limit="50" :on-exceed="handleExceed" :file-list="fileList">
79
+                                <el-button size="small" type="primary">点击上传</el-button>
80
+                                <div slot="tip" class="el-upload__tip">
81
+                                    文件支持上传.jpg,png,.doc,docx,.txt,.pdf文件
82
+                                </div>
83
+                            </el-upload>
84
+                        </el-form-item>
85
+                    </el-col>
86
+                    <el-col :span="24" v-if="modelFlag">
87
+                        <el-form-item label="证据">
88
+                            <div v-for="(item, index) in formData.caseAttachList" :key="index">
89
+                                <div style="color: blue;cursor: pointer;" @click="fileDetil(item.annexPath)">{{
90
+                                    item.annexName }}</div>
91
+                            </div>
92
+                        </el-form-item>
93
+                    </el-col>
73
                     <el-col :span="24">
94
                     <el-col :span="24">
74
                         <div style="display: inline-flex">
95
                         <div style="display: inline-flex">
75
                             <div class="infoIcon"></div>
96
                             <div class="infoIcon"></div>
303
 import {
324
 import {
304
     getTemplate,
325
     getTemplate,
305
 } from "@/api/officialSeal/officialSeal.js";
326
 } from "@/api/officialSeal/officialSeal.js";
327
+import { getToken } from "@/utils/auth";
306
 export default {
328
 export default {
307
     props: ["addVisable", "queryParams", "caseData", "caseDisabled"],
329
     props: ["addVisable", "queryParams", "caseData", "caseDisabled"],
308
     dicts: ["case_built_type"],
330
     dicts: ["case_built_type"],
317
                 caseAttachList: []
339
                 caseAttachList: []
318
             },
340
             },
319
             templateList: [],
341
             templateList: [],
320
-            modelFlag:false,
342
+            modelFlag: false,
343
+            fileURL: window.location.origin + "/API",
344
+            fileList: [],
345
+            filedata: {
346
+                annexType: 2,
347
+            },
348
+            headers: {
349
+                Authorization: "Bearer " + getToken(),
350
+            },
321
         };
351
         };
322
     },
352
     },
323
     watch: {
353
     watch: {
372
                 this.templateList = res.rows;
402
                 this.templateList = res.rows;
373
             })
403
             })
374
         },
404
         },
405
+        /** 查看证据 */
406
+        fileDetil(val) {
407
+            window.open(this.fileURL + val)
408
+        },
409
+        /** 文件上传地址 */
410
+        UploadUrl() {
411
+            return window.location.origin + "/API/common/upload";
412
+        },
413
+        /**文件上传成功*/
414
+        handlSuccess(res, file) {
415
+            this.formData.caseAttachList.push(
416
+                {
417
+                    annexId:res.annexId,
418
+                }
419
+            );
420
+        },
421
+        /**文件超出个数限制时的钩子*/
422
+        handleExceed(files, fileList) {
423
+            this.$message.warning(
424
+                `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length
425
+                } 个文件`
426
+            );
427
+        },
428
+        // 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。
429
+        beforeRemove(file, fileList) {
430
+            return this.$confirm(`确定移除 ${file.name}?`);
431
+        },
432
+        handleRemove(file, fileList) {
433
+            this.caseAttachListArr = this.caseAttachListArr.filter(item => item.annexId != file.annexId)
434
+        },
435
+        handlePreview(file) {
436
+            window.open(
437
+                window.location.origin + "/API" + file.certificatePath,
438
+                "_blank"
439
+            );
440
+        },
375
         // 提交form表单
441
         // 提交form表单
376
         submitForm() {
442
         submitForm() {
377
             this.$refs['ruleForm'].validate((valid) => {
443
             this.$refs['ruleForm'].validate((valid) => {