| | |
| | | } from "@/api/project/donatebaseinfo"; |
| | | import Li_area_select from "@/components/Address"; |
| | | import OrgSelecter from "@/views/project/components/orgselect"; |
| | | import { getToken } from "@/utils/auth"; |
| | | |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | updatedatas: {}, |
| | | //当前选中捐献者姓名 |
| | | curdonordoname: "", |
| | | //当前选中捐献者案例编号 |
| | | //当前选中捐献者住院号 |
| | | curdonorno: "", |
| | | // 遮罩层 |
| | | loading: true, |
| | |
| | | amountrequested: [ |
| | | { required: true, message: "请输入申请金额", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | headers: { |
| | | Authorization: "Bearer " + getToken() |
| | | }, |
| | | //当前选中捐献案例 |
| | | curCase: {}, |
| | |
| | | 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); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | |
| | | }); |
| | | } else { |
| | | //保存主表记录 |
| | | |
| | | |
| | | addFund(this.form).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$modal.msgSuccess("新增成功"); |
| | |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | else { |
| | | this.$alert("请确认您要下载的专家劳务表", "提醒", { |
| | | confirmButtonText: "确定", |
| | |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | else if(id){ |
| | | getdownloadYX(id).then((res) => { |
| | | if (res.downloadUrl) { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | else { |
| | | this.$alert("请确认您要下载的专家劳务表", "提醒", { |
| | | confirmButtonText: "确定", |