Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡宝山
template_vue
Commits
7422b763
Commit
7422b763
authored
Mar 06, 2024
by
YuY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备入库功能练习
parent
872e65f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
magnagement.js
src/api/magnagement.js
+1
-1
index.vue
src/views/equipment/inventoryManagement/index.vue
+13
-13
No files found.
src/api/magnagement.js
View file @
7422b763
...
@@ -30,7 +30,7 @@ export function updatadevice_t(data) {
...
@@ -30,7 +30,7 @@ export function updatadevice_t(data) {
/* 导出库存信息*/
/* 导出库存信息*/
export
function
exportWarehouse
(
query
)
{
export
function
exportWarehouse
(
query
)
{
return
request
({
return
request
({
// url: '/system/user
/export',
url
:
'/wbwarehouse-test
/export'
,
method
:
'get'
,
method
:
'get'
,
params
:
query
,
params
:
query
,
responseType
:
'blob'
responseType
:
'blob'
...
...
src/views/equipment/inventoryManagement/index.vue
View file @
7422b763
...
@@ -229,7 +229,7 @@
...
@@ -229,7 +229,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
listdevice_t
,
getDetailById_t
,
updatadevice_t
}
from
'@/api/magnagement'
import
{
listdevice_t
,
getDetailById_t
,
updatadevice_t
,
exportWarehouse
}
from
'@/api/magnagement'
import
{
resetForm
}
from
'@/utils/common'
import
{
resetForm
}
from
'@/utils/common'
import
{
getToken
}
from
'@/utils/auth'
import
{
getToken
}
from
'@/utils/auth'
...
@@ -421,18 +421,18 @@ export default {
...
@@ -421,18 +421,18 @@ export default {
type
:
'warning'
type
:
'warning'
}).
then
(
function
()
{
}).
then
(
function
()
{
console
.
log
(
'导出'
,
queryParams
)
console
.
log
(
'导出'
,
queryParams
)
// return exportUser
(queryParams).then(response => {
return
exportWarehouse
(
queryParams
).
then
(
response
=>
{
//
const blob = new Blob([response])
const
blob
=
new
Blob
([
response
])
//
const downloadElement = document.createElement('a')
const
downloadElement
=
document
.
createElement
(
'a'
)
//
const href = window.URL.createObjectURL(blob)// 创建下载的链接
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
//
downloadElement.href = href
downloadElement
.
href
=
href
// downloadElement.download = '用户
信息' + '.xls' // 下载后文件名
downloadElement
.
download
=
'库存
信息'
+
'.xls'
// 下载后文件名
//
document.body.appendChild(downloadElement)
document
.
body
.
appendChild
(
downloadElement
)
//
downloadElement.click()// 点击下载
downloadElement
.
click
()
// 点击下载
//
document.body.removeChild(downloadElement)// 下载完成移除元素
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
//
window.URL.revokeObjectURL(href)// 释放掉blob对象
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
//
// this.download(response.msg);
// this.download(response.msg);
//
})
})
})
})
},
},
/** 导入按钮操作 */
/** 导入按钮操作 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment