Commit 571e53f7 authored by shifangwuji's avatar shifangwuji

Merge branch 'project9-8' of http://gitlab.91isoft.com:90/yangshuo/template_vue into project9-8

parents 83d92631 cef9d101
......@@ -55,6 +55,14 @@ export function exporTable(params) {
responseType: 'blob'
})
}
export function lotExportTable(params) {
return request({
url: '/ysgxlog/export',
method: 'get',
params,
responseType: 'blob'
})
}
// 根据key值查询数据字典数据
export function getDictData(params) {
......@@ -63,4 +71,4 @@ export function getDictData(params) {
method: 'get',
params
})
}
\ No newline at end of file
}
......@@ -69,6 +69,16 @@
@click="resetQuery"
>重置</el-button>
</el-form-item>
<el-form-item style="float: right">
<el-button
style="padding: 8px 7px"
type="success"
size="small"
icon="el-icon-download"
@click="handleExport"
>导出</el-button
>
</el-form-item>
<!-- <div style="float: right">
<el-form-item>
<el-button
......@@ -318,8 +328,7 @@ import {
getDetailById,
updataInfo,
deleteLogical,
exporTable,
getDictData
getDictData, lotExportTable
} from '@/api/production/gxlog'
import { parseTime } from '@/utils'
......@@ -535,21 +544,19 @@ export default {
},
handleExport() {
const obj = {
page: this.queryParams.page,
rows: this.queryParams.rows,
pn: this.queryParams.pn,
ptype: this.queryParams.ptype,
lot: this.queryParams.lot,
gx: this.queryParams.gx
}
exporTable(obj).then(response => {
lotExportTable(obj).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
// TODO: 创建下载的链接
const href = window.URL.createObjectURL(blob)
downloadElement.href = href
// TODO: 下载后文件名
downloadElement.download = '样品库记录' + '.xls'
downloadElement.download = '工序日志' + '.xls'
document.body.appendChild(downloadElement)
// TODO: 点击下载
downloadElement.click()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment