lxp
2025-03-14 9c91c96c4c1dca21670abfa7a0c879a734a888de
src/views/business/reportPreparation/index.vue
@@ -244,37 +244,6 @@
                    </el-dropdown-menu>
                  </el-dropdown>
                </template>
                <template>
                  <el-button
                    size="small"
                    type="primary"
                    @click="handleDowns"
                    :loading="outLoading"
                    style="margin-right: 6px"
                    >批量下载</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    @click="openBatchUploadDia()"
                    :loading="inLoading"
                    >批量上传</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    @click="oneClickApproval()"
                    :loading="approvalLoading"
                    >一键审批</el-button
                  >
                  <el-button
                    size="small"
                    type="primary"
                    @click="openApprovalConfig()"
                    :loading="approvalConfigLoading"
                    >审批签名配置</el-button
                  >
                </template>
              </div>
              <!-- <div class="btns">
              <el-button size="small" type="primary" @click="handleDowns" :loading="outLoading" style="margin-right: 16px;">批量下载</el-button>
@@ -316,6 +285,8 @@
          </p>
        </div>
        <lims-table
          :handleSelectionChange="handleSelectionChange"
          isSelection
          :tableData="tableData"
          :column="column"
          :tableLoading="tableLoading"
@@ -850,15 +821,18 @@
  downAll,
  getBatchApprovalProgress,
  getReportCountInfo,
  downReport,
  upReportUrl,
  ratifyReport,
  writeReport,
  examineReport,
  downLoad,
  getReportInfo,
  getURL
  getURL,
  batchApprovalReport,
  downReport,
} from "../../../api/business/reportPreparation";
import { getToken } from "@/utils/auth";
export default {
  components: {
@@ -1129,11 +1103,10 @@
            {
              name: "上传",
              type: "upload",
              url: "/file/attachmentType/upload",
              url: "/insReport/inReport",
              data: (row) => {
                return {
                  id: row.id,
                  type: 1,
                };
              },
              uploadIdFun: (row) => {
@@ -1238,12 +1211,13 @@
  },
  computed: {
    headers() {
      let token = getToken();
      return {
        token: sessionStorage.getItem("token"),
        authorization: token,
      };
    },
    action() {
      return "";
      return this.javaApi + "/insReport/upAll";
    },
  },
  created() {
@@ -1332,7 +1306,7 @@
    },
    // 撤回 弹框
    withdraw(row) {
      getLaboratoryByReportId(row.id).then((res) => {
      getLaboratoryByReportId({ id: row.id }).then((res) => {
        this.laboratorys = res.data;
        this.reportId = row.id;
        this.withdrawDialogVisible = true;
@@ -1350,6 +1324,7 @@
      withdraw(data).then((res) => {
        if (res.code == 200) {
          this.$message.success("撤回成功");
          this.laboratory = [];
          this.withdrawDialogVisible = false;
          this.refresh();
        }
@@ -1400,6 +1375,7 @@
    getAuthorizedPerson() {
      getUserList()
        .then((res) => {
          console.log('res',res);
          this.personList = res.data;
        })
        .catch((error) => {
@@ -1540,6 +1516,10 @@
    handleChange(arr) {
      this.mutiList = arr;
    },
    handleSelectionChange(val) {
      this.mutiList = val;
      console.log(`output->val`, val);
    },
    handleDowns() {
      if (this.mutiList.length == 0) {
        this.$message.error("请选择报告");
@@ -1583,14 +1563,8 @@
      downAll({ ids: str }).then((res) => {
        this.outLoading = false;
        this.$message.success("导出成功");
        // const blob = new Blob([res],{ type: 'application/octet-stream' });
        // const url = URL.createObjectURL(blob);
        // const link = document.createElement('a');
        // link.href = url;
        // link.download = '报告.zip';
        // link.click();
        const link = document.createElement("a");
        link.href = this.javaApi + res.message;
        link.href = this.javaApi + res.data;
        link.target = "_blank";
        document.body.appendChild(link);
        link.click();
@@ -1719,27 +1693,21 @@
      console.log(`output->row`, row);
    },
    download(row) {
      getReportInfo({ id: row.id, type: 1,suffix:'.docx' }).then((response) => {
        if (response.data && response.data.contentType) {
          downLoad({ id: row.id, type: 1, code: row.code,suffix: '.docx' })
            .then((res) => {
              // 获取文件名
              const blob = new Blob([res], { type: response.data.contentType });
              const url = URL.createObjectURL(blob);
              let link = document.createElement("a");
              link.href = url;
              link.download = row.code;
              document.body.appendChild(link);
              link.click();
              document.body.removeChild(link);
              URL.revokeObjectURL(url);
            })
            .catch((error) => {
              this.$message.error(error);
            });
        } else {
          this.$message.error("未找到文件");
        }
      downReport({ id: row.id, type: 0 }).then((res) => {
          let rowUrl = row.urlS ? row.urlS : row.url;
          let fileName =
            rowUrl.indexOf("_") == -1
              ? rowUrl.split("/")[2]
              : rowUrl.split("_")[1];
          console.log(fileName);
          const blod = new Blob([res], { type: "application/octet-stream" });
          const url = URL.createObjectURL(blod);
          const link = document.createElement("a");
          link.href = url;
          link.target = "_blank";
          link.download = fileName;
          document.body.appendChild(link);
          link.click();
      });
    },
    // 还原操作
@@ -1750,7 +1718,7 @@
        type: "warning",
      })
        .then(() => {
          upReportUrl({ id: row.id,type:1 }).then((res) => {
          upReportUrl({ id: row.id, type: 1 }).then((res) => {
            if (res.code === 200) {
              this.$message.success("操作成功");
              this.refreshTable("page");
@@ -1763,7 +1731,7 @@
      this.currentInfo = row;
      let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
      fileName = fileName.replace("/word/", "");
      const userName = JSON.parse(localStorage.getItem("user")).name;
      const userName = this.$store.state.user.name;
      this.option = {
        url: this.javaApi + "/word/" + fileName,
        isEdit: false,
@@ -1799,17 +1767,11 @@
    },
    handleApprove(row) {
      this.currentInfo = row;
      getURL().then(res => {
      })
      let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
      fileName = fileName.replace("/word/", "");
      const userName = this.$store.state.user.name;
      this.option = {
        url: javaApi + "/word/" + fileName,
        url: this.javaApi + "/word/" + fileName,
        isEdit: false,
        fileType: "docx",
        title: fileName,
@@ -1895,8 +1857,8 @@
      this.loadingApproveReason = true;
      examineReport({
        id: this.currentInfo.id,
        isRatify: 0,
        ratifyTell: this.reason,
        isExamine: 0,
        examineTell: this.reason,
      })
        .then((res) => {
          this.loadingApproveReason = false;