zzs 3 місяців тому
батько
коміт
ad0273e93f
1 змінених файлів з 41 додано та 13 видалено
  1. 41 13
      ruoyi-ui/src/views/tender/tender1/components/CompEval.vue

+ 41 - 13
ruoyi-ui/src/views/tender/tender1/components/CompEval.vue

@@ -6,37 +6,57 @@
       <el-descriptions class="margin-top" title="" :column="2" border>
         <el-descriptions-item label="专家签到表">
           <div v-show="!isEdit">
-            <el-image v-show="sSignSrc" style="width: 100px; height: 100px" :src="sSignSrc"
-              :preview-src-list="[sSignSrc]"></el-image>
+            <template v-if="!sSignSrc.tolowerCase().includes('.pdf')">
+              <el-image v-show="sSignSrc" style="width: 100px; height: 100px" :src="sSignSrc"
+                :preview-src-list="[sSignSrc]"></el-image>
+            </template>
+            <template v-else>
+              <a :href="sSignSrc" :download="sSignName">{{ sSignName }}</a>
+            </template>
           </div>
           <file-upload-json v-show="isEdit" @input="handleUploadSSign" :limit="1" :value="SSignFiles" :file-size="10"
-            :file-type="['png', 'jpg','pdf']" />
+            :file-type="['png', 'jpg', 'pdf']" />
         </el-descriptions-item>
         <el-descriptions-item label="审查表">
 
           <div v-show="!isEdit">
-            <el-image v-show="sCensorSrc" style="width: 100px; height: 100px" :src="sCensorSrc"
-              :preview-src-list="[sCensorSrc]"></el-image>
+            <template v-if="!sCensorSrc.tolowerCase().includes('.pdf')">
+              <el-image v-show="sCensorSrc" style="width: 100px; height: 100px" :src="sCensorSrc"
+                :preview-src-list="[sCensorSrc]"></el-image>
+            </template>
+            <template v-else>
+              <a :href="sCensorSrc" :download="sCensorName">{{ sCensorName }}</a>
+            </template>
           </div>
           <file-upload-json v-show="isEdit" @input="handleUploadSCensor" :limit="1" :value="SCensorFiles"
-            :file-size="10" :file-type="['png', 'jpg','pdf']" />
+            :file-size="10" :file-type="['png', 'jpg', 'pdf']" />
         </el-descriptions-item>
         <el-descriptions-item label="评审表">
-
           <div v-show="!isEdit">
-            <el-image v-show="sReviewSrc" style="width: 100px; height: 100px" :src="sReviewSrc"
-              :preview-src-list="[sReviewSrc]"></el-image>
+            <template v-if="!sReviewSrc.tolowerCase().includes('.pdf')">
+              <el-image v-show="sReviewSrc" style="width: 100px; height: 100px" :src="sReviewSrc"
+                :preview-src-list="[sReviewSrc]"></el-image>
+            </template>
+            <template v-else>
+              <a :href="sReviewSrc" :download="sReviewName">{{ sReviewName }}</a>
+            </template>
           </div>
           <file-upload-json v-show="isEdit" @input="handleUploadSReview" :limit="1" :value="SReviewFiles"
-            :file-size="10" :file-type="['png', 'jpg','pdf']" />
+            :file-size="10" :file-type="['png', 'jpg', 'pdf']" />
         </el-descriptions-item>
         <el-descriptions-item label="最终汇总表">
           <div v-show="!isEdit">
-            <el-image v-show="sSummarySrc" style="width: 100px; height: 100px" :src="sSummarySrc"
-              :preview-src-list="[sSummarySrc]"></el-image>
+            <template v-if="!sSummarySrc.tolowerCase().includes('.pdf')">
+              <el-image v-show="sSummarySrc" style="width: 100px; height: 100px" :src="sSummarySrc"
+                :preview-src-list="[sSummarySrc]"></el-image>
+            </template>
+            <template v-else>
+              <a :href="sSummarySrc" :download="sSummaryName">{{ sSummaryName }}</a>
+            </template>
+
           </div>
           <file-upload-json v-show="isEdit" @input="handleUploadSSummary" :limit="1" :value="SSummaryFiles"
-            :file-size="10" :file-type="['png', 'jpg','pdf']" />
+            :file-size="10" :file-type="['png', 'jpg', 'pdf']" />
         </el-descriptions-item>
       </el-descriptions>
       <div style="margin-top: 20px;text-align: center;">
@@ -81,9 +101,13 @@ export default {
       },
       loading: false,
       sSignSrc: null,
+      sSignName: null,
       sCensorSrc: null,
+      sCensorName: null,
       sReviewSrc: null,
+      sReviewName: null,
       sSummarySrc: null,
+      sSummaryName: null,
       SSignFiles: [],
       SCensorFiles: [],
       SReviewFiles: [],
@@ -120,21 +144,25 @@ export default {
       if (tender.sSign) {
         this.SSignFiles = JSON.parse(tender.sSign);
         this.sSignSrc = this.SSignFiles[0]?.url
+        this.sSignName = this.SSignFiles[0]?.name
       }
       this.form.sCensor = tender.sCensor;
       if (tender.sCensor) {
         this.SCensorFiles = JSON.parse(tender.sCensor);
         this.sCensorSrc = this.SCensorFiles[0]?.url
+        this.sCensorName = this.SCensorFiles[0]?.name
       }
       this.form.sReview = tender.sReview;
       if (tender.sReview) {
         this.SReviewFiles = JSON.parse(tender.sReview);
         this.sReviewSrc = this.SReviewFiles[0]?.url
+        this.sReviewName = this.SReviewFiles[0]?.name
       }
       this.form.sSummary = tender.sSummary;
       if (tender.sSummary) {
         this.SSummaryFiles = JSON.parse(tender.sSummary);
         this.sSummarySrc = this.SSummaryFiles[0]?.url
+        this.sSummaryName = this.SSummaryFiles[0]?.name
       }
     },
     async getMarks () {