gaoluyang
2025-05-07 c11eac1694b3d4a24d83e7e72f3acff6b398572f
1.质量监督计划-完成报告可以上传pdf
已修改2个文件
35 ■■■■ 文件已修改
src/components/Preview/filePreview.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/ensureResultsValidity/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Preview/filePreview.vue
@@ -4,9 +4,10 @@
      <img :src="imgUrl" alt="Image Preview" />
    </div>
    <div v-if="isPdf">
      <object :data="fileUrl" type="application/pdf" width="100%" height="750px">
        <p>您的浏览器不支持 PDF 预览。<a :href="fileUrl" style="color: #3a7bfa;" target="_blank">下载 PDF 文件</a></p>
      </object>
<!--      <object :data="fileUrl" type="application/pdf" width="100%" height="750px">-->
<!--        <p>您的浏览器不支持 PDF 预览。<a :href="fileUrl" style="color: #3a7bfa;" target="_blank">下载 PDF 文件</a></p>-->
<!--      </object>-->
      <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;" />
    </div>
    <div v-if="isDoc">
      <p v-if="!isDocShow">文档无法直接预览,请下载查看。</p>
@@ -58,8 +59,10 @@
import VueOfficeExcel from '@vue-office/excel'
//引入相关样式
import '@vue-office/excel/lib/index.css'
import onlyoffice from "@/components/Onlyoffice/onlyoffice.vue";
export default {
  components: {
    onlyoffice,
    VueOfficeDocx,
    VueOfficeExcel,
  },
@@ -72,6 +75,9 @@
      type: Object,
      required: true
    },
    option: {
      type: Object,
    },
  },
  data() {
    return {
src/views/CNAS/process/ensureResults/ensureResultsValidity/index.vue
@@ -85,7 +85,7 @@
    </el-dialog>
    <!--预览报告-->
    <el-dialog :visible.sync="lookDialogVisible" fullscreen title="查看附件" top="5vh" width="800px">
      <filePreview v-if="lookDialogVisible" :currentFile="{}"
      <filePreview v-if="lookDialogVisible" :currentFile="{}" :option="option"
        :fileUrl="javaApi + '/word/' + currentInfo.finishReportUrl" style="height: 70vh;overflow-y: auto;" />
      <div>
        批准状态:
@@ -153,7 +153,7 @@
      <div style="margin: 0 auto;">
        <el-upload ref="upload1" :action="action1" :auto-upload="false"
          :data="{ qualityMonitorDetailsId: qualityMonitorDetailsId }" :file-list="fileList1" :headers="uploadHeader"
          :limit="1" :on-change="beforeUpload1" :on-error="onError1" :on-success="onSuccess1" accept='.doc,.docx' drag
          :limit="1" :on-change="beforeUpload1" :on-error="onError1" :on-success="onSuccess1" accept='.doc,.docx,application/pdf,' drag
          name="file">
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
@@ -569,7 +569,8 @@
      ratifyRemark: '',
      downloadDialog: false,
      download: {},
      planYear: ''
      planYear: '',
      option: {}
    };
  },
  mounted() {
@@ -802,6 +803,22 @@
      if (row.finishReportUrl) {
        this.currentInfo = row
        this.ratifyStatus = row.ratifyStatus
        const userName = this.nickName
        const isPdf = /\.pdf$/i.test(row.finishReportUrl)
        if (isPdf) {
          this.option = {
            url: this.javaApi + "/word/" + row.finishReportUrl,
            isEdit: false,
            fileType: 'pdf',
            title: '报告',
            lang: 'zh-CN',
            isPrint: false,
            user_id: 1,
            user_name: userName,
          }
        } else {
          this.option = {}
        }
        this.lookDialogVisible = true
      } else {
        this.uploadDia1 = true