Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
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
mobile-group
galaxy-iOS
Commits
d2984cc8
Commit
d2984cc8
authored
Oct 13, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 分批修改
parent
f2132ce0
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
369 additions
and
120 deletions
+369
-120
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+1
-1
YHResignAppointSubmitScheduleViewController.swift
...递交预约)/C/YHResignAppointSubmitScheduleViewController.swift
+36
-0
YHResignAppointTimeModifyViewController.swift
...t(在港递交预约)/C/YHResignAppointTimeModifyViewController.swift
+240
-34
YHResignAppointTimeViewController.swift
...Appoint(在港递交预约)/C/YHResignAppointTimeViewController.swift
+11
-2
YHResignAppointGroup.swift
...(续签)/ResignHKAppoint(在港递交预约)/M/YHResignAppointGroup.swift
+39
-0
YHResignAppointTimeSettingModel.swift
...HKAppoint(在港递交预约)/M/YHResignAppointTimeSettingModel.swift
+2
-1
YHResignAppointApplicantInfoCell.swift
...KAppoint(在港递交预约)/V/YHResignAppointApplicantInfoCell.swift
+16
-2
YHResignAppointOptionResultCell.swift
...HKAppoint(在港递交预约)/V/YHResignAppointOptionResultCell.swift
+6
-0
YHResignAppointShowTimeItemView.swift
...HKAppoint(在港递交预约)/V/YHResignAppointShowTimeItemView.swift
+5
-1
YHResignAppointedScheduleSingleItemView.swift
...t(在港递交预约)/V/YHResignAppointedScheduleSingleItemView.swift
+6
-20
YHResignHaveAppointedMultipleInfoCell.swift
...int(在港递交预约)/V/YHResignHaveAppointedMultipleInfoCell.swift
+6
-40
YHResignHaveAppointedSingleInfoCell.swift
...point(在港递交预约)/V/YHResignHaveAppointedSingleInfoCell.swift
+1
-19
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
d2984cc8
...
@@ -3549,8 +3549,8 @@
...
@@ -3549,8 +3549,8 @@
children
=
(
children
=
(
04912F932CB921C300CC3105
/* YHResignAppointContainerViewController.swift */
,
04912F932CB921C300CC3105
/* YHResignAppointContainerViewController.swift */
,
04912F6F2CB765FE00CC3105
/* YHResignAppointTimeViewController.swift */
,
04912F6F2CB765FE00CC3105
/* YHResignAppointTimeViewController.swift */
,
04912F952CB924DA00CC3105
/* YHResignAppointTimeModifyViewController.swift */
,
04F4A5272CB8D4270026D469
/* YHResignAppointSubmitScheduleViewController.swift */
,
04F4A5272CB8D4270026D469
/* YHResignAppointSubmitScheduleViewController.swift */
,
04912F952CB924DA00CC3105
/* YHResignAppointTimeModifyViewController.swift */
,
);
);
path
=
C
;
path
=
C
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/C/YHResignAppointSubmitScheduleViewController.swift
View file @
d2984cc8
...
@@ -15,6 +15,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -15,6 +15,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
var
scheduleArr
:
[
YHResignAppointGroup
]
=
[]
{
var
scheduleArr
:
[
YHResignAppointGroup
]
=
[]
{
didSet
{
didSet
{
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
self
.
updateBottomBtnStatus
()
}
}
}
}
...
@@ -102,6 +103,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -102,6 +103,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
98
)
make
.
height
.
equalTo
(
98
)
}
}
self
.
updateBottomBtnStatus
()
}
}
...
@@ -109,6 +111,21 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -109,6 +111,21 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
}
}
// 更新底部下一步按钮点击状态
func
updateBottomBtnStatus
()
{
// 是否所有分批都已确认在港
var
isAllGroupHaveConfirmInHK
=
true
for
group
in
scheduleArr
{
let
confirmHKStatus
=
group
.
getConfirmInHKStatus
()
if
confirmHKStatus
!=
.
haveConfirmHK
{
isAllGroupHaveConfirmInHK
=
false
}
}
self
.
nextBtn
.
isUserInteractionEnabled
=
isAllGroupHaveConfirmInHK
self
.
nextBtn
.
alpha
=
isAllGroupHaveConfirmInHK
?
1.0
:
0.3
}
func
clickConfirmHKButton
(
status
:
YHResignConfirmHKStatus
)
{
func
clickConfirmHKButton
(
status
:
YHResignConfirmHKStatus
)
{
if
status
==
.
waitConfirmHK
{
// 待确认在港
if
status
==
.
waitConfirmHK
{
// 待确认在港
// 展示提前到港弹窗
// 展示提前到港弹窗
...
@@ -152,6 +169,8 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -152,6 +169,8 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
let
vc
=
YHResignAppointTimeViewController
()
let
vc
=
YHResignAppointTimeViewController
()
if
scheduleArr
.
count
>
0
{
if
scheduleArr
.
count
>
0
{
let
group
=
scheduleArr
[
0
]
let
group
=
scheduleArr
[
0
]
vc
.
defaultSubmitTime
=
group
.
ready_to_submit_at
vc
.
defaultLeaveHKTime
=
group
.
leave_hk_at
vc
.
allAppointUsers
=
group
.
user_list
.
map
{
vc
.
allAppointUsers
=
group
.
user_list
.
map
{
return
$0
.
transformToMember
()
return
$0
.
transformToMember
()
}
}
...
@@ -161,7 +180,24 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -161,7 +180,24 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
}
}
// 多人多批
// 多人多批
var
groupArr
=
[
YHResignAppointTimeSettingModel
]()
for
(
index
,
group
)
in
scheduleArr
.
enumerated
()
{
let
model
=
YHResignAppointTimeSettingModel
()
let
status
=
group
.
getConfirmInHKStatus
()
model
.
isHaveAppointed
=
(
status
==
.
haveConfirmHK
)
model
.
ready_to_submit_at
=
group
.
ready_to_submit_at
model
.
leave_hk_at
=
group
.
leave_hk_at
model
.
notleaveHK
=
group
.
leave_hk_at
.
isEmpty
model
.
itemIndex
=
index
model
.
users
=
group
.
user_list
.
map
{
return
$0
.
transformToMember
()
}
groupArr
.
append
(
model
)
}
let
modifyVC
=
YHResignAppointTimeModifyViewController
()
modifyVC
.
selectGroupArr
=
groupArr
self
.
navigationController
?
.
pushViewController
(
modifyVC
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/C/YHResignAppointTimeModifyViewController.swift
View file @
d2984cc8
...
@@ -12,8 +12,15 @@ import SwifterSwift
...
@@ -12,8 +12,15 @@ import SwifterSwift
class
YHResignAppointTimeModifyViewController
:
YHBaseViewController
{
class
YHResignAppointTimeModifyViewController
:
YHBaseViewController
{
var
renewalId
:
Int
=
0
var
familyArr
:
[
String
]
=
[
""
,
""
,
""
,
""
,
""
]
var
familyArr
:
[
String
]
=
[
""
,
""
,
""
,
""
,
""
]
var
selectGroupArr
:
[
YHResignAppointTimeSettingModel
]
=
[]
let
viewModel
=
YHResignAppointViewModel
()
// 是否一起在港递交
var
isTogether
:
Bool
=
false
lazy
var
tableView
:
UITableView
=
{
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
grouped
)
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
grouped
)
if
#available(iOS 15.0, *)
{
if
#available(iOS 15.0, *)
{
...
@@ -26,12 +33,8 @@ class YHResignAppointTimeModifyViewController: YHBaseViewController {
...
@@ -26,12 +33,8 @@ class YHResignAppointTimeModifyViewController: YHBaseViewController {
tableView
.
backgroundColor
=
.
clear
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
separatorStyle
=
.
none
tableView
.
bounces
=
false
tableView
.
bounces
=
false
tableView
.
register
(
YHResignAppointTimeSingleCell
.
self
,
forCellReuseIdentifier
:
YHResignAppointTimeSingleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignAppointOptionCell
.
self
,
forCellReuseIdentifier
:
YHResignAppointOptionCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignAppointApplicantInfoCell
.
self
,
forCellReuseIdentifier
:
YHResignAppointApplicantInfoCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignAppointOptionResultCell
.
self
,
forCellReuseIdentifier
:
YHResignAppointOptionResultCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignAppointOptionResultCell
.
self
,
forCellReuseIdentifier
:
YHResignAppointOptionResultCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignHaveAppointedMultipleInfoCell
.
self
,
forCellReuseIdentifier
:
YHResignHaveAppointedMultipleInfoCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignAppointApplicantInfoCell
.
self
,
forCellReuseIdentifier
:
YHResignAppointApplicantInfoCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignHaveAppointedSingleInfoCell
.
self
,
forCellReuseIdentifier
:
YHResignHaveAppointedSingleInfoCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignAppointTimeMultipleCell
.
self
,
forCellReuseIdentifier
:
YHResignAppointTimeMultipleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHResignAppointTimeMultipleCell
.
self
,
forCellReuseIdentifier
:
YHResignAppointTimeMultipleCell
.
cellReuseIdentifier
)
tableView
.
delegate
=
self
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
dataSource
=
self
...
@@ -98,50 +101,61 @@ class YHResignAppointTimeModifyViewController: YHBaseViewController {
...
@@ -98,50 +101,61 @@ class YHResignAppointTimeModifyViewController: YHBaseViewController {
}
}
}
}
@objc
func
didSubmitBtnClicked
()
{
}
}
}
extension
YHResignAppointTimeModifyViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
extension
YHResignAppointTimeModifyViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
2
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
familyArr
.
count
if
section
==
0
{
// 是否一起在港递交的section
return
1
}
// 分组section
return
selectGroupArr
.
count
}
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell2
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignAppointTimeSingleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignAppointTimeSingleCell
if
indexPath
.
section
==
0
{
let
cell1
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignAppointOptionResultCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignAppointOptionResultCell
cell1
.
isTogether
=
self
.
isTogether
return
cell1
}
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
familyArr
.
count
{
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
familyArr
.
count
{
let
model
=
selectGroupArr
[
indexPath
.
row
]
if
indexPath
.
row
==
0
{
if
model
.
isHaveAppointed
{
// 已确认在港 只展示信息
let
cell1
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignAppointOptionResultCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignAppointOptionResultCell
return
cell1
}
if
indexPath
.
row
==
1
{
let
cell1
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignAppointOptionCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignAppointOptionCell
return
cell1
}
if
indexPath
.
row
==
2
{
let
cell1
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignAppointApplicantInfoCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignAppointApplicantInfoCell
let
cell1
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignAppointApplicantInfoCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignAppointApplicantInfoCell
cell1
.
updateModel
(
model
)
return
cell1
return
cell1
}
}
// 分批次cell
if
indexPath
.
row
==
3
{
let
cell1
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignAppointTimeMultipleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignAppointTimeMultipleCell
let
cell1
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignHaveAppointedSingleInfoCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignHaveAppointedSingleInfoCell
cell1
.
updateModel
(
model
)
return
cell1
cell1
.
selectUserBlock
=
{
[
weak
self
]
member
,
isSelect
,
groupIndex
in
guard
let
self
=
self
else
{
return
}
self
.
selectMember
(
member
,
select
:
isSelect
,
groupLevel
:
groupIndex
)
}
}
cell1
.
switchBlock
=
{
if
indexPath
.
row
==
4
{
[
weak
self
]
isOn
in
let
cell1
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignAppointTimeMultipleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignAppointTimeMultipleCell
guard
let
self
=
self
else
{
return
}
return
cell1
model
.
notleaveHK
=
isOn
self
.
tableView
.
reloadData
()
}
}
cell1
.
refreshBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
tableView
.
reloadData
()
}
return
cell1
}
}
return
cell2
let
defaultCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
defaultCell
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
...
@@ -174,3 +188,195 @@ extension YHResignAppointTimeModifyViewController: UITableViewDelegate, UITableV
...
@@ -174,3 +188,195 @@ extension YHResignAppointTimeModifyViewController: UITableViewDelegate, UITableV
return
view
return
view
}
}
}
}
extension
YHResignAppointTimeModifyViewController
{
// memberId 申请人id
// select 点击选择
// groupLevel 是分的第几组 从0开始计数
func
selectMember
(
_
currentMember
:
YHResignAppointMember
,
select
:
Bool
,
groupLevel
:
Int
)
{
// 获取当前批的成员组
var
currentMembers
:[
YHResignAppointMember
]
=
[]
// 先改变点击当前批的选择状态
if
0
<=
groupLevel
,
groupLevel
<
selectGroupArr
.
count
{
let
item
=
selectGroupArr
[
groupLevel
]
let
members
=
item
.
users
currentMembers
=
members
for
member
in
members
{
if
member
.
id
==
currentMember
.
id
{
member
.
isSelected
=
select
}
}
}
if
!
select
{
// 如果操作是取消
// 如果操作的当前批次是最后一批,则需要分新批次
if
groupLevel
==
selectGroupArr
.
count
-
1
{
// 进行分批
let
newItem
=
YHResignAppointTimeSettingModel
()
// 批次+1
newItem
.
itemIndex
=
groupLevel
+
1
// 找出上一批未选中的人
let
needMembers
=
currentMembers
.
filter
{
return
$0
.
isSelected
==
false
}
// 在下一批中默认全选中
let
nextMembers
=
needMembers
.
deepCopy
()
.
map
{
let
item
=
$0
item
.
isSelected
=
true
return
item
}
newItem
.
users
=
nextMembers
selectGroupArr
.
append
(
newItem
)
}
else
{
// 如果操作的当前批次不是最后一批 需要更新当前批次的下一批该用户的选中状态
var
nextGroupIndex
=
groupLevel
+
1
let
newMember
=
currentMember
.
copy
()
as!
YHResignAppointMember
newMember
.
isSelected
=
true
while
0
<=
groupLevel
,
groupLevel
<
selectGroupArr
.
count
{
let
item
=
selectGroupArr
[
nextGroupIndex
]
if
!
item
.
isHaveAppointed
{
// 不是已确认在港
var
members
=
item
.
users
members
.
append
(
newMember
)
item
.
users
=
members
break
}
nextGroupIndex
+=
1
}
if
nextGroupIndex
==
selectGroupArr
.
count
{
// 在现有列表没有找到下一批可以操作的批次 则需要分一个新批次
// 进行分批
let
newItem
=
YHResignAppointTimeSettingModel
()
// 批次+1
newItem
.
itemIndex
=
groupLevel
+
1
// 找出上一批未选中的人
let
needMembers
=
currentMembers
.
filter
{
return
$0
.
isSelected
==
false
}
// 在下一批中默认全选中
let
nextMembers
=
needMembers
.
deepCopy
()
.
map
{
let
item
=
$0
item
.
isSelected
=
true
return
item
}
newItem
.
users
=
nextMembers
selectGroupArr
.
append
(
newItem
)
}
}
}
else
{
// 如果操作是选中
// 肯定会有下一层因为之前取消过
let
nextGroupIndex
=
groupLevel
+
1
if
0
<=
nextGroupIndex
,
nextGroupIndex
<
selectGroupArr
.
count
{
for
i
in
nextGroupIndex
..<
selectGroupArr
.
count
{
let
item
=
selectGroupArr
[
i
]
if
!
item
.
isHaveAppointed
{
// 不是已确认在港
var
members
=
item
.
users
// 下几批的组员中都要删除该人
members
=
members
.
filter
{
$0
.
id
!=
currentMember
.
id
}
item
.
users
=
members
}
}
}
}
// 无论是选中还是反选 检测下面所有批次有无全未选数组,有则删除该批
let
nextGroupIndex
=
groupLevel
+
1
if
0
<=
nextGroupIndex
,
nextGroupIndex
<
selectGroupArr
.
count
{
var
i
=
nextGroupIndex
while
i
<
selectGroupArr
.
count
{
let
item
=
selectGroupArr
[
i
]
let
members
=
item
.
users
let
a
=
members
.
filter
{
return
$0
.
isSelected
==
true
}
// 数组中全未选
if
!
item
.
isHaveAppointed
{
// 不是已确认在港
if
a
.
count
<=
0
{
selectGroupArr
.
remove
(
at
:
i
)
}
else
{
i
+=
1
}
}
else
{
// 已确认在港 不能编辑直接跳过
i
+=
1
}
}
}
// 重新进行批次排号
for
(
index
,
group
)
in
selectGroupArr
.
enumerated
()
{
group
.
itemIndex
=
index
}
self
.
tableView
.
reloadData
()
}
@objc
func
didSubmitBtnClicked
()
{
// 判断是否有分组没有选择时间
var
isNoSelectTime
=
false
for
group
in
self
.
selectGroupArr
{
if
!
group
.
isHaveAppointed
{
group
.
isClickSubmit
=
true
var
noSeletTime
=
false
if
group
.
notleaveHK
{
noSeletTime
=
group
.
ready_to_submit_at
.
isEmpty
}
else
{
noSeletTime
=
(
group
.
ready_to_submit_at
.
isEmpty
&&
group
.
leave_hk_at
.
isEmpty
)
}
if
noSeletTime
{
isNoSelectTime
=
true
}
}
}
if
isNoSelectTime
{
// 有分组没有选择时间
self
.
tableView
.
reloadData
()
return
}
requestSubmit
()
}
func
requestSubmit
()
{
var
batchs
:
[[
String
:
Any
]]
=
[]
for
group
in
self
.
selectGroupArr
{
group
.
isClickSubmit
=
false
let
selectUser
=
group
.
users
.
filter
{
let
item
=
$0
return
item
.
isSelected
}
let
allUserInfoArr
=
selectUser
.
map
{
let
dict
=
[
"member_id"
:
"
\(
$0
.
id
)
"
]
return
dict
}
let
dict
=
[
"ready_to_submit_at"
:
group
.
ready_to_submit_at
,
"leave_hk_at"
:
group
.
notleaveHK
?
""
:
group
.
leave_hk_at
,
"users"
:
allUserInfoArr
]
as!
[
String
:
Any
]
batchs
.
append
(
dict
)
}
let
param
:
[
String
:
Any
]
=
[
"renewal_id"
:
renewalId
,
"is_together"
:
self
.
isTogether
,
"batch"
:
batchs
]
printLog
(
param
)
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
viewModel
.
submitAppointInfo
(
params
:
param
)
{
[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
flash
(
message
:
"提交成功"
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
return
}
let
msg
=
error
?
.
errorMsg
??
"提交失败"
YHHUD
.
flash
(
message
:
msg
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/C/YHResignAppointTimeViewController.swift
View file @
d2984cc8
...
@@ -10,16 +10,23 @@ import UIKit
...
@@ -10,16 +10,23 @@ import UIKit
import
AttributedString
import
AttributedString
import
SwifterSwift
import
SwifterSwift
// 初始是单人或初始默认为所有人为一批的情况 可用此VC
class
YHResignAppointTimeViewController
:
YHBaseViewController
{
class
YHResignAppointTimeViewController
:
YHBaseViewController
{
var
renewalId
:
Int
=
0
var
renewalId
:
Int
=
0
// 所有预约人员
// 所有预约人员
var
allAppointUsers
:
[
YHResignAppointMember
]
=
[]
var
allAppointUsers
:
[
YHResignAppointMember
]
=
[]
// 预约在港递交时间
var
defaultSubmitTime
:
String
=
""
// 预计离港时间
var
defaultLeaveHKTime
:
String
=
""
let
viewModel
=
YHResignAppointViewModel
()
let
viewModel
=
YHResignAppointViewModel
()
// 申请人是否在港
// 申请人是否在港
var
togetherArr
:
[
YHResignAppointTogetherSetting
]
=
[]
var
togetherArr
:
[
YHResignAppointTogetherSetting
]
=
[]
// 是否一起在港递交
lazy
var
togetherSetting
=
{
lazy
var
togetherSetting
=
{
let
model
=
YHResignAppointTogetherSetting
()
let
model
=
YHResignAppointTogetherSetting
()
model
.
is_together
=
1
model
.
is_together
=
1
...
@@ -28,8 +35,6 @@ class YHResignAppointTimeViewController: YHBaseViewController {
...
@@ -28,8 +35,6 @@ class YHResignAppointTimeViewController: YHBaseViewController {
// 分组信息
// 分组信息
var
selectGroupArr
:
[
YHResignAppointTimeSettingModel
]
=
[]
var
selectGroupArr
:
[
YHResignAppointTimeSettingModel
]
=
[]
// 是否一起赴港
var
isTogether
:
Bool
=
true
// 是否单人
// 是否单人
private
var
isOnyOne
:
Bool
{
private
var
isOnyOne
:
Bool
{
get
{
get
{
...
@@ -126,6 +131,8 @@ class YHResignAppointTimeViewController: YHBaseViewController {
...
@@ -126,6 +131,8 @@ class YHResignAppointTimeViewController: YHBaseViewController {
if
isOnyOne
{
// 只有一个人
if
isOnyOne
{
// 只有一个人
self
.
togetherSetting
.
is_together
=
0
self
.
togetherSetting
.
is_together
=
0
let
model1
=
YHResignAppointTimeSettingModel
()
let
model1
=
YHResignAppointTimeSettingModel
()
model1
.
ready_to_submit_at
=
defaultSubmitTime
model1
.
leave_hk_at
=
defaultLeaveHKTime
selectGroupArr
.
append
(
model1
)
selectGroupArr
.
append
(
model1
)
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
return
return
...
@@ -136,6 +143,8 @@ class YHResignAppointTimeViewController: YHBaseViewController {
...
@@ -136,6 +143,8 @@ class YHResignAppointTimeViewController: YHBaseViewController {
togetherArr
.
append
(
self
.
togetherSetting
)
togetherArr
.
append
(
self
.
togetherSetting
)
// 分组数据
// 分组数据
let
model1
=
YHResignAppointTimeSettingModel
()
let
model1
=
YHResignAppointTimeSettingModel
()
model1
.
ready_to_submit_at
=
defaultSubmitTime
model1
.
leave_hk_at
=
defaultLeaveHKTime
if
self
.
togetherSetting
.
is_together
==
2
{
// 不一起递交 需显示候选人列表
if
self
.
togetherSetting
.
is_together
==
2
{
// 不一起递交 需显示候选人列表
// 默认全部选中
// 默认全部选中
let
users
=
allAppointUsers
.
deepCopy
()
.
map
{
let
users
=
allAppointUsers
.
deepCopy
()
.
map
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/M/YHResignAppointGroup.swift
View file @
d2984cc8
...
@@ -39,6 +39,45 @@ class YHResignAppointGroup: SmartCodable {
...
@@ -39,6 +39,45 @@ class YHResignAppointGroup: SmartCodable {
// 自定义 第几批
// 自定义 第几批
var
batchIndex
:
Int
=
0
var
batchIndex
:
Int
=
0
func
getConfirmInHKStatus
()
->
YHResignConfirmHKStatus
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
let
nowDateString
=
dateFormatter
.
string
(
from
:
Date
())
var
confirmStatus
=
YHResignConfirmHKStatus
.
waitConfirmHK
// 是否到了预约递交时间
let
isArriveSubmitTime
=
compareDates
(
self
.
ready_to_submit_at
,
nowDateString
)
if
!
isArriveSubmitTime
{
// 待确认在港
confirmStatus
=
.
waitConfirmHK
}
else
{
confirmStatus
=
!
self
.
determine_hk_at
.
isEmpty
?
.
haveConfirmHK
:
.
canConfirmHK
}
return
confirmStatus
}
// dateString1 是否不小于dateString2
func
compareDates
(
_
dateString1
:
String
,
_
dateString2
:
String
)
->
Bool
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
// 将字符串转换为 Date 对象
guard
let
date1
=
dateFormatter
.
date
(
from
:
dateString1
),
let
date2
=
dateFormatter
.
date
(
from
:
dateString2
)
else
{
print
(
"日期格式错误"
)
return
false
}
// 比较日期
if
date1
<
date2
{
print
(
"
\(
dateString1
)
小于
\(
dateString2
)
"
)
return
false
}
return
true
}
required
init
()
{
required
init
()
{
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/M/YHResignAppointTimeSettingModel.swift
View file @
d2984cc8
...
@@ -15,8 +15,9 @@ class YHResignAppointTimeSettingModel: SmartCodable {
...
@@ -15,8 +15,9 @@ class YHResignAppointTimeSettingModel: SmartCodable {
var
leave_hk_at
:
String
=
""
// 预计离港时间
var
leave_hk_at
:
String
=
""
// 预计离港时间
var
notleaveHK
:
Bool
=
false
// 暂不离港
var
notleaveHK
:
Bool
=
false
// 暂不离港
var
users
:
[
YHResignAppointMember
]
=
[]
var
users
:
[
YHResignAppointMember
]
=
[]
var
itemIndex
:
Int
=
0
// 第几批
var
itemIndex
:
Int
=
0
// 第几批
从0开始
var
isClickSubmit
:
Bool
=
false
var
isClickSubmit
:
Bool
=
false
var
isHaveAppointed
:
Bool
=
false
required
init
()
{
required
init
()
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignAppointApplicantInfoCell.swift
View file @
d2984cc8
...
@@ -31,7 +31,7 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
...
@@ -31,7 +31,7 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
label
.
numberOfLines
=
0
label
.
numberOfLines
=
0
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
17
)
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
17
)
label
.
textColor
=
.
mainTextColor
label
.
textColor
=
.
mainTextColor
label
.
text
=
"第
一
批赴港递交信息"
label
.
text
=
"第
?
批赴港递交信息"
return
label
return
label
}()
}()
...
@@ -55,7 +55,7 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
...
@@ -55,7 +55,7 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
label
.
numberOfLines
=
0
label
.
numberOfLines
=
0
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
label
.
textColor
=
.
mainTextColor
label
.
textColor
=
.
mainTextColor
label
.
text
=
"成员:
侯林、张曼玉、刘德华
"
label
.
text
=
"成员:"
return
label
return
label
}()
}()
...
@@ -82,6 +82,20 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
...
@@ -82,6 +82,20 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
setupUI
()
setupUI
()
}
}
func
updateModel
(
_
model
:
YHResignAppointTimeSettingModel
)
{
titleLabel
.
text
=
"第
\(
String
.
convertNumberToChineseText
(
model
.
itemIndex
+
1
)
)
批赴港递交信息"
var
names
=
"成员:"
for
(
index
,
user
)
in
model
.
users
.
enumerated
()
{
names
+=
user
.
apply_name
if
index
!=
model
.
users
.
count
-
1
{
names
+=
"、"
}
}
applicantNamesLabel
.
text
=
names
submitTimeView
.
detail
=
model
.
ready_to_submit_at
leaveHKTimeView
.
detail
=
model
.
leave_hk_at
}
func
setupUI
()
{
func
setupUI
()
{
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignAppointOptionResultCell.swift
View file @
d2984cc8
...
@@ -11,6 +11,12 @@ import UIKit
...
@@ -11,6 +11,12 @@ import UIKit
class
YHResignAppointOptionResultCell
:
UITableViewCell
{
class
YHResignAppointOptionResultCell
:
UITableViewCell
{
static
let
cellReuseIdentifier
=
"YHResignAppointOptionResultCell"
static
let
cellReuseIdentifier
=
"YHResignAppointOptionResultCell"
var
isTogether
:
Bool
=
false
{
didSet
{
optionLabel
.
text
=
isTogether
?
"是"
:
"否"
}
}
lazy
var
whiteContentView
:
UIView
=
{
lazy
var
whiteContentView
:
UIView
=
{
let
view
=
UIView
()
let
view
=
UIView
()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignAppointShowTimeItemView.swift
View file @
d2984cc8
...
@@ -18,7 +18,11 @@ class YHResignAppointShowTimeItemView: UIView {
...
@@ -18,7 +18,11 @@ class YHResignAppointShowTimeItemView: UIView {
var
detail
:
String
=
""
{
var
detail
:
String
=
""
{
didSet
{
didSet
{
detailLabel
.
text
=
detail
var
text
=
detail
if
text
.
isEmpty
{
text
=
" "
// 空字符串不能自适应label高度
}
detailLabel
.
text
=
text
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignAppointedScheduleSingleItemView.swift
View file @
d2984cc8
...
@@ -98,26 +98,12 @@ class YHResignAppointedScheduleSingleItemView: UIView {
...
@@ -98,26 +98,12 @@ class YHResignAppointedScheduleSingleItemView: UIView {
submitTimeLabel
.
text
=
"预约递交时间: "
+
model
.
ready_to_submit_at
submitTimeLabel
.
text
=
"预约递交时间: "
+
model
.
ready_to_submit_at
confirmHKTimeLabel
.
text
=
"确认在港时间: "
+
model
.
determine_hk_at
confirmHKTimeLabel
.
text
=
"确认在港时间: "
+
model
.
determine_hk_at
let
dateFormatter
=
DateFormatter
()
self
.
confirmHKStatus
=
model
.
getConfirmInHKStatus
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
let
nowDateString
=
dateFormatter
.
string
(
from
:
Date
())
var
confirmStatus
=
YHResignConfirmHKStatus
.
waitConfirmHK
// 是否到了预约递交时间
let
isArriveSubmitTime
=
compareDates
(
model
.
ready_to_submit_at
,
nowDateString
)
if
!
isArriveSubmitTime
{
// 待确认在港
confirmStatus
=
.
waitConfirmHK
}
else
{
confirmStatus
=
!
model
.
determine_hk_at
.
isEmpty
?
.
haveConfirmHK
:
.
canConfirmHK
}
self
.
confirmHKStatus
=
confirmStatus
haveConfirmInHKLabel
.
isHidden
=
(
confirm
Status
!=
.
haveConfirmHK
)
haveConfirmInHKLabel
.
isHidden
=
(
self
.
confirmHK
Status
!=
.
haveConfirmHK
)
confirmInHKBtn
.
isHidden
=
(
confirm
Status
==
.
haveConfirmHK
)
confirmInHKBtn
.
isHidden
=
(
self
.
confirmHK
Status
==
.
haveConfirmHK
)
if
confirm
Status
==
.
waitConfirmHK
{
if
self
.
confirmHK
Status
==
.
waitConfirmHK
{
confirmInHKBtn
.
setTitle
(
"待确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitle
(
"待确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
mainTextColor
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
mainTextColor
,
for
:
.
normal
)
confirmInHKBtn
.
backgroundColor
=
.
init
(
hex
:
0xF4F6FA
)
confirmInHKBtn
.
backgroundColor
=
.
init
(
hex
:
0xF4F6FA
)
...
@@ -126,7 +112,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
...
@@ -126,7 +112,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
}
}
}
else
if
confirm
Status
==
.
canConfirmHK
{
}
else
if
self
.
confirmHK
Status
==
.
canConfirmHK
{
confirmInHKBtn
.
setTitle
(
"确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitle
(
"确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
confirmInHKBtn
.
backgroundColor
=
.
brandMainColor
confirmInHKBtn
.
backgroundColor
=
.
brandMainColor
...
@@ -138,7 +124,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
...
@@ -138,7 +124,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
confirmHKTimeLabel
.
removeFromSuperview
()
confirmHKTimeLabel
.
removeFromSuperview
()
confirmHKTimeLabel
.
snp
.
removeConstraints
()
confirmHKTimeLabel
.
snp
.
removeConstraints
()
if
confirm
Status
==
.
haveConfirmHK
{
// 已确认在港 需要显示确认在港时间
if
self
.
confirmHK
Status
==
.
haveConfirmHK
{
// 已确认在港 需要显示确认在港时间
self
.
addSubview
(
confirmHKTimeLabel
)
self
.
addSubview
(
confirmHKTimeLabel
)
confirmHKTimeLabel
.
snp
.
remakeConstraints
{
make
in
confirmHKTimeLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
make
.
left
.
equalTo
(
18
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignHaveAppointedMultipleInfoCell.swift
View file @
d2984cc8
...
@@ -118,26 +118,12 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
...
@@ -118,26 +118,12 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
submitTimeLabel
.
text
=
"预约递交时间: "
+
model
.
ready_to_submit_at
submitTimeLabel
.
text
=
"预约递交时间: "
+
model
.
ready_to_submit_at
confirmHKTimeLabel
.
text
=
"确认在港时间: "
+
model
.
determine_hk_at
confirmHKTimeLabel
.
text
=
"确认在港时间: "
+
model
.
determine_hk_at
let
dateFormatter
=
DateFormatter
()
self
.
confirmHKStatus
=
model
.
getConfirmInHKStatus
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
let
nowDateString
=
dateFormatter
.
string
(
from
:
Date
())
var
confirmStatus
=
YHResignConfirmHKStatus
.
waitConfirmHK
haveConfirmInHKLabel
.
isHidden
=
(
self
.
confirmHKStatus
!=
.
haveConfirmHK
)
// 是否到了预约递交时间
confirmInHKBtn
.
isHidden
=
(
self
.
confirmHKStatus
==
.
haveConfirmHK
)
let
isArriveSubmitTime
=
compareDates
(
model
.
ready_to_submit_at
,
nowDateString
)
if
!
isArriveSubmitTime
{
if
self
.
confirmHKStatus
==
.
waitConfirmHK
{
// 待确认在港
confirmStatus
=
.
waitConfirmHK
}
else
{
confirmStatus
=
!
model
.
determine_hk_at
.
isEmpty
?
.
haveConfirmHK
:
.
canConfirmHK
}
self
.
confirmHKStatus
=
confirmStatus
haveConfirmInHKLabel
.
isHidden
=
(
confirmStatus
!=
.
haveConfirmHK
)
confirmInHKBtn
.
isHidden
=
(
confirmStatus
==
.
haveConfirmHK
)
if
confirmStatus
==
.
waitConfirmHK
{
confirmInHKBtn
.
setTitle
(
"待确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitle
(
"待确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
mainTextColor
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
mainTextColor
,
for
:
.
normal
)
confirmInHKBtn
.
backgroundColor
=
.
init
(
hex
:
0xF4F6FA
)
confirmInHKBtn
.
backgroundColor
=
.
init
(
hex
:
0xF4F6FA
)
...
@@ -146,7 +132,7 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
...
@@ -146,7 +132,7 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
}
}
}
else
if
confirm
Status
==
.
canConfirmHK
{
}
else
if
self
.
confirmHK
Status
==
.
canConfirmHK
{
confirmInHKBtn
.
setTitle
(
"确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitle
(
"确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
confirmInHKBtn
.
backgroundColor
=
.
brandMainColor
confirmInHKBtn
.
backgroundColor
=
.
brandMainColor
...
@@ -158,7 +144,7 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
...
@@ -158,7 +144,7 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
confirmHKTimeLabel
.
removeFromSuperview
()
confirmHKTimeLabel
.
removeFromSuperview
()
confirmHKTimeLabel
.
snp
.
removeConstraints
()
confirmHKTimeLabel
.
snp
.
removeConstraints
()
if
confirm
Status
==
.
haveConfirmHK
{
// 已确认在港 需要显示确认在港时间
if
self
.
confirmHK
Status
==
.
haveConfirmHK
{
// 已确认在港 需要显示确认在港时间
self
.
addSubview
(
confirmHKTimeLabel
)
self
.
addSubview
(
confirmHKTimeLabel
)
confirmHKTimeLabel
.
snp
.
remakeConstraints
{
make
in
confirmHKTimeLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
make
.
left
.
equalTo
(
18
)
...
@@ -190,26 +176,6 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
...
@@ -190,26 +176,6 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
self
.
layoutIfNeeded
()
self
.
layoutIfNeeded
()
}
}
// dateString1 是否不小于dateString2
func
compareDates
(
_
dateString1
:
String
,
_
dateString2
:
String
)
->
Bool
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
// 将字符串转换为 Date 对象
guard
let
date1
=
dateFormatter
.
date
(
from
:
dateString1
),
let
date2
=
dateFormatter
.
date
(
from
:
dateString2
)
else
{
print
(
"日期格式错误"
)
return
false
}
// 比较日期
if
date1
<
date2
{
print
(
"
\(
dateString1
)
小于
\(
dateString2
)
"
)
return
false
}
return
true
}
func
createUI
()
{
func
createUI
()
{
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignHaveAppointedSingleInfoCell.swift
View file @
d2984cc8
...
@@ -73,25 +73,7 @@ class YHResignHaveAppointedSingleInfoCell: UITableViewCell {
...
@@ -73,25 +73,7 @@ class YHResignHaveAppointedSingleInfoCell: UITableViewCell {
modifyBtnBlock
?()
modifyBtnBlock
?()
}
}
// dateString1 是否不小于dateString2
func
compareDates
(
_
dateString1
:
String
,
_
dateString2
:
String
)
->
Bool
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
// 将字符串转换为 Date 对象
guard
let
date1
=
dateFormatter
.
date
(
from
:
dateString1
),
let
date2
=
dateFormatter
.
date
(
from
:
dateString2
)
else
{
print
(
"日期格式错误"
)
return
false
}
// 比较日期
if
date1
<
date2
{
print
(
"
\(
dateString1
)
小于
\(
dateString2
)
"
)
return
false
}
return
true
}
func
setupUI
()
{
func
setupUI
()
{
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
...
...
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