diff --git a/src/views/modules/plugins/change/changedeath.vue b/src/views/modules/plugins/change/changedeath.vue index 5fce6621..d7136351 100644 --- a/src/views/modules/plugins/change/changedeath.vue +++ b/src/views/modules/plugins/change/changedeath.vue @@ -30,7 +30,7 @@ placeholder="请输入手机"> - { + // this.download(res.data, title + '.xls') + if (res.headers["content-disposition"]) { + let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) + console.log('filename', fileName) + let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) + var url = window.URL.createObjectURL(blob) + var aLink = document.createElement('a') + aLink.style.display = 'none' + aLink.href = url + aLink.setAttribute('download', fileName) + document.body.appendChild(aLink) + aLink.click() + document.body.removeChild(aLink) //下载完成移除元素 + window.URL.revokeObjectURL(url) //释放掉blob对象 + } else this.$message.error('下载失败') + }).catch(err => { + console.log('err', err) + return this.$message.error('网络错误') }) - .then(res => { - // this.download(res.data, title + '.xls') - if (res.headers["content-disposition"]) { - let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) - console.log('filename', fileName) - let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) - var url = window.URL.createObjectURL(blob) - var aLink = document.createElement('a') - aLink.style.display = 'none' - aLink.href = url - aLink.setAttribute('download', fileName) - document.body.appendChild(aLink) - aLink.click() - document.body.removeChild(aLink) //下载完成移除元素 - window.URL.revokeObjectURL(url) //释放掉blob对象 - } else this.$message.error('下载失败') - }) - .catch(err => { - console.log('err', err) - return this.$message.error('网络错误') - }) }, resetForm(formName) { for(const n in this.dataForm) { diff --git a/src/views/modules/plugins/change/changerelocation.vue b/src/views/modules/plugins/change/changerelocation.vue index 6e2b578a..d6181065 100644 --- a/src/views/modules/plugins/change/changerelocation.vue +++ b/src/views/modules/plugins/change/changerelocation.vue @@ -274,6 +274,34 @@ export default { } }, methods: { + exportHandle () { + const url = this.mixinViewModuleOptions.exportURL + this.$http({ + method: 'GET', + url, + responseType: 'blob', + params: this.dataForm + }).then(res => { + // this.download(res.data, title + '.xls') + if (res.headers["content-disposition"]) { + let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) + console.log('filename', fileName) + let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) + var url = window.URL.createObjectURL(blob) + var aLink = document.createElement('a') + aLink.style.display = 'none' + aLink.href = url + aLink.setAttribute('download', fileName) + document.body.appendChild(aLink) + aLink.click() + document.body.removeChild(aLink) //下载完成移除元素 + window.URL.revokeObjectURL(url) //释放掉blob对象 + } else this.$message.error('下载失败') + }).catch(err => { + console.log('err', err) + return this.$message.error('网络错误') + }) + }, async handleLook (row) { if(row.agencyId !== ''){ const url = '/gov/org/grid/griddetail' diff --git a/src/views/modules/plugins/rent/renthouseForm.vue b/src/views/modules/plugins/rent/renthouseForm.vue index a6058463..c9c30ac8 100644 --- a/src/views/modules/plugins/rent/renthouseForm.vue +++ b/src/views/modules/plugins/rent/renthouseForm.vue @@ -292,6 +292,7 @@ export default { this.houseType = this.dataForm.houseType this.purpose = this.dataForm.purpose this.rentFlag = parseInt(this.dataForm.rentFlag) + this.dataForm.needUpdate = false } else { @@ -497,7 +498,7 @@ export default { let url = '' if (this.formType === 'add') { - url = '/pli/power/rentHouse/' + url = '/pli/power/rentHouse/save' } else { url = '/gov/org/house/houseupdate' this.dataForm.houseId = this.houseId