吴羡
3 天以前 78a3c898908bbb8827d1c2aa6299f92ff03f5847
src/views/CNAS/systemManagement/documentControl/components/FileList.vue
@@ -21,10 +21,7 @@
        </el-form>
      </div>
      <div>
        <el-upload :action="action" :multiple="false" accept='.xls,.xlsx' :headers="uploadHeader"
                   :on-change="beforeUpload" :on-error="onError" ref='upload' :on-success="handleSuccessUp"
                   :show-file-list="false">
          <el-button size="small" type="primary" :loading="upLoading">导入</el-button></el-upload>
        <el-button size="small" type="primary" @click="$refs.importDialog.open()">导入</el-button>
      </div>
    </div>
    <div class="table">
@@ -32,6 +29,9 @@
        :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table>
    </div>
    <el-dialog title="上传" v-model="addDialogVisible" width="1000px" top="3vh">
      <div style="margin-bottom: 10px; padding: 8px 12px; border-radius: 4px; background: var(--el-color-primary-light-9); font-size: 13px; color: var(--el-text-color-regular);">
        支持 PDF、Word(.doc/.docx)、Excel(.xls/.xlsx)、PPT、图片等常见格式,单个文件不超过 20MB。PDF 可预览并盖章;其他格式按原文件上传,不盖章。
      </div>
      <UpPdfStamp ref="UpPdfStamp" v-if="addDialogVisible" @uploadPDF="uploadPDF" :isUpFile="true"
        @uploadPDFErr="uploadPDFErr"></UpPdfStamp>
      <template #footer><span  class="dialog-footer">
@@ -84,6 +84,16 @@
        <el-button :loading="uploading" type="primary" @click="submitProduct('currentInfoForm')">确 认</el-button>
      </span></template>
    </el-dialog>
    <import-dialog
      ref="importDialog"
      title="导入文件清单"
      :action="action"
      accept=".xls,.xlsx"
      template-url="/import-templates/文件清单导入模板.xlsx?v=2"
      template-name="文件清单导入模板.xlsx"
      :tips="['表头必须与模板完全一致,不能增删列或修改列名', '生效日期格式:YYYY-MM-DD']"
      @success="refreshTable"
    />
  </div>
</template>
@@ -91,6 +101,7 @@
import UpPdfStamp from '@/components/UpPdfStamp/index.vue'
import filePreview from '@/components/Preview/filePreview.vue'
import limsTable from "@/components/Table/lims-table.vue";
import ImportDialog from '@/components/ImportDialog/index.vue'
import {
  uploadFileManageDocumentList,
  pageManageDocumentList,
@@ -102,6 +113,7 @@
    UpPdfStamp,
    filePreview,
    limsTable,
    ImportDialog,
  },
  data() {
    return {
@@ -205,7 +217,7 @@
      page: {
        total: 0,
        size: 10,
        current: 0,
        current: 1,
      },
      tableLoading: false,
      addDia: false,
@@ -268,7 +280,9 @@
    // 下载文件
    handleDown(row) {
      if (!row.url) return this.$message.warning('文件未上传')
      this.$download.saveAs(row.url, row.url);
      // 后端保存的是 word 目录下的 uuid_原文件名,下载时走静态资源地址并去掉 uuid 前缀
      const fileName = row.url.replace(/^[0-9a-fA-F-]{36}_/, '')
      this.$download.saveAs(this.javaApi + '/word/' + row.url, fileName);
    },
    // 查看文件
    handleLook(row) {