|
@@ -198,24 +198,19 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div v-if="choice == 1" class="fBtn" style="position: relative">
|
|
|
+ <el-button type="primary" icon="el-icon-download" style="position: absolute; right: 120px" @click="highDownload('病历-高级搜索')">导出execl</el-button>
|
|
|
<el-button
|
|
|
class="btn11"
|
|
|
@click="reset"
|
|
|
>重置条件</el-button
|
|
|
>
|
|
|
- <!-- <el-select
|
|
|
- v-model="formData1.seniorList1"
|
|
|
- class="inputOn"
|
|
|
- style="position: absolute; right: 30px"
|
|
|
- placeholder="检索历史"
|
|
|
- @change="funSetformData2"
|
|
|
- /> -->
|
|
|
<el-button class="btn2" @click="funQuery(1)">检索</el-button>
|
|
|
</div>
|
|
|
<div v-else class="fBtn" style="position: relative">
|
|
|
+ <el-button type="primary" icon="el-icon-download" style="position: absolute; right: 220px" @click="normalDownload('病历-普通搜索')">导出execl</el-button>
|
|
|
<el-select
|
|
|
v-model="formData0.input1"
|
|
|
- style="position: absolute; right: 30px"
|
|
|
+ style="position: absolute; right: 0px"
|
|
|
placeholder="检索历史"
|
|
|
@change="funSetList()"
|
|
|
>
|
|
@@ -387,6 +382,7 @@
|
|
|
import Title from "@/components/Title";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import mPagination from "@/components/m-pagination";
|
|
|
+import { bassNormalSearchDownload, bassHighSearchDownload } from '@/api/excel'
|
|
|
|
|
|
export default {
|
|
|
name: "Dashboard",
|
|
@@ -491,6 +487,51 @@ export default {
|
|
|
},
|
|
|
created() {},
|
|
|
methods: {
|
|
|
+ normalDownload(name) {
|
|
|
+ const params = {
|
|
|
+ keyword: this.formData0.input
|
|
|
+ }
|
|
|
+ bassNormalSearchDownload(params).then(res => {
|
|
|
+ const content = res.data // 后台返回二进制数据
|
|
|
+ const blob = new Blob([content])
|
|
|
+ const fileName = `${name}.xlsx`
|
|
|
+ if ('download' in document.createElement('a')) { // 非IE下载
|
|
|
+ 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)
|
|
|
+ } else { // IE10+下载
|
|
|
+ navigator.msSaveBlob(blob, fileName)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ highDownload(name) {
|
|
|
+ alert('api 有问题 todo ')
|
|
|
+ // const params = {
|
|
|
+ // keyword: this.formData0.input
|
|
|
+ // }
|
|
|
+ // bassNormalSearchDownload(params).then(res => {
|
|
|
+ // const content = res.data // 后台返回二进制数据
|
|
|
+ // const blob = new Blob([content])
|
|
|
+ // const fileName = `${name}.xlsx`
|
|
|
+ // if ('download' in document.createElement('a')) { // 非IE下载
|
|
|
+ // 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)
|
|
|
+ // } else { // IE10+下载
|
|
|
+ // navigator.msSaveBlob(blob, fileName)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
onLockResult() {
|
|
|
this.lock = true
|
|
|
this.formData1.seniorList.map(item => {
|