Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
I
IFS-iOS
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
张杰
IFS-iOS
Commits
2bf0a5c7
Commit
2bf0a5c7
authored
Jun 01, 2018
by
哈南
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IFSBug修复
parent
ee7fb9fb
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
511 additions
and
350 deletions
+511
-350
Appdelegate+Extension.swift
IFS/IFS/Appdelegate+Extension.swift
+1
-1
Enums.swift
IFS/IFS/Expand/Const/Enums.swift
+14
-0
Urls.swift
IFS/IFS/Expand/Const/Urls.swift
+22
-4
NetworkAPI.swift
IFS/IFS/Expand/Network/NetworkAPI.swift
+15
-1
RepairOrderDetailBgController.swift
...epairOrder/Controller/RepairOrderDetailBgController.swift
+6
-0
RepairOrderDetailViewController.swift
...airOrder/Controller/RepairOrderDetailViewController.swift
+15
-0
RepairOrderEditSonOrderViewController.swift
...er/Controller/RepairOrderEditSonOrderViewController.swift
+11
-2
RepairOrderDetailResultModel.swift
...ness/RepairOrder/Model/RepairOrderDetailResultModel.swift
+4
-3
RepairOrderAddViewModel.swift
...iness/RepairOrder/ViewModel/RepairOrderAddViewModel.swift
+64
-50
TodoViewController.swift
...FS/Main/Business/Todo/Controller/TodoViewController.swift
+52
-34
TodoResultModel.swift
IFS/IFS/Main/Business/Todo/Model/TodoResultModel.swift
+47
-29
TodoTableViewCell.swift
IFS/IFS/Main/Business/Todo/View/TodoTableViewCell.swift
+8
-3
TodoViewModel.swift
IFS/IFS/Main/Business/Todo/ViewModel/TodoViewModel.swift
+2
-2
HomeTableViewController.swift
IFS/IFS/Main/Home/Controller/HomeTableViewController.swift
+55
-35
QueryTodoModel.swift
IFS/IFS/Main/Home/Model/QueryTodoModel.swift
+5
-1
HomeTableViewCell.swift
IFS/IFS/Main/Home/View/HomeTableViewCell.swift
+7
-2
Function.storyboard
IFS/IFS/Main/Storyboards/Function.storyboard
+181
-181
Info.plist
IFS/IFS/Resource/Info.plist
+2
-2
No files found.
IFS/IFS/Appdelegate+Extension.swift
View file @
2bf0a5c7
...
...
@@ -32,7 +32,7 @@ extension AppDelegate:JPUSHRegisterDelegate{
entity
.
types
=
Int
(
JPAuthorizationOptions
.
alert
.
rawValue
|
JPAuthorizationOptions
.
badge
.
rawValue
|
JPAuthorizationOptions
.
sound
.
rawValue
)
JPUSHService
.
register
(
forRemoteNotificationConfig
:
entity
,
delegate
:
self
)
JPUSHService
.
setup
(
withOption
:
launchOptions
,
appKey
:
"6554c0463b6a9ff2262f4d3d"
,
channel
:
"App Store"
,
apsForProduction
:
tru
e
)
JPUSHService
.
setup
(
withOption
:
launchOptions
,
appKey
:
"6554c0463b6a9ff2262f4d3d"
,
channel
:
"App Store"
,
apsForProduction
:
fals
e
)
}
}
IFS/IFS/Expand/Const/Enums.swift
View file @
2bf0a5c7
...
...
@@ -110,7 +110,21 @@ public enum CHILD_BILL_EDIT_SECTION: Int {
public
enum
TODO_STATE
:
String
{
case
INIT
=
"init"
case
DREW
=
"drew"
case
PROCESSING
=
"processing"
case
ALL
=
"all"
func
getStateString
()
->
String
{
switch
self
{
case
.
INIT
:
return
"未开始"
case
.
DREW
:
return
"已领单"
case
.
PROCESSING
:
return
"处理中"
case
.
ALL
:
return
""
}
}
}
...
...
IFS/IFS/Expand/Const/Urls.swift
View file @
2bf0a5c7
...
...
@@ -13,13 +13,27 @@ import Foundation
//public let BaseUrl: String = "http://192.168.1.176:9030/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://192.168.1.176:9030"
//重庆IFS测试环境
//public let BaseUrl: String="http://222.180.250.18:7080/ifs-server/rest/"
//public let BaseAttachmentUrl: String="http://222.180.250.18:7080"
//成都IFS测试环境
//public let BaseUrl: String="http://183.221.125.236:7080/ifs-server/rest/"
//public let BaseAttachmentUrl: String="http://183.221.125.236:7080"
////重庆IFS正式环境
//public let BaseUrl: String="http://222.180.250.18:7090/ifs-server/rest/"
//public let BaseAttachmentUrl: String="http://222.180.250.18:7090"
//正式环境
//public let BaseUrl: String = "http://222.180.250.18:7090/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://222.180.250.18:7090"
//测试环境
public
let
BaseUrl
:
String
=
"http://222.180.250.18
:7080/ifs-server/rest"
public
let
BaseAttachmentUrl
:
String
=
"http://222.180.250.18
:7080"
//public let BaseUrl: String = "http://183.221.125.236
:7080/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://183.221.125.236
:7080"
//外网开发环境
//
public let BaseUrl: String = "http://dev.gomoretech.com/ifs-server/rest"
//
public let BaseAttachmentUrl: String = "http://dev.gomoretech.com"
public
let
BaseUrl
:
String
=
"http://dev.gomoretech.com/ifs-server/rest"
public
let
BaseAttachmentUrl
:
String
=
"http://dev.gomoretech.com"
/// 登录
public
let
loginUrl
:
String
=
"/user/login/%@"
...
...
@@ -90,6 +104,10 @@ public let storeSubOrgs: String = "/store/getSubOrgs/%@"
public
let
flooryuUrl
:
String
=
"/flooryu/query"
/// 获取某一楼宇下的楼层
public
let
floorlayerUrl
:
String
=
"/floorlayer/%@/floors"
///工单完成
public
let
submitMessageRemind
:
String
=
"/work/submitMessageRemind/%@/%@"
///子工单完成
public
let
drawMessageRemind
:
String
=
"/work/drawMessageRemind/%@/%@"
...
...
IFS/IFS/Expand/Network/NetworkAPI.swift
View file @
2bf0a5c7
...
...
@@ -80,6 +80,10 @@ public enum Service {
case
UpdateVersion
()
// MARK: - 修改密码
case
ChangePassword
(
String
)
// MARK: - 完成工单消息
case
CompleteMessageRemind
(
String
,
String
)
// MARK: - 子工单消息
case
ChildOrderComplete
(
String
,
String
)
}
extension
Service
:
TargetType
{
...
...
@@ -166,6 +170,12 @@ extension Service: TargetType {
case
.
UsefulWorkBill
(
let
uuid
):
let
path
=
String
(
format
:
usefulWorkBill
,
uuid
)
+
"?operator.operId=
\(
kUser
()
.
userCode
!
)
&operator.operName=
\(
kUser
()
.
userName
!
)
&time=
\(
NSDate
()
.
httpParameterString
()
!
)
"
return
path
.
urlEncoded
()
case
.
CompleteMessageRemind
(
let
uuid
,
let
step
):
let
path
=
String
(
format
:
submitMessageRemind
,
uuid
,
step
)
return
path
.
urlEncoded
()
case
.
ChildOrderComplete
(
let
uuid
,
let
step
):
let
path
=
String
(
format
:
drawMessageRemind
,
uuid
,
step
)
return
path
.
urlEncoded
()
}
}
...
...
@@ -204,7 +214,9 @@ extension Service: TargetType {
.
QueryStoreByUserId
,
.
QueryStoreSubOrgs
(
_
),
.
QueryInitiator
(
_
),
.
QueryPrority
():
.
QueryPrority
(),
.
ChildOrderComplete
(
_
,
_
),
.
CompleteMessageRemind
(
_
,
_
):
return
.
get
}
}
...
...
@@ -244,6 +256,8 @@ extension Service: TargetType {
.
QueryStoreByUserId
,
.
Queryfloorlayer
(
_
),
.
QueryInitiator
(
_
),
.
CompleteMessageRemind
(
_
,
_
),
.
ChildOrderComplete
(
_
,
_
),
.
QueryPrority
():
return
.
requestPlain
case
.
GetRepairOrderDepartment
(
let
model
),
...
...
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderDetailBgController.swift
View file @
2bf0a5c7
...
...
@@ -115,6 +115,11 @@ class RepairOrderDetailBgController: BaseViewController {
let
completeVc
=
RepairOrderCompletedViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderCompletedViewController
completeVc
.
setStateBlock
({[
weak
self
]
(
state
)
in
self
?
.
rapairBillBottomViewAction
(
state
)
Network
.
request
(
target
:
Service
.
CompleteMessageRemind
(
self
?
.
detailVc
.
orderDetailViewModel
.
billDetailModel
.
uuid
??
""
,
"finished"
),
success
:
{
(
json
)
in
},
failure
:
{
(
error
)
in
})
})
completeVc
.
billCompleteViewModel
.
billCompltedModel
=
BillCompletedRequestModel
(
fromJson
:
JSON
(
detailVc
.
orderDetailViewModel
.
billDetailModel
.
toDictionary
()))
pushVC
(
completeVc
)
...
...
@@ -122,6 +127,7 @@ class RepairOrderDetailBgController: BaseViewController {
// MARK: - 工单底部view
fileprivate
func
rapairBillBottomViewAction
(
_
state
:
String
)
{
if
state
==
SUBMIT_REPAIR_ORDER_STATE
.
FINISHED
.
rawValue
||
state
==
SUBMIT_REPAIR_ORDER_STATE
.
DELETED
.
rawValue
||
state
==
SUBMIT_REPAIR_ORDER_STATE
.
CANCLED
.
rawValue
||
state
==
SUBMIT_REPAIR_ORDER_STATE
.
CREATED
.
rawValue
{
bottomLayoutHeight
.
constant
=
0
UIView
.
animate
(
withDuration
:
kAnimationTime
,
animations
:
{
...
...
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderDetailViewController.swift
View file @
2bf0a5c7
...
...
@@ -183,6 +183,11 @@ class RepairOrderDetailViewController: BaseTableViewController {
self
?
.
getBillDetailAction
()
self
?
.
gotoEditingSonOrderVc
(
indexPath
)
ShowMessage
(
"领取成功"
)
Network
.
request
(
target
:
Service
.
ChildOrderComplete
(
model
.
uuid
,
"drew"
),
success
:
{
(
json
)
in
},
failure
:
{
(
error
)
in
})
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
}
else
{
...
...
@@ -196,6 +201,11 @@ class RepairOrderDetailViewController: BaseTableViewController {
self
?
.
childBillViewModel
.
finishChildBillAction
()
.
subscribe
(
onNext
:
{
()
in
self
?
.
getBillDetailAction
()
ShowMessage
(
"子工单完成"
)
Network
.
request
(
target
:
Service
.
ChildOrderComplete
(
model
.
uuid
,
"done"
),
success
:
{
(
json
)
in
},
failure
:
{
(
error
)
in
})
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
}
...
...
@@ -381,6 +391,11 @@ extension RepairOrderDetailViewController {
if
model
.
isEditable
{
self
?
.
gotoEditingSonOrderVc
(
indexPath
)
}
Network
.
request
(
target
:
Service
.
ChildOrderComplete
(
model
.
uuid
,
"drew"
),
success
:
{
(
json
)
in
},
failure
:
{
(
error
)
in
})
ShowMessage
(
"领取成功"
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
...
...
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderEditSonOrderViewController.swift
View file @
2bf0a5c7
...
...
@@ -155,7 +155,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
NotificationCenter
.
default
.
post
(
Notification
(
name
:
Notification
.
Name
(
rawValue
:
UPDATE_BILL_DETAIL_LIST
)))
})
ShowMessage
(
"子工单完成"
)
self
?
.
popVC
()
self
?
.
backUP
()
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
...
...
@@ -167,7 +167,16 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
navigationItem
.
rightBarButtonItem
=
createButtonItem
(
"保存"
,
nil
,
self
,
#selector(
RepairOrderEditSonOrderViewController.saveButtonClickAction
)
)
}
}
func
backUP
(){
Network
.
request
(
target
:
Service
.
ChildOrderComplete
(
self
.
childBillViewModel
.
childBillDetailData
.
uuid
,
"done"
),
success
:
{
(
json
)
in
},
failure
:
{
(
error
)
in
})
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
DispatchTime
.
now
()
+
0.2
,
execute
:
{
self
.
popVC
()
})
}
// MARK: - 提交、保存子工单
@objc
fileprivate
func
saveButtonClickAction
()
{
if
!
PermissionsManager
.
saveChildPermissions
()
{
...
...
IFS/IFS/Main/Business/RepairOrder/Model/RepairOrderDetailResultModel.swift
View file @
2bf0a5c7
...
...
@@ -136,9 +136,10 @@ open class BillDetailData : NSObject{
let
executesArray
=
json
[
"executes"
]
.
arrayValue
for
executesJson
in
executesArray
{
let
value
=
BillDetailExecute
(
fromJson
:
executesJson
)
if
value
.
isEditable
{
executes
.
append
(
value
)
}
executes
.
append
(
value
)
// if value.isEditable {
// executes.append(value)
// }
}
feedback
=
json
[
"feedback"
]
.
stringValue
feedbackNote
=
json
[
"feedbackNote"
]
.
stringValue
...
...
IFS/IFS/Main/Business/RepairOrder/ViewModel/RepairOrderAddViewModel.swift
View file @
2bf0a5c7
...
...
@@ -35,52 +35,52 @@ extension RepairOrderAddViewModel {
ShowMessage
(
"请选择项目"
)
return
false
}
guard
saveOrderModel
.
source
!=
nil
else
{
ShowMessage
(
"请选择工单来源"
)
return
false
}
guard
saveOrderModel
.
serviceType
!=
nil
else
{
ShowMessage
(
"请选择工单服务类型"
)
return
false
}
guard
saveOrderModel
.
level
!=
nil
else
{
ShowMessage
(
"请选择工单优先级"
)
return
false
}
guard
saveOrderModel
.
reportUser
!=
nil
else
{
ShowMessage
(
"请选择工单报事人"
)
return
false
}
guard
saveOrderModel
.
receiveTime
!=
nil
else
{
ShowMessage
(
"请选择工单接报时间"
)
return
false
}
guard
saveOrderModel
.
requestTime
!=
nil
else
{
ShowMessage
(
"请选择工单指定时间"
)
return
false
}
guard
NSString
(
string
:
saveOrderModel
.
reporterPhone
)
.
isTelephone
()
!=
false
else
{
ShowMessage
(
"报事人电话格式不正确"
)
return
false
}
guard
saveOrderModel
.
position
!=
nil
else
{
ShowMessage
(
"请选择工单指定位置"
)
return
false
}
guard
saveOrderModel
.
position
!=
nil
else
{
ShowMessage
(
"请选择工单指定位置"
)
return
false
}
if
sender
.
isOn
{
guard
saveOrderModel
.
device
!=
nil
else
{
ShowMessage
(
"请选择故障设施"
)
return
false
}
guard
saveOrderModel
.
brokenTime
!=
nil
else
{
ShowMessage
(
"请选择设施故障时间"
)
return
false
}
}
//
guard saveOrderModel.source != nil else {
//
ShowMessage("请选择工单来源")
//
return false
//
}
//
guard saveOrderModel.serviceType != nil else {
//
ShowMessage("请选择工单服务类型")
//
return false
//
}
//
guard saveOrderModel.level != nil else {
//
ShowMessage("请选择工单优先级")
//
return false
//
}
//
guard saveOrderModel.reportUser != nil else {
//
ShowMessage("请选择工单报事人")
//
return false
//
}
//
guard saveOrderModel.receiveTime != nil else {
//
ShowMessage("请选择工单接报时间")
//
return false
//
}
//
guard saveOrderModel.requestTime != nil else {
//
ShowMessage("请选择工单指定时间")
//
return false
//
}
//
guard NSString(string: saveOrderModel.reporterPhone).isTelephone() != false else {
//
ShowMessage("报事人电话格式不正确")
//
return false
//
}
//
guard saveOrderModel.position != nil else {
//
ShowMessage("请选择工单指定位置")
//
return false
//
}
//
guard saveOrderModel.position != nil else {
//
ShowMessage("请选择工单指定位置")
//
return false
//
}
//
if sender.isOn {
//
guard saveOrderModel.device != nil else {
//
ShowMessage("请选择故障设施")
//
return false
//
}
//
guard saveOrderModel.brokenTime != nil else {
//
ShowMessage("请选择设施故障时间")
//
return false
//
}
//
}
return
true
}
...
...
@@ -193,11 +193,25 @@ extension RepairOrderAddViewModel {
ShowMessage
(
"无数据"
)
return
}
YXPickerManager
.
share
()
.
showGeneralPickerView
(
kMainColor
,
dataArray
:
result
,
defaultString
:
controller
.
serviceTypeLabel
.
text
,
commit
:
{
(
text
,
index
)
in
controller
.
serviceTypeLabel
.
text
=
text
let
publicFilterVc
=
FilterViewController
.
instantiateViewController
(
.
Function
)
as!
FilterViewController
for
model
in
result
{
let
filterModel
:
PublicFilterModel
?
if
controller
.
serviceTypeLabel
.
text
!.
contains
(
model
)
{
filterModel
=
PublicFilterModel
(
uuid
:
""
,
title
:
model
,
isSelected
:
"
\(
kONE
)
"
)
}
else
{
filterModel
=
PublicFilterModel
(
uuid
:
""
,
title
:
model
,
isSelected
:
"
\(
kZERO
)
"
)
}
publicFilterVc
.
publicViewModel
.
filterArray
.
add
(
filterModel
!
)
}
controller
.
pushVC
(
publicFilterVc
)
publicFilterVc
.
setNavigationTitle
(
"筛选项目"
,
.
MULTIPLE
,
{
(
choices
,
index
)
in
let
typeString
=
choices
.
map
({
(
model
)
->
String
in
return
model
.
title
})
.
joined
(
separator
:
","
)
controller
.
serviceTypeLabel
.
text
=
typeString
self
?
.
saveOrderModel
.
serviceType
=
typeString
controller
.
serviceTypeLabel
.
textColor
=
kBlackColor
self
?
.
saveOrderModel
.
serviceType
=
text
},
cancel
:
nil
)
})
})
.
disposed
(
by
:
disposeBag
)
break
case
IndexPath
(
row
:
4
,
section
:
0
):
...
...
IFS/IFS/Main/Business/Todo/Controller/TodoViewController.swift
View file @
2bf0a5c7
...
...
@@ -50,7 +50,11 @@ class TodoViewController: BaseTableViewPullController {
self
?
.
tableView
.
reloadData
()
}
.
disposed
(
by
:
disposeBag
)
}
func
loadDataWhenDraw
()
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
DispatchTime
.
now
()
+
1.0
)
{
self
.
loadWebDataSource
()
}
}
// MARK: - 设置tableview高度
fileprivate
func
tableViewAnimationHeight
()
{
tableView
.
rowHeight
=
UITableViewAutomaticDimension
...
...
@@ -67,40 +71,54 @@ class TodoViewController: BaseTableViewPullController {
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
model
=
todoViewModel
.
todoResultArray
[
indexPath
.
row
]
switch
model
.
state
{
case
SUBMIT_REPAIR_ORDER_STATE
.
INIT
.
rawValue
:
if
!
PermissionsManager
.
drawChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有领取权限!"
)
return
}
ShowAlertView
(
hint
,
"请确认是否领单?"
,
[
cancel
,
sure
],
.
alert
,
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
orderDetailViewModel
.
getChildBillAction
(
model
.
uuid
)
.
subscribe
(
onNext
:
{
()
in
self
?
.
loadWebDataSource
()
ShowMessage
(
"领取成功"
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
break
case
SUBMIT_REPAIR_ORDER_STATE
.
DREW
.
rawValue
:
if
!
PermissionsManager
.
saveChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有编辑权限!"
)
return
;
}
let
childBillVc
=
RepairOrderEditSonOrderViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderEditSonOrderViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
pushVC
(
childBillVc
)
break
case
SUBMIT_REPAIR_ORDER_STATE
.
DONE
.
rawValue
,
SUBMIT_REPAIR_ORDER_STATE
.
CANCLED
.
rawValue
:
if
!
PermissionsManager
.
childViewPermissions
()
{
ShowMessage
(
"当前用户对此工单没有查看权限!"
)
return
;
if
model
.
entityType
==
.
work
{
let
detailBgController
=
UIStoryboard
(
name
:
"Function"
,
bundle
:
nil
)
.
instantiateViewController
(
withIdentifier
:
RepairOrderDetailBgController
.
name
())
as!
RepairOrderDetailBgController
detailBgController
.
billModel
=
RepairOrderRecord
(
fromJson
:
JSON
(
model
.
toDictionary
()))
detailBgController
.
billModel
.
uuid
=
model
.
entityUuid
pushVC
(
detailBgController
)
}
else
{
switch
model
.
workState
{
case
TODO_STATE
.
INIT
:
if
!
PermissionsManager
.
drawChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有领取权限!"
)
return
}
ShowAlertView
(
hint
,
"请确认是否领单?"
,
[
cancel
,
sure
],
.
alert
,
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
orderDetailViewModel
.
getChildBillAction
(
model
.
entityUuid
)
.
subscribe
(
onNext
:
{
()
in
self
?
.
loadDataWhenDraw
()
ShowMessage
(
"领取成功"
)
Network
.
request
(
target
:
Service
.
ChildOrderComplete
(
model
.
entityUuid
,
"drew"
),
success
:
{
(
json
)
in
},
failure
:
{
(
error
)
in
})
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
break
case
TODO_STATE
.
DREW
:
if
!
PermissionsManager
.
saveChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有编辑权限!"
)
return
;
}
let
childBillVc
=
RepairOrderEditSonOrderViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderEditSonOrderViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
childBillVc
.
billModel
.
uuid
=
model
.
entityUuid
pushVC
(
childBillVc
)
break
case
TODO_STATE
.
PROCESSING
:
if
!
PermissionsManager
.
childViewPermissions
()
{
ShowMessage
(
"当前用户对此工单没有查看权限!"
)
return
;
}
let
childBillVc
=
RepairOrderChildBillDetailViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderChildBillDetailViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
childBillVc
.
billModel
.
uuid
=
model
.
entityUuid
pushVC
(
childBillVc
)
break
default
:
break
}
let
childBillVc
=
RepairOrderChildBillDetailViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderChildBillDetailViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
pushVC
(
childBillVc
)
break
default
:
break
}
}
}
...
...
IFS/IFS/Main/Business/Todo/Model/TodoResultModel.swift
View file @
2bf0a5c7
...
...
@@ -57,14 +57,21 @@ class TodoResultModel{
class
TodoData
{
var
dateTime
:
String
!
var
dept
:
UCN
!
var
executeId
:
String
!
var
executeNo
:
String
!
var
state
:
String
!
var
uuid
:
String
!
enum
EntityType
:
String
{
case
work
=
"work"
case
workExecute
=
"workExecute"
}
var
dept
:
UCN
=
UCN
(
""
,
""
,
""
)
var
createTime
:
String
=
""
var
uuid
:
String
=
""
var
version
:
String
=
""
var
state
:
Bool
=
false
var
content
:
String
=
""
var
entityType
:
EntityType
=
EntityType
.
work
var
entityUuid
:
String
=
""
var
userid
:
String
=
""
var
workState
:
TODO_STATE
=
TODO_STATE
.
ALL
var
workNo
:
String
=
""
/**
* Instantiate the instance using the passed json values to set the properties values
*/
...
...
@@ -72,41 +79,52 @@ class TodoData{
if
json
.
isEmpty
{
return
}
dateTime
=
json
[
"dateTime"
]
.
stringValue
createTime
=
json
[
"createTime"
]
.
stringValue
uuid
=
json
[
"uuid"
]
.
stringValue
version
=
json
[
"version"
]
.
stringValue
state
=
json
[
"state"
]
.
boolValue
content
=
json
[
"content"
]
.
stringValue
entityType
=
EntityType
(
rawValue
:
json
[
"entityType"
]
.
stringValue
)
??
EntityType
.
work
entityUuid
=
json
[
"entityUuid"
]
.
stringValue
userid
=
json
[
"userid"
]
.
stringValue
workState
=
TODO_STATE
(
rawValue
:
json
[
"workState"
]
.
stringValue
)
??
TODO_STATE
.
ALL
workNo
=
json
[
"workNo"
]
.
stringValue
let
deptJson
=
json
[
"dept"
]
if
!
deptJson
.
isEmpty
{
dept
=
UCN
(
fromJson
:
deptJson
)
}
executeId
=
json
[
"executeId"
]
.
stringValue
executeNo
=
json
[
"executeNo"
]
.
stringValue
state
=
json
[
"state"
]
.
stringValue
uuid
=
json
[
"uuid"
]
.
stringValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func
toDictionary
()
->
[
String
:
Any
]
{
var
dictionary
=
[
String
:
Any
]()
if
dateTime
!=
nil
{
dictionary
[
"
dateTime"
]
=
d
ateTime
if
createTime
!=
""
{
dictionary
[
"
createTime"
]
=
cre
ateTime
}
if
dept
!=
nil
{
dictionary
[
"
dept"
]
=
dept
.
toDictionary
()
if
uuid
!=
""
{
dictionary
[
"
uuid"
]
=
uuid
}
if
executeId
!=
nil
{
dictionary
[
"
executeId"
]
=
executeId
if
version
!=
""
{
dictionary
[
"
version"
]
=
version
}
if
executeNo
!=
nil
{
dictionary
[
"executeNo"
]
=
executeNo
dictionary
[
"state"
]
=
state
if
content
!=
""
{
dictionary
[
"content"
]
=
content
}
if
state
!=
nil
{
dictionary
[
"state"
]
=
state
dictionary
[
"entityType"
]
=
entityType
.
rawValue
if
entityUuid
!=
""
{
dictionary
[
"entityUuid"
]
=
entityUuid
}
if
uuid
!=
nil
{
dictionary
[
"uuid"
]
=
uuid
if
userid
!=
""
{
dictionary
[
"userid"
]
=
userid
}
if
workNo
!=
""
{
dictionary
[
"workNo"
]
=
workNo
}
if
dept
.
name
!=
nil
{
dictionary
[
"dept"
]
=
dept
.
toDictionary
()
}
dictionary
[
"workState"
]
=
workState
.
rawValue
return
dictionary
}
...
...
IFS/IFS/Main/Business/Todo/View/TodoTableViewCell.swift
View file @
2bf0a5c7
...
...
@@ -26,9 +26,14 @@ class TodoTableViewCell: UITableViewCell {
// MARK: - 更新待办cell
func
updateTodoCell
(
_
model
:
TodoData
,
_
indexPath
:
IndexPath
)
{
titleCodeLabel
.
text
=
String
(
format
:
"%@(%@)"
,
model
.
dept
.
name
,
model
.
dept
.
code
)
operationDateLabel
.
text
=
String
(
format
:
"转交时间:%@"
,
model
.
dateTime
)
todoStateLabel
.
text
=
repairOrderChineseState
(
model
.
state
)
if
model
.
entityType
==
.
work
{
titleCodeLabel
.
text
=
"工单单号:"
+
(
model
.
workNo
==
""
?
"无数据"
:
model
.
workNo
)
}
else
{
let
titleString
=
model
.
dept
.
code
!=
""
?
"(
\(
model
.
dept
.
code
??
""
)
)"
:
" "
titleCodeLabel
.
text
=
model
.
dept
.
name
+
titleString
}
operationDateLabel
.
text
=
String
(
format
:
"%@"
,
model
.
createTime
)
todoStateLabel
.
text
=
model
.
workState
.
getStateString
()
}
}
IFS/IFS/Main/Business/Todo/ViewModel/TodoViewModel.swift
View file @
2bf0a5c7
...
...
@@ -33,9 +33,9 @@ class TodoViewModel: BaseViewModel {
/// - page: 页数
/// - state: 状态
func
queryTodoAction
(
_
state
:
TODO_STATE
)
->
Observable
<
Void
>
{
queryModel
.
stateEquals
=
state
.
rawValue
queryModel
.
workState
=
state
.
rawValue
if
state
==
.
ALL
{
queryModel
.
stateEquals
=
nil
queryModel
.
workState
=
nil
}
return
Observable
.
create
({
(
observer
)
->
Disposable
in
Network
.
request
(
target
:
.
QueryTodo
(
self
.
queryModel
),
success
:
{[
weak
self
]
(
json
)
in
...
...
IFS/IFS/Main/Home/Controller/HomeTableViewController.swift
View file @
2bf0a5c7
...
...
@@ -57,7 +57,12 @@ class HomeTableViewController: BaseTableViewPullController {
self
?
.
reloadData
()
}
.
disposed
(
by
:
disposeBag
)
}
func
delyLoadData
(){
ShowLoadingView
()
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
DispatchTime
.
now
()
+
3
)
{
self
.
loadWebDataSource
()
}
}
override
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
return
todoViewModel
.
dequeueReusableHomeCell
(
HomeTableViewCell
.
name
(),
indexPath
,
tableView
)
}
...
...
@@ -69,44 +74,59 @@ class HomeTableViewController: BaseTableViewPullController {
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
60
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
tableView
.
deselectRow
(
at
:
indexPath
,
animated
:
true
)
let
model
=
todoViewModel
.
todoResultArray
[
indexPath
.
row
]
switch
model
.
state
{
case
SUBMIT_REPAIR_ORDER_STATE
.
INIT
.
rawValue
:
if
!
PermissionsManager
.
drawChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有领取权限!"
)
return
}
ShowAlertView
(
hint
,
"请确认是否领单?"
,
[
cancel
,
sure
],
.
alert
,
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
orderDetailViewModel
.
getChildBillAction
(
model
.
uuid
)
.
subscribe
(
onNext
:
{
()
in
self
?
.
loadWebDataSource
()
ShowMessage
(
"领取成功"
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
break
case
SUBMIT_REPAIR_ORDER_STATE
.
DREW
.
rawValue
:
if
!
PermissionsManager
.
saveChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有编辑权限!"
)
return
;
}
let
childBillVc
=
RepairOrderEditSonOrderViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderEditSonOrderViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
pushVC
(
childBillVc
)
break
case
SUBMIT_REPAIR_ORDER_STATE
.
DONE
.
rawValue
,
SUBMIT_REPAIR_ORDER_STATE
.
CANCLED
.
rawValue
:
if
!
PermissionsManager
.
childViewPermissions
()
{
ShowMessage
(
"当前用户对此工单没有查看权限!"
)
return
;
if
model
.
entityType
==
.
work
{
let
detailBgController
=
UIStoryboard
(
name
:
"Function"
,
bundle
:
nil
)
.
instantiateViewController
(
withIdentifier
:
RepairOrderDetailBgController
.
name
())
as!
RepairOrderDetailBgController
detailBgController
.
billModel
=
RepairOrderRecord
(
fromJson
:
JSON
(
model
.
toDictionary
()))
detailBgController
.
billModel
.
uuid
=
model
.
entityUuid
pushVC
(
detailBgController
)
}
else
{
switch
model
.
workState
{
case
TODO_STATE
.
INIT
:
if
!
PermissionsManager
.
drawChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有领取权限!"
)
return
}
ShowAlertView
(
hint
,
"请确认是否领单?"
,
[
cancel
,
sure
],
.
alert
,
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
orderDetailViewModel
.
getChildBillAction
(
model
.
entityUuid
)
.
subscribe
(
onNext
:
{
()
in
self
?
.
loadWebDataSource
()
Network
.
request
(
target
:
Service
.
ChildOrderComplete
(
model
.
entityUuid
,
"drew"
),
success
:
{
(
json
)
in
},
failure
:
{
(
error
)
in
})
ShowMessage
(
"领取成功"
)
self
?
.
delyLoadData
()
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
break
case
TODO_STATE
.
DREW
:
if
!
PermissionsManager
.
saveChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有编辑权限!"
)
return
;
}
let
childBillVc
=
RepairOrderEditSonOrderViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderEditSonOrderViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
childBillVc
.
billModel
.
uuid
=
model
.
entityUuid
pushVC
(
childBillVc
)
break
case
TODO_STATE
.
PROCESSING
:
if
!
PermissionsManager
.
childViewPermissions
()
{
ShowMessage
(
"当前用户对此工单没有查看权限!"
)
return
;
}
let
childBillVc
=
RepairOrderChildBillDetailViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderChildBillDetailViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
childBillVc
.
billModel
.
uuid
=
model
.
entityUuid
pushVC
(
childBillVc
)
break
default
:
break
}
let
childBillVc
=
RepairOrderChildBillDetailViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderChildBillDetailViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
pushVC
(
childBillVc
)
break
default
:
break
}
}
...
...
IFS/IFS/Main/Home/Model/QueryTodoModel.swift
View file @
2bf0a5c7
...
...
@@ -12,8 +12,9 @@ public class QueryTodoModel {
var
userId
:
String
!
//drew 已领单
//init 未开始
var
stateEquals
:
String
!
var
stateEquals
:
String
=
"false"
var
entityType
:
String
!
var
workState
:
String
!
// var page: Int!
// var pageSize: Int!
...
...
@@ -29,6 +30,9 @@ public class QueryTodoModel {
if
entityType
!=
nil
{
dictionary
[
"entityType"
]
=
entityType
}
if
workState
!=
nil
{
dictionary
[
"workState"
]
=
workState
}
// if page != nil{
// dictionary["page"] = page
// }
...
...
IFS/IFS/Main/Home/View/HomeTableViewCell.swift
View file @
2bf0a5c7
...
...
@@ -21,8 +21,13 @@ class HomeTableViewCell: UITableViewCell {
// MARK: - 更新待办cell
func
updateTodoCell
(
_
model
:
TodoData
,
_
indexPath
:
IndexPath
)
{
departmentLabel
.
text
=
String
(
format
:
"%@(%@)"
,
model
.
dept
.
name
,
model
.
dept
.
code
)
orderTimeLabel
.
text
=
String
(
format
:
"转交时间:%@"
,
model
.
dateTime
)
if
model
.
entityType
==
.
work
{
departmentLabel
.
text
=
model
.
workNo
}
else
{
let
titleString
=
model
.
dept
.
code
!=
""
?
"(
\(
model
.
dept
.
code
??
""
)
)"
:
" "
departmentLabel
.
text
=
model
.
dept
.
name
+
titleString
}
orderTimeLabel
.
text
=
String
(
format
:
"创建时间:%@"
,
model
.
createTime
)
}
}
IFS/IFS/Main/Storyboards/Function.storyboard
View file @
2bf0a5c7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
IFS/IFS/Resource/Info.plist
View file @
2bf0a5c7
...
...
@@ -17,9 +17,9 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0.
5
<
/string
>
<
string
>
1.0.
6
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.0.
5
<
/string
>
<
string
>
1.0.
6
<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
...
...
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