Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-operator-master
Commits
55202e4a
Commit
55202e4a
authored
Aug 27, 2023
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单导出改异步下载
parent
77558614
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
34 deletions
+50
-34
order.js
src/api/ecw/order.js
+0
-11
download.js
src/api/system/download.js
+13
-0
dict.js
src/utils/dict.js
+2
-0
index.vue
src/views/ecw/order/index.vue
+2
-1
index.vue
src/views/system/download/index.vue
+33
-22
No files found.
src/api/ecw/order.js
View file @
55202e4a
...
...
@@ -632,7 +632,6 @@ export function orderExportSearch(params){
url
:
'
/ecw/order/export/search
'
,
method
:
'
GET
'
,
timeout
:
5
*
60000
,
responseType
:
'
arraybuffer
'
,
params
})
}
...
...
@@ -641,7 +640,6 @@ export function orderExportSearch(params){
export
function
orderExportMySearch
(
params
){
return
request
({
url
:
'
/ecw/order/export/my/search
'
,
responseType
:
'
arraybuffer
'
,
method
:
'
GET
'
,
timeout
:
5
*
60000
,
params
...
...
@@ -653,7 +651,6 @@ export function orderExportDeptSearch(params){
return
request
({
url
:
'
/ecw/order/export/dept/search
'
,
method
:
'
GET
'
,
responseType
:
'
arraybuffer
'
,
timeout
:
5
*
60000
,
params
})
...
...
@@ -666,7 +663,6 @@ export function exportAbnormal(params){
method
:
'
get
'
,
params
:
params
,
timeout
:
5
*
60000
,
responseType
:
'
blob
'
})
}
...
...
@@ -678,7 +674,6 @@ export function exportHeavyOrder(params){
method
:
'
get
'
,
params
:
params
,
timeout
:
5
*
60000
,
responseType
:
'
blob
'
})
}
...
...
@@ -689,7 +684,6 @@ export function exportReturnOrder(params){
method
:
'
get
'
,
params
:
params
,
timeout
:
5
*
60000
,
responseType
:
'
blob
'
})
}
...
...
@@ -700,7 +694,6 @@ export function exportSaleRepay(params){
method
:
'
get
'
,
params
:
params
,
timeout
:
5
*
60000
,
responseType
:
'
blob
'
})
}
...
...
@@ -712,7 +705,6 @@ export function exportCustomsDatas(params){
method
:
'
get
'
,
params
:
params
,
timeout
:
5
*
60000
,
responseType
:
'
blob
'
})
}
...
...
@@ -724,7 +716,6 @@ export function exportShippingDatas(params){
method
:
'
get
'
,
params
:
params
,
timeout
:
5
*
60000
,
responseType
:
'
blob
'
})
}
...
...
@@ -736,7 +727,6 @@ export function exportShipFee(params){
method
:
'
get
'
,
params
:
params
,
timeout
:
5
*
60000
,
responseType
:
'
blob
'
})
}
...
...
@@ -748,7 +738,6 @@ export function exportUnload(params){
method
:
'
get
'
,
params
:
params
,
timeout
:
5
*
60000
,
responseType
:
'
blob
'
})
}
...
...
src/api/system/download.js
View file @
55202e4a
import
request
from
'
@/utils/request
'
import
axios
from
"
axios
"
;
// 下载日志分页
export
function
downloadPage
(
params
)
{
...
...
@@ -8,3 +9,15 @@ export function downloadPage(params) {
params
})
}
// 下载
export
function
download
(
id
){
return
request
({
url
:
'
system/download-log/down/
'
+
id
})
}
// 获取文件二进制
export
function
downloadFileResponse
(
url
){
return
axios
.
get
(
url
)
}
src/utils/dict.js
View file @
55202e4a
...
...
@@ -123,6 +123,8 @@ export const DICT_TYPE = {
STOCK_UP_EXCEPTION_TYPE
:
'
stock_up_exception_type
'
,
// 备货异常类型,
ORDER_ITEM_PACK_STATUS
:
'
order_item_pack_status
'
,
// 空运备货打包状态
RECEIPT_FEE_TYPE
:
'
receipt_fee_type
'
,
DOWNLOAD_LOG_STATUS
:
'
download_log_status
'
,
// 下载日志状态
DOWNLOAD_TYPE
:
'
download_type
'
,
// 下载类型
//--------ecw---------
CUSTOMER_STATUS
:
'
customer_status
'
,
CUSTOMER_SOURCE
:
'
customer_source
'
,
...
...
src/views/ecw/order/index.vue
View file @
55202e4a
...
...
@@ -792,7 +792,8 @@ export default {
if
(
!
fileName
){
fileName
=
this
.
$t
(
'
订单
'
)
}
this
.
$download
.
excel
(
res
,
fileName
+
'
.xls
'
);
this
.
$message
.
success
(
this
.
$t
(
'
已加入导出队列,请稍后在下载日志中下载
'
))
// this.$download.excel(res, fileName + '.xls');
}).
finally
(()
=>
{
this
.
exportLoading
=
false
})
...
...
src/views/system/download/index.vue
View file @
55202e4a
<
template
>
<div
class=
"app-container"
>
<div
class=
"mb-10"
>
<div
class=
"mb-10 flex items-center"
>
<div
class=
"flex-1"
>
<h2
class=
"page-title mb-5"
>
下载队列
</h2>
<div>
*
{{
$t
(
'
文件生成成功后,保留12小时,12小时后自动删除
'
)
}}
</div>
</div>
<el-button
class=
""
@
click=
"handleQuery"
type=
"primary"
>
刷新
</el-button>
</div>
<!--el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item
:label=
"$t('文件名称')"
prop=
"fileName"
>
<el-input
v-model=
"queryParams.fileName"
:placeholder=
"$t('请输入文件名称')"
clearable
@
keyup.enter.native=
"handleQuery"
/>
...
...
@@ -16,9 +19,13 @@
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
:label=
"$t('下载编号')"
align=
"center"
prop=
"id"
width=
"100"
/>
<el-table-column
:label=
"$t('分类')"
align=
"center"
prop=
"type"
:show-overflow-tooltip=
"true"
/>
<el-table-column
:label=
"$t('分类')"
align=
"center"
prop=
"type"
width=
"100"
>
<template
v-slot:default=
"
{row}">
<dict-tag
:type=
"DICT_TYPE.DOWNLOAD_TYPE"
:value=
"row.type"
/>
</
template
>
</el-table-column>
<!--<el-table-column :label="$t('业务编号')" align="center" prop="type" width="100" /-->
<el-table-column
:label=
"$t('下载内容')"
align=
"center"
prop=
"
fileName"
width=
"100
"
/>
<el-table-column
:label=
"$t('下载内容')"
align=
"center"
prop=
"
name
"
/>
<el-table-column
:label=
"$t('开始下载时间')"
align=
"center"
prop=
"createTime"
width=
"150"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
...
...
@@ -26,10 +33,13 @@
</el-table-column>
<el-table-column
:label=
"$t('下载状态')"
align=
"center"
prop=
"createBy"
width=
"150"
>
<
template
v-slot:default=
"{row}"
>
{{
statusMap
[
row
.
status
]
}}
<!--status ==2 表示已处理,配合downNum来判断是否已下载-->
<template
v-if=
"row.status == 2 && row.downNum > 0"
>
{{
$t
(
'
已下载
'
)
}}
</
template
>
<
template
v-else-if=
"row.status == 2"
>
{{
$t
(
'
待下载
'
)
}}
</
template
>
<dict-tag
v-else
:type=
"DICT_TYPE.DOWNLOAD_LOG_STATUS"
:value=
"row.status"
/>
</template>
</el-table-column>
<el-table-column
:label=
"$t('操作')"
align=
"center"
class-name=
"small-padding fixed-width"
width=
"
2
00"
>
<el-table-column
:label=
"$t('操作')"
align=
"center"
class-name=
"small-padding fixed-width"
width=
"
1
00"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleDownload(scope.row)"
v-hasPermi=
"['system:notice:update']"
>
{{
$t
(
'
下载
'
)
}}
</el-button>
...
...
@@ -44,7 +54,7 @@
</template>
<
script
>
import
{
downloadPage
}
from
"
@/api/system/download
"
;
import
{
download
,
downloadFileArrayBuffer
,
downloadFileResponse
,
download
Page
}
from
"
@/api/system/download
"
;
import
{
parseTime
}
from
"
../../../utils/ruoyi
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
...
...
@@ -61,12 +71,6 @@ export default {
queryParams
:
{
pageNo
:
1
,
pageSize
:
10
},
statusMap
:
{
0
:
"
待处理
"
,
1
:
"
处理中
"
,
2
:
"
处理成功
"
,
3
:
"
处理失败
"
}
};
},
...
...
@@ -76,13 +80,20 @@ export default {
methods
:
{
parseTime
,
handleDownload
(
row
){
console
.
log
(
'
下载
'
,
row
)
const
loading
=
this
.
$loading
()
download
(
row
.
id
).
then
(
res
=>
{
return
downloadFileResponse
(
res
.
data
)
}).
then
(
res
=>
{
this
.
$download
.
download0
(
res
.
data
,
row
.
name
+
row
.
fileSuffix
,
res
.
headers
[
'
content-type
'
])
}).
finally
(()
=>
{
loading
.
close
()
})
},
/** 查询公告列表 */
getList
()
{
this
.
loading
=
true
;
downloadPage
(
this
.
queryParams
).
then
(
response
=>
{
this
.
noticeL
ist
=
response
.
data
.
list
;
this
.
l
ist
=
response
.
data
.
list
;
this
.
total
=
response
.
data
.
total
;
this
.
loading
=
false
;
}).
finally
(()
=>
{
...
...
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