Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-ces
Project
Project
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
wangqinghua
wisdom-ces
Commits
e493940f
Commit
e493940f
authored
Oct 17, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
fdc96cfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
81 deletions
+84
-81
select-change-person.ts
...s/manageDuty/select-change-person/select-change-person.ts
+84
-81
No files found.
src/pages/manageDuty/select-change-person/select-change-person.ts
View file @
e493940f
import
{
Component
}
from
'@angular/core'
;
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
AppService
}
from
"../../../service/appHttpService"
;
import
{
AppService
}
from
"../../../service/appHttpService"
;
import
{
ChangeApplySurePage
}
from
"../change-apply-sure/change-apply-sure"
;
import
{
ChangeApplySurePage
}
from
"../change-apply-sure/change-apply-sure"
;
import
{
CalendarComponentOptions
,
DayConfig
}
from
"ion2-calendar"
;
import
{
CalendarComponentOptions
,
DayConfig
}
from
"ion2-calendar"
;
import
{
monthCh
,
weekDay
}
from
"../../../app/main"
;
import
{
monthCh
,
weekDay
}
from
"../../../app/main"
;
import
{
DatePipe
}
from
"@angular/common"
;
import
{
DatePipe
}
from
"@angular/common"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
selector
:
'page-select-change-person'
,
selector
:
'page-select-change-person'
,
templateUrl
:
'select-change-person.html'
,
templateUrl
:
'select-change-person.html'
,
})
})
export
class
SelectChangePersonPage
{
export
class
SelectChangePersonPage
{
...
@@ -22,98 +22,101 @@ export class SelectChangePersonPage {
...
@@ -22,98 +22,101 @@ export class SelectChangePersonPage {
date
;
//换班日期
date
;
//换班日期
list
=
[];
list
=
[];
type
;
type
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
,
public
datePipe
:
DatePipe
)
{
}
ionViewDidLoad
()
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
this
.
scheduleId
=
this
.
navParams
.
get
(
'scheduleId'
);
public
appService
:
AppService
,
public
datePipe
:
DatePipe
)
{
this
.
getDetail
();
}
}
ionViewDidLoad
()
{
this
.
scheduleId
=
this
.
navParams
.
get
(
'scheduleId'
);
this
.
getDetail
();
}
getDetail
(){
getDetail
()
{
const
year
=
this
.
datePipe
.
transform
(
this
.
navParams
.
get
(
'date'
),
'yyyy'
);
const
year
=
this
.
datePipe
.
transform
(
this
.
navParams
.
get
(
'date'
),
'yyyy'
);
const
month
=
this
.
datePipe
.
transform
(
this
.
navParams
.
get
(
'date'
),
'MM'
);
const
month
=
this
.
datePipe
.
transform
(
this
.
navParams
.
get
(
'date'
),
'MM'
);
const
data
=
{
const
data
=
{
id
:
this
.
scheduleId
id
:
this
.
scheduleId
}
}
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/schedule/getScheduleById'
,
data
).
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/schedule/getScheduleById'
,
data
).
subscribe
((
res
)
=>
{
subscribe
((
res
)
=>
{
this
.
type
=
res
.
json
().
type
;
this
.
type
=
res
.
json
().
type
;
this
.
getMonth
(
year
,
month
);
this
.
getMonth
(
year
,
month
);
})
})
}
}
//选择月份
//选择月份
//月份改变
//月份改变
monChange
(
e
)
{
monChange
(
e
)
{
this
.
getMonth
(
e
.
newMonth
.
years
,
e
.
newMonth
.
months
);
this
.
getMonth
(
e
.
newMonth
.
years
,
e
.
newMonth
.
months
);
}
}
getMonth
(
year
,
month
)
{
getMonth
(
year
,
month
)
{
let
date
=
new
Date
();
let
date
=
new
Date
();
//4.每月的周末
//4.每月的周末
let
d
=
new
Date
(
year
,
month
,
0
).
getDate
();
let
d
=
new
Date
(
year
,
month
,
0
).
getDate
();
// for (let i = 1; i < d + 1; i++) {
// for (let i = 1; i < d + 1; i++) {
// date.setFullYear(year, month - 1, i);
// date.setFullYear(year, month - 1, i);
// let day = date.getDay();
// let day = date.getDay();
// if (day == 6 || day == 0) {
// if (day == 6 || day == 0) {
// const data = {
// const data = {
// date: new Date(year, month - 1, i),
// date: new Date(year, month - 1, i),
// cssClass: 'dayOff1'
// cssClass: 'dayOff1'
// };
// };
// this.newArr.push(data);
// this.newArr.push(data);
// }
// }
// }
// }
const
data
=
{
const
data
=
{
date
:
year
+
'/'
+
month
+
'/01'
,
date
:
year
+
'/'
+
month
+
'/01'
,
type
:
this
.
type
type
:
this
.
type
};
};
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/schedule/getScheduleByMonthAndType'
,
data
)
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/schedule/getScheduleByMonthAndType'
,
data
)
.
subscribe
((
res
)
=>
{
.
subscribe
((
res
)
=>
{
let
response
=
res
.
json
();
let
response
=
res
.
json
();
response
.
forEach
(
event
=>
{
response
.
forEach
(
event
=>
{
this
.
newArr
.
push
({
this
.
newArr
.
push
({
date
:
new
Date
(
event
.
dutyDate
),
date
:
new
Date
(
event
.
dutyDate
),
disable
:
false
,
disable
:
false
,
subTitle
:
event
.
name
,
subTitle
:
event
.
name
,
cssClass
:
event
.
id
cssClass
:
event
.
id
})
})
});
});
this
.
optionsMulti
=
{
this
.
optionsMulti
=
{
pickMode
:
'single'
,
pickMode
:
'single'
,
monthFormat
:
'YYYY 年 MM 月 '
,
monthFormat
:
'YYYY 年 MM 月 '
,
weekdays
:
weekDay
,
weekdays
:
weekDay
,
monthPickerFormat
:
monthCh
,
monthPickerFormat
:
monthCh
,
weekStart
:
0
,
weekStart
:
0
,
daysConfig
:
this
.
newArr
daysConfig
:
this
.
newArr
};
};
})
})
}
}
onSelect
(
e
){
onSelect
(
e
)
{
console
.
log
(
e
);
this
.
changeInfo
=
null
;
this
.
changeInfo
=
e
;
console
.
log
(
e
);
if
(
e
.
subTitle
!=
''
)
{
this
.
changeInfo
=
e
;
}
}
}
//换班
//换班
submit
(){
submit
()
{
if
(
!
this
.
changeInfo
)
{
if
(
!
this
.
changeInfo
)
{
this
.
appService
.
popToastView
(
'请选择换班人员'
,
'middle'
,
1500
);
this
.
appService
.
popToastView
(
'请选择换班人员'
,
'middle'
,
1500
);
return
false
;
return
false
;
}
}
const
item
=
{
const
item
=
{
name
:
this
.
changeInfo
.
subTitle
,
name
:
this
.
changeInfo
.
subTitle
,
time
:
this
.
changeInfo
.
time
time
:
this
.
changeInfo
.
time
};
};
this
.
navCtrl
.
push
(
'ChangeApplySurePage'
,{
this
.
navCtrl
.
push
(
'ChangeApplySurePage'
,
{
'changeId'
:
this
.
changeInfo
.
cssClass
,
'changeId'
:
this
.
changeInfo
.
cssClass
,
'nowId'
:
this
.
scheduleId
,
'nowId'
:
this
.
scheduleId
,
'item'
:
item
,
'item'
:
item
,
'applyId'
:
this
.
navParams
.
get
(
'applyId'
),
'applyId'
:
this
.
navParams
.
get
(
'applyId'
),
})
})
}
}
...
...
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