Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e4556811
authored
Nov 26, 2020
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
员工活码下载
1 parent
fbe5170a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
9 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeEmpleCodeController.java
linkwe-ui/src/api/drainageCode/staff.js
linkwe-ui/src/views/drainageCode/staff/detail.vue
linkwe-ui/src/views/drainageCode/staff/list.vue
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeEmpleCodeController.java
View file @
e455681
...
@@ -189,6 +189,22 @@ public class WeEmpleCodeController extends BaseController {
...
@@ -189,6 +189,22 @@ public class WeEmpleCodeController extends BaseController {
}
}
}
}
@PreAuthorize
(
"@ss.hasPermi('wecom:code:download')"
)
@Log
(
title
=
"员工活码下载"
,
businessType
=
BusinessType
.
OTHER
)
@GetMapping
(
"/download"
)
public
void
download
(
String
id
,
HttpServletRequest
request
,
HttpServletResponse
response
){
WeEmpleCode
weEmpleCode
=
weEmpleCodeService
.
selectWeEmpleCodeById
(
Long
.
valueOf
(
id
));
if
(
StringUtils
.
isEmpty
(
weEmpleCode
.
getQrCode
())){
return
;
}
else
{
try
{
FileUtils
.
downloadFile
(
weEmpleCode
.
getQrCode
(),
response
.
getOutputStream
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
/**
/**
* 成员添加客户统计
* 成员添加客户统计
...
...
linkwe-ui/src/api/drainageCode/staff.js
View file @
e455681
...
@@ -141,7 +141,16 @@ export function downloadBatch(ids) {
...
@@ -141,7 +141,16 @@ export function downloadBatch(ids) {
},
},
responseType
:
'blob'
responseType
:
'blob'
})
})
//return process.env.VUE_APP_BASE_API + service + '/downloadBatch/?ids=' + ids
}
export
function
download
(
id
)
{
return
request
({
url
:
service
+
'/download'
,
params
:
{
id
,
},
responseType
:
'blob'
})
}
}
/**
/**
...
...
linkwe-ui/src/views/drainageCode/staff/detail.vue
View file @
e455681
<
script
>
<
script
>
import
{
getDetail
,
getUserAddCustomerStat
}
from
'@/api/drainageCode/staff'
import
{
getDetail
,
getUserAddCustomerStat
,
download
}
from
'@/api/drainageCode/staff'
import
{
download
,
downloadBatch
}
from
'@/api/common'
import
ClipboardJS
from
'clipboard'
import
ClipboardJS
from
'clipboard'
import
echarts
from
'echarts'
import
echarts
from
'echarts'
export
default
{
export
default
{
...
@@ -105,7 +104,22 @@ export default {
...
@@ -105,7 +104,22 @@ export default {
return
year
+
'-'
+
month
+
'-'
+
date
return
year
+
'-'
+
month
+
'-'
+
date
},
},
download
()
{
download
()
{
window
.
open
(
this
.
form
.
qrCode
)
let
userName
=
""
;
this
.
form
.
weEmpleCodeUseScops
.
forEach
((
item
)
=>
{
userName
+=
item
.
businessName
+
","
;
})
let
name
=
userName
.
substr
(
0
,
userName
.
length
-
1
)
+
"-"
+
this
.
form
.
activityScene
+
".png"
download
(
this
.
form
.
id
).
then
((
res
)
=>
{
if
(
res
!=
null
)
{
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
});
let
url
=
window
.
URL
.
createObjectURL
(
blob
);
const
link
=
document
.
createElement
(
'a'
);
// 创建a标签
link
.
href
=
url
;
link
.
download
=
name
;
// 重命名文件
link
.
click
();
URL
.
revokeObjectURL
(
url
);
// 释放内存
}
})
},
},
},
},
}
}
...
...
linkwe-ui/src/views/drainageCode/staff/list.vue
View file @
e455681
...
@@ -4,8 +4,8 @@ import {
...
@@ -4,8 +4,8 @@ import {
remove
,
remove
,
batchAdd
,
batchAdd
,
downloadBatch
,
downloadBatch
,
download
,
}
from
'@/api/drainageCode/staff'
}
from
'@/api/drainageCode/staff'
import
{
download
}
from
'@/api/common'
import
SelectUser
from
'@/components/SelectUser'
import
SelectUser
from
'@/components/SelectUser'
import
ClipboardJS
from
'clipboard'
import
ClipboardJS
from
'clipboard'
export
default
{
export
default
{
...
@@ -129,11 +129,22 @@ export default {
...
@@ -129,11 +129,22 @@ export default {
this
.
getList
(
1
)
this
.
getList
(
1
)
})
})
},
},
download
(
id
,
userName
,
activityScene
){
let
name
=
userName
+
"-"
+
activityScene
+
".png"
download
(
id
).
then
((
res
)
=>
{
if
(
res
!=
null
)
{
let
blob
=
new
Blob
([
res
],
{
type
:
'application/zip'
});
let
url
=
window
.
URL
.
createObjectURL
(
blob
);
const
link
=
document
.
createElement
(
'a'
);
// 创建a标签
link
.
href
=
url
;
link
.
download
=
name
;
// 重命名文件
link
.
click
();
URL
.
revokeObjectURL
(
url
);
// 释放内存
}
})
},
/** 下载 */
/** 下载 */
downloadBatch
(
qrCode
)
{
downloadBatch
(
qrCode
)
{
// window.open(download(row.qrCode, row.createBy.split(',')[0] + '.png'))
qrCode
&&
window
.
open
(
qrCode
)
qrCode
||
this
.
$confirm
(
'是否确认下载所有图片吗?'
,
'警告'
,
{
this
.
$confirm
(
'是否确认下载所有图片吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
...
@@ -296,7 +307,7 @@ export default {
...
@@ -296,7 +307,7 @@ export default {
<
template
slot-scope=
"{ row }"
>
<
template
slot-scope=
"{ row }"
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"download
Batch(row.qrCod
e)"
@
click=
"download
(row.id,row.useUserName,row.activityScen
e)"
v-hasPermi=
"['monitor:operlog:query']"
v-hasPermi=
"['monitor:operlog:query']"
>
下载
</el-button
>
下载
</el-button
>
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment