Commit 15243242 authored by 高宇's avatar 高宇

修改条码生产

parent 31d784bf
...@@ -34,3 +34,11 @@ export function exportInventoryRecord(params) { ...@@ -34,3 +34,11 @@ export function exportInventoryRecord(params) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 测试导出数据
export function exportTest(){
return request({
url: '/wbapply/exportTest',
method: 'get',
responseType: 'blob'
})
}
...@@ -49,7 +49,7 @@ export function deleteLogical(id) { ...@@ -49,7 +49,7 @@ export function deleteLogical(id) {
// 导出信息接口 // 导出信息接口
export function exporTable(params) { export function exporTable(params) {
return request({ return request({
url: '/ysjbcode/export', url: '/wbapply/exportTest',
method: 'get', method: 'get',
params, params,
responseType: 'blob' responseType: 'blob'
......
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
</template> </template>
<script> <script>
import { exportInventoryRecord, findSingleLogDetail, listLog } from '@/api/processMangement/InventoryRecord' import {exportInventoryRecord, exportTest, findSingleLogDetail, listLog} from '@/api/processMangement/InventoryRecord'
import BaseTable from '@/components/Table/BaseTable/index.vue' import BaseTable from '@/components/Table/BaseTable/index.vue'
import { BaseTableArgumentsTest } from '@/components/Table/AllTableArguments/BaseTableArguments' import { BaseTableArgumentsTest } from '@/components/Table/AllTableArguments/BaseTableArguments'
import { getDictData } from '@/api/equipment/application' import { getDictData } from '@/api/equipment/application'
...@@ -458,6 +458,7 @@ export default { ...@@ -458,6 +458,7 @@ export default {
} }
this.getList() this.getList()
this.getDict() this.getDict()
// this.test()
}, },
mounted() { mounted() {
this.$refs.autoGetFocusInput.focus() this.$refs.autoGetFocusInput.focus()
...@@ -594,6 +595,25 @@ export default { ...@@ -594,6 +595,25 @@ export default {
} }
this.openDetails = true this.openDetails = true
}, },
test(){
exportTest().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);
})
},
handleExport() { handleExport() {
const obj = { const obj = {
page: this.queryParams.page, page: this.queryParams.page,
......
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