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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
182 additions
and
164 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'
name=文件名称,带后缀
}
*/
export
function
download
(
params
)
{
return
request
({
url
:
'/common/download/url'
,
params
,
})
export
function
download
(
url
,
name
)
{
return
`/common/download/url?url=
${
url
}
&name=
${
name
}
`
}
linkwe-ui/src/api/drainageCode/staff.js
View file @
538422f
...
...
@@ -128,3 +128,11 @@ export function getQrcode(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 {
},
data
()
{
return
{
text
:
''
,
image
:
''
,
text
:
{},
image
:
{},
file
:
{},
}
},
watch
:
{},
...
...
linkwe-ui/src/components/SelectMaterial/list.vue
View file @
538422f
...
...
@@ -112,18 +112,28 @@ export default {
<!--
<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"
>
<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
>
</el-table-column>
<el-table-column
prop=
"content"
>
</el-table-column>
</el-table>
<!-- 图片 -->
<el-radio-group
v-if=
"type == 0"
class=
"img-wrap"
v-model=
"radio"
>
<el-radio
v-for=
"(item, index) in list"
:label=
"item.id"
:key=
"index"
>
<el-radio-group
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
/>
<div
class=
"ac mt5"
>
{{ item.materialName }}
</div>
</el-radio>
...
...
linkwe-ui/src/components/SelectUser.vue
View file @
538422f
...
...
@@ -84,11 +84,10 @@ export default {
},
// 选择变化
handleCheckChange
(
data
,
checked
,
indeterminate
)
{
debugger
if
(
checked
)
{
if
(
this
.
isSigleSelect
)
{
// 单选
清空
let
userList
=
[]
// 单选
情况
this
.
$refs
.
tree
.
setCheckedKeys
([
data
.
key
])
}
this
.
userList
.
push
(
data
)
}
else
{
...
...
linkwe-ui/src/views/drainageCode/staff/add.vue
View file @
538422f
<
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
PhoneDialog
from
'@/components/PhoneDialog'
import
SelectUser
from
'@/components/SelectUser'
...
...
@@ -18,29 +18,62 @@ export default {
// 表单参数
form
:
{
codeType
:
1
,
qrcode
:
''
,
isJoinConfirmFriends
:
0
,
weEmpleCodeTags
:
[],
weEmpleCodeUseScops
:
[],
},
materialSelected
:
''
,
welQuery
:
{
welcomeMsg
:
''
},
welLoading
:
false
,
welList
:
[],
welSelected
:
{},
type
:
{
1
:
'单人'
,
2
:
'多人'
,
3
:
'批量单人'
},
}
},
created
()
{
let
id
=
this
.
$route
.
query
.
id
id
&&
this
.
getD
ata
(
id
)
id
&&
this
.
getD
etail
(
id
)
},
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
{
businessId
:
d
.
id
||
d
.
userId
,
businessName
:
d
.
name
,
businessIdType
:
d
.
userId
?
2
:
1
,
}
})
params
.
userIds
+=
''
params
.
departmentIds
+=
''
getQrcode
(
params
).
then
(({
data
})
=>
{
this
.
form
.
qrcode
=
data
.
qr_code
})
},
submitSelectTag
(
data
)
{
this
.
form
.
weEmpleCodeTags
=
data
.
map
((
d
)
=>
({
...
...
@@ -49,22 +82,14 @@ export default {
}))
},
// 选择素材确认按钮
submitSelectMaterial
(
text
,
image
,
file
)
{},
/** 获取详情 */
getData
(
id
)
{
this
.
loading
=
true
getDetail
(
id
).
then
(({
data
})
=>
{
this
.
form
=
data
this
.
loading
=
false
})
submitSelectMaterial
(
text
,
image
,
file
)
{
this
.
form
.
mediaId
=
image
.
id
this
.
materialSelected
=
image
.
materialUrl
this
.
dialogVisibleSelectMaterial
=
false
},
/** 获取欢迎语列表 */
getWelList
()
{
this
.
welLoading
=
true
getList
(
this
.
welQuery
).
then
(({
rows
})
=>
{
this
.
welList
=
rows
this
.
welLoading
=
false
})
removeMaterial
()
{
this
.
form
.
mediaId
=
''
this
.
materialSelected
=
''
},
// 欢迎语确认按钮
selectWelcome
()
{
...
...
@@ -75,6 +100,7 @@ export default {
submit
()
{
this
.
loading
=
true
add
(
this
.
form
).
then
(({
data
})
=>
{
this
.
msgSuccess
(
'操作成功'
)
this
.
loading
=
false
this
.
$router
.
back
()
})
...
...
@@ -86,15 +112,19 @@ export default {
<div
class=
"wrap"
v-loading=
"loading"
>
<el-form
:model=
"form"
ref=
"form"
label-width=
"100px"
>
<el-form-item
label=
"类型"
prop=
"codeType"
>
<el-radio-group
v-model=
"form.codeType"
>
<el-radio
:label=
"1"
>
单人
</el-radio>
<el-radio
:label=
"2"
>
多人
</el-radio>
<el-radio
:label=
"3"
>
批量
</el-radio>
<el-radio-group
v-model=
"form.codeType"
@
change=
"codeTypeChange"
>
<el-radio
v-for=
"(value, key, index) in type"
:key=
"index"
:label=
"+key"
>
{{
value
}}
</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"使用员工"
>
<!-- closable -->
<el-tag
closable
size=
"medium"
v-for=
"(item, index) in form.weEmpleCodeUseScops"
:key=
"index"
>
{{
item
.
businessName
}}
</el-tag
...
...
@@ -102,6 +132,7 @@ export default {
<el-button
type=
"primary"
plain
class=
"ml10"
icon=
"el-icon-plus"
size=
"mini"
@
click=
"dialogVisibleSelectUser = true"
...
...
@@ -126,14 +157,16 @@ export default {
/>
</el-form-item>
<el-form-item
label=
"扫码标签"
prop=
"weEmpleCodeTags"
>
<!-- closable -->
<el-tag
closable
size=
"medium"
v-for=
"(item, index) in form.weEmpleCodeTags"
:key=
"index"
>
{{
item
.
tagName
}}
</el-tag
>
<el-button
type=
"primary"
class=
"ml10"
plain
icon=
"el-icon-plus"
size=
"mini"
...
...
@@ -170,7 +203,17 @@ export default {
>
添加图片
</el-button
>
</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
v-else
icon=
"el-icon-plus"
size=
"mini"
@
click=
"dialogVisibleSelectMaterial = true"
...
...
@@ -197,7 +240,7 @@ export default {
<div
class=
"preview-wrap"
>
<el-image
style=
"width: 180px; height: 180px"
src=
"@/assets/image/profile.jpg
"
:src=
"form.qrcode || require('@/assets/image/user-code-example.jpg')
"
fit=
"fit"
></el-image>
<div
class=
"tip mb20"
>
二维码预览
</div>
...
...
@@ -209,8 +252,9 @@ export default {
<div>
设置:备注和描述
</div>
<div>
标签:
<el-tag>
试用版1重要(1w以上)
</el-tag>
<el-tag>
试用版1
</el-tag>
<el-tag
v-for=
"(item, index) in form.weEmpleCodeTags"
:key=
"index"
>
{{
item
.
tagName
}}
</el-tag>
</div>
</el-card>
<div
class=
"tip mb20"
>
扫码标签样式
</div>
...
...
@@ -225,7 +269,7 @@ export default {
:key=
"form.codeType"
:visible
.
sync=
"dialogVisibleSelectUser"
title=
"选择使用员工"
:isOnlyLeaf=
"f
alse
"
:isOnlyLeaf=
"f
orm.codeType !== 2
"
:isSigleSelect=
"form.codeType == 1"
@
success=
"selectedUser"
></SelectUser>
...
...
@@ -248,6 +292,7 @@ export default {
</SelectMaterial>
<el-dialog
key=
"a"
title=
"选择欢迎语"
:visible
.
sync=
"dialogVisibleSelectWel"
width=
"500"
...
...
@@ -261,6 +306,7 @@ export default {
<el-button
slot=
"append"
@
click=
"getWelList"
>
查询
</el-button>
</el-input>
<el-table
ref=
"table"
v-loading=
"welLoading"
:data=
"welList"
:max-height=
"300"
...
...
@@ -309,4 +355,6 @@ export default {
width
:
80%
;
margin
:
0
auto
20px
;
}
.el-icon-error
{
}
</
style
>
linkwe-ui/src/views/drainageCode/staff/detail.vue
View file @
538422f
This diff is collapsed.
Click to expand it.
linkwe-ui/src/views/drainageCode/staff/list.vue
View file @
538422f
<
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
{
name
:
'CodeStaff'
,
components
:
{
SelectUser
},
data
()
{
return
{
// 查询参数
...
...
@@ -18,67 +21,6 @@ export default {
},
// 日期范围
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
,
// 遮罩层
loading
:
false
,
...
...
@@ -89,12 +31,31 @@ export default {
// 表格数据
list
:
[],
// 表单参数
form
:
{},
form
:
{
codeType
:
3
,
qrcode
:
''
,
isJoinConfirmFriends
:
0
,
weEmpleCodeTags
:
[],
weEmpleCodeUseScops
:
[],
},
}
},
created
()
{
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
:
{
getList
(
page
)
{
// console.log(this.dateRange);
...
...
@@ -128,13 +89,9 @@ export default {
this
.
$router
.
push
({
path
:
'/drainageCode/'
+
path
,
query
:
{
id
}
})
},
download
(
row
)
{
window
.
open
(
row
.
qrCode
)
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
operId
)
this
.
multiple
=
!
selection
.
length
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
id
)
},
/** 删除按钮操作 */
remove
(
id
)
{
...
...
@@ -153,21 +110,35 @@ export default {
})
.
catch
(
function
()
{})
},
/** 导出按钮操作 */
handleExport
()
{
const
query
=
this
.
query
this
.
$confirm
(
'是否确认导出所有操作数据项?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
// 选择人员变化事件
selectedUser
(
users
)
{
this
.
form
.
weEmpleCodeUseScops
=
users
.
map
((
d
)
=>
{
return
{
businessId
:
d
.
id
||
d
.
userId
,
businessName
:
d
.
name
,
businessIdType
:
d
.
userId
?
2
:
1
,
}
})
.
then
(
function
()
{
return
exportOperlog
(
query
)
})
.
then
((
response
)
=>
{
this
.
download
(
response
.
msg
)
batchAdd
(
this
.
form
).
then
(({
data
})
=>
{
this
.
msgSuccess
(
'操作成功'
)
this
.
getList
(
1
)
})
},
/** 下载 */
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 {
<el-button
type=
"primary"
size=
"mini"
@
click=
"dialogVisible = true"
>
批量新建
</el-button
>
<el-button
type=
"primary"
size=
"mini"
>
删除
</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"
@
click=
"downloadBatch"
>
批量下载
</el-button
>
</div>
</div>
...
...
@@ -265,8 +238,13 @@ export default {
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"样式"
align=
"center"
prop=
"qrCode"
>
<!-- style="width: 100px; height: 100px" -->
<el-image
:src=
"qrCode"
:fit=
"fit"
></el-image>
<template
slot-scope=
"
{ row }">
<el-image
:src=
"row.qrCode"
fit=
"fit"
style=
"width: 100px; height: 100px"
></el-image>
</
template
>
</el-table-column>
<!-- <el-table-column label="使用员工" align="center" prop="useUserName" /> -->
<el-table-column
...
...
@@ -300,34 +278,35 @@ export default {
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"
scope
"
>
<
template
slot-scope=
"
{ row }
"
>
<el-button
type=
"text"
@
click=
"download
(scope.row
)"
@
click=
"download
Batch(row.id
)"
v-hasPermi=
"['monitor:operlog:query']"
>
下载
</el-button
>
<el-button
type=
"text"
@
click=
"handleView(scope.row)"
class=
"copy-btn"
:data-clipboard-text=
"row.qrCode"
v-hasPermi=
"['monitor:operlog:query']"
>
复制链接
</el-button
>
<el-button
type=
"text"
@
click=
"goRoute('staffDetail',
scope.
row.id)"
@
click=
"goRoute('staffDetail', row.id)"
v-hasPermi=
"['monitor:operlog:query']"
>
查看详情
</el-button
>
<el-button
type=
"text"
@
click=
"goRoute('staffAdd',
scope.
row.id)"
@
click=
"goRoute('staffAdd', row.id)"
v-hasPermi=
"['monitor:operlog:query']"
>
编辑
</el-button
>
<el-button
type=
"text"
@
click=
"remove(
scope.
row.id)"
@
click=
"remove(row.id)"
v-hasPermi=
"['monitor:operlog:query']"
>
删除
</el-button
>
...
...
@@ -340,39 +319,15 @@ export default {
:total=
"total"
:page
.
sync=
"query.pageNum"
:limit
.
sync=
"query.pageSize"
@
pagination=
"getList"
@
pagination=
"getList
()
"
/>
<!-- 批量新建弹窗 -->
<el-dialog
title=
"组织架构"
<SelectUser
:visible
.
sync=
"dialogVisible"
width=
"width"
:before-close=
"dialogBeforeClose"
>
<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>
title=
"组织架构"
@
success=
"selectedUser"
></SelectUser>
</div>
</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