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) { ...@@ -55,6 +55,14 @@ export function exporTable(params) {
responseType: 'blob' responseType: 'blob'
}) })
} }
export function lotExportTable(params) {
return request({
url: '/ysgxlog/export',
method: 'get',
params,
responseType: 'blob'
})
}
// 根据key值查询数据字典数据 // 根据key值查询数据字典数据
export function getDictData(params) { export function getDictData(params) {
......
...@@ -69,6 +69,16 @@ ...@@ -69,6 +69,16 @@
@click="resetQuery" @click="resetQuery"
>重置</el-button> >重置</el-button>
</el-form-item> </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"> <!-- <div style="float: right">
<el-form-item> <el-form-item>
<el-button <el-button
...@@ -318,8 +328,7 @@ import { ...@@ -318,8 +328,7 @@ import {
getDetailById, getDetailById,
updataInfo, updataInfo,
deleteLogical, deleteLogical,
exporTable, getDictData, lotExportTable
getDictData
} from '@/api/production/gxlog' } from '@/api/production/gxlog'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
...@@ -535,21 +544,19 @@ export default { ...@@ -535,21 +544,19 @@ export default {
}, },
handleExport() { handleExport() {
const obj = { const obj = {
page: this.queryParams.page,
rows: this.queryParams.rows,
pn: this.queryParams.pn, pn: this.queryParams.pn,
ptype: this.queryParams.ptype, ptype: this.queryParams.ptype,
lot: this.queryParams.lot, lot: this.queryParams.lot,
gx: this.queryParams.gx gx: this.queryParams.gx
} }
exporTable(obj).then(response => { lotExportTable(obj).then(response => {
const blob = new Blob([response]) const blob = new Blob([response])
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
// TODO: 创建下载的链接 // TODO: 创建下载的链接
const href = window.URL.createObjectURL(blob) const href = window.URL.createObjectURL(blob)
downloadElement.href = href downloadElement.href = href
// TODO: 下载后文件名 // TODO: 下载后文件名
downloadElement.download = '样品库记录' + '.xls' downloadElement.download = '工序日志' + '.xls'
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement)
// TODO: 点击下载 // TODO: 点击下载
downloadElement.click() 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