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 538422fc
authored
Nov 23, 2020
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
c326db0c
59ea6c11
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
320 additions
and
350 deletions
linkwe-ui/src/api/common.js
linkwe-ui/src/api/drainageCode/staff.js
linkwe-ui/src/assets/image/user-code-example.jpg
linkwe-ui/src/components/SelectMaterial/index.vue
linkwe-ui/src/components/SelectMaterial/list.vue
linkwe-ui/src/components/SelectUser.vue
linkwe-ui/src/views/drainageCode/staff/add.vue
linkwe-ui/src/views/drainageCode/staff/detail.vue
linkwe-ui/src/views/drainageCode/staff/list.vue
linkwe-ui/src/api/common.js
View file @
538422f
...
@@ -8,9 +8,6 @@ import request from '@/utils/request'
...
@@ -8,9 +8,6 @@ import request from '@/utils/request'
name=文件名称,带后缀
name=文件名称,带后缀
}
}
*/
*/
export
function
download
(
params
)
{
export
function
download
(
url
,
name
)
{
return
request
({
return
`/common/download/url?url=
${
url
}
&name=
${
name
}
`
url
:
'/common/download/url'
,
params
,
})
}
}
linkwe-ui/src/api/drainageCode/staff.js
View file @
538422f
...
@@ -128,3 +128,11 @@ export function getQrcode(params) {
...
@@ -128,3 +128,11 @@ export function getQrcode(params) {
params
,
params
,
})
})
}
}
/**
* 员工活码批量下载
* @param {*} 员工活码ids,多个逗号隔开
*/
export
function
downloadBatch
(
ids
)
{
return
service
+
'/downloadBatch/'
+
ids
}
linkwe-ui/src/assets/image/user-code-example.jpg
0 → 100644
View file @
538422f
4.29 KB
linkwe-ui/src/components/SelectMaterial/index.vue
View file @
538422f
...
@@ -27,8 +27,9 @@ export default {
...
@@ -27,8 +27,9 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
text
:
''
,
text
:
{},
image
:
''
,
image
:
{},
file
:
{},
}
}
},
},
watch
:
{},
watch
:
{},
...
...
linkwe-ui/src/components/SelectMaterial/list.vue
View file @
538422f
...
@@ -112,18 +112,28 @@ export default {
...
@@ -112,18 +112,28 @@ export default {
<!--
<slot
:list=
"list"
></slot>
-->
<!--
<slot
:list=
"list"
></slot>
-->
<!-- 文本 -->
<!-- 文本 -->
<el-table
v-if=
"type == 4"
:data=
"list"
:show-header=
"false"
>
<el-table
v-if=
"type == 4"
v-loading=
"loading"
:data=
"list"
:show-header=
"false"
>
<el-table-column
width=
"30"
>
<el-table-column
width=
"30"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-radio
v-model=
"radio"
:label=
"scope.row
.id
"
>
'
</el-radio>
<el-radio
v-model=
"radio"
:label=
"scope.row"
>
'
</el-radio>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"content"
>
</el-table-column>
<el-table-column
prop=
"content"
>
</el-table-column>
</el-table>
</el-table>
<!-- 图片 -->
<!-- 图片 -->
<el-radio-group
v-if=
"type == 0"
class=
"img-wrap"
v-model=
"radio"
>
<el-radio-group
<el-radio
v-for=
"(item, index) in list"
:label=
"item.id"
:key=
"index"
>
v-if=
"type == 0"
v-loading=
"loading"
class=
"img-wrap"
v-model=
"radio"
>
<el-radio
v-for=
"(item, index) in list"
:label=
"item"
:key=
"index"
>
<img
class=
"img-li"
:src=
"item.materialUrl"
alt
/>
<img
class=
"img-li"
:src=
"item.materialUrl"
alt
/>
<div
class=
"ac mt5"
>
{{ item.materialName }}
</div>
<div
class=
"ac mt5"
>
{{ item.materialName }}
</div>
</el-radio>
</el-radio>
...
...
linkwe-ui/src/components/SelectUser.vue
View file @
538422f
...
@@ -84,11 +84,10 @@ export default {
...
@@ -84,11 +84,10 @@ export default {
},
},
// 选择变化
// 选择变化
handleCheckChange
(
data
,
checked
,
indeterminate
)
{
handleCheckChange
(
data
,
checked
,
indeterminate
)
{
debugger
if
(
checked
)
{
if
(
checked
)
{
if
(
this
.
isSigleSelect
)
{
if
(
this
.
isSigleSelect
)
{
// 单选
清空
// 单选
情况
let
userList
=
[]
this
.
$refs
.
tree
.
setCheckedKeys
([
data
.
key
])
}
}
this
.
userList
.
push
(
data
)
this
.
userList
.
push
(
data
)
}
else
{
}
else
{
...
...
linkwe-ui/src/views/drainageCode/staff/add.vue
View file @
538422f
<
script
>
<
script
>
import
{
getDetail
,
add
,
update
}
from
'@/api/drainageCode/staff'
import
{
getDetail
,
add
,
update
,
getQrcode
}
from
'@/api/drainageCode/staff'
import
{
getList
}
from
'@/api/drainageCode/welcome'
import
{
getList
}
from
'@/api/drainageCode/welcome'
import
PhoneDialog
from
'@/components/PhoneDialog'
import
PhoneDialog
from
'@/components/PhoneDialog'
import
SelectUser
from
'@/components/SelectUser'
import
SelectUser
from
'@/components/SelectUser'
...
@@ -18,29 +18,62 @@ export default {
...
@@ -18,29 +18,62 @@ export default {
// 表单参数
// 表单参数
form
:
{
form
:
{
codeType
:
1
,
codeType
:
1
,
qrcode
:
''
,
isJoinConfirmFriends
:
0
,
isJoinConfirmFriends
:
0
,
weEmpleCodeTags
:
[],
weEmpleCodeTags
:
[],
weEmpleCodeUseScops
:
[],
weEmpleCodeUseScops
:
[],
},
},
materialSelected
:
''
,
welQuery
:
{
welcomeMsg
:
''
},
welQuery
:
{
welcomeMsg
:
''
},
welLoading
:
false
,
welLoading
:
false
,
welList
:
[],
welList
:
[],
welSelected
:
{},
welSelected
:
{},
type
:
{
1
:
'单人'
,
2
:
'多人'
,
3
:
'批量单人'
},
}
}
},
},
created
()
{
created
()
{
let
id
=
this
.
$route
.
query
.
id
let
id
=
this
.
$route
.
query
.
id
id
&&
this
.
getD
ata
(
id
)
id
&&
this
.
getD
etail
(
id
)
},
},
methods
:
{
methods
:
{
selectedUser
(
data
)
{
/** 获取详情 */
this
.
form
.
weEmpleCodeUseScops
=
data
.
map
((
d
)
=>
{
getDetail
(
id
)
{
this
.
loading
=
true
getDetail
(
id
).
then
(({
data
})
=>
{
this
.
form
=
data
this
.
loading
=
false
})
},
/** 获取欢迎语列表 */
getWelList
()
{
this
.
welLoading
=
true
getList
(
this
.
welQuery
).
then
(({
rows
})
=>
{
this
.
welList
=
rows
this
.
$refs
.
table
.
$forceUpdate
()
this
.
welLoading
=
false
})
},
codeTypeChange
()
{
this
.
form
.
weEmpleCodeUseScops
=
[]
this
.
form
.
qrcode
=
''
},
// 选择人员变化事件
selectedUser
(
users
)
{
let
params
=
{
userIds
:
[],
departmentIds
:
[]
}
this
.
form
.
weEmpleCodeUseScops
=
users
.
map
((
d
)
=>
{
d
.
userId
&&
params
.
userIds
.
push
(
d
.
userId
)
d
.
id
&&
params
.
departmentIds
.
push
(
d
.
id
)
return
{
return
{
businessId
:
d
.
id
||
d
.
userId
,
businessId
:
d
.
id
||
d
.
userId
,
businessName
:
d
.
name
,
businessName
:
d
.
name
,
businessIdType
:
d
.
userId
?
2
:
1
,
businessIdType
:
d
.
userId
?
2
:
1
,
}
}
})
})
params
.
userIds
+=
''
params
.
departmentIds
+=
''
getQrcode
(
params
).
then
(({
data
})
=>
{
this
.
form
.
qrcode
=
data
.
qr_code
})
},
},
submitSelectTag
(
data
)
{
submitSelectTag
(
data
)
{
this
.
form
.
weEmpleCodeTags
=
data
.
map
((
d
)
=>
({
this
.
form
.
weEmpleCodeTags
=
data
.
map
((
d
)
=>
({
...
@@ -49,22 +82,14 @@ export default {
...
@@ -49,22 +82,14 @@ export default {
}))
}))
},
},
// 选择素材确认按钮
// 选择素材确认按钮
submitSelectMaterial
(
text
,
image
,
file
)
{},
submitSelectMaterial
(
text
,
image
,
file
)
{
/** 获取详情 */
this
.
form
.
mediaId
=
image
.
id
getData
(
id
)
{
this
.
materialSelected
=
image
.
materialUrl
this
.
loading
=
true
this
.
dialogVisibleSelectMaterial
=
false
getDetail
(
id
).
then
(({
data
})
=>
{
this
.
form
=
data
this
.
loading
=
false
})
},
},
/** 获取欢迎语列表 */
removeMaterial
()
{
getWelList
()
{
this
.
form
.
mediaId
=
''
this
.
welLoading
=
true
this
.
materialSelected
=
''
getList
(
this
.
welQuery
).
then
(({
rows
})
=>
{
this
.
welList
=
rows
this
.
welLoading
=
false
})
},
},
// 欢迎语确认按钮
// 欢迎语确认按钮
selectWelcome
()
{
selectWelcome
()
{
...
@@ -75,6 +100,7 @@ export default {
...
@@ -75,6 +100,7 @@ export default {
submit
()
{
submit
()
{
this
.
loading
=
true
this
.
loading
=
true
add
(
this
.
form
).
then
(({
data
})
=>
{
add
(
this
.
form
).
then
(({
data
})
=>
{
this
.
msgSuccess
(
'操作成功'
)
this
.
loading
=
false
this
.
loading
=
false
this
.
$router
.
back
()
this
.
$router
.
back
()
})
})
...
@@ -86,15 +112,19 @@ export default {
...
@@ -86,15 +112,19 @@ export default {
<div
class=
"wrap"
v-loading=
"loading"
>
<div
class=
"wrap"
v-loading=
"loading"
>
<el-form
:model=
"form"
ref=
"form"
label-width=
"100px"
>
<el-form
:model=
"form"
ref=
"form"
label-width=
"100px"
>
<el-form-item
label=
"类型"
prop=
"codeType"
>
<el-form-item
label=
"类型"
prop=
"codeType"
>
<el-radio-group
v-model=
"form.codeType"
>
<el-radio-group
v-model=
"form.codeType"
@
change=
"codeTypeChange"
>
<el-radio
:label=
"1"
>
单人
</el-radio>
<el-radio
<el-radio
:label=
"2"
>
多人
</el-radio>
v-for=
"(value, key, index) in type"
<el-radio
:label=
"3"
>
批量
</el-radio>
:key=
"index"
:label=
"+key"
>
{{
value
}}
</el-radio
>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item
label=
"使用员工"
>
<el-form-item
label=
"使用员工"
>
<!-- closable -->
<el-tag
<el-tag
closable
size=
"medium"
v-for=
"(item, index) in form.weEmpleCodeUseScops"
v-for=
"(item, index) in form.weEmpleCodeUseScops"
:key=
"index"
:key=
"index"
>
{{
item
.
businessName
}}
</el-tag
>
{{
item
.
businessName
}}
</el-tag
...
@@ -102,6 +132,7 @@ export default {
...
@@ -102,6 +132,7 @@ export default {
<el-button
<el-button
type=
"primary"
type=
"primary"
plain
plain
class=
"ml10"
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
@
click=
"dialogVisibleSelectUser = true"
@
click=
"dialogVisibleSelectUser = true"
...
@@ -126,14 +157,16 @@ export default {
...
@@ -126,14 +157,16 @@ export default {
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"扫码标签"
prop=
"weEmpleCodeTags"
>
<el-form-item
label=
"扫码标签"
prop=
"weEmpleCodeTags"
>
<!-- closable -->
<el-tag
<el-tag
closable
size=
"medium"
v-for=
"(item, index) in form.weEmpleCodeTags"
v-for=
"(item, index) in form.weEmpleCodeTags"
:key=
"index"
:key=
"index"
>
{{
item
.
tagName
}}
</el-tag
>
{{
item
.
tagName
}}
</el-tag
>
>
<el-button
<el-button
type=
"primary"
type=
"primary"
class=
"ml10"
plain
plain
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
...
@@ -170,7 +203,17 @@ export default {
...
@@ -170,7 +203,17 @@ export default {
>
添加图片
</el-button
>
添加图片
</el-button
>
>
</el-popover>
-->
</el-popover>
-->
<el-image
v-if=
"materialSelected"
style=
"width: 100px; height: 100px"
:src=
"materialSelected"
:fit=
"fit"
@
click=
"dialogVisibleSelectMaterial = true"
>
<i
class=
"el-icon-error"
@
click=
"removeMaterial"
></i>
</el-image>
<el-button
<el-button
v-else
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
@
click=
"dialogVisibleSelectMaterial = true"
@
click=
"dialogVisibleSelectMaterial = true"
...
@@ -197,7 +240,7 @@ export default {
...
@@ -197,7 +240,7 @@ export default {
<div
class=
"preview-wrap"
>
<div
class=
"preview-wrap"
>
<el-image
<el-image
style=
"width: 180px; height: 180px"
style=
"width: 180px; height: 180px"
src=
"@/assets/image/profile.jpg
"
:src=
"form.qrcode || require('@/assets/image/user-code-example.jpg')
"
fit=
"fit"
fit=
"fit"
></el-image>
></el-image>
<div
class=
"tip mb20"
>
二维码预览
</div>
<div
class=
"tip mb20"
>
二维码预览
</div>
...
@@ -209,8 +252,9 @@ export default {
...
@@ -209,8 +252,9 @@ export default {
<div>
设置:备注和描述
</div>
<div>
设置:备注和描述
</div>
<div>
<div>
标签:
标签:
<el-tag>
试用版1重要(1w以上)
</el-tag>
<el-tag
v-for=
"(item, index) in form.weEmpleCodeTags"
:key=
"index"
>
{{
<el-tag>
试用版1
</el-tag>
item
.
tagName
}}
</el-tag>
</div>
</div>
</el-card>
</el-card>
<div
class=
"tip mb20"
>
扫码标签样式
</div>
<div
class=
"tip mb20"
>
扫码标签样式
</div>
...
@@ -225,7 +269,7 @@ export default {
...
@@ -225,7 +269,7 @@ export default {
:key=
"form.codeType"
:key=
"form.codeType"
:visible
.
sync=
"dialogVisibleSelectUser"
:visible
.
sync=
"dialogVisibleSelectUser"
title=
"选择使用员工"
title=
"选择使用员工"
:isOnlyLeaf=
"f
alse
"
:isOnlyLeaf=
"f
orm.codeType !== 2
"
:isSigleSelect=
"form.codeType == 1"
:isSigleSelect=
"form.codeType == 1"
@
success=
"selectedUser"
@
success=
"selectedUser"
></SelectUser>
></SelectUser>
...
@@ -248,6 +292,7 @@ export default {
...
@@ -248,6 +292,7 @@ export default {
</SelectMaterial>
</SelectMaterial>
<el-dialog
<el-dialog
key=
"a"
title=
"选择欢迎语"
title=
"选择欢迎语"
:visible
.
sync=
"dialogVisibleSelectWel"
:visible
.
sync=
"dialogVisibleSelectWel"
width=
"500"
width=
"500"
...
@@ -261,6 +306,7 @@ export default {
...
@@ -261,6 +306,7 @@ export default {
<el-button
slot=
"append"
@
click=
"getWelList"
>
查询
</el-button>
<el-button
slot=
"append"
@
click=
"getWelList"
>
查询
</el-button>
</el-input>
</el-input>
<el-table
<el-table
ref=
"table"
v-loading=
"welLoading"
v-loading=
"welLoading"
:data=
"welList"
:data=
"welList"
:max-height=
"300"
:max-height=
"300"
...
@@ -309,4 +355,6 @@ export default {
...
@@ -309,4 +355,6 @@ export default {
width
:
80%
;
width
:
80%
;
margin
:
0
auto
20px
;
margin
:
0
auto
20px
;
}
}
.el-icon-error
{
}
</
style
>
</
style
>
linkwe-ui/src/views/drainageCode/staff/detail.vue
View file @
538422f
<
style
lang=
"scss"
scoped
>
.mid-action
{
display
:
flex
;
justify-content
:
space-between
;
margin
:
10px
0
;
align-items
:
center
;
.total
{
background-color
:
rgba
(
65
,
133
,
244
,
0.1
);
border
:
1px
solid
rgba
(
65
,
133
,
244
,
0.2
);
border-radius
:
3px
;
font-size
:
14px
;
min-height
:
32px
;
line-height
:
32px
;
padding
:
0
12px
;
color
:
#606266
;
}
.num
{
color
:
#00f
;
}
}
.top
{
align-items
:
flex-start
;
}
</
style
>
<
template
>
<div
class=
"app-container"
>
<el-card
:body-style=
"
{padding: '20px 0 0'}">
<div>
员工活码信息
</div>
<div
class=
"flex top"
>
<div>
<img
src
alt
/>
<div>
<el-button
type=
"text"
>
下载二维码
</el-button>
<el-button
type=
"text"
>
复制链接
</el-button>
</div>
</div>
<el-form
ref=
"form"
label-width=
"100px"
>
<el-form-item
label=
"使用成员:"
>
<el-tag
type=
"success"
>
春夏
</el-tag>
</el-form-item>
<el-form-item
label=
"活动场景:"
>
55
</el-form-item>
<el-form-item
label=
"类型:"
>
单人
</el-form-item>
<el-form-item
label=
"类型:"
>
客户添加时无需经过确认自动成为好友
</el-form-item>
<el-form-item
label=
"创建人:"
>
wsscrm2019
</el-form-item>
<el-form-item
label=
"创建时间:"
>
2020-08-26 17:39:08
</el-form-item>
</el-form>
<el-form
ref=
"form"
label-width=
"100px"
>
<el-form-item
label=
"扫码标签:"
>
客户添加时无需经过确认自动成为好友
</el-form-item>
<el-form-item
label=
"欢迎语:"
>
wsscrm2019
</el-form-item>
</el-form>
</div>
</el-card>
<el-card
shadow=
"never"
>
<div>
扫码人数
</div>
<div>
累计总人数:0
</div>
<div>
<el-button-group>
<el-button
type=
"primary"
>
近7日
</el-button>
<el-button
type=
"primary"
>
近30日
</el-button>
</el-button-group>
<el-date-picker
v-model=
"dateRange"
size=
"small"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
></el-date-picker>
</div>
<div
class=
"chart"
ref=
"chart"
style=
"width: 600px;height:400px;"
></div>
</el-card>
</div>
</
template
>
<
script
>
<
script
>
import
echarts
from
"echarts"
;
import
{
getDetail
}
from
'@/api/drainageCode/staff'
import
{
download
,
downloadBatch
}
from
'@/api/common'
import
ClipboardJS
from
'clipboard'
import
echarts
from
'echarts'
export
default
{
export
default
{
name
:
"Operlog"
,
name
:
'CodeDetail'
,
data
()
{
data
()
{
return
{
return
{
// 遮罩层
// 遮罩层
loading
:
false
,
loading
:
false
,
// 选中数组
// 选中数组
ids
:
[],
ids
:
[],
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
// 总条数
total
:
0
,
total
:
0
,
// 表格数据
// 表格数据
list
:
[],
list
:
[],
// 是否显示弹出层
open
:
false
,
// 类型数据字典
typeOptions
:
[],
// 类型数据字典
statusOptions
:
[],
// 日期范围
// 日期范围
dateRange
:
[],
dateRange
:
[],
// 表单参数
// 表单参数
...
@@ -114,131 +28,169 @@ export default {
...
@@ -114,131 +28,169 @@ export default {
businessType
:
undefined
,
businessType
:
undefined
,
status
:
undefined
,
status
:
undefined
,
},
},
};
type
:
{
1
:
'单人'
,
2
:
'多人'
,
3
:
'批量单人'
},
}
},
},
created
()
{
created
()
{
this
.
getList
();
let
id
=
this
.
$route
.
query
.
id
this
.
getDicts
(
"sys_oper_type"
).
then
((
response
)
=>
{
id
&&
this
.
getDetail
(
id
)
this
.
typeOptions
=
response
.
data
;
// this.getList()
});
this
.
getDicts
(
"sys_common_status"
).
then
((
response
)
=>
{
this
.
statusOptions
=
response
.
data
;
});
},
},
mounted
()
{
mounted
()
{
var
clipboard
=
new
ClipboardJS
(
'.copy-btn'
)
clipboard
.
on
(
'success'
,
(
e
)
=>
{
this
.
$notify
({
title
:
'成功'
,
message
:
'链接已复制到剪切板,可粘贴。'
,
type
:
'success'
,
})
})
clipboard
.
on
(
'error'
,
(
e
)
=>
{
this
.
$message
.
error
(
'链接复制失败'
)
})
var
option
=
{
var
option
=
{
xAxis
:
{
xAxis
:
{
type
:
"category"
,
type
:
'category'
,
data
:
[
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
,
"Sun"
],
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
],
},
},
yAxis
:
{
yAxis
:
{
type
:
"value"
,
type
:
'value'
,
},
},
series
:
[
series
:
[
{
{
data
:
[
820
,
932
,
901
,
934
,
1290
,
1330
,
1320
],
data
:
[
820
,
932
,
901
,
934
,
1290
,
1330
,
1320
],
type
:
"line"
,
type
:
'line'
,
},
},
],
],
};
}
console
.
log
(
'ec'
,
echarts
);
var
myChart
=
echarts
.
init
(
this
.
$refs
.
chart
)
var
myChart
=
echarts
.
init
(
this
.
$refs
.
chart
);
myChart
.
setOption
(
option
)
myChart
.
setOption
(
option
);
},
},
methods
:
{
methods
:
{
/** 查询登录日志 */
/** 获取详情 */
getDetail
(
id
)
{
this
.
loading
=
true
getDetail
(
id
).
then
(({
data
})
=>
{
this
.
form
=
data
this
.
loading
=
false
})
},
/** */
getList
()
{
getList
()
{
this
.
loading
=
false
;
this
.
loading
=
false
list
(
this
.
addDateRange
(
this
.
queryParams
,
this
.
dateRange
)).
then
(
list
(
this
.
addDateRange
(
this
.
queryParams
,
this
.
dateRange
)).
then
(
(
response
)
=>
{
(
response
)
=>
{
this
.
list
=
response
.
rows
;
this
.
list
=
response
.
rows
this
.
total
=
response
.
total
;
this
.
total
=
response
.
total
this
.
loading
=
false
;
this
.
loading
=
false
}
}
);
)
},
// 操作日志状态字典翻译
statusFormat
(
row
,
column
)
{
return
this
.
selectDictLabel
(
this
.
statusOptions
,
row
.
status
);
},
// 操作日志类型字典翻译
typeFormat
(
row
,
column
)
{
return
this
.
selectDictLabel
(
this
.
typeOptions
,
row
.
businessType
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
dateRange
=
[];
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
operId
);
this
.
multiple
=
!
selection
.
length
;
},
/** 详细按钮操作 */
handleView
(
row
)
{
this
.
open
=
true
;
this
.
form
=
row
;
},
},
/** 删除按钮操作 */
/** 删除按钮操作 */
handleDelete
(
row
)
{
handleDelete
(
row
)
{
const
operIds
=
row
.
operId
||
this
.
ids
;
const
operIds
=
row
.
operId
||
this
.
ids
this
.
$confirm
(
this
.
$confirm
(
'是否确认删除日志编号为"'
+
operIds
+
'"的数据项?'
,
'是否确认删除日志编号为"'
+
operIds
+
'"的数据项?'
,
"警告"
,
'警告'
,
{
{
confirmButtonText
:
"确定"
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
"取消"
,
cancelButtonText
:
'取消'
,
type
:
"warning"
,
type
:
'warning'
,
}
}
)
)
.
then
(
function
()
{
.
then
(
function
()
{
return
delOperlog
(
operIds
)
;
return
delOperlog
(
operIds
)
})
})
.
then
(()
=>
{
.
then
(()
=>
{
this
.
getList
();
this
.
getList
()
this
.
msgSuccess
(
"删除成功"
);
this
.
msgSuccess
(
'删除成功'
)
})
.
catch
(
function
()
{});
},
/** 清空按钮操作 */
handleClean
()
{
this
.
$confirm
(
"是否确认清空所有操作日志数据项?"
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
,
})
.
then
(
function
()
{
return
cleanOperlog
();
})
.
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"清空成功"
);
})
.
catch
(
function
()
{});
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
this
.
$confirm
(
"是否确认导出所有操作日志数据项?"
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
,
})
.
then
(
function
()
{
return
exportOperlog
(
queryParams
);
})
})
.
then
((
response
)
=>
{
.
catch
(
function
()
{})
this
.
download
(
response
.
msg
);
})
.
catch
(
function
()
{});
},
},
},
},
};
</
script
>
\ No newline at end of file
\ No newline at end of file
}
</
script
>
<
template
>
<div
v-loading=
"loading"
>
<div>
员工活码信息
</div>
<div
class=
"flex top"
>
<div>
<el-image
:src=
"form.qrCode"
fit=
"fit"
style=
"width: 100px; height: 100px"
></el-image>
<div>
<el-button
type=
"text"
@
click=
"downloadBatch(row.id)"
>
下载二维码
</el-button
>
<el-button
type=
"text"
class=
"copy-btn"
:data-clipboard-text=
"form.qrCode"
>
复制链接
</el-button
>
</div>
</div>
<el-form
ref=
"form"
label-width=
"100px"
>
<el-form-item
label=
"使用成员:"
>
<el-tag
size=
"medium"
v-for=
"(item, index) in form.weEmpleCodeUseScops"
:key=
"index"
>
{{
item
.
userUserName
}}
</el-tag
>
</el-form-item>
<el-form-item
label=
"活动场景:"
>
{{
form
.
activityScene
}}
</el-form-item>
<el-form-item
label=
"类型:"
>
{{
type
[
form
.
codeType
]
}}
</el-form-item>
<el-form-item
label=
"设置:"
>
{{
`客户添加时${
form.isJoinConfirmFriends === 1 ? '无' : ''
}
需经过确认自动成为好友`
}}
<
/el-form-item
>
<
el
-
form
-
item
label
=
"创建人:"
>
{{
form
.
createBy
}}
<
/el-form-item
>
<
el
-
form
-
item
label
=
"创建时间:"
>
{{
form
.
createTime
}}
<
/el-form-item
>
<
/el-form
>
<
el
-
form
ref
=
"form"
label
-
width
=
"100px"
>
<
el
-
form
-
item
label
=
"扫码标签:"
><
el
-
tag
size
=
"medium"
v
-
for
=
"(item, index) in form.weEmpleCodeTags"
:
key
=
"index"
>
{{
item
.
tagName
}}
<
/el-ta
g
><
/el-form-ite
m
>
<
el
-
form
-
item
label
=
"欢迎语:"
>
{{
form
.
welcomeMsg
}}
<
/el-form-item
>
<
/el-form
>
<
/div
>
<
el
-
divider
><
/el-divider
>
<
div
>
扫码人数
<
/div
>
<
div
>
累计总人数:
0
<
/div
>
<
div
>
<
el
-
button
-
group
>
<
el
-
button
type
=
"primary"
>
近
7
日
<
/el-button
>
<
el
-
button
type
=
"primary"
>
近
30
日
<
/el-button
>
<
/el-button-group
>
<
el
-
date
-
picker
v
-
model
=
"dateRange"
size
=
"small"
style
=
"width: 240px"
value
-
format
=
"yyyy-MM-dd"
type
=
"daterange"
range
-
separator
=
"-"
start
-
placeholder
=
"开始日期"
end
-
placeholder
=
"结束日期"
><
/el-date-picker
>
<
/div
>
<
div
class
=
"chart"
ref
=
"chart"
style
=
"width: 600px;height:400px;"
><
/div
>
<
/div
>
<
/template
>
<
style
lang
=
"scss"
scoped
>
.
top
{
align
-
items
:
flex
-
start
;
}
<
/style
>
linkwe-ui/src/views/drainageCode/staff/list.vue
View file @
538422f
<
script
>
<
script
>
import
{
getList
,
remove
}
from
'@/api/drainageCode/staff'
import
{
getList
,
remove
,
batchAdd
}
from
'@/api/drainageCode/staff'
import
{
download
,
downloadBatch
}
from
'@/api/common'
import
SelectUser
from
'@/components/SelectUser'
import
ClipboardJS
from
'clipboard'
export
default
{
export
default
{
name
:
'CodeStaff'
,
name
:
'CodeStaff'
,
components
:
{
SelectUser
},
data
()
{
data
()
{
return
{
return
{
// 查询参数
// 查询参数
...
@@ -18,67 +21,6 @@ export default {
...
@@ -18,67 +21,6 @@ export default {
},
},
// 日期范围
// 日期范围
dateRange
:
[],
dateRange
:
[],
treeData
:
[
{
label
:
'一级 1'
,
children
:
[
{
label
:
'二级 1-1'
,
children
:
[
{
label
:
'三级 1-1-1'
,
},
],
},
],
},
{
label
:
'一级 2'
,
children
:
[
{
label
:
'二级 2-1'
,
children
:
[
{
label
:
'三级 2-1-1'
,
},
],
},
{
label
:
'二级 2-2'
,
children
:
[
{
label
:
'三级 2-2-1'
,
},
],
},
],
},
{
label
:
'一级 3'
,
children
:
[
{
label
:
'二级 3-1'
,
children
:
[
{
label
:
'三级 3-1-1'
,
},
],
},
{
label
:
'二级 3-2'
,
children
:
[
{
label
:
'三级 3-2-1'
,
},
],
},
],
},
],
defaultProps
:
{
children
:
'children'
,
label
:
'label'
,
},
dialogVisible
:
false
,
dialogVisible
:
false
,
// 遮罩层
// 遮罩层
loading
:
false
,
loading
:
false
,
...
@@ -89,12 +31,31 @@ export default {
...
@@ -89,12 +31,31 @@ export default {
// 表格数据
// 表格数据
list
:
[],
list
:
[],
// 表单参数
// 表单参数
form
:
{},
form
:
{
codeType
:
3
,
qrcode
:
''
,
isJoinConfirmFriends
:
0
,
weEmpleCodeTags
:
[],
weEmpleCodeUseScops
:
[],
},
}
}
},
},
created
()
{
created
()
{
this
.
getList
()
this
.
getList
()
},
},
mounted
()
{
var
clipboard
=
new
ClipboardJS
(
'.copy-btn'
)
clipboard
.
on
(
'success'
,
(
e
)
=>
{
this
.
$notify
({
title
:
'成功'
,
message
:
'链接已复制到剪切板,可粘贴。'
,
type
:
'success'
,
})
})
clipboard
.
on
(
'error'
,
(
e
)
=>
{
this
.
$message
.
error
(
'链接复制失败'
)
})
},
methods
:
{
methods
:
{
getList
(
page
)
{
getList
(
page
)
{
// console.log(this.dateRange);
// console.log(this.dateRange);
...
@@ -128,13 +89,9 @@ export default {
...
@@ -128,13 +89,9 @@ export default {
this
.
$router
.
push
({
path
:
'/drainageCode/'
+
path
,
query
:
{
id
}
})
this
.
$router
.
push
({
path
:
'/drainageCode/'
+
path
,
query
:
{
id
}
})
},
},
download
(
row
)
{
window
.
open
(
row
.
qrCode
)
},
// 多选框选中数据
// 多选框选中数据
handleSelectionChange
(
selection
)
{
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
operId
)
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
id
)
this
.
multiple
=
!
selection
.
length
},
},
/** 删除按钮操作 */
/** 删除按钮操作 */
remove
(
id
)
{
remove
(
id
)
{
...
@@ -153,21 +110,35 @@ export default {
...
@@ -153,21 +110,35 @@ export default {
})
})
.
catch
(
function
()
{})
.
catch
(
function
()
{})
},
},
/** 导出按钮操作 */
// 选择人员变化事件
handleExport
()
{
selectedUser
(
users
)
{
const
query
=
this
.
query
this
.
form
.
weEmpleCodeUseScops
=
users
.
map
((
d
)
=>
{
this
.
$confirm
(
'是否确认导出所有操作数据项?'
,
'警告'
,
{
return
{
confirmButtonText
:
'确定'
,
businessId
:
d
.
id
||
d
.
userId
,
cancelButtonText
:
'取消'
,
businessName
:
d
.
name
,
type
:
'warning'
,
businessIdType
:
d
.
userId
?
2
:
1
,
}
})
})
.
then
(
function
()
{
batchAdd
(
this
.
form
).
then
(({
data
})
=>
{
return
exportOperlog
(
query
)
this
.
msgSuccess
(
'操作成功'
)
})
this
.
getList
(
1
)
.
then
((
response
)
=>
{
})
this
.
download
(
response
.
msg
)
},
/** 下载 */
downloadBatch
(
id
)
{
const
ids
=
id
||
this
.
ids
// window.open(download(row.qrCode, row.createBy.split(',')[0] + '.png'))
id
&&
window
.
open
(
row
.
qrCode
)
id
||
this
.
$confirm
(
'是否确认下载所有图片吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
})
})
.
catch
(
function
()
{})
.
then
(
function
()
{
return
window
.
open
(
downloadBatch
(
ids
))
})
.
catch
(
function
()
{})
},
},
},
},
}
}
...
@@ -253,8 +224,10 @@ export default {
...
@@ -253,8 +224,10 @@ export default {
<el-button
type=
"primary"
size=
"mini"
@
click=
"dialogVisible = true"
<el-button
type=
"primary"
size=
"mini"
@
click=
"dialogVisible = true"
>
批量新建
</el-button
>
批量新建
</el-button
>
>
<el-button
type=
"primary"
size=
"mini"
>
删除
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"remove"
>
删除
</el-button>
<el-button
type=
"primary"
size=
"mini"
>
下载
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"downloadBatch"
>
批量下载
</el-button
>
</div>
</div>
</div>
</div>
...
@@ -265,8 +238,13 @@ export default {
...
@@ -265,8 +238,13 @@ export default {
>
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"样式"
align=
"center"
prop=
"qrCode"
>
<el-table-column
label=
"样式"
align=
"center"
prop=
"qrCode"
>
<!-- style="width: 100px; height: 100px" -->
<template
slot-scope=
"
{ row }">
<el-image
:src=
"qrCode"
:fit=
"fit"
></el-image>
<el-image
:src=
"row.qrCode"
fit=
"fit"
style=
"width: 100px; height: 100px"
></el-image>
</
template
>
</el-table-column>
</el-table-column>
<!-- <el-table-column label="使用员工" align="center" prop="useUserName" /> -->
<!-- <el-table-column label="使用员工" align="center" prop="useUserName" /> -->
<el-table-column
<el-table-column
...
@@ -300,34 +278,35 @@ export default {
...
@@ -300,34 +278,35 @@ export default {
align=
"center"
align=
"center"
class-name=
"small-padding fixed-width"
class-name=
"small-padding fixed-width"
>
>
<template
slot-scope=
"
scope
"
>
<
template
slot-scope=
"
{ row }
"
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"download
(scope.row
)"
@
click=
"download
Batch(row.id
)"
v-hasPermi=
"['monitor:operlog:query']"
v-hasPermi=
"['monitor:operlog:query']"
>
下载
</el-button
>
下载
</el-button
>
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"handleView(scope.row)"
class=
"copy-btn"
:data-clipboard-text=
"row.qrCode"
v-hasPermi=
"['monitor:operlog:query']"
v-hasPermi=
"['monitor:operlog:query']"
>
复制链接
</el-button
>
复制链接
</el-button
>
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"goRoute('staffDetail',
scope.
row.id)"
@
click=
"goRoute('staffDetail', row.id)"
v-hasPermi=
"['monitor:operlog:query']"
v-hasPermi=
"['monitor:operlog:query']"
>
查看详情
</el-button
>
查看详情
</el-button
>
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"goRoute('staffAdd',
scope.
row.id)"
@
click=
"goRoute('staffAdd', row.id)"
v-hasPermi=
"['monitor:operlog:query']"
v-hasPermi=
"['monitor:operlog:query']"
>
编辑
</el-button
>
编辑
</el-button
>
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"remove(
scope.
row.id)"
@
click=
"remove(row.id)"
v-hasPermi=
"['monitor:operlog:query']"
v-hasPermi=
"['monitor:operlog:query']"
>
删除
</el-button
>
删除
</el-button
>
>
...
@@ -340,39 +319,15 @@ export default {
...
@@ -340,39 +319,15 @@ export default {
:total=
"total"
:total=
"total"
:page
.
sync=
"query.pageNum"
:page
.
sync=
"query.pageNum"
:limit
.
sync=
"query.pageSize"
:limit
.
sync=
"query.pageSize"
@
pagination=
"getList"
@
pagination=
"getList
()
"
/>
/>
<!-- 批量新建弹窗 -->
<!-- 批量新建弹窗 -->
<el-dialog
<SelectUser
title=
"组织架构"
:visible
.
sync=
"dialogVisible"
:visible
.
sync=
"dialogVisible"
width=
"width"
title=
"组织架构"
:before-close=
"dialogBeforeClose"
@
success=
"selectedUser"
>
></SelectUser>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-input
placeholder=
"请输入关键字"
v-model=
"input3"
class
>
<el-button
slot=
"append"
>
查询
</el-button>
</el-input>
<el-tree
:data=
"treeData"
:props=
"defaultProps"
accordion
@
node-click=
"handleNodeClick"
></el-tree>
</el-col>
<el-col
:span=
"12"
>
<div
class=
"grid-content bg-purple"
></div>
</el-col>
</el-row>
<div
slot=
"footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"dialogVisible = false"
>
确 定
</el-button
>
</div>
</el-dialog>
</div>
</div>
</template>
</template>
...
...
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