Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
Details
Activity
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
marketing-web
marketing
Commits
d69efeab
Commit
d69efeab
authored
Aug 30, 2022
by
huaying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 导出数据
parent
c496fa69
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
35 deletions
+7
-35
cardApi.js
src/service/api/cardApi.js
+0
-4
writeOff.js
src/views/card/writeOff.js
+0
-26
writeOffCard.vue
src/views/card/writeOffCard.vue
+4
-3
writeOffStore.vue
src/views/card/writeOffStore.vue
+3
-2
No files found.
src/service/api/cardApi.js
View file @
d69efeab
...
...
@@ -214,10 +214,6 @@ export const getStoreWidgetStore = params => requests('/api-plug/get-store-widge
export
const
importCostStore
=
params
=>
requests
(
'/api-marketing/import-cost-store'
,
params
,
true
);
//卡券核销列表
export
const
getCardLogPage
=
params
=>
requests
(
PREFIX
+
'card-write-off-log-page'
,
params
);
//核销记录导出
export
const
exportCardLog
=
params
=>
requests
(
PREFIX
+
'export-card-write-off-log'
,
params
);
//核销记录导出(门店)
export
const
exportStoreLog
=
params
=>
requests
(
PREFIX
+
'export-card-write-off-store'
,
params
);
//核销数据 (门店)列表
export
const
getCardStorePage
=
params
=>
requests
(
PREFIX
+
'card-write-off-store-page'
,
params
);
//核销数据 (门店)--明细列表
...
...
src/views/card/writeOff.js
View file @
d69efeab
import
{
exportStoreLog
}
from
'@/service/api/cardApi.js'
;
import
{
formatDateTimeByType
}
from
'@/utils/index.js'
;
export
default
{
data
()
{
...
...
@@ -105,31 +104,6 @@ export default {
this
.
params
.
writeOffBeginTime
=
''
;
this
.
params
.
writeOffEndTime
=
''
;
}
},
exportStoreResult
()
{
const
paras
=
{
search
:
this
.
params
.
search
,
writeOffBeginTime
:
this
.
params
.
writeOffBeginTime
,
writeOffEndTime
:
this
.
params
.
writeOffEndTime
,
sortBy
:
this
.
params
.
sortBy
,
dataType
:
0
};
exportStoreLog
(
paras
).
then
(
res
=>
{
if
(
res
.
result
.
errorCode
==
'0'
)
{
let
blob
=
new
Blob
([
res
.
data
],
{
type
:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
});
// 3.创建一个临时的url指向blob对象
let
objectUrl
=
window
.
URL
.
createObjectURL
(
blob
);
// 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
let
a
=
document
.
createElement
(
'a'
);
a
.
setAttribute
(
'href'
,
objectUrl
);
a
.
setAttribute
(
'download'
,
`卡券核销数据-
${
new
Date
().
toLocaleDateString
()}
`
);
a
.
click
();
// 5.释放这个临时的对象url
window
.
URL
.
revokeObjectURL
(
objectUrl
);
}
});
}
}
};
src/views/card/writeOffCard.vue
View file @
d69efeab
...
...
@@ -56,7 +56,7 @@
</template>
<
script
>
import
{
getCardLogPage
,
exportCardLog
}
from
'@/service/api/cardApi.js'
;
import
{
getCardLogPage
}
from
'@/service/api/cardApi.js'
;
import
writeOff
from
'./writeOff'
;
export
default
{
name
:
'writeOffCard'
,
...
...
@@ -98,10 +98,11 @@ export default {
this
.
loading
=
false
;
});
},
// 导出数据
exportResult
()
{
this
.
dialogVisible
=
true
;
this
.
excelUrl
=
exportCardLog
;
this
.
params
=
{
this
.
excelUrl
=
'/api-marketing/export-card-write-off-log'
;
this
.
params
ex
=
{
search
:
this
.
params
.
search
,
writeOffBeginTime
:
this
.
params
.
writeOffBeginTime
,
writeOffEndTime
:
this
.
params
.
writeOffEndTime
,
...
...
src/views/card/writeOffStore.vue
View file @
d69efeab
...
...
@@ -29,7 +29,7 @@
</template>
<
script
>
import
{
getCardStorePage
,
exportStoreLog
}
from
'@/service/api/cardApi.js'
;
import
{
getCardStorePage
}
from
'@/service/api/cardApi.js'
;
import
writeOff
from
'./writeOff'
;
export
default
{
name
:
'writeOffCard'
,
...
...
@@ -75,9 +75,10 @@ export default {
details
(
row
)
{
this
.
$router
.
push
(
`/card/storeDetails?id=
${
row
.
storeId
}
`
);
},
// 导出数据
exportResult
()
{
this
.
dialogVisible
=
true
;
this
.
excelUrl
=
exportStoreLog
;
this
.
excelUrl
=
'api-marketing/export-card-write-off-store'
;
this
.
params
=
{
search
:
this
.
params
.
search
,
writeOffBeginTime
:
this
.
params
.
writeOffBeginTime
,
...
...
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