11
WXL
2024-07-17 21fe2968337eb8eab97adc88750b71c4057e98f8
src/views/project/fundcheck/ethicalExpertFeeCheck/index.vue
@@ -106,7 +106,7 @@
              <el-button v-if="scope.row.checkFlag == 1" size="mini" type="text" icon="el-icon-edit"
                @click="handleCheck(scope.row)">审核</el-button>
              <!-- v-hasPermi="['project:donateconsolationfund:edit']" -->
              <el-button size="mini" type="text" icon="el-icon-download" @click="dayin(scope.row.id)">下载</el-button>
              <el-button size="mini" type="text" icon="el-icon-download" @click="totaldayin(scope.row.id)">下载</el-button>
              <!-- <el-popover placement="right" width="400" trigger="click">
                <el-table :data="gridData">
                  <el-table-column
@@ -428,6 +428,8 @@
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import { getUserProfile } from "@/api/system/user";
import { getToken } from "@/utils/auth";
// 导入本地存储的方法
import { setItem, grtItem, removeItem } from "@/utils/storage.js";
@@ -509,6 +511,9 @@
      //捐献案例列表数据
      // donationCaseTableData:[],
      donatebaseinfoList: [],
      headers: {
        Authorization: "Bearer " + getToken()
      },
      gridData: [
        {
          date: "2016-05-02",
@@ -746,22 +751,35 @@
    totaldayin(e) {
      // const id =this.row.id
      getdownloadBX(e).then(res => {
        if (res.downloadUrl) {
          var fileUrl = res;
          //获取当前网址
          var urlBase = process.env.VUE_APP_BASE_API;
          var curWWWPath = window.document.location.href;
          var pos = curWWWPath.indexOf(window.document.location.pathname);
          // 创建a标签
          var aEle = document.createElement("a");
          aEle.href =
            curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
          aEle.click();
          this.$alert("下载成功", "提示", {
            confirmButtonText: "确定",
            type: "success"
        var fileUrl = res;
        //获取当前网址
        var urlBase = process.env.VUE_APP_BASE_API;
        var curWWWPath = window.document.location.href;
        var pos = curWWWPath.indexOf(window.document.location.pathname);
        // 创建a标签
        var aEle = document.createElement("a");
        aEle.href =
          curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
        console.log(aEle.href);
        // 添加Authorization头部
        fetch(aEle.href, {
          headers: this.headers
        })
          .then(response => {
            // 将文件下载链接作为blob对象进行下载
            return response.blob();
          })
          .then(blob => {
            const url = window.URL.createObjectURL(new Blob([blob]));
            console.log(url);
            const link = document.createElement("a");
            link.href = url;
            const name=fileUrl["downloadName"]
            link.setAttribute("download", name); // 替换file.pdf为实际的文件名
            document.body.appendChild(link);
            link.click();
            link.parentNode.removeChild(link);
          });
        }
      });
    },