bug: 🐛 导出
This commit is contained in:
parent
5a843344ee
commit
208e58c1f6
@ -18,7 +18,7 @@
|
|||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="searchKey"
|
v-model:value="searchKey"
|
||||||
:placeholder="`名称/编码`"
|
:placeholder="`名称/编码/型号`"
|
||||||
allow-clear
|
allow-clear
|
||||||
enter-button
|
enter-button
|
||||||
@search="loadData()"
|
@search="loadData()"
|
||||||
@ -83,9 +83,16 @@
|
|||||||
|
|
||||||
//导出数据
|
//导出数据
|
||||||
const downloadData = () => {
|
const downloadData = () => {
|
||||||
// 调用后端接口下载excel文件
|
// 创建 URLSearchParams 对象
|
||||||
const url = `${http.prefix}/apply/download-excel?applyType=1
|
const params = new URLSearchParams()
|
||||||
&type=${typeVal.value}&key=${searchKey.value}`
|
if (typeVal.value) {
|
||||||
|
params.append('type', typeVal.value)
|
||||||
|
}
|
||||||
|
if (searchKey.value) {
|
||||||
|
params.append('key', searchKey.value)
|
||||||
|
}
|
||||||
|
params.append('applyType', '1')
|
||||||
|
const url = `${http.prefix}/apply/download-excel?${params.toString()}`
|
||||||
window.open(url)
|
window.open(url)
|
||||||
}
|
}
|
||||||
//表格列
|
//表格列
|
||||||
@ -109,7 +116,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '物料型号',
|
title: '物料型号',
|
||||||
dataIndex: 'typeName',
|
dataIndex: 'spec',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '入库类型',
|
title: '入库类型',
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="searchKey"
|
v-model:value="searchKey"
|
||||||
placeholder="名称/编码"
|
placeholder="名称/编码/型号"
|
||||||
allow-clear
|
allow-clear
|
||||||
enter-button
|
enter-button
|
||||||
width="100%"
|
width="100%"
|
||||||
@ -86,8 +86,16 @@
|
|||||||
|
|
||||||
//导出数据
|
//导出数据
|
||||||
const downloadData = () => {
|
const downloadData = () => {
|
||||||
// 调用后端接口下载excel文件
|
// 创建 URLSearchParams 对象
|
||||||
const url = `${http.prefix}/material/download-excel?key=${searchKey.value}&type=${typeVal.value}`
|
const params = new URLSearchParams()
|
||||||
|
if (typeVal.value) {
|
||||||
|
params.append('type', typeVal.value)
|
||||||
|
}
|
||||||
|
if (searchKey.value) {
|
||||||
|
params.append('key', searchKey.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = `${http.prefix}/material/download-excel?${params.toString()}`
|
||||||
window.open(url)
|
window.open(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="searchKey"
|
v-model:value="searchKey"
|
||||||
:placeholder="`名称/编码`"
|
:placeholder="`名称/编码/型号`"
|
||||||
allow-clear
|
allow-clear
|
||||||
enter-button
|
enter-button
|
||||||
@search="loadData()"
|
@search="loadData()"
|
||||||
@ -96,7 +96,7 @@
|
|||||||
import { http } from '@/settings/http'
|
import { http } from '@/settings/http'
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
||||||
|
|
||||||
const searchKey = ref('')
|
const searchKey = ref()
|
||||||
const pagedata = ref<IPage<material.ApplyDTO>>()
|
const pagedata = ref<IPage<material.ApplyDTO>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const typeVal = ref<string>() // 物料类型选择值
|
const typeVal = ref<string>() // 物料类型选择值
|
||||||
@ -124,8 +124,16 @@
|
|||||||
|
|
||||||
//导出数据
|
//导出数据
|
||||||
const downloadData = () => {
|
const downloadData = () => {
|
||||||
// 调用后端接口下载excel文件
|
// 创建 URLSearchParams 对象
|
||||||
const url = `${http.prefix}/apply/download-excel?applyType=3&type=${typeVal.value}&key=${searchKey.value}`
|
const params = new URLSearchParams()
|
||||||
|
if (typeVal.value) {
|
||||||
|
params.append('type', typeVal.value)
|
||||||
|
}
|
||||||
|
if (searchKey.value) {
|
||||||
|
params.append('key', searchKey.value)
|
||||||
|
}
|
||||||
|
params.append('applyType', '3')
|
||||||
|
const url = `${http.prefix}/apply/download-excel?${params.toString()}`
|
||||||
window.open(url)
|
window.open(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,6 +156,10 @@
|
|||||||
title: '物料编码',
|
title: '物料编码',
|
||||||
dataIndex: 'code',
|
dataIndex: 'code',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '物料型号',
|
||||||
|
dataIndex: 'spec',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '出库类型',
|
title: '出库类型',
|
||||||
dataIndex: 'applyTypeInfo',
|
dataIndex: 'applyTypeInfo',
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user