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 7ee1ca19
authored
Nov 25, 2020
by
xinlaa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
引流码接口对接与功能基本完成
1 parent
59ea6c11
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
76 deletions
linkwe-ui/src/api/common.js
linkwe-ui/src/api/drainageCode/staff.js
linkwe-ui/src/views/drainageCode/staff/detail.vue
linkwe-ui/src/views/drainageCode/staff/list.vue
linkwe-ui/src/api/common.js
View file @
7ee1ca1
...
@@ -9,5 +9,8 @@ import request from '@/utils/request'
...
@@ -9,5 +9,8 @@ import request from '@/utils/request'
}
}
*/
*/
export
function
download
(
url
,
name
)
{
export
function
download
(
url
,
name
)
{
return
`/common/download/url?url=
${
url
}
&name=
${
name
}
`
return
(
process
.
env
.
VUE_APP_BASE_API
+
`/common/download/url?url=
${
url
}
&name=
${
name
}
`
)
}
}
linkwe-ui/src/api/drainageCode/staff.js
View file @
7ee1ca1
...
@@ -134,5 +134,23 @@ export function getQrcode(params) {
...
@@ -134,5 +134,23 @@ export function getQrcode(params) {
* @param {*} 员工活码ids,多个逗号隔开
* @param {*} 员工活码ids,多个逗号隔开
*/
*/
export
function
downloadBatch
(
ids
)
{
export
function
downloadBatch
(
ids
)
{
return
service
+
'/downloadBatch/'
+
ids
return
request
({
url
:
service
+
'/downloadBatch'
,
params
:
{
ids
,
},
})
return
process
.
env
.
VUE_APP_BASE_API
+
service
+
'/downloadBatch/?ids='
+
ids
}
/**
* 成员添加客户统计
* @param {*} params
* userId=成员id&addWay=添加类型,二维码:1&beginTime=开始时间&endTime=结束时间
*/
export
function
getUserAddCustomerStat
(
params
)
{
return
request
({
url
:
service
+
'/getUserAddCustomerStat'
,
params
,
})
}
}
linkwe-ui/src/views/drainageCode/staff/detail.vue
View file @
7ee1ca1
<
script
>
<
script
>
import
{
getDetail
}
from
'@/api/drainageCode/staff'
import
{
getDetail
,
getUserAddCustomerStat
}
from
'@/api/drainageCode/staff'
import
{
download
,
downloadBatch
}
from
'@/api/common'
import
{
download
,
downloadBatch
}
from
'@/api/common'
import
ClipboardJS
from
'clipboard'
import
ClipboardJS
from
'clipboard'
import
echarts
from
'echarts'
import
echarts
from
'echarts'
...
@@ -20,13 +20,11 @@ export default {
...
@@ -20,13 +20,11 @@ export default {
// 表单参数
// 表单参数
form
:
{},
form
:
{},
// 查询参数
// 查询参数
queryParams
:
{
query
:
{
pageNum
:
1
,
userId
:
undefined
,
pageSize
:
10
,
addWay
:
undefined
,
title
:
undefined
,
beginTime
:
undefined
,
operName
:
undefined
,
endTime
:
undefined
,
businessType
:
undefined
,
status
:
undefined
,
},
},
type
:
{
1
:
'单人'
,
2
:
'多人'
,
3
:
'批量单人'
},
type
:
{
1
:
'单人'
,
2
:
'多人'
,
3
:
'批量单人'
},
}
}
...
@@ -48,23 +46,6 @@ export default {
...
@@ -48,23 +46,6 @@ export default {
clipboard
.
on
(
'error'
,
(
e
)
=>
{
clipboard
.
on
(
'error'
,
(
e
)
=>
{
this
.
$message
.
error
(
'链接复制失败'
)
this
.
$message
.
error
(
'链接复制失败'
)
})
})
var
option
=
{
xAxis
:
{
type
:
'category'
,
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
],
},
yAxis
:
{
type
:
'value'
,
},
series
:
[
{
data
:
[
820
,
932
,
901
,
934
,
1290
,
1330
,
1320
],
type
:
'line'
,
},
],
}
var
myChart
=
echarts
.
init
(
this
.
$refs
.
chart
)
myChart
.
setOption
(
option
)
},
},
methods
:
{
methods
:
{
/** 获取详情 */
/** 获取详情 */
...
@@ -73,39 +54,58 @@ export default {
...
@@ -73,39 +54,58 @@ export default {
getDetail
(
id
).
then
(({
data
})
=>
{
getDetail
(
id
).
then
(({
data
})
=>
{
this
.
form
=
data
this
.
form
=
data
this
.
loading
=
false
this
.
loading
=
false
this
.
query
.
userId
=
data
.
weEmpleCodeUseScops
[
0
].
businessId
this
.
query
.
addWay
=
1
this
.
setTime
(
7
)
this
.
getList
()
})
})
},
},
/** */
/** */
getList
()
{
getList
()
{
this
.
query
.
beginTime
=
this
.
dateRange
[
0
]
this
.
query
.
endTime
=
this
.
dateRange
[
1
]
getUserAddCustomerStat
(
this
.
query
).
then
(({
data
})
=>
{
this
.
total
=
data
.
total
this
.
loading
=
false
this
.
loading
=
false
list
(
this
.
addDateRange
(
this
.
queryParams
,
this
.
dateRange
)).
then
(
(
response
)
=>
{
let
option
=
{
this
.
list
=
response
.
rows
xAxis
:
{
this
.
total
=
response
.
total
type
:
'category'
,
this
.
loading
=
false
data
:
data
.
dateList
,
}
)
},
},
/** 删除按钮操作 */
yAxis
:
{
handleDelete
(
row
)
{
type
:
'value'
,
const
operIds
=
row
.
operId
||
this
.
ids
},
this
.
$confirm
(
series
:
[
'是否确认删除日志编号为"'
+
operIds
+
'"的数据项?'
,
'警告'
,
{
{
confirmButtonText
:
'确定'
,
data
:
data
.
statList
,
cancelButtonText
:
'取消'
,
type
:
'line'
,
type
:
'warning'
,
},
],
}
}
)
var
myChart
=
echarts
.
init
(
this
.
$refs
.
chart
)
.
then
(
function
()
{
myChart
.
setOption
(
option
)
return
delOperlog
(
operIds
)
this
.
$nextTick
(()
=>
{})
})
.
then
(()
=>
{
this
.
getList
()
this
.
msgSuccess
(
'删除成功'
)
})
})
.
catch
(
function
()
{})
},
setTime
(
days
)
{
let
date
=
new
Date
()
date
.
setDate
(
date
.
getDate
()
-
days
)
this
.
dateRange
=
[
this
.
getTime
(
date
),
this
.
getTime
()]
},
getHandledValue
(
num
)
{
return
num
<
10
?
'0'
+
num
:
num
},
getTime
(
datePar
)
{
const
d
=
datePar
?
new
Date
(
datePar
)
:
new
Date
()
const
year
=
d
.
getFullYear
()
const
month
=
this
.
getHandledValue
(
d
.
getMonth
()
+
1
)
const
date
=
this
.
getHandledValue
(
d
.
getDate
())
return
year
+
'-'
+
month
+
'-'
+
date
},
download
()
{
window
.
open
(
this
.
form
.
qrCode
)
},
},
},
},
}
}
...
@@ -113,18 +113,17 @@ export default {
...
@@ -113,18 +113,17 @@ export default {
<
template
>
<
template
>
<div
v-loading=
"loading"
>
<div
v-loading=
"loading"
>
<div>
员工活码信息
</div>
<div
class=
"title"
>
员工活码信息
</div>
<div
class=
"flex top"
>
<div
class=
"flex top"
>
<div>
<div
class=
"ac"
>
<el-image
<el-image
:src=
"form.qrCode"
:src=
"form.qrCode"
fit=
"fit"
fit=
"fit"
style=
"width: 100px; height: 100px"
:preview-src-list=
"[form.qrCode]"
style=
"width: 150px; height: 150px"
></el-image>
></el-image>
<div>
<div>
<el-button
type=
"text"
@
click=
"downloadBatch(row.id)"
<el-button
type=
"text"
@
click=
"download()"
>
下载二维码
</el-button>
>
下载二维码
</el-button
>
<el-button
<el-button
type=
"text"
type=
"text"
class=
"copy-btn"
class=
"copy-btn"
...
@@ -136,10 +135,10 @@ export default {
...
@@ -136,10 +135,10 @@ export default {
<el-form
ref=
"form"
label-width=
"100px"
>
<el-form
ref=
"form"
label-width=
"100px"
>
<el-form-item
label=
"使用成员:"
>
<el-form-item
label=
"使用成员:"
>
<el-tag
<el-tag
size=
"
medium
"
size=
"
small
"
v-for=
"(item, index) in form.weEmpleCodeUseScops"
v-for=
"(item, index) in form.weEmpleCodeUseScops"
:key=
"index"
:key=
"index"
>
{{
item
.
userUser
Name
}}
</el-tag
>
{{
item
.
business
Name
}}
</el-tag
>
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"活动场景:"
>
{{
form
.
activityScene
}}
</el-form-item>
<el-form-item
label=
"活动场景:"
>
{{
form
.
activityScene
}}
</el-form-item>
...
@@ -156,7 +155,7 @@ export default {
...
@@ -156,7 +155,7 @@ export default {
<
el
-
form
ref
=
"form"
label
-
width
=
"100px"
>
<
el
-
form
ref
=
"form"
label
-
width
=
"100px"
>
<
el
-
form
-
item
label
=
"扫码标签:"
<
el
-
form
-
item
label
=
"扫码标签:"
><
el
-
tag
><
el
-
tag
size
=
"
medium
"
size
=
"
small
"
v
-
for
=
"(item, index) in form.weEmpleCodeTags"
v
-
for
=
"(item, index) in form.weEmpleCodeTags"
:
key
=
"index"
:
key
=
"index"
>
{{
item
.
tagName
}}
<
/el-ta
g
>
{{
item
.
tagName
}}
<
/el-ta
g
...
@@ -166,26 +165,32 @@ export default {
...
@@ -166,26 +165,32 @@ export default {
<
/el-form
>
<
/el-form
>
<
/div
>
<
/div
>
<
el
-
divider
><
/el-divider
>
<
el
-
divider
><
/el-divider
>
<
div
>
扫码人数
<
/div
>
<
div
class
=
"title"
>
扫码人数
<
/div
>
<
div
>
累计总人数:
0
<
/div
>
<
div
class
=
"mb15"
>
累计总人数:
{{
total
}}
<
/div
>
<
div
>
<
div
>
<
el
-
button
-
group
>
<
el
-
button
-
group
>
<
el
-
button
type
=
"primary"
>
近
7
日
<
/el-button
>
<
el
-
button
size
=
"small"
type
=
"primary"
plain
@
click
=
"setTime(7)"
<
el
-
button
type
=
"primary"
>
近
30
日
<
/el-button
>
>
近
7
日
<
/el-butto
n
>
<
el
-
button
size
=
"small"
type
=
"primary"
plain
@
click
=
"setTime(30)"
>
近
30
日
<
/el-butto
n
>
<
/el-button-group
>
<
/el-button-group
>
<
el
-
date
-
picker
<
el
-
date
-
picker
v
-
model
=
"dateRange"
v
-
model
=
"dateRange"
size
=
"small"
size
=
"small"
style
=
"width: 240px"
class
=
"ml20"
style
=
"width: 260px"
value
-
format
=
"yyyy-MM-dd"
value
-
format
=
"yyyy-MM-dd"
type
=
"daterange"
type
=
"daterange"
range
-
separator
=
"-"
range
-
separator
=
"-"
start
-
placeholder
=
"开始日期"
start
-
placeholder
=
"开始日期"
end
-
placeholder
=
"结束日期"
end
-
placeholder
=
"结束日期"
@
change
=
"getList"
><
/el-date-picker
>
><
/el-date-picker
>
<
/div
>
<
/div
>
<
div
class
=
"chart"
ref
=
"chart"
style
=
"width:
600px
;height:400px;"
><
/div
>
<
div
class
=
"chart"
ref
=
"chart"
style
=
"width:
90%
;height:400px;"
><
/div
>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
...
@@ -193,4 +198,9 @@ export default {
...
@@ -193,4 +198,9 @@ export default {
.
top
{
.
top
{
align
-
items
:
flex
-
start
;
align
-
items
:
flex
-
start
;
}
}
.
title
{
font
-
size
:
16
px
;
font
-
weight
:
600
;
margin
:
0
0
20
px
;
}
<
/style
>
<
/style
>
linkwe-ui/src/views/drainageCode/staff/list.vue
View file @
7ee1ca1
<
script
>
<
script
>
import
{
getList
,
remove
,
batchAdd
}
from
'@/api/drainageCode/staff'
import
{
import
{
download
,
downloadBatch
}
from
'@/api/common'
getList
,
remove
,
batchAdd
,
downloadBatch
,
}
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
{
...
@@ -125,18 +130,18 @@ export default {
...
@@ -125,18 +130,18 @@ export default {
})
})
},
},
/** 下载 */
/** 下载 */
downloadBatch
(
id
)
{
downloadBatch
(
qrCode
)
{
const
ids
=
id
||
this
.
ids
// window.open(download(row.qrCode, row.createBy.split(',')[0] + '.png'))
// window.open(download(row.qrCode, row.createBy.split(',')[0] + '.png'))
id
&&
window
.
open
(
row
.
qrCode
)
qrCode
&&
window
.
open
(
qrCode
)
id
||
qrCode
||
this
.
$confirm
(
'是否确认下载所有图片吗?'
,
'警告'
,
{
this
.
$confirm
(
'是否确认下载所有图片吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
type
:
'warning'
,
})
})
.
then
(
function
()
{
.
then
(()
=>
{
return
window
.
open
(
downloadBatch
(
ids
))
downloadBatch
(
this
.
ids
+
''
)
// window.open(downloadBatch(this.ids))
})
})
.
catch
(
function
()
{})
.
catch
(
function
()
{})
},
},
...
@@ -225,7 +230,7 @@ export default {
...
@@ -225,7 +230,7 @@ export default {
>
批量新建
</el-button
>
批量新建
</el-button
>
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"remove"
>
删除
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"remove"
>
删除
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"downloadBatch"
<el-button
type=
"primary"
size=
"mini"
@
click=
"downloadBatch
()
"
>
批量下载
</el-button
>
批量下载
</el-button
>
>
</div>
</div>
...
@@ -242,6 +247,7 @@ export default {
...
@@ -242,6 +247,7 @@ export default {
<el-image
<el-image
:src=
"row.qrCode"
:src=
"row.qrCode"
fit=
"fit"
fit=
"fit"
:preview-src-list=
"[row.qrCode]"
style=
"width: 100px; height: 100px"
style=
"width: 100px; height: 100px"
></el-image>
></el-image>
</
template
>
</
template
>
...
@@ -281,7 +287,7 @@ export default {
...
@@ -281,7 +287,7 @@ export default {
<
template
slot-scope=
"{ row }"
>
<
template
slot-scope=
"{ row }"
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"downloadBatch(row.
id
)"
@
click=
"downloadBatch(row.
qrCode
)"
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