Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OKR
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hanfeng zhang
OKR
Commits
e5e94480
Commit
e5e94480
authored
Sep 07, 2021
by
hanfeng zhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'main' of gitlab.33.cn:HF_web/OKR
parents
a980efc9
3a6f2c92
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
291 additions
and
127 deletions
+291
-127
index.ts
src/store/index.ts
+14
-2
add-department.vue
src/views/team/add-department.vue
+18
-14
add-member.vue
src/views/team/add-member.vue
+72
-42
team-contacts.vue
src/views/team/components/team-contacts.vue
+11
-0
confirm-join.vue
src/views/team/join-team/confirm-join.vue
+66
-16
select-team.vue
src/views/team/select-team.vue
+62
-42
team-detail.vue
src/views/team/team-detail.vue
+4
-2
team-frame.vue
src/views/team/team-frame.vue
+41
-7
two-code.vue
src/views/team/two-code.vue
+3
-2
No files found.
src/store/index.ts
View file @
e5e94480
...
@@ -8,7 +8,10 @@ Vue.use(Vuex)
...
@@ -8,7 +8,10 @@ Vue.use(Vuex)
export
default
new
Vuex
.
Store
({
export
default
new
Vuex
.
Store
({
state
:
{
state
:
{
enterpriseInfo
:
undefined
,
enterpriseInfo
:
undefined
,
acceptJoin
:
undefined
acceptJoin
:
undefined
,
addDep
:
undefined
,
selectedStaff
:
undefined
,
selectedDep
:
undefined
},
},
mutations
:
{
mutations
:
{
setEnterpriseInfo
(
state
,
payload
)
{
setEnterpriseInfo
(
state
,
payload
)
{
...
@@ -16,7 +19,16 @@ export default new Vuex.Store({
...
@@ -16,7 +19,16 @@ export default new Vuex.Store({
},
},
setAcceptJoin
(
state
,
payload
)
{
setAcceptJoin
(
state
,
payload
)
{
state
.
acceptJoin
=
payload
state
.
acceptJoin
=
payload
}
},
setAddDep
(
state
,
payload
)
{
state
.
addDep
=
payload
},
setSelectedStaff
(
state
,
payload
)
{
state
.
selectedStaff
=
payload
},
setSelectedDep
(
state
,
payload
)
{
state
.
selectedDep
=
payload
},
},
},
actions
:
{
actions
:
{
},
},
...
...
src/views/team/add-department.vue
View file @
e5e94480
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
>
>
<div
class=
"pt-14 px-4"
>
<div
class=
"pt-14 px-4"
>
<input-cell
<input-cell
v-model=
"name"
v-model=
"
addDep.
name"
required
required
:limit=
"20"
:limit=
"20"
label=
"部门名称"
label=
"部门名称"
...
@@ -16,14 +16,14 @@
...
@@ -16,14 +16,14 @@
<group-cell
class=
"mt-4"
title=
"部门主管"
>
<group-cell
class=
"mt-4"
title=
"部门主管"
>
<c-cell
<c-cell
dot
dot
title=
"默认为添加的人,主管即为群主
"
:title=
"leader.name || '选择主管'
"
@
click=
"selectCharger"
@
click=
"selectCharger"
/>
/>
</group-cell>
</group-cell>
<group-cell
class=
"mt-4"
title=
"所属团队"
>
<group-cell
class=
"mt-4"
title=
"所属团队"
>
<c-cell
<c-cell
dot
dot
title=
"杭州复杂美科技有限公司
"
:title=
"parentDep.name
"
@
click=
"$router.push('/team/select-team')"
@
click=
"$router.push('/team/select-team')"
/>
/>
</group-cell>
</group-cell>
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
import
{
useRequest
}
from
'ahooks-vue'
import
{
useRequest
}
from
'ahooks-vue'
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
AddSubDTO
}
from
'@/service/moudles/service.dto'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
components
:{
components
:{
...
@@ -51,6 +52,12 @@ export default Vue.extend({
...
@@ -51,6 +52,12 @@ export default Vue.extend({
},
},
name
:
'AddDepartment'
,
name
:
'AddDepartment'
,
data
()
{
data
()
{
const
addDep
:
AddSubDTO
=
{
entId
:
''
,
leaderId
:
'1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR'
,
name
:
''
,
parentId
:
''
}
return
{
return
{
name
:
'产品部'
,
name
:
'产品部'
,
check
:
false
,
check
:
false
,
...
@@ -59,21 +66,18 @@ export default Vue.extend({
...
@@ -59,21 +66,18 @@ export default Vue.extend({
data
:
null
as
any
,
data
:
null
as
any
,
loading
:
true
as
any
,
loading
:
true
as
any
,
error
:
null
as
any
error
:
null
as
any
}
},
addDep
,
parentDep
:
{},
leader
:
{}
}
}
},
},
async
mounted
(){
mounted
(){
this
.
addDep
=
this
.
$store
.
state
.
addDep
||
this
.
addDep
this
.
parentDep
=
this
.
$store
.
state
.
addDepParent
||
{}
this
.
leader
=
this
.
$store
.
state
.
addDepLeader
||
{}
},
},
methods
:
{
methods
:
{
// enterpriseInfo(){
// const { data, loading, error} =useRequest(this.$service.enterprise.getEnterpriseInfo({
// "id": "166961152260050944"
// }))
// this.enterpriseInfoObj.data = data
// this.enterpriseInfoObj.loading = loading
// this.enterpriseInfoObj.error = error
// },
addDepConfirm
(){
addDepConfirm
(){
const
{
data
,
loading
,
error
,
run
}
=
useRequest
(
this
.
$service
.
department
.
addDep
({
const
{
data
,
loading
,
error
,
run
}
=
useRequest
(
this
.
$service
.
department
.
addDep
({
"entId"
:
"entId"
,
"entId"
:
"entId"
,
...
...
src/views/team/add-member.vue
View file @
e5e94480
...
@@ -2,12 +2,13 @@
...
@@ -2,12 +2,13 @@
<div
class=
"file"
>
<div
class=
"file"
>
<main-page
<main-page
left-arrow
left-arrow
:loading=
"loading"
@
click-left=
"handleClickLeft"
@
click-left=
"handleClickLeft"
>
>
<div
class=
"px-4 pt-14 pb-16"
>
<div
class=
"px-4 pt-14 pb-16"
>
<!-- 姓名/职位 -->
<!-- 姓名/职位 -->
<input-cell
<input-cell
v-model=
"name"
v-model=
"
acceptJoin.
name"
required
required
:limit=
"10"
:limit=
"10"
label=
"真实姓名"
label=
"真实姓名"
...
@@ -15,7 +16,7 @@
...
@@ -15,7 +16,7 @@
error-msg=
"姓名不能为空"
error-msg=
"姓名不能为空"
/>
/>
<input-cell
<input-cell
v-model=
"position"
v-model=
"
acceptJoin.
position"
required
required
:limit=
"10"
:limit=
"10"
label=
"职位"
label=
"职位"
...
@@ -24,7 +25,7 @@
...
@@ -24,7 +25,7 @@
/>
/>
<!-- 手机号/员工编号/入职时间 -->
<!-- 手机号/员工编号/入职时间 -->
<c-cell
<c-cell
v-model=
"phone"
v-model=
"
acceptJoin.
phone"
required
required
title=
"手机号"
title=
"手机号"
placeholder=
"请输入手机号"
placeholder=
"请输入手机号"
...
@@ -33,18 +34,18 @@
...
@@ -33,18 +34,18 @@
type=
"input"
type=
"input"
:validator=
"checkPhone"
:validator=
"checkPhone"
/>
/>
<c-cell
<
!--
<
c-cell
v-model=
"digit"
v-model=
"digit"
title=
"员工编号"
title=
"员工编号"
placeholder=
"请输入员工编号"
placeholder=
"请输入员工编号"
type=
"input"
type=
"input"
/>
/>
-->
<c-cell
<c-cell
v-model=
"date"
v-model=
"date"
dot
dot
required
required
title=
"入职时间"
title=
"入职时间"
:content=
"
date
"
:content=
"
formatDate(acceptJoin.joinTime || new Date().getTime(), 'YYYY-MM-DD')
"
@
click=
"show = true"
@
click=
"show = true"
/>
/>
<van-calendar
<van-calendar
...
@@ -61,9 +62,9 @@
...
@@ -61,9 +62,9 @@
required
required
class=
"mt-4"
class=
"mt-4"
title=
"所属部门"
title=
"所属部门"
@
click=
"
$router.push('/team/select-team')
"
@
click=
"
selectDep
"
>
>
<c-cell
title=
"产品设计部
"
/>
<c-cell
:title=
"currentDep.name
"
/>
</group-cell>
</group-cell>
<!--按钮-->
<!--按钮-->
<div
class=
"fixed bottom-0 left-0 w-full px-4 py-1.5 bg-common-bg"
>
<div
class=
"fixed bottom-0 left-0 w-full px-4 py-1.5 bg-common-bg"
>
...
@@ -82,7 +83,9 @@ import Vue from 'vue'
...
@@ -82,7 +83,9 @@ import Vue from 'vue'
import
{
Calendar
}
from
'vant'
import
{
Calendar
}
from
'vant'
import
{
AcceptJoinDTO
}
from
'@/service/moudles/service.dto'
import
{
AcceptJoinDTO
}
from
'@/service/moudles/service.dto'
import
{
trim
}
from
'@/util/Contact'
import
{
trim
}
from
'@/util/Contact'
import
{
Department
}
from
'@/Interface'
import
{
useLocalStorageState
}
from
'ahooks-vue'
import
{
useLocalStorageState
}
from
'ahooks-vue'
import
{
formatDate
}
from
'@/util/FormatDate'
Vue
.
use
(
Calendar
)
Vue
.
use
(
Calendar
)
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
...
@@ -95,29 +98,67 @@ export default Vue.extend({
...
@@ -95,29 +98,67 @@ export default Vue.extend({
'group-cell'
:
()
=>
import
(
'@/components/common/group-cell.vue'
)
'group-cell'
:
()
=>
import
(
'@/components/common/group-cell.vue'
)
},
},
data
()
{
data
()
{
const
currentDep
:
Department
=
{
entId
:
''
,
id
:
''
,
leaderId
:
''
,
name
:
''
,
parentId
:
''
,
}
const
acceptJoin
:
AcceptJoinDTO
=
{
expiration
:
0
,
inviterId
:
'17MTDNzwBXXKNzwdzEnQrehmSEPAy31sUS'
,
name
:
''
,
oaServer
:
'oaServer'
,
depId
:
''
,
entId
:
''
,
hash
:
'mock-hash'
,
joinTime
:
0
,
phone
:
''
,
position
:
''
}
return
{
return
{
// "expiration": number,
formatDate
,
// "inviterId": string,
// joinTime: new Date().getTime(),
// "name": string,
// name: '', // 姓名
// "oaServer": string,
// position: '',
// "depId": string,
// phone: '', // 电话号码
// "entId": string,
// digit: '', // 员工编号
// "hash": string,
joinTime
:
new
Date
().
getTime
(),
// "position": string
name
:
''
,
// 姓名
position
:
''
,
phone
:
''
,
// 电话号码
digit
:
''
,
// 员工编号
date
:
'请选择入职时间'
,
// 入职时间
date
:
'请选择入职时间'
,
// 入职时间
show
:
false
,
// 日期弹窗
show
:
false
,
// 日期弹窗
depId
:
'123'
depId
:
'123'
,
entId
:
''
,
currentDep
,
loading
:
false
,
acceptJoin
,
}
}
},
},
created
()
{
created
()
{
// this.depId = (this.$route.query.teamId || '') as string
this
.
depId
=
this
.
$route
.
query
.
id
as
string
this
.
entId
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
||
'{}'
).
id
this
.
acceptJoin
=
Object
.
assign
(
this
.
acceptJoin
,
this
.
$store
.
state
.
acceptJoin
)
this
.
getDep
()
},
},
methods
:
{
methods
:
{
selectDep
()
{
this
.
acceptJoin
.
expiration
=
this
.
acceptJoin
.
joinTime
this
.
acceptJoin
.
oaServer
=
'http://172.16.101.107:20000'
this
.
$store
.
commit
(
'setAcceptJoin'
,
this
.
acceptJoin
)
this
.
$router
.
push
(
'/team/select-team'
)
},
getDep
()
{
this
.
loading
=
true
this
.
$service
.
department
.
getDep
({
entId
:
this
.
entId
,
id
:
this
.
depId
}).
then
((
res
:
any
)
=>
{
const
{
data
}
=
res
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
currentDep
=
data
.
data
}
})
},
validatePhone
(
val
:
string
)
{
validatePhone
(
val
:
string
)
{
const
reg
=
/^1
[
3456789
]\d{9}
$/
const
reg
=
/^1
[
3456789
]\d{9}
$/
return
reg
.
test
(
val
)
return
reg
.
test
(
val
)
...
@@ -132,18 +173,14 @@ export default Vue.extend({
...
@@ -132,18 +173,14 @@ export default Vue.extend({
handleClickLeft
()
{
handleClickLeft
()
{
this
.
$router
.
go
(
-
1
)
this
.
$router
.
go
(
-
1
)
},
},
formatDate
(
date
:
Date
)
{
// 获取日期
return
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
},
// 入职日期
// 入职日期
selectJoinTime
(
date
:
Date
)
{
selectJoinTime
(
date
:
Date
)
{
this
.
joinTime
=
new
Date
(
date
).
getTime
()
this
.
acceptJoin
.
joinTime
=
new
Date
(
date
).
getTime
()
this
.
show
=
false
this
.
show
=
false
this
.
date
=
this
.
formatDate
(
date
)
this
.
date
=
this
.
formatDate
(
date
)
},
},
generateQrCode
()
{
generateQrCode
()
{
if
(
!
this
.
validatePhone
(
this
.
phone
)
||
trim
(
this
.
name
)
===
''
||
trim
(
this
.
position
)
===
''
||
this
.
joinTime
===
0
||
trim
(
this
.
depId
)
===
''
)
{
if
(
!
this
.
validatePhone
(
this
.
acceptJoin
.
phone
)
||
trim
(
this
.
acceptJoin
.
name
)
===
''
||
trim
(
this
.
acceptJoin
.
position
)
===
''
||
this
.
acceptJoin
.
joinTime
===
0
||
trim
(
this
.
depId
)
===
''
)
{
this
.
$toast
(
'请检查输入内容'
)
this
.
$toast
(
'请检查输入内容'
)
return
return
}
}
...
@@ -152,19 +189,12 @@ export default Vue.extend({
...
@@ -152,19 +189,12 @@ export default Vue.extend({
message
:
'确定保存该成员信息,并生成成员信息二维码邀请该成员加入团队?'
message
:
'确定保存该成员信息,并生成成员信息二维码邀请该成员加入团队?'
// confirmButtonText: '解散'
// confirmButtonText: '解散'
}).
then
(()
=>
{
}).
then
(()
=>
{
const
data
=
{
this
.
acceptJoin
.
entId
=
this
.
entId
expiration
:
1
,
this
.
acceptJoin
.
depId
=
this
.
depId
inviterId
:
'inviterId'
,
this
.
acceptJoin
.
expiration
=
this
.
acceptJoin
.
joinTime
name
:
this
.
name
,
this
.
acceptJoin
.
inviterId
=
"1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR"
oaServer
:
'oaServer'
,
this
.
acceptJoin
.
oaServer
=
'http://172.16.101.107:20000'
depId
:
this
.
depId
,
this
.
$store
.
commit
(
'setAcceptJoin'
,
this
.
acceptJoin
)
entId
:
'entId'
,
hash
:
'hash'
,
joinTime
:
this
.
joinTime
,
phone
:
this
.
phone
,
position
:
this
.
position
}
this
.
$store
.
commit
(
'setAcceptJoin'
,
data
)
this
.
$router
.
push
(
'/team/two-code'
)
this
.
$router
.
push
(
'/team/two-code'
)
}).
catch
(()
=>
{})
}).
catch
(()
=>
{})
}
}
...
...
src/views/team/components/team-contacts.vue
View file @
e5e94480
...
@@ -112,6 +112,10 @@ export default Vue.extend({
...
@@ -112,6 +112,10 @@ export default Vue.extend({
default
()
{
default
()
{
return
[]
return
[]
}
}
},
multiple
:
{
type
:
Boolean
,
default
:
false
}
}
},
},
components
:{
components
:{
...
@@ -190,6 +194,8 @@ export default Vue.extend({
...
@@ -190,6 +194,8 @@ export default Vue.extend({
this
.
$emit
(
'click-member'
,
member
)
this
.
$emit
(
'click-member'
,
member
)
},
},
handleCheck
(
member
:
Staff
)
{
handleCheck
(
member
:
Staff
)
{
if
(
this
.
multiple
)
{
// 多选
let
arr
=
Array
.
from
(
this
.
checked
)
let
arr
=
Array
.
from
(
this
.
checked
)
const
index
=
arr
.
findIndex
(
id
=>
id
===
member
.
id
)
const
index
=
arr
.
findIndex
(
id
=>
id
===
member
.
id
)
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
...
@@ -198,6 +204,11 @@ export default Vue.extend({
...
@@ -198,6 +204,11 @@ export default Vue.extend({
arr
.
push
(
member
.
id
)
arr
.
push
(
member
.
id
)
}
}
this
.
$emit
(
'update:checked'
,
arr
)
this
.
$emit
(
'update:checked'
,
arr
)
}
else
{
// 单选
const
arr
=
[
member
.
id
]
this
.
$emit
(
'update:checked'
,
arr
)
}
}
}
}
}
})
})
...
...
src/views/team/join-team/confirm-join.vue
View file @
e5e94480
...
@@ -4,17 +4,15 @@
...
@@ -4,17 +4,15 @@
<main-page
<main-page
header-bg=
"bg-transparent"
header-bg=
"bg-transparent"
title-color=
"text-white"
title-color=
"text-white"
@
click-left=
"$router.go(-1)
"
:loading=
"loading
"
>
>
<!-- 顶部左侧插槽 -->
<!-- 顶部左侧插槽 -->
<template
slot=
"left"
>
<!--
<app-icon
<app-icon
slot=
"left"
type=
"png"
class-name=
"w-6.5 w-6.5"
class-name=
"w-6.5 w-6.5"
:path=
"require('@/assets/icons/left-arrow-white.png')
"
icon-name=
"left-arrow-white
"
@
click=
"$router.go(-1)"
@
click=
"$router.go(-1)"
/>
/>
-->
</
template
>
<div
class=
"relative w-full h-40 bg-color-primary"
>
<div
class=
"relative w-full h-40 bg-color-primary"
>
<!-- 背景图 -->
<!-- 背景图 -->
<!--
<img
class=
"w-82 absolute top-0 right-0"
src=
"@/assets/images/header-bg.png"
alt=
""
>
-->
<!--
<img
class=
"w-82 absolute top-0 right-0"
src=
"@/assets/images/header-bg.png"
alt=
""
>
-->
...
@@ -50,12 +48,25 @@
...
@@ -50,12 +48,25 @@
title=
"部门"
title=
"部门"
title-class=
"text-sm text-text-secondary"
title-class=
"text-sm text-text-secondary"
>
>
<div
slot=
"content"
class=
"text-text-primary"
>
{{info.name}}
</div>
<div
slot=
"content"
class=
"text-text-primary"
>
{{
departName
}}
</div>
</c-cell>
<c-cell
title=
"入职时间"
title-class=
"text-sm text-text-secondary"
>
<div
slot=
"content"
class=
"text-text-primary"
>
{{
formatDate
(
info
.
joinTime
,
'YYYY-MM-DD'
)
}}
</div>
</c-cell>
<c-cell
title=
"手机号"
title-class=
"text-sm text-text-secondary"
>
<div
slot=
"content"
class=
"text-text-primary"
>
{{
info
.
phone
}}
</div>
</c-cell>
</c-cell>
</group-cell>
</group-cell>
<!-- 底部操作 -->
<!-- 底部操作 -->
<div
class=
"py-2 px-4 bg-common-bg w-screen fixed bottom-0 left-0 z-30"
>
<div
class=
"pt-1 pb-3 px-4 bg-common-bg w-screen fixed bottom-0 left-0 z-30"
>
<c-button
round
@
click=
"submit"
>
提交申请
</c-button>
<c-button
round
@
click=
"submit"
>
同意加入团队
</c-button>
<div
class=
"px-6 info text-xs text-text-secondary mt-2.5 text-center"
>
同意加入团队将绑定您的个人账号,若信息有误需修改,请联系团队管理员
</div>
</div>
</div>
</div>
</div>
</main-page>
</main-page>
...
@@ -64,6 +75,8 @@
...
@@ -64,6 +75,8 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
formatDate
}
from
'@/util/FormatDate'
import
{
AcceptJoinDTO
}
from
'@/service/moudles/service.dto'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
name
:
'JoinTeam'
,
name
:
'JoinTeam'
,
...
@@ -76,23 +89,60 @@ export default Vue.extend({
...
@@ -76,23 +89,60 @@ export default Vue.extend({
'c-cell'
:
()
=>
import
(
'@/components/common/c-cell.vue'
)
'c-cell'
:
()
=>
import
(
'@/components/common/c-cell.vue'
)
},
},
data
()
{
data
()
{
return
{
const
info
:
AcceptJoinDTO
=
{
expiration
:
0
,
inviterId
:
''
,
name
:
''
,
name
:
''
,
oaServer
:
''
,
depId
:
''
,
entId
:
''
,
hash
:
''
,
joinTime
:
0
,
phone
:
''
,
phone
:
''
,
validateNum
:
''
,
position
:
''
reason
:
''
,
info
:
{
name
:
'张三'
}
}
return
{
formatDate
,
info
,
departName
:
''
,
loading
:
false
}
}
},
},
created
()
{
created
()
{
const
query
=
this
.
$route
.
query
.
query
||
'{}'
const
query
=
this
.
$route
.
query
.
query
||
'{}'
const
info
=
JSON
.
parse
(
query
as
string
)
this
.
info
=
JSON
.
parse
(
query
as
string
)
this
.
getDepInfo
()
},
},
methods
:
{
methods
:
{
submit
()
{
submit
()
{
console
.
log
(
'申请'
)
console
.
log
(
'申请'
)
this
.
loading
=
true
this
.
$service
.
enterprise
.
acceptJoin
(
this
.
info
)
.
then
((
res
:
any
)
=>
{
const
{
data
}
=
res
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
$toast
(
'加入成功'
)
this
.
$store
.
commit
(
'acceptJoin'
,
{})
}
else
{
this
.
$toast
(
data
.
msg
)
}
})
},
getDepInfo
()
{
this
.
loading
=
true
this
.
$service
.
department
.
getDep
({
entId
:
this
.
info
.
entId
,
id
:
this
.
info
.
depId
}).
then
((
res
:
any
)
=>
{
this
.
loading
=
false
const
{
data
}
=
res
if
(
data
.
code
===
this
.
$global
.
success
)
{
console
.
log
(
data
.
data
.
name
,
'depIndo'
)
this
.
departName
=
data
.
data
.
name
}
})
}
}
}
}
})
})
...
...
src/views/team/select-team.vue
View file @
e5e94480
<
template
>
<
template
>
<!-- 选择部门 -->
<!-- 选择部门 -->
<div
class=
"select-team"
>
<div
class=
"select-team"
>
<main-page
left-arrow
@
click-left=
"$router.go(-1)"
>
<main-page
left-arrow
:loading=
"loading"
@
click-left=
"$router.go(-1)"
>
<template
slot=
"right"
>
<template
slot=
"right"
>
<app-icon
<app-icon
type=
"png"
type=
"png"
...
@@ -13,14 +17,14 @@
...
@@ -13,14 +17,14 @@
<div
class=
"px-4 pt-14 pb-16"
>
<div
class=
"px-4 pt-14 pb-16"
>
<!-- 顶部 -->
<!-- 顶部 -->
<div
class=
"bread"
>
<div
class=
"bread"
>
<
template
v-if=
"current
TeamId === 0
"
>
<
template
v-if=
"current
Dep.parentId === '-1'
"
>
<div
class=
"font-medium py-3.5"
>
杭州复杂美科技有限公司
</div>
<div
class=
"font-medium py-3.5"
>
{{
entName
}}
</div>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<div
class=
"text-text-secondary font-medium py-3"
@
click=
"goPre"
>
所有部门
</div>
<div
class=
"text-text-secondary font-medium py-3"
@
click=
"goPre"
>
所有部门
</div>
<div
class=
"text-text-secondary py-3 text-xs mx-2"
>
>
</div>
<div
class=
"text-text-secondary py-3 text-xs mx-2"
>
>
</div>
<div
class=
"font-medium py-3"
>
{{
current
Team
.
name
}}
</div>
<div
class=
"font-medium py-3"
>
{{
current
Dep
.
name
}}
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -28,7 +32,7 @@
...
@@ -28,7 +32,7 @@
<!-- 部门列表 -->
<!-- 部门列表 -->
<div
class=
"list mt-1.5"
>
<div
class=
"list mt-1.5"
>
<div
<div
v-for=
"t in current
Team
.children"
v-for=
"t in current
Dep
.children"
:key=
"t.id"
:key=
"t.id"
class=
"flex items-center"
class=
"flex items-center"
>
>
...
@@ -53,7 +57,6 @@
...
@@ -53,7 +57,6 @@
</div>
</div>
</div>
</div>
<div
<div
v-if=
"t.children && t.children.length > 0"
class=
"flex-shrink-0 flex items-center text-color-primary py-3"
class=
"flex-shrink-0 flex items-center text-color-primary py-3"
@
click=
"goNext(t)"
@
click=
"goNext(t)"
>
>
...
@@ -66,7 +69,6 @@
...
@@ -66,7 +69,6 @@
</div>
</div>
</div>
</div>
<div
<div
v-if=
"checked !== 0"
class=
"action fixed bottom-0 left-0 w-full px-4 py-2 z-10 bg-common-bg"
class=
"action fixed bottom-0 left-0 w-full px-4 py-2 z-10 bg-common-bg"
@
click=
"confirm"
@
click=
"confirm"
>
>
...
@@ -79,7 +81,7 @@
...
@@ -79,7 +81,7 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
team
,
flatTeams
,
Member
}
from
'@/DTO
'
import
{
Department
}
from
'@/Interface
'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
name
:
'SelectTeam'
,
name
:
'SelectTeam'
,
...
@@ -94,63 +96,81 @@ export default Vue.extend({
...
@@ -94,63 +96,81 @@ export default Vue.extend({
vm
.
fromPath
=
from
.
path
vm
.
fromPath
=
from
.
path
})
})
},
},
created
()
{
// console.log(this.team, 'team')
},
data
()
{
data
()
{
const
selectedIds
:
Array
<
number
>
=
[]
const
selectedIds
:
Array
<
Department
>
=
[]
const
currentDep
:
Department
=
{
entId
:
''
,
id
:
''
,
leaderId
:
''
,
name
:
''
,
parentId
:
''
,
children
:
[]
}
return
{
return
{
team
,
checked
:
''
,
flatTeams
,
fromPath
:
''
,
checked
:
0
,
loading
:
false
,
selectedIds
,
entId
:
''
,
currentTeamId
:
0
,
depId
:
''
,
fromPath
:
''
currentDep
,
entName
:
''
}
}
},
},
computed
:
{
created
()
{
tags
()
{
const
ent
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
||
'{}'
)
const
arr
:
Array
<
Member
>
=
[]
this
.
entId
=
ent
.
id
this
.
selectedIds
.
forEach
(
id
=>
{
this
.
depId
=
ent
.
rootDepId
const
index
=
this
.
flatTeams
.
findIndex
(
team
=>
team
.
id
===
id
)
this
.
checked
=
ent
.
id
if
(
index
>
-
1
)
{
this
.
getSub
()
arr
.
push
(
this
.
flatTeams
[
index
])
}
})
return
arr
},
},
currentTeam
():
Member
{
methods
:
{
// return this.flatTeams.find(team => team.id === this.currentTeamId)
getSub
()
{
return
this
.
findTeamById
(
this
.
currentTeamId
,
this
.
flatTeams
)
as
Member
this
.
loading
=
true
this
.
$service
.
department
.
getSub
({
entId
:
this
.
entId
,
parentId
:
this
.
depId
}).
then
((
res
:
any
)
=>
{
const
{
data
}
=
res
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
console
.
log
(
data
,
'adad'
)
this
.
currentDep
=
data
.
data
.
dep
if
(
this
.
currentDep
.
parentId
===
'-1'
)
{
this
.
entName
=
this
.
currentDep
.
name
}
this
.
currentDep
.
children
=
data
.
data
.
subDepList
}
}
}).
catch
(()
=>
{
this
.
loading
=
false
})
},
},
methods
:
{
// 下一级
// 下一级
goNext
(
team
:
Member
)
{
goNext
(
team
:
Department
)
{
this
.
currentTeamId
=
team
.
id
console
.
log
(
team
,
'team'
)
// this.currentTeamId = team.id
this
.
depId
=
team
.
id
this
.
getSub
()
},
},
// 所有部门
// 所有部门
goPre
()
{
goPre
()
{
this
.
currentTeamId
=
this
.
currentTeam
.
parentId
||
0
this
.
depId
=
this
.
currentDep
.
parentId
this
.
checked
=
0
this
.
getSub
()
},
},
// 选择
// 选择
selectTeam
(
team
:
Member
)
{
selectTeam
(
team
:
Department
)
{
if
(
this
.
checked
===
team
.
id
)
{
if
(
this
.
checked
===
team
.
id
)
{
this
.
checked
=
0
this
.
checked
=
this
.
currentDep
.
id
return
return
}
}
this
.
checked
=
team
.
id
this
.
checked
=
team
.
id
},
},
findTeamById
(
id
:
number
|
string
,
teamArr
:
Array
<
Member
>
)
{
return
teamArr
.
find
(
team
=>
team
.
id
===
id
)
},
// 确认选择
// 确认选择
confirm
()
{
confirm
()
{
console
.
log
(
this
.
checked
,
'checked'
)
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
this
.
fromPath
,
path
:
this
.
fromPath
,
query
:
{
query
:
{
teamI
d
:
String
(
this
.
checked
)
i
d
:
String
(
this
.
checked
)
}
}
})
})
}
}
...
...
src/views/team/team-detail.vue
View file @
e5e94480
...
@@ -88,7 +88,8 @@ export default Vue.extend({
...
@@ -88,7 +88,8 @@ export default Vue.extend({
checkedMemberId
:
[],
checkedMemberId
:
[],
showRadio
:
false
,
showRadio
:
false
,
ifContainChildDep
:
true
,
ifContainChildDep
:
true
,
loading
:
false
loading
:
false
,
multiple
:
false
}
}
},
},
watch
:
{
watch
:
{
...
@@ -101,7 +102,8 @@ export default Vue.extend({
...
@@ -101,7 +102,8 @@ export default Vue.extend({
}
}
},
},
created
()
{
created
()
{
this
.
showRadio
=
this
.
$route
.
query
.
transfer
===
'1'
this
.
showRadio
=
this
.
$route
.
query
.
showRadio
===
'1'
this
.
multiple
=
this
.
$route
.
query
.
multiple
===
'2'
this
.
parentId
=
this
.
$route
.
params
.
id
this
.
parentId
=
this
.
$route
.
params
.
id
this
.
entId
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
||
'{}'
).
id
this
.
entId
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
||
'{}'
).
id
this
.
getStaff
(
this
.
parentId
)
this
.
getStaff
(
this
.
parentId
)
...
...
src/views/team/team-frame.vue
View file @
e5e94480
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<team-contacts
<team-contacts
:radio=
"showRadio"
:radio=
"showRadio"
:multiple=
"multiple"
:checked
.
sync=
"checkedMemberId"
:checked
.
sync=
"checkedMemberId"
:contacts=
"contacts"
:contacts=
"contacts"
@
click-member=
"clickMember"
@
click-member=
"clickMember"
...
@@ -40,12 +41,12 @@
...
@@ -40,12 +41,12 @@
<!-- 底部操作 -->
<!-- 底部操作 -->
<div
class=
"py-2 px-4 bg-white w-screen fixed bottom-0 left-0 z-30"
>
<div
class=
"py-2 px-4 bg-white w-screen fixed bottom-0 left-0 z-30"
>
<
template
v-if=
"showRadio"
>
<
template
v-if=
"showRadio"
>
<c-button
round
@
click=
"
$router.go(-1)
"
>
确定
</c-button>
<c-button
round
@
click=
"
confirmSelect
"
>
确定
</c-button>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<div
class=
"grid grid-cols-3 gap-2.5"
>
<div
class=
"grid grid-cols-3 gap-2.5"
>
<c-button
round
@
click=
"
$router.push('/team/add-member')
"
>
添加成员
</c-button>
<c-button
round
@
click=
"
addMember
"
>
添加成员
</c-button>
<c-button
round
@
click=
"
$router.push('/team/add-department')
"
>
添加部门
</c-button>
<c-button
round
@
click=
"
addDep
"
>
添加部门
</c-button>
<c-button
round
@
click=
"setDepartment"
>
部门设置
</c-button>
<c-button
round
@
click=
"setDepartment"
>
部门设置
</c-button>
</div>
</div>
</
template
>
</
template
>
...
@@ -73,8 +74,20 @@ export default Vue.extend({
...
@@ -73,8 +74,20 @@ export default Vue.extend({
'c-button'
:
()
=>
import
(
'@/components/common/c-button.vue'
),
'c-button'
:
()
=>
import
(
'@/components/common/c-button.vue'
),
'switch-cell'
:
()
=>
import
(
'@/components/common/switch-cell.vue'
)
'switch-cell'
:
()
=>
import
(
'@/components/common/switch-cell.vue'
)
},
},
beforeRouteEnter
(
to
,
from
,
next
)
{
next
((
vm
:
any
)
=>
{
vm
.
fromPath
=
from
.
path
})
},
data
()
{
data
()
{
const
team
:
Array
<
Department
>
=
[]
const
team
:
Array
<
Department
>
=
[]
const
currentDep
:
Department
=
{
entId
:
''
,
id
:
''
,
leaderId
:
''
,
name
:
''
,
parentId
:
''
}
return
{
return
{
title
:
'导航'
,
title
:
'导航'
,
team
,
team
,
...
@@ -83,10 +96,12 @@ export default Vue.extend({
...
@@ -83,10 +96,12 @@ export default Vue.extend({
parentId
:
'166961152260050945'
,
parentId
:
'166961152260050945'
,
ifContainChildDep
:
true
,
ifContainChildDep
:
true
,
enterpriseInfo
:
{},
enterpriseInfo
:
{},
currentDep
:
{}
,
currentDep
,
// 是否显示check
// 是否显示check
checkedMemberId
:
[],
checkedMemberId
:
[],
showRadio
:
false
showRadio
:
false
,
fromPath
:
''
,
multiple
:
false
}
}
},
},
created
()
{
created
()
{
...
@@ -98,6 +113,11 @@ export default Vue.extend({
...
@@ -98,6 +113,11 @@ export default Vue.extend({
this
.
getStaff
()
this
.
getStaff
()
},
},
methods
:
{
methods
:
{
// 确认选择
confirmSelect
()
{
this
.
$store
.
commit
(
'setAddDepLeader'
,
this
.
checkedMemberId
)
this
.
$router
.
push
(
this
.
fromPath
)
},
appNavBack
(){
appNavBack
(){
appNavBack
()
appNavBack
()
},
},
...
@@ -148,12 +168,12 @@ export default Vue.extend({
...
@@ -148,12 +168,12 @@ export default Vue.extend({
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
`/team/team/
${
val
.
id
}
`
,
path
:
`/team/team/
${
val
.
id
}
`
,
query
:
{
query
:
{
transfer
:
'1'
showRadio
:
'1'
,
multiple
:
'1'
// 1单选2多选
}
}
})
})
return
return
}
}
console
.
log
(
val
,
'del'
)
this
.
$router
.
push
(
`/team/team/
${
val
.
id
}
`
)
this
.
$router
.
push
(
`/team/team/
${
val
.
id
}
`
)
},
},
// 切换成员显示
// 切换成员显示
...
@@ -164,6 +184,20 @@ export default Vue.extend({
...
@@ -164,6 +184,20 @@ export default Vue.extend({
setDepartment
()
{
setDepartment
()
{
const
id
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
||
'{}'
).
rootDepId
const
id
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
||
'{}'
).
rootDepId
this
.
$router
.
push
(
`/team/department-management/
${
id
}
`
)
this
.
$router
.
push
(
`/team/department-management/
${
id
}
`
)
},
// 添加成员
addMember
()
{
this
.
$router
.
push
({
path
:
'/team/add-member'
,
query
:
{
id
:
this
.
currentDep
.
id
}
})
// $router.push('/team/add-member')
},
addDep
()
{
this
.
$store
.
commit
(
'setAddDepParent'
,
this
.
currentDep
)
this
.
$router
.
push
(
'/team/add-department'
)
}
}
}
}
})
})
...
...
src/views/team/two-code.vue
View file @
e5e94480
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<vue-qr
<vue-qr
:logoSrc=
"require('@/assets/icons/y-chat33.png')"
:logoSrc=
"require('@/assets/icons/y-chat33.png')"
:text=
"qrCodeText"
:text=
"qrCodeText"
:correct-level=
"3"
:margin=
"2"
:margin=
"2"
:size=
"400"
:size=
"400"
/>
/>
...
@@ -73,8 +73,9 @@ export default Vue.extend({
...
@@ -73,8 +73,9 @@ export default Vue.extend({
async
created
()
{
async
created
()
{
// console.log(Mock, 'mock')
// console.log(Mock, 'mock')
this
.
joinInfo
=
this
.
$store
.
state
.
acceptJoin
||
{}
this
.
joinInfo
=
this
.
$store
.
state
.
acceptJoin
||
{}
console
.
log
(
this
.
joinInfo
,
'joinIndo'
)
this
.
qrCodeText
=
JSON
.
stringify
(
this
.
joinInfo
)
this
.
qrCodeText
=
JSON
.
stringify
(
this
.
joinInfo
)
let
url
=
'http://192.168.20.138:8080/team/
join-team
'
let
url
=
'http://192.168.20.138:8080/team/
confirm-join
'
// for(const key in this.joinInfo) {
// for(const key in this.joinInfo) {
// url = `${url}?${key}=${this.joinInfo[key]}`
// url = `${url}?${key}=${this.joinInfo[key]}`
// }
// }
...
...
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