Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
ba2dc226
Commit
ba2dc226
authored
Jun 04, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成生产时间选择
parent
e74bf87c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
19 deletions
+84
-19
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/View/TimeSelectView/ShowTimeSelectView.swift
...nessPlatform/View/TimeSelectView/ShowTimeSelectView.swift
+10
-0
GeliBusinessPlatform/View/TimeSelectView/TimeSelectView.swift
...BusinessPlatform/View/TimeSelectView/TimeSelectView.swift
+66
-13
GeliBusinessPlatform/ViewController/1.1入库&出库/入库/NewRKVc.swift
...BusinessPlatform/ViewController/1.1入库&出库/入库/NewRKVc.swift
+8
-6
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
ba2dc226
No preview for this file type
GeliBusinessPlatform/View/TimeSelectView/ShowTimeSelectView.swift
View file @
ba2dc226
...
@@ -123,6 +123,16 @@ class ShowTimeSelectView: UIView ,TimeSelectViewDelgate{
...
@@ -123,6 +123,16 @@ class ShowTimeSelectView: UIView ,TimeSelectViewDelgate{
}
}
}
}
var
endDateByWork
:
Date
?
=
nil
{
didSet
{
calendarV
.
endDateByWork
=
endDateByWork
if
BeginDate
!=
nil
{
calendarV
.
setOldDate
(
beginD
:
BeginDate
,
endD
:
BeginDate
)
let
timeInterval
:
TimeInterval
=
BeginDate
.
timeIntervalSince1970
timeLbl
.
text
=
dayByDouble
(
sender
:
timeInterval
)
}
}
}
var
BeginDate
:
Date
!
=
nil
var
BeginDate
:
Date
!
=
nil
var
EndDate
:
Date
!
=
nil
var
EndDate
:
Date
!
=
nil
...
...
GeliBusinessPlatform/View/TimeSelectView/TimeSelectView.swift
View file @
ba2dc226
...
@@ -91,7 +91,8 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
...
@@ -91,7 +91,8 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
//MARKl:--新增限定时间 ,如果不为nil就是有限定的时间
//MARKl:--新增限定时间 ,如果不为nil就是有限定的时间
var
beginDateByWork
:
Date
?
=
nil
var
beginDateByWork
:
Date
?
=
nil
var
endDateByWork
:
Date
?
=
nil
func
setOldDate
(
beginD
:
Date
,
endD
:
Date
)
{
func
setOldDate
(
beginD
:
Date
,
endD
:
Date
)
{
let
selectArr
=
calendarC
.
selectedDates
let
selectArr
=
calendarC
.
selectedDates
...
@@ -212,10 +213,30 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
...
@@ -212,10 +213,30 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
}
}
}
else
{
}
else
{
//单选
//单选
BeginDate
=
date
if
endDateByWork
!=
nil
{
EndDate
=
nil
if
date
>
endDateByWork
!
{
let
dateEnd
=
BeginDate
.
addingTimeInterval
(
TimeInterval
(
60*60*
24
-
1
))
//无用处
let
endDateByWorkT
:
TimeInterval
=
endDateByWork
!.
timeIntervalSince1970
self
.
delegate
?
.
selectMoreDate
(
beginDate
:
BeginDate
,
endginDate
:
dateEnd
)
HUD
.
flash
(
.
label
(
"所选日期不得大于"
+
dayByDouble
(
sender
:
endDateByWorkT
)),
delay
:
1.2
)
let
selectArr
=
calendar
.
selectedDates
for
select
in
selectArr
{
calendar
.
deselect
(
select
)
}
calendarC
.
select
(
BeginDate
)
SelectAction
=
true
}
else
{
BeginDate
=
date
EndDate
=
nil
let
dateEnd
=
BeginDate
.
addingTimeInterval
(
TimeInterval
(
60*60*
24
-
1
))
//无用处
self
.
delegate
?
.
selectMoreDate
(
beginDate
:
BeginDate
,
endginDate
:
dateEnd
)
}
}
else
{
BeginDate
=
date
EndDate
=
nil
let
dateEnd
=
BeginDate
.
addingTimeInterval
(
TimeInterval
(
60*60*
24
-
1
))
//无用处
self
.
delegate
?
.
selectMoreDate
(
beginDate
:
BeginDate
,
endginDate
:
dateEnd
)
}
}
}
self
.
configureVisibleCells
()
self
.
configureVisibleCells
()
...
@@ -237,17 +258,49 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
...
@@ -237,17 +258,49 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
self
.
delegate
?
.
selectMoreDate
(
beginDate
:
BeginDate
,
endginDate
:
dateEnd
)
self
.
delegate
?
.
selectMoreDate
(
beginDate
:
BeginDate
,
endginDate
:
dateEnd
)
}
else
{
}
else
{
//单选
//单选
BeginDate
=
date
if
endDateByWork
!=
nil
{
EndDate
=
nil
if
date
>
endDateByWork
!
{
let
dateEnd
=
BeginDate
.
addingTimeInterval
(
TimeInterval
(
60*60*
24
-
1
))
//无用处
let
endDateByWorkT
:
TimeInterval
=
endDateByWork
!.
timeIntervalSince1970
self
.
delegate
?
.
selectMoreDate
(
beginDate
:
BeginDate
,
endginDate
:
dateEnd
)
HUD
.
flash
(
.
label
(
"所选日期不得大于"
+
dayByDouble
(
sender
:
endDateByWorkT
)),
delay
:
1.2
)
let
selectArr
=
calendar
.
selectedDates
for
select
in
selectArr
{
calendar
.
deselect
(
select
)
}
calendarC
.
select
(
BeginDate
)
SelectAction
=
true
}
else
{
BeginDate
=
date
EndDate
=
nil
let
dateEnd
=
BeginDate
.
addingTimeInterval
(
TimeInterval
(
60*60*
24
-
1
))
//无用处
self
.
delegate
?
.
selectMoreDate
(
beginDate
:
BeginDate
,
endginDate
:
dateEnd
)
}
}
else
{
BeginDate
=
date
EndDate
=
nil
let
dateEnd
=
BeginDate
.
addingTimeInterval
(
TimeInterval
(
60*60*
24
-
1
))
//无用处
self
.
delegate
?
.
selectMoreDate
(
beginDate
:
BeginDate
,
endginDate
:
dateEnd
)
}
}
}
self
.
configureVisibleCells
()
self
.
configureVisibleCells
()
}
}
//MARK:--最大天数为今日
// //MARK:--最大天数为今日
// func maximumDate(for calendar: FSCalendar) -> Date {
// func maximumDate(for calendar: FSCalendar) -> Date {
// return Date()
// if endDateByWork == nil{
// }
// return Date().addingTimeInterval(TimeInterval(100*365*60*60*24))//最大为后100年
// }
// return endDateByWork!
// }
//MARK:--最小天数为今日
//
// func minimumDate(for calendar: FSCalendar) -> Date {
// if beginDateByWork == nil{
// return Date().addingTimeInterval(TimeInterval(-100*365*60*60*24)) //最小为前100年
// }
// return beginDateByWork!
// }
// func calendar(_ calendar: FSCalendar, shouldSelect date: Date, at monthPosition: FSCalendarMonthPosition) -> Bool {
// func calendar(_ calendar: FSCalendar, shouldSelect date: Date, at monthPosition: FSCalendarMonthPosition) -> Bool {
// return monthPosition == .current
// return monthPosition == .current
// }
// }
...
...
GeliBusinessPlatform/ViewController/1.1入库&出库/入库/NewRKVc.swift
View file @
ba2dc226
...
@@ -390,12 +390,14 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
...
@@ -390,12 +390,14 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
let
data
=
rkSelectArr
[
tempTag
!
]
let
data
=
rkSelectArr
[
tempTag
!
]
print
(
"date =="
,
data
.
createDayStr
,
data
.
createDay
)
print
(
"date =="
,
data
.
createDayStr
,
data
.
createDay
)
//把默认值传回去
//把默认值传回去
// if time_start != 0 && time_end != 0{
if
data
.
createDay
!=
nil
{
// var time = TimeInterval(exactly: time_start!)
let
time
=
TimeInterval
(
exactly
:
data
.
createDay
!
)
// timeSelectV.BeginDate = Date(timeIntervalSince1970: time!)
timeSelectV
.
BeginDate
=
Date
(
timeIntervalSince1970
:
time
!
)
// time = TimeInterval(exactly: time_end!)
timeSelectV
.
EndDate
=
Date
(
timeIntervalSince1970
:
time
!
)
//无用处
// timeSelectV.EndDate = Date(timeIntervalSince1970: time!)
// }
}
timeSelectV
.
endDateByWork
=
Date
()
timeSelectV
.
titleLbl
.
text
=
"请选择生产日期"
timeSelectV
.
titleLbl
.
text
=
"请选择生产日期"
timeSelectV
.
delegate
=
self
timeSelectV
.
delegate
=
self
self
.
view
.
window
?
.
addSubview
(
timeSelectV
)
self
.
view
.
window
?
.
addSubview
(
timeSelectV
)
...
...
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