Commit 3d3c555e authored by CenXinYi's avatar CenXinYi

完成出入库导出功能

Signed-off-by: 's avatarCenXinYi <2810162984@qq.com>
parent b19f892b
......@@ -9,6 +9,7 @@ export function listLog(queryParams) {
})
}
/* TODO: 用来查询单项出入库记录的废弃详情信息 */
export function findSingleLogDetail(singleLogIdAndFqYs) {
return request({
url: '/wbwarehouselog/detail',
......@@ -19,3 +20,12 @@ export function findSingleLogDetail(singleLogIdAndFqYs) {
}
})
}
/* TODO: 用来导出表单信息 */
export function exportInventoryRecord() {
return request({
url: '/wbwarehouselog/export',
method: 'get',
responseType: 'blob'
})
}
<template>
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">{{ allTableArguments.listName }}</div>
<div class="tableList" style=" height:600px;">
<el-scrollbar style="height: 100%;">
<div class="tableList">
<el-scrollbar>
<el-table
v-loading="allTableArguments.loading"
class="processList"
......
......@@ -212,7 +212,7 @@
</template>
<script>
import { listLog, findSingleLogDetail } from '@/api/processMangement/InventoryRecord'
import { listLog, findSingleLogDetail, exportInventoryRecord } from '@/api/processMangement/InventoryRecord'
import BaseTable from '@/components/Table/BaseTable/index.vue'
export default {
......@@ -490,7 +490,7 @@ export default {
/* TODO: 如果库状态==='4' 并且返回的状态码为200的时候,才会将可变的详情字段设置为true,去激活并打开 */
this.activateAbandonedState = true
} else {
/* TODO: 如果状态码不对则不会激活可变字段,并且抛出错误信息response.message */
/* TODO: 如果状态码不对则不会激活可变字段,只会对普通字段进行赋值,并且抛出错误信息response.message */
this.$message({
showClose: true,
message: response.message,
......@@ -503,6 +503,31 @@ export default {
}
this.title = '记录详情'
this.openDetails = true
},
handleExport() {
this.$confirm('是否确认导出所有出入库记录信息?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportInventoryRecord().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'
document.body.appendChild(downloadElement)
// TODO: 点击下载
downloadElement.click()
// TODO: 下载完成移除元素
document.body.removeChild(downloadElement)
// TODO: 释放掉blob对象
window.URL.revokeObjectURL(href)
// this.download(response.msg);
})
})
}
}
}
......
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