From 32a95699e59c5c65e18c08643266c9cbfa380ee4 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期五, 07 六月 2024 09:56:05 +0800 Subject: [PATCH] 优化设备明细、检验任务附件权限 --- src/components/do/b3-work-time-management/work-time-management.vue | 36 +++++++++--------------------------- 1 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/components/do/b3-work-time-management/work-time-management.vue b/src/components/do/b3-work-time-management/work-time-management.vue index 583d07b..86d3e07 100644 --- a/src/components/do/b3-work-time-management/work-time-management.vue +++ b/src/components/do/b3-work-time-management/work-time-management.vue @@ -333,6 +333,7 @@ requiredAdd: [], requiredUp: [] }, + addFileVisible:false, entityCopy1: {}, upIndex1:100, weekList:[ @@ -702,35 +703,16 @@ }, handleOut(){ this.outLoading = true - this.$axios.post(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: 'blob'}).then(res => { + this.$axios.get(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: "blob"}).then(res => { this.outLoading = false this.$message.success('瀵煎嚭鎴愬姛') - // let fileName="鏃ュ伐鏃舵眹鎬昏〃"; - // const blob = new Blob([res], { - // type: 'application/force-download' - // }) - // const filename = decodeURI(fileName+'.xlsx') - // // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠� - // const elink = document.createElement('a') - // elink.download = filename - // elink.style.display = 'none' - // elink.href = URL.createObjectURL(blob) - // document.body.appendChild(elink) - // elink.click() - // URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄 - // document.body.removeChild(elink) - const blob = new Blob([res], { - type: 'application/force-download' - }) - const link = document.createElement('a') - link.href = URL.createObjectURL(blob) - link.download = decodeURI('鏃ュ伐鏃舵眹鎬昏〃'+'.xlsx') - document.body.appendChild(link) - link.click() - window.setTimeout(function () { - URL.revokeObjectURL(blob) - document.body.removeChild(link) - }, 0) + const blob = new Blob([res]); + console.log(blob) + const url = URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = '鏃ュ伐鏃舵眹鎬昏〃.xlsx'; + link.click(); }) }, } -- Gitblit v1.9.3