Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
schedule
Commits
8fd652f1
Commit
8fd652f1
authored
5 years ago
by
fengzhaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选人
parent
e4c2b8ce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
29 deletions
+41
-29
createOrEditSchedule.js
pages/createOrEditSchedule/createOrEditSchedule.js
+41
-29
No files found.
pages/createOrEditSchedule/createOrEditSchedule.js
View file @
8fd652f1
...
...
@@ -23,7 +23,10 @@ create.Page({
// 人员增量信息 减量信息 只有在编辑的时候使用
addUserList
:
undefined
,
deleteUserList
:
undefined
,
originUserList
:
[]
originUserList
:
[],
requireUsers
:
[],
requireUsersInfo
:
[],
organizer
:
''
},
onLoad
(
event
)
{
...
...
@@ -154,52 +157,60 @@ create.Page({
title
:
event
.
detail
.
value
})
},
//
创建
添加参会人
// 添加参会人
addParticipants
()
{
const
_that
=
this
let
require
=
[]
let
select
=
[]
if
(
!
this
.
data
.
scheduleItem
||
this
.
data
.
organizer
===
getApp
().
globalData
.
userid
)
{
select
=
this
.
store
.
data
.
participatorUserId
require
=
[
getApp
().
globalData
.
userid
]
select
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
userId
==
getApp
().
globalData
.
userid
)
{
select
.
splice
(
index
,
1
)
}
})
}
else
{
select
=
this
.
store
.
data
.
participatorUserId
require
=
this
.
data
.
requireUsers
console
.
log
(
require
)
console
.
log
(
_that
.
selectedelRequired
(
require
,
select
).
pickedUsers
)
}
dd
.
complexChoose
({
limitTips
:
"超出了"
,
//超过限定人数返回提示
title
:
"选择参会人"
,
//标题
multiple
:
true
,
//是否多选
pickedUsers
:
_that
.
s
tore
.
data
.
participatorUserId
,
//已选用户
requiredUsers
:
[]
,
//必选用户(不可取消选中状态)
pickedUsers
:
_that
.
s
electedelRequired
(
require
,
select
).
pickedUsers
,
//已选用户
requiredUsers
:
require
,
//必选用户(不可取消选中状态)
responseUserOnly
:
true
,
//返回人,或者返回人和部门
success
:
function
(
res
)
{
if
(
!
_that
.
data
.
scheduleItem
||
_that
.
data
.
organizer
===
getApp
().
globalData
.
userid
)
{
_that
.
store
.
data
.
participatorList
=
[]
_that
.
store
.
data
.
participat
rUserId
=
[]
_that
.
store
.
data
.
participato
rUserId
=
[]
res
.
users
.
forEach
((
item
,
index
)
=>
{
_that
.
store
.
data
.
participatorList
.
push
({
userId
:
item
.
userId
,
username
:
item
.
name
,
headUrl
:
item
.
headUrl
})
_that
.
store
.
data
.
participatorUserId
.
push
(
item
.
userId
)
})
_that
.
store
.
data
.
participatorList
=
_that
.
setArrary
(
_that
.
store
.
data
.
participatorList
)
_that
.
store
.
data
.
participatorUserId
=
[...
new
Set
(
_that
.
store
.
data
.
participatorUserId
)]
_that
.
update
()
_that
.
conflict
()
// _that.arrayPoor(_that.data.originUserList, _that.store.data.participatorList)
},
fail
:
function
(
err
)
{
}
})
},
// 编辑添加参会人
editPParticipants
()
{
const
_that
=
this
dd
.
complexChoose
({
title
:
"选择参会人"
,
//标题
multiple
:
true
,
//是否多选
pickedUsers
:
[],
//已选用户
requiredUsers
:
[],
//必选用户(不可取消选中状态)
responseUserOnly
:
true
,
//返回人,或者返回人和部门
success
:
function
(
res
)
{
_that
.
store
.
data
.
participatorList
.
push
({
userId
:
getApp
().
globalData
.
userid
,
username
:
getApp
().
globalData
.
name
,
headUrl
:
getApp
().
globalData
.
avatar
})
_that
.
store
.
data
.
participatorUserId
.
push
(
getApp
().
globalData
.
userid
)
}
else
{
_that
.
store
.
data
.
participatorList
=
[]
_that
.
store
.
data
.
participatorUserId
=
[]
res
.
users
.
forEach
((
item
,
index
)
=>
{
_that
.
store
.
data
.
participatorList
.
push
({
userId
:
item
.
userId
,
username
:
item
.
name
,
headUrl
:
item
.
headUrl
})
_that
.
store
.
data
.
participatorUserId
.
push
(
item
.
userId
)
})
_that
.
data
.
requireUsersInfo
.
forEach
((
item
,
index
)
=>
{
_that
.
store
.
data
.
participatorList
.
push
({
userId
:
item
.
userId
,
username
:
item
.
name
,
headUrl
:
item
.
headUrl
})
_that
.
store
.
data
.
participatorUserId
.
push
(
item
.
userId
)
})
}
_that
.
store
.
data
.
participatorList
=
_that
.
setArrary
(
_that
.
store
.
data
.
participatorList
)
_that
.
store
.
data
.
participatorUserId
=
[...
new
Set
(
_that
.
store
.
data
.
participatorUserId
)]
_that
.
update
()
_that
.
conflict
()
//
_that.arrayPoor(_that.data.originUserList, _that.store.data.participatorList)
_that
.
arrayPoor
(
_that
.
data
.
originUserList
,
_that
.
store
.
data
.
participatorList
)
},
fail
:
function
(
err
)
{
}
...
...
@@ -378,6 +389,9 @@ create.Page({
this
.
store
.
data
.
remark
=
res
.
data
.
data
.
remark
||
''
this
.
store
.
data
.
recurrenceModel
=
res
.
data
.
data
.
recurrenceModel
||
{
model
:
'no-repeat'
}
this
.
setData
({
organizer
:
res
.
data
.
data
.
organizer
,
requireUsersInfo
:
participatorList
,
requireUsers
:
participatorUserId
,
originUserList
:
participatorList
,
title
:
res
.
data
.
data
.
title
,
time1
:
res
.
data
.
data
.
startTime
.
replace
(
/-/g
,
'/'
),
...
...
@@ -385,9 +399,7 @@ create.Page({
week1
:
this
.
data
.
weekList
[
new
Date
(
res
.
data
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
)).
getDay
()],
week2
:
this
.
data
.
weekList
[
new
Date
(
res
.
data
.
data
.
endTime
.
replace
(
/
\/
/g
,
"-"
)).
getDay
()]
})
console
.
log
(
2222222
)
// this.store(JSON.stringify())
console
.
log
(
2222222
)
this
.
update
()
this
.
conflict
()
})
...
...
This diff is collapsed.
Click to expand it.
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