吴羡
2 天以前 78a3c898908bbb8827d1c2aa6299f92ff03f5847
src/views/CNAS/systemManagement/documentControl/components/FileChangeRequest.vue
@@ -4,7 +4,7 @@
    <div style="display: flex;justify-content: space-between">
      <div style="display: flex;">
        <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
          <span style="width: 128px;font-size: 14px;font-weight: 700;color: #606266;">申请文件编号</span>
          <span style="width: 128px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">申请文件编号</span>
          <el-input v-model="queryParams.code" clearable placeholder="请输入" size="small"
                    @keyup.enter="refreshTable()"></el-input>
        </div>
@@ -184,7 +184,7 @@
            <div class="search_thing" style="width: 100%;">
              <div class="search_label">相关附件:</div>
              <div class="search_input"><el-upload v-if="addDialogVisible" :auto-upload="false" :multiple="false"
                                                   :on-change="handleChangeUpload" accept='.pdf' action="#" style="margin: 8px 0 0px 50px;">
                                                   :on-change="handleChangeUpload" accept='.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.wps,.et,.dps,.txt,.jpg,.jpeg,.png' action="#" style="margin: 8px 0 0px 50px;">
                <el-button size="small" type="primary">上传附件</el-button>
              </el-upload></div>
            </div>
@@ -342,7 +342,7 @@
      page: {
        total: 0,
        size: 10,
        current: 0,
        current: 1,
      },
      tableLoading: false,
    }
@@ -536,15 +536,23 @@
      this.getCurrentFile(alterBeforeCode)
      this.addDialogVisible = true
      this.diaLoading = true
      checkManageDocumentAlterPdf({ id: row.id }).then(res => {
      checkManageDocumentAlterPdf({ id: row.id }).then(async res => {
        //
        this.diaLoading = false
        const blob = new Blob([res]);
        // 后端转 PDF 失败时会返回 JSON 错误,blob 里就不是 PDF
        if (res.type && res.type.includes('json')) {
          const data = JSON.parse(await res.text())
          this.$message.error(data.msg || '附件转换预览失败')
          this.addDialogVisible = false
          return
        }
        const blob = new Blob([res], { type: 'application/pdf' });
        const file = new File([blob], row.name, { type: 'application/pdf' })
        this.$refs.UpPdfStamp.lookFile(file)
        this.currentInfo = row
      }).catch(err => {
        this.diaLoading = false
        this.addDialogVisible = false
        console.log(err)
      })
    },