Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
I
IFS
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
Commits
714c2739
Commit
714c2739
authored
7 years ago
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门界面刷新控制,跳转控制,优化部分代码
parent
d47bc6c6
master
重庆IFS
重庆ifs20190308
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
324 additions
and
289 deletions
+324
-289
project.pbxproj
IFS/IFS.xcodeproj/project.pbxproj
+8
-18
Urls.swift
IFS/IFS/Expand/Const/Urls.swift
+4
-4
NetworkAPI.swift
IFS/IFS/Expand/Network/NetworkAPI.swift
+1
-1
PhotoAttachmentViewController.swift
...Attachment/Controller/PhotoAttachmentViewController.swift
+10
-7
RepairOrderAddTableViewController.swift
...rOrder/Controller/RepairOrderAddTableViewController.swift
+54
-53
RepairOrderChildBillDetailViewController.swift
...Controller/RepairOrderChildBillDetailViewController.swift
+4
-3
RepairOrderDetailBgController.swift
...epairOrder/Controller/RepairOrderDetailBgController.swift
+3
-2
RepairOrderDetailViewController.swift
...airOrder/Controller/RepairOrderDetailViewController.swift
+43
-24
RepairOrderEditSonOrderViewController.swift
...er/Controller/RepairOrderEditSonOrderViewController.swift
+17
-11
MaintainAfterAttachmentTableViewCell.xib
...RepairOrder/View/MaintainAfterAttachmentTableViewCell.xib
+1
-0
MaintainBeforAttachmentTableViewCell.xib
...RepairOrder/View/MaintainBeforAttachmentTableViewCell.xib
+1
-0
RepairOrderAttachmentTableViewCell.xib
...s/RepairOrder/View/RepairOrderAttachmentTableViewCell.xib
+1
-0
RepairOrderDetailBottomView.swift
...siness/RepairOrder/View/RepairOrderDetailBottomView.swift
+0
-20
RepairOrderDetailBottomView.xib
...Business/RepairOrder/View/RepairOrderDetailBottomView.xib
+0
-75
RepairOrderDetailSuspendView.swift
...iness/RepairOrder/View/RepairOrderDetailSuspendView.swift
+2
-2
RepairOrderSubOrderTableViewCell.xib
...ess/RepairOrder/View/RepairOrderSubOrderTableViewCell.xib
+3
-2
RepairOrderAddViewModel.swift
...iness/RepairOrder/ViewModel/RepairOrderAddViewModel.swift
+6
-2
RepairOrderDetailViewModel.swift
...ss/RepairOrder/ViewModel/RepairOrderDetailViewModel.swift
+27
-14
RepairOrderViewModel.swift
...Business/RepairOrder/ViewModel/RepairOrderViewModel.swift
+1
-0
ReparirChildBillViewModel.swift
...ess/RepairOrder/ViewModel/ReparirChildBillViewModel.swift
+42
-15
TodoViewController.swift
...FS/Main/Business/Todo/Controller/TodoViewController.swift
+20
-1
HomeTableViewController.swift
IFS/IFS/Main/Home/Controller/HomeTableViewController.swift
+15
-0
Function.storyboard
IFS/IFS/Main/Storyboards/Function.storyboard
+57
-29
LoginViewModel.swift
IFS/IFS/Other/Login/ViewModel/LoginViewModel.swift
+3
-1
Podfile
IFS/Podfile
+0
-1
Podfile.lock
IFS/Podfile.lock
+1
-4
No files found.
IFS/IFS.xcodeproj/project.pbxproj
View file @
714c2739
This diff is collapsed.
Click to expand it.
IFS/IFS/Expand/Const/Urls.swift
View file @
714c2739
...
...
@@ -14,12 +14,12 @@ import Foundation
//public let BaseAttachmentUrl: String = "http://192.168.1.176:9030"
//测试环境
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://222.180.250.18:7080/ifs-server/rest"
//
public let BaseAttachmentUrl: String = "http://222.180.250.18: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/%@"
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Expand/Network/NetworkAPI.swift
View file @
714c2739
...
...
@@ -120,7 +120,7 @@ extension Service: TargetType {
case
.
QuerybrokenOption
:
return
brokenOptionUrl
case
.
QueryprocessMethods
:
return
pro
tectOption
Url
return
pro
cessMethods
Url
case
.
CompleteOrder
:
return
completedBillUrl
case
.
UploadAttachment
(
let
model
):
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Expand/Public/PhotoAttachment/Controller/PhotoAttachmentViewController.swift
View file @
714c2739
...
...
@@ -171,13 +171,16 @@ extension PhotoAttachmentViewController: ImagePickerDelegate {
// MARK: - 删除附件
extension
PhotoAttachmentViewController
:
DeleteAttachmentDelegate
{
func
deleteAttachment
(
_
indexPath
:
IndexPath
)
{
attachmentViewModel
.
photoAttachments
.
remove
(
at
:
indexPath
.
item
)
let
count
=
attachmentViewModel
.
photoAttachments
.
count
let
height
=
attachmentHeight
(
count
,
key
)
ShowAlertView
(
hint
,
"确定删除此附件吗?"
,
[
cancel
,
sure
],
.
actionSheet
)
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
attachmentViewModel
.
photoAttachments
.
remove
(
at
:
indexPath
.
item
)
let
count
=
self
?
.
attachmentViewModel
.
photoAttachments
.
count
let
height
=
self
?
.
attachmentHeight
(
count
!
,
self
?
.
key
)
DispatchQueue
.
main
.
async
(
execute
:
{
self
.
photoAttachmentCollectionView
.
reloadData
()
self
.
delegate
?
.
updatePhotoAttachment
(
height
,
self
.
key
)
self
?
.
photoAttachmentCollectionView
.
reloadData
()
self
?
.
delegate
?
.
updatePhotoAttachment
(
height
!
,
self
?
.
key
)
})
}
}
}
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderAddTableViewController.swift
View file @
714c2739
...
...
@@ -12,7 +12,6 @@ import SKPhotoBrowser
import
RxSwift
import
RxCocoa
import
SVProgressHUD
import
Async
class
RepairOrderAddTableViewController
:
BaseTableViewController
{
...
...
@@ -82,22 +81,25 @@ class RepairOrderAddTableViewController: BaseTableViewController {
// MARK: - 提交工单--上传附件
@objc
fileprivate
func
submitButtonClickAction
()
{
if
!
repairOrderAddViewModel
.
repairOrderAvailable
(
facilitiesSwitch
)
{
return
}
ShowAlertView
(
hint
,
"确认提交此工单吗?"
,
[
cancel
,
sure
],
.
alert
)
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
var
fileUrlArray
=
Array
<
String
>
()
for
i
in
0
..<
attachmentVc
.
attachmentViewModel
.
photoAttachments
.
count
-
1
{
let
image
=
attachmentVc
.
attachmentViewModel
.
photoAttachments
[
i
]
let
imageName
=
randomMD5
()
let
fileUrl
=
saveImage
(
currentImage
:
image
.
attachment
as!
UIImage
,
persent
:
0.8
,
imageName
:
imageName
+
".jpg"
)
fileUrlArray
.
append
(
fileUrl
)
for
i
in
0
..<
self
!.
attachmentVc
.
attachmentViewModel
.
photoAttachments
.
count
-
1
{
let
image
=
self
?
.
attachmentVc
.
attachmentViewModel
.
photoAttachments
[
i
]
let
imageName
=
self
?
.
randomMD5
()
let
fileUrl
=
self
?
.
saveImage
(
currentImage
:
image
?
.
attachment
as!
UIImage
,
persent
:
0.8
,
imageName
:
imageName
!
+
".jpg"
)
fileUrlArray
.
append
(
fileUrl
!
)
}
let
entityUuid
=
randomMD5
()
let
entityUuid
=
self
?
.
randomMD5
()
guard
fileUrlArray
.
count
!=
kZERO
else
{
submitRepairBillAction
(
entityUuid
)
self
?
.
submitRepairBillAction
(
entityUuid
!
)
return
}
var
oberverArray
=
Array
<
Observable
<
Double
>>
()
for
i
in
0
..<
fileUrlArray
.
count
{
let
fileUrl
=
fileUrlArray
[
i
]
let
model
=
UploadPhotoAttachmentModel
(
randomMD5
(),
fileUrl
,
ATTACHMENT_TYPE
.
BILL_ATTACHMENT_TYPE
.
rawValue
,
entityUuid
)
let
model
=
UploadPhotoAttachmentModel
(
self
!.
randomMD5
(),
fileUrl
,
ATTACHMENT_TYPE
.
BILL_ATTACHMENT_TYPE
.
rawValue
,
entityUuid
!
)
let
signal
=
Observable
<
Double
>.
create
({
(
oberver
)
->
Disposable
in
Network
.
upload
(
target
:
.
UploadAttachment
(
model
),
progress
:
{
(
progress
)
in
oberver
.
onNext
(
progress
)
...
...
@@ -121,18 +123,18 @@ class RepairOrderAddTableViewController: BaseTableViewController {
ShowProgressView
(
Float
(
perogress
))
break
case
.
completed
:
self
?
.
submitRepairBillAction
(
entityUuid
)
self
?
.
submitRepairBillAction
(
entityUuid
!
)
break
case
.
error
(
let
error
):
SVProgressHUD
.
showError
(
withStatus
:
error
.
localizedDescription
)
break
}
}
.
disposed
(
by
:
disposeBag
)
}
.
disposed
(
by
:
self
!.
disposeBag
)
}
}
// MARK: - 提交工单
fileprivate
func
submitRepairBillAction
(
_
entityUuid
:
String
)
{
if
repairOrderAddViewModel
.
repairOrderAvailable
(
facilitiesSwitch
)
{
repairOrderAddViewModel
.
saveOrderModel
.
attachmentId
=
entityUuid
repairOrderAddViewModel
.
submitRepairOrder
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
NotificationCenter
.
default
.
post
(
Notification
(
name
:
Notification
.
Name
(
rawValue
:
UPDATE_BILL_LIST
)))
...
...
@@ -140,7 +142,6 @@ class RepairOrderAddTableViewController: BaseTableViewController {
ShowMessage
(
"提交成功"
)
})
.
disposed
(
by
:
disposeBag
)
}
}
// MARK: - 设置附件VC
fileprivate
func
setupPhotoAttachmentVc
(){
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderChildBillDetailViewController.swift
View file @
714c2739
...
...
@@ -90,7 +90,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
// MARK: - UI
fileprivate
func
uiConfigAction
()
{
title
=
billModel
.
dept
.
name
title
=
String
(
format
:
"%@工单详情"
,
billModel
.
dept
.
name
)
tableView
.
register
(
UINib
(
nibName
:
RepairOrderDetailSectionView
.
name
(),
bundle
:
nil
),
forHeaderFooterViewReuseIdentifier
:
RepairOrderDetailSectionView
.
name
())
tableView
.
register
(
UINib
(
nibName
:
MaintainBeforAttachmentTableViewCell
.
name
(),
bundle
:
nil
),
forCellReuseIdentifier
:
MaintainBeforAttachmentTableViewCell
.
name
())
tableView
.
register
(
UINib
(
nibName
:
MaintainAfterAttachmentTableViewCell
.
name
(),
bundle
:
nil
),
forCellReuseIdentifier
:
MaintainAfterAttachmentTableViewCell
.
name
())
...
...
@@ -104,6 +104,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
self
?
.
childBillViewModel
.
childBillDetailAssignment
(
self
!
)
self
?
.
childBillViewModel
.
billDetailStataDispose
(
self
!
)
self
?
.
disposeAttachment
()
self
?
.
tableView
.
reloadData
()
}
.
disposed
(
by
:
disposeBag
)
}
...
...
@@ -143,14 +144,14 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
if
indexPath
.
section
==
CHILD_BILL_DETAIL_SECTION
.
DESCRIBE
.
rawValue
{
if
indexPath
.
row
==
kONE
{
let
beforCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
MaintainBeforAttachmentTableViewCell
.
name
(),
for
:
indexPath
)
beforAttachmentVc
.
view
.
frame
=
CGRect
(
x
:
80
,
y
:
0
,
width
:
kWidth
-
8
0
,
height
:
beforAttachmentHeight
)
beforAttachmentVc
.
view
.
frame
=
CGRect
(
x
:
80
,
y
:
0
,
width
:
kWidth
-
9
0
,
height
:
beforAttachmentHeight
)
beforCell
.
contentView
.
addSubview
(
beforAttachmentVc
.
view
)
beforAttachmentVc
.
photoAttachmentCollectionView
.
reloadData
()
return
beforCell
}
if
indexPath
.
row
==
kONE
*
2
{
let
afterCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
MaintainAfterAttachmentTableViewCell
.
name
(),
for
:
indexPath
)
afterAttachmentVc
.
view
.
frame
=
CGRect
(
x
:
80
,
y
:
0
,
width
:
kWidth
-
8
0
,
height
:
afterAttachmentHeight
)
afterAttachmentVc
.
view
.
frame
=
CGRect
(
x
:
80
,
y
:
0
,
width
:
kWidth
-
9
0
,
height
:
afterAttachmentHeight
)
afterCell
.
contentView
.
addSubview
(
afterAttachmentVc
.
view
)
afterAttachmentVc
.
photoAttachmentCollectionView
.
reloadData
()
return
afterCell
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderDetailBgController.swift
View file @
714c2739
...
...
@@ -67,11 +67,11 @@ class RepairOrderDetailBgController: BaseViewController {
self
?
.
suspendView
?
.
alpha
=
alpha
}
detailVc
.
setSuspendViewStateBlock
{[
weak
self
]
(
model
,
indexPath
,
state
)
in
if
state
==
SUBMIT_REPAIR_ORDER_STATE
.
INIT
.
rawValue
{
if
state
==
SUBMIT_REPAIR_ORDER_STATE
.
INIT
.
rawValue
||
state
==
SUBMIT_REPAIR_ORDER_STATE
.
DREW
.
rawValue
{
self
?
.
setupSuspendViewAction
(
model
,
indexPath
)
}
else
{
UIView
.
animate
(
withDuration
:
kAnimationTime
,
animations
:
{
self
?
.
suspendView
?
.
set
h
(
h
:
kHeight
)
self
?
.
suspendView
?
.
set
y
(
y
:
kHeight
)
},
completion
:
{
(
bool
)
in
self
?
.
suspendView
?
.
removeFromSuperview
()
})
...
...
@@ -113,6 +113,7 @@ class RepairOrderDetailBgController: BaseViewController {
// MARK: - 设置悬浮框
fileprivate
func
setupSuspendViewAction
(
_
model
:
BillDetailExecute
,
_
indexPath
:
IndexPath
)
{
self
.
suspendView
?
.
removeFromSuperview
()
let
suspendView
=
RepairOrderDetailSuspendView
.
instantiateFromNib
()
as!
RepairOrderDetailSuspendView
suspendView
.
updateSuspendView
(
model
,
indexPath
)
suspendView
.
frame
=
CGRect
(
x
:
15
,
y
:
kHeight
,
width
:
kWidth
-
30
,
height
:
60
)
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderDetailViewController.swift
View file @
714c2739
...
...
@@ -38,6 +38,8 @@ class RepairOrderDetailViewController: BaseTableViewController {
@IBOutlet
weak
var
createTimeLab
:
UILabel
!
/// 指定时间
@IBOutlet
weak
var
requestTimeLab
:
UILabel
!
/// 位置
@IBOutlet
weak
var
positionLabel
:
UILabel
!
/// 设施
@IBOutlet
weak
var
deviceLab
:
UILabel
!
/// 设施位置
...
...
@@ -73,7 +75,11 @@ class RepairOrderDetailViewController: BaseTableViewController {
/// 工单数据
open
var
billModel
:
RepairOrderRecord
!
/// 图片附件高度
var
attachmentHeight
:
CGFloat
!
=
0
var
attachmentHeight
:
CGFloat
!
=
20
/// 子工单高度
let
childBillCellHeight
:
CGFloat
!
=
70
/// 附件每行显示个数
let
attachmentCount
:
Int
=
3
/// 图片附件
lazy
final
var
attachmentVc
:
PhotoAttachmentViewController
=
{
var
attachmentVc
=
PhotoAttachmentViewController
.
instantiateViewController
(
.
Function
)
as!
PhotoAttachmentViewController
...
...
@@ -136,7 +142,11 @@ class RepairOrderDetailViewController: BaseTableViewController {
fileprivate
func
suspendViewStateAction
()
{
for
i
in
0
..<
orderDetailViewModel
.
billDetailModel
.
executes
.
count
{
let
model
=
orderDetailViewModel
.
billDetailModel
.
executes
[
i
]
if
model
.
dept
.
uuid
==
kUser
()
.
orgUuid
&&
model
.
state
==
SUBMIT_REPAIR_ORDER_STATE
.
INIT
.
rawValue
{
if
model
.
dept
.
uuid
==
kUser
()
.
orgUuid
&&
(
model
.
state
==
SUBMIT_REPAIR_ORDER_STATE
.
INIT
.
rawValue
||
model
.
state
==
SUBMIT_REPAIR_ORDER_STATE
.
DREW
.
rawValue
)
&&
orderDetailViewModel
.
billDetailModel
.
state
!=
SUBMIT_REPAIR_ORDER_STATE
.
FINISHED
.
rawValue
&&
orderDetailViewModel
.
billDetailModel
.
state
!=
SUBMIT_REPAIR_ORDER_STATE
.
CANCLED
.
rawValue
&&
orderDetailViewModel
.
billDetailModel
.
state
!=
SUBMIT_REPAIR_ORDER_STATE
.
DELETED
.
rawValue
{
self
.
suspendViewStateBlock
(
model
,
IndexPath
(
row
:
i
,
section
:
REPAIR_ORDER_DETAIL_SECTION
.
SUBORDER
.
rawValue
),
model
.
state
)
break
}
...
...
@@ -152,17 +162,20 @@ class RepairOrderDetailViewController: BaseTableViewController {
ShowAlertView
(
hint
,
"请确认是否领单?"
,
[
cancel
,
sure
],
.
alert
,
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
orderDetailViewModel
.
getChildBillAction
(
model
.
uuid
)
.
subscribe
(
onNext
:
{
()
in
ShowMessage
(
"领取成功"
)
self
?
.
getBillDetailAction
()
self
?
.
gotoEditingSonOrderVc
(
indexPath
)
ShowMessage
(
"领取成功"
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
}
else
{
childBillViewModel
.
childBillDetailData
=
ChildBillDetailData
(
fromJson
:
JSON
(
model
.
toDictionary
()))
childBillViewModel
.
finishChildBillAction
()
.
subscribe
(
onNext
:
{[
weak
self
]
()
in
ShowMessage
(
"子工单完成"
)
ShowAlertView
(
hint
,
"请确认是否完成此部门工单?"
,
[
cancel
,
sure
],
.
alert
,
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
childBillViewModel
.
childBillDetailData
=
ChildBillDetailData
(
fromJson
:
JSON
(
model
.
toDictionary
()))
self
?
.
childBillViewModel
.
finishChildBillAction
()
.
subscribe
(
onNext
:
{
()
in
self
?
.
getBillDetailAction
()
})
.
disposed
(
by
:
disposeBag
)
ShowMessage
(
"子工单完成"
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
}
}
...
...
@@ -174,8 +187,11 @@ class RepairOrderDetailViewController: BaseTableViewController {
let
url
=
String
(
format
:
attachmentUrl
,
model
.
entityType
,
model
.
entityUuid
,
model
.
fileName
)
self
?
.
attachmentVc
.
attachmentViewModel
.
photoAttachments
.
append
(
PhotoAttachmentModel
(
url
,
ATTACHMENT_TYPE
.
BILL_ATTACHMENT_TYPE
.
rawValue
,
model
.
entityUuid
,
ATTACHMENT_LOCATION
.
ATTACHMENT_HTTP
))
}
self
?
.
attachmentVc
.
setItemSize
(
CGSize
(
width
:
self
!.
imageWidth
,
height
:
self
!.
imageWidth
),
3
)
self
?
.
attachmentHeight
=
self
?
.
attachmentVc
.
attachmentHeight
(
attachments
.
count
,
nil
)
self
?
.
attachmentVc
.
setItemSize
(
CGSize
(
width
:
self
!.
imageWidth
,
height
:
self
!.
imageWidth
),
self
!.
attachmentCount
)
let
attHeight
=
self
?
.
attachmentVc
.
attachmentHeight
(
attachments
.
count
,
nil
)
if
attHeight
!
>
self
!.
attachmentHeight
{
self
?
.
attachmentHeight
=
attHeight
}
self
?
.
tableView
.
reloadData
()
})
.
disposed
(
by
:
disposeBag
)
}
...
...
@@ -212,9 +228,9 @@ class RepairOrderDetailViewController: BaseTableViewController {
model
.
deptUuids
=
array
model
.
workUuid
=
orderDetailViewModel
.
billDetailModel
.
uuid
orderDetailViewModel
.
transferRepairOrderAction
(
model
)
.
subscribe
(
onNext
:
{[
weak
self
]
()
in
ShowMessage
(
"转交成功"
)
self
?
.
getBillDetailAction
()
NotificationCenter
.
default
.
post
(
Notification
(
name
:
Notification
.
Name
(
rawValue
:
UPDATE_BILL_LIST
)))
ShowMessage
(
"转交成功"
)
})
.
disposed
(
by
:
disposeBag
)
}
...
...
@@ -233,9 +249,9 @@ extension RepairOrderDetailViewController {
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SUBORDER
.
rawValue
{
return
orderDetailViewModel
.
dequeueChildBillReusableCell
(
RepairOrderSubOrderTableViewCell
.
name
(),
indexPath
,
tableView
)
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
1
1
{
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
1
2
{
let
attachmentCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
RepairOrderAttachmentTableViewCell
.
name
(),
for
:
indexPath
)
attachmentVc
.
view
.
frame
=
CGRect
(
x
:
80
,
y
:
5
,
width
:
kWidth
-
8
0
,
height
:
attachmentHeight
)
attachmentVc
.
view
.
frame
=
CGRect
(
x
:
80
,
y
:
5
,
width
:
kWidth
-
9
0
,
height
:
attachmentHeight
)
attachmentCell
.
contentView
.
addSubview
(
attachmentVc
.
view
)
return
attachmentCell
}
...
...
@@ -276,13 +292,16 @@ extension RepairOrderDetailViewController {
override
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SUBORDER
.
rawValue
{
return
70
if
indexPath
.
row
==
orderDetailViewModel
.
billDetailModel
.
executes
.
count
-
kONE
{
return
childBillCellHeight
+
10
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
10
{
return
orderDetailViewModel
.
billDetailModel
.
descriptionFieldHeight
+
20
return
childBillCellHeight
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
11
{
return
attachmentHeight
+
30
return
orderDetailViewModel
.
billDetailModel
.
descriptionFieldHeight
+
20
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
12
{
return
attachmentHeight
+
20
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
COMPLETED
.
rawValue
&&
indexPath
.
row
==
1
{
return
orderDetailViewModel
.
billDetailModel
.
finishNoteHeight
+
20
...
...
@@ -302,14 +321,14 @@ extension RepairOrderDetailViewController {
ShowAlertView
(
hint
,
"请确认是否领单?"
,
[
cancel
,
sure
],
.
alert
,
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
orderDetailViewModel
.
getChildBillAction
(
model
.
uuid
)
.
subscribe
(
onNext
:
{
()
in
ShowMessage
(
"领取成功"
)
self
?
.
getBillDetailAction
()
self
?
.
gotoEditingSonOrderVc
(
indexPath
)
ShowMessage
(
"领取成功"
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
break
case
SUBMIT_REPAIR_ORDER_STATE
.
DREW
.
rawValue
:
if
orderDetailViewModel
.
billDetailModel
.
state
==
SUBMIT_REPAIR_ORDER_STATE
.
FINISHED
.
rawValue
{
if
orderDetailViewModel
.
billDetailModel
.
state
==
SUBMIT_REPAIR_ORDER_STATE
.
FINISHED
.
rawValue
||
orderDetailViewModel
.
billDetailModel
.
state
==
SUBMIT_REPAIR_ORDER_STATE
.
CANCLED
.
rawValue
||
orderDetailViewModel
.
billDetailModel
.
state
==
SUBMIT_REPAIR_ORDER_STATE
.
DELETED
.
rawValue
{
self
.
performSegue
(
withIdentifier
:
RepairOrderChildBillDetailViewController
.
name
(),
sender
:
indexPath
)
return
}
...
...
@@ -347,9 +366,9 @@ extension RepairOrderDetailViewController {
}
override
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SUBORDER
.
rawValue
{
return
kSectionTen
}
//
if section == REPAIR_ORDER_DETAIL_SECTION.SUBORDER.rawValue {
//
return kSectionTen
//
}
return
kSectionZero
}
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderEditSonOrderViewController.swift
View file @
714c2739
...
...
@@ -76,6 +76,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
// MARK: - UI
fileprivate
func
uiConfigAction
()
{
describeTextView
.
placeholder
=
"描述"
title
=
String
(
format
:
"完成%@工单"
,
billModel
.
dept
.
name
)
describeTextView
.
textContainerInset
=
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
)
}
...
...
@@ -141,13 +142,16 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
let
completeView
=
RepairOrderEditSonOrderCompleteView
.
instantiateFromNib
()
as!
RepairOrderEditSonOrderCompleteView
//完成子工单
completeView
.
completeBtn
.
rx
.
controlEvent
(
UIControlEvents
.
touchUpInside
)
.
subscribe
(
onNext
:
{[
weak
self
]
(
event
)
in
self
?
.
uploadActtachmentAction
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
ShowAlertView
(
hint
,
"确定完成此子工单吗?"
,
[
cancel
,
sure
],
.
alert
,
{
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
uploadActtachmentAction
()
.
subscribe
(
onNext
:
{
(
result
)
in
self
?
.
childBillViewModel
.
finishChildBillAction
()
.
subscribe
(
onNext
:
{
()
in
ShowMessage
(
"子工单完成"
)
NotificationCenter
.
default
.
post
(
Notification
(
name
:
Notification
.
Name
(
rawValue
:
UPDATE_BILL_DETAIL_LIST
)))
self
?
.
popVC
()
ShowMessage
(
"子工单完成"
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
})
.
disposed
(
by
:
disposeBag
)
tableView
.
tableFooterView
=
completeView
navigationItem
.
rightBarButtonItem
=
createButtonItem
(
"保存"
,
nil
,
self
,
#selector(
RepairOrderEditSonOrderViewController.saveButtonClickAction
)
)
...
...
@@ -155,12 +159,14 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
// MARK: - 提交、保存子工单
@objc
fileprivate
func
saveButtonClickAction
()
{
uploadActtachmentAction
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
ShowAlertView
(
hint
,
"确定保存此子工单吗?"
,
[
cancel
,
sure
],
.
alert
)
{[
weak
self
]
(
index
)
in
self
?
.
uploadActtachmentAction
()
.
subscribe
(
onNext
:
{
(
result
)
in
self
?
.
childBillViewModel
.
saveChildBillAction
()
.
subscribe
(
onNext
:
{
()
in
ShowMessage
(
"保存成功"
)
self
?
.
popVC
()
ShowMessage
(
"保存成功"
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
.
disposed
(
by
:
disposeBag
)
})
.
disposed
(
by
:
self
!.
disposeBag
)
}
}
// MARK: - 上传附件
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/View/MaintainAfterAttachmentTableViewCell.xib
View file @
714c2739
...
...
@@ -31,6 +31,7 @@
<constraint
firstItem=
"j4V-Po-dFb"
firstAttribute=
"leading"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"leading"
constant=
"15"
id=
"utU-tL-C0b"
/>
</constraints>
</tableViewCellContentView>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"njF-e1-oar"
/>
<point
key=
"canvasLocation"
x=
"25"
y=
"28.5"
/>
</tableViewCell>
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/View/MaintainBeforAttachmentTableViewCell.xib
View file @
714c2739
...
...
@@ -31,6 +31,7 @@
<constraint
firstItem=
"IBZ-p5-QTS"
firstAttribute=
"leading"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"leading"
constant=
"15"
id=
"uNv-wU-GyU"
/>
</constraints>
</tableViewCellContentView>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"njF-e1-oar"
/>
<point
key=
"canvasLocation"
x=
"-102"
y=
"-17"
/>
</tableViewCell>
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/View/RepairOrderAttachmentTableViewCell.xib
View file @
714c2739
...
...
@@ -31,6 +31,7 @@
<constraint
firstItem=
"BEL-rn-e0r"
firstAttribute=
"leading"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"leading"
constant=
"15"
id=
"egr-iP-at2"
/>
</constraints>
</tableViewCellContentView>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"njF-e1-oar"
/>
<point
key=
"canvasLocation"
x=
"-72"
y=
"20"
/>
</tableViewCell>
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/View/RepairOrderDetailBottomView.swift
deleted
100644 → 0
View file @
d47bc6c6
//
// RepairOrderDetailBottomView.swift
// IFS
//
// Created by 曹云霄 on 2018/1/8.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import
UIKit
class
RepairOrderDetailBottomView
:
UIView
{
/// 转交
@IBOutlet
weak
var
transferButton
:
UIButton
!
/// 完成
@IBOutlet
weak
var
completeButton
:
UIButton
!
}
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/View/RepairOrderDetailBottomView.xib
deleted
100644 → 0
View file @
d47bc6c6
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"13771"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"13772"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<objects>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
/>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"-2"
customClass=
"UIResponder"
/>
<view
contentMode=
"scaleToFill"
id=
"iN0-l3-epB"
customClass=
"RepairOrderDetailBottomView"
customModule=
"IFS"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"70"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"1mh-aC-JRq"
>
<rect
key=
"frame"
x=
"0.0"
y=
"21"
width=
"187.5"
height=
"49"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"49"
id=
"Yza-1q-CFi"
/>
</constraints>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<state
key=
"normal"
title=
"转交"
/>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"OGh-UT-VCv"
>
<rect
key=
"frame"
x=
"187.5"
y=
"21"
width=
"187.5"
height=
"49"
/>
<color
key=
"backgroundColor"
red=
"0.21755459899999999"
green=
"0.53306800129999998"
blue=
"0.99824184179999997"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<state
key=
"normal"
title=
"完成"
>
<color
key=
"titleColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
</state>
</button>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"DWW-Eq-xjB"
>
<rect
key=
"frame"
x=
"0.0"
y=
"20"
width=
"375"
height=
"1"
/>
<color
key=
"backgroundColor"
red=
"0.94901960780000005"
green=
"0.94901960780000005"
blue=
"0.94901960780000005"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"1"
id=
"y4N-Dd-1UD"
/>
</constraints>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Aqz-jC-Q2t"
>
<rect
key=
"frame"
x=
"0.0"
y=
"69"
width=
"375"
height=
"1"
/>
<color
key=
"backgroundColor"
red=
"0.94901960780000005"
green=
"0.94901960780000005"
blue=
"0.94901960780000005"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"1"
id=
"yfP-6J-aYK"
/>
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<constraints>
<constraint
firstAttribute=
"bottom"
secondItem=
"1mh-aC-JRq"
secondAttribute=
"bottom"
id=
"36x-7m-r3b"
/>
<constraint
firstItem=
"OGh-UT-VCv"
firstAttribute=
"leading"
secondItem=
"1mh-aC-JRq"
secondAttribute=
"trailing"
id=
"3o0-od-HLJ"
/>
<constraint
firstItem=
"Aqz-jC-Q2t"
firstAttribute=
"trailing"
secondItem=
"vUN-kp-3ea"
secondAttribute=
"trailing"
id=
"8fA-X7-kX2"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"OGh-UT-VCv"
secondAttribute=
"bottom"
id=
"G0O-pu-dCE"
/>
<constraint
firstItem=
"1mh-aC-JRq"
firstAttribute=
"top"
secondItem=
"DWW-Eq-xjB"
secondAttribute=
"bottom"
id=
"Z1M-y1-9yS"
/>
<constraint
firstItem=
"OGh-UT-VCv"
firstAttribute=
"width"
secondItem=
"1mh-aC-JRq"
secondAttribute=
"width"
id=
"ZtD-ny-5Rc"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"DWW-Eq-xjB"
secondAttribute=
"trailing"
id=
"bNC-PD-AEV"
/>
<constraint
firstItem=
"OGh-UT-VCv"
firstAttribute=
"trailing"
secondItem=
"vUN-kp-3ea"
secondAttribute=
"trailing"
id=
"dM9-er-Dd0"
/>
<constraint
firstItem=
"vUN-kp-3ea"
firstAttribute=
"bottom"
secondItem=
"Aqz-jC-Q2t"
secondAttribute=
"bottom"
id=
"jd2-Ct-hvz"
/>
<constraint
firstItem=
"DWW-Eq-xjB"
firstAttribute=
"leading"
secondItem=
"vUN-kp-3ea"
secondAttribute=
"leading"
id=
"jmE-PH-fKI"
/>
<constraint
firstItem=
"1mh-aC-JRq"
firstAttribute=
"leading"
secondItem=
"vUN-kp-3ea"
secondAttribute=
"leading"
id=
"p6k-LW-ads"
/>
<constraint
firstItem=
"OGh-UT-VCv"
firstAttribute=
"height"
secondItem=
"1mh-aC-JRq"
secondAttribute=
"height"
id=
"rxI-cN-5oE"
/>
<constraint
firstItem=
"Aqz-jC-Q2t"
firstAttribute=
"leading"
secondItem=
"vUN-kp-3ea"
secondAttribute=
"leading"
id=
"wvI-jq-ap2"
/>
</constraints>
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"vUN-kp-3ea"
/>
<connections>
<outlet
property=
"completeButton"
destination=
"OGh-UT-VCv"
id=
"vk6-oA-yP7"
/>
<outlet
property=
"transferButton"
destination=
"1mh-aC-JRq"
id=
"P0y-jq-TXN"
/>
</connections>
<point
key=
"canvasLocation"
x=
"-100.5"
y=
"-210"
/>
</view>
</objects>
</document>
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/View/RepairOrderDetailSuspendView.swift
View file @
714c2739
...
...
@@ -47,11 +47,11 @@ class RepairOrderDetailSuspendView: UIView {
operationTimeLab
.
text
=
model
.
lastModifyTime
departmentLab
.
text
=
model
.
dept
.
name
switch
model
.
state
{
case
SUBMIT_REPAIR_ORDER_STATE
.
DREW
.
rawValue
:
case
SUBMIT_REPAIR_ORDER_STATE
.
INIT
.
rawValue
:
operationOrderBtn
.
setTitle
(
SUSPEND_BUTTON_TYPE
.
GET
.
rawValue
,
for
:
.
normal
)
operationOrderBtn
.
backgroundColor
=
kBlueColor
break
case
SUBMIT_REPAIR_ORDER_STATE
.
D
ONE
.
rawValue
:
case
SUBMIT_REPAIR_ORDER_STATE
.
D
REW
.
rawValue
:
operationOrderBtn
.
setTitle
(
SUSPEND_BUTTON_TYPE
.
COMPLETED
.
rawValue
,
for
:
.
normal
)
operationOrderBtn
.
backgroundColor
=
kYellowColor
break
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/View/RepairOrderSubOrderTableViewCell.xib
View file @
714c2739
...
...
@@ -50,6 +50,7 @@
</subviews>
<constraints>
<constraint
firstAttribute=
"trailing"
secondItem=
"WXJ-0x-D52"
secondAttribute=
"trailing"
constant=
"15"
id=
"E7i-7V-QDq"
/>
<constraint
firstAttribute=
"height"
constant=
"60"
id=
"JJB-hv-kxn"
/>
<constraint
firstItem=
"jv3-76-R1p"
firstAttribute=
"centerY"
secondItem=
"iXK-9n-8CZ"
secondAttribute=
"centerY"
multiplier=
"0.6"
id=
"OoP-za-6WD"
/>
<constraint
firstItem=
"2Os-EU-PFL"
firstAttribute=
"centerY"
secondItem=
"JPd-pD-Y4s"
secondAttribute=
"centerY"
id=
"SAb-QY-DX7"
/>
<constraint
firstItem=
"WXJ-0x-D52"
firstAttribute=
"centerY"
secondItem=
"jv3-76-R1p"
secondAttribute=
"centerY"
id=
"dQC-3e-fCi"
/>
...
...
@@ -61,12 +62,12 @@
</view>
</subviews>
<constraints>
<constraint
firstItem=
"iXK-9n-8CZ"
firstAttribute=
"top"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"top"
constant=
"10"
id=
"0FS-NV-dAg"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"iXK-9n-8CZ"
secondAttribute=
"trailing"
constant=
"15"
id=
"4Ki-3e-u2u"
/>
<constraint
firstItem=
"iXK-9n-8CZ"
firstAttribute=
"top"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"top"
constant=
"10"
id=
"6m3-VS-Pp5"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"iXK-9n-8CZ"
secondAttribute=
"bottom"
id=
"EJ3-vT-i23"
/>
<constraint
firstItem=
"iXK-9n-8CZ"
firstAttribute=
"leading"
secondItem=
"H2p-sc-9uM"
secondAttribute=
"leading"
constant=
"15"
id=
"hdP-Ty-wso"
/>
</constraints>
</tableViewCellContentView>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"njF-e1-oar"
/>
<connections>
<outlet
property=
"contentBgView"
destination=
"iXK-9n-8CZ"
id=
"fiE-6x-Xdz"
/>
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/ViewModel/RepairOrderAddViewModel.swift
View file @
714c2739
...
...
@@ -55,8 +55,12 @@ extension RepairOrderAddViewModel {
ShowMessage
(
"请选择工单指定时间"
)
return
false
}
guard
saveOrderModel
.
reporterPhone
!=
nil
else
{
ShowMessage
(
"请输入报事人电话"
)
guard
NSString
(
string
:
saveOrderModel
.
reporterPhone
)
.
isTelephone
()
!=
false
else
{
ShowMessage
(
"报事人电话格式不正确"
)
return
false
}
guard
saveOrderModel
.
position
!=
nil
else
{
ShowMessage
(
"请选择工单指定位置"
)
return
false
}
guard
saveOrderModel
.
position
!=
nil
else
{
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/ViewModel/RepairOrderDetailViewModel.swift
View file @
714c2739
...
...
@@ -145,27 +145,36 @@ extension RepairOrderDetailViewModel {
// MARK: - 工单详情赋值
func
billDetailAssignment
(
_
controller
:
RepairOrderDetailViewController
)
{
controller
.
sourceLab
.
text
=
billDetailModel
.
source
controller
.
serverTypeLab
.
text
=
billDetailModel
.
serviceType
controller
.
priorityLab
.
text
=
billDetailModel
.
level
controller
.
sourceLab
.
text
=
disposeEmpty
(
billDetailModel
.
source
)
controller
.
serverTypeLab
.
text
=
disposeEmpty
(
billDetailModel
.
serviceType
)
controller
.
priorityLab
.
text
=
disposeEmpty
(
billDetailModel
.
level
)
if
billDetailModel
.
reportUser
!=
nil
{
controller
.
userLab
.
text
=
billDetailModel
.
reportUser
.
name
controller
.
userLab
.
text
=
disposeEmpty
(
billDetailModel
.
reportUser
.
name
)
}
controller
.
phoneLab
.
text
=
billDetailModel
.
reporterPhone
controller
.
createTimeLab
.
text
=
billDetailModel
.
createTime
controller
.
requestTimeLab
.
text
=
billDetailModel
.
requestTime
controller
.
phoneLab
.
text
=
disposeEmpty
(
billDetailModel
.
reporterPhone
)
controller
.
createTimeLab
.
text
=
disposeEmpty
(
billDetailModel
.
createTime
)
controller
.
requestTimeLab
.
text
=
disposeEmpty
(
billDetailModel
.
requestTime
)
if
billDetailModel
.
device
!=
nil
{
controller
.
deviceLocationLab
.
text
=
billDetailModel
.
deviceadree
controller
.
deviceLab
.
text
=
billDetailModel
.
device
.
name
controller
.
brokenTimeLab
.
text
=
billDetailModel
.
brokenTime
controller
.
deviceLocationLab
.
text
=
disposeEmpty
(
billDetailModel
.
deviceadree
)
controller
.
deviceLab
.
text
=
disposeEmpty
(
billDetailModel
.
device
.
name
)
controller
.
brokenTimeLab
.
text
=
disposeEmpty
(
billDetailModel
.
brokenTime
)
}
if
billDetailModel
.
position
!=
nil
{
controller
.
deviceLocationLab
.
text
=
billDetailModel
.
position
.
name
controller
.
positionLabel
.
text
=
disposeEmpty
(
billDetailModel
.
position
.
name
)
}
controller
.
descriptionLab
.
text
=
billDetailModel
.
descriptionField
controller
.
deviceLocationLab
.
text
=
disposeEmpty
(
billDetailModel
.
deviceadree
)
controller
.
descriptionLab
.
text
=
disposeEmpty
(
billDetailModel
.
descriptionField
)
controller
.
billNumberLab
.
text
=
billDetailModel
.
workNo
controller
.
isSolveLabel
.
text
=
billDetailModel
.
finish
?
"是"
:
"否"
controller
.
completionLabel
.
text
=
billDetailModel
.
finishNote
controller
.
completionLabel
.
text
=
disposeEmpty
(
billDetailModel
.
finishNote
)
}
// MARK: - 处理空数据
func
disposeEmpty
(
_
string
:
String
)
->
String
?
{
if
string
.
isEmpty
{
return
"---"
}
return
string
}
// MARK: - 工单详情状态处理
...
...
@@ -261,7 +270,11 @@ extension RepairOrderDetailViewModel {
break
case
REPAIR_ORDER_DETAIL_SECTION
.
SUBORDER
.
rawValue
:
sectionView
.
sectionStateLabel
.
text
=
"创建"
// sectionView.stateTimeLabel.text = billDetailModel.executes.first?.createTime
if
billDetailModel
.
executes
!=
nil
{
sectionView
.
stateTimeLabel
.
text
=
billDetailModel
.
executes
.
first
?
.
createTime
}
else
{
sectionView
.
stateTimeLabel
.
text
=
nil
}
break
case
REPAIR_ORDER_DETAIL_SECTION
.
COMPLETED
.
rawValue
:
sectionView
.
sectionStateLabel
.
text
=
"完成情况"
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/ViewModel/RepairOrderViewModel.swift
View file @
714c2739
...
...
@@ -138,6 +138,7 @@ extension RepairOrderViewModel {
sender
.
addBorder
(
1.0
,
kGaryColor
)
sender
.
setTitle
(
text
,
for
:
.
normal
)
sender
.
horizontalCenterTitleAndImage
(
5
)
self
?
.
queryModel
.
source
=
text
observer
.
onNext
(())
},
cancel
:
{
sender
.
isSelected
=
false
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/RepairOrder/ViewModel/ReparirChildBillViewModel.swift
View file @
714c2739
...
...
@@ -210,22 +210,21 @@ extension ReparirChildBillViewModel {
// MARK: - 子工单赋值.查看
func
childBillDetailAssignment
(
_
controller
:
RepairOrderChildBillDetailViewController
)
{
controller
.
workPersonLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processor
)
controller
.
placeTimeLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processBegin
)
controller
.
leaveTimeLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processBegin
)
controller
.
failureCauseLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
reason
)
controller
.
processModeLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processMode
)
controller
.
materialCostLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
materielfee
)
controller
.
workPersonLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
processor
)
controller
.
placeTimeLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
processBegin
)
controller
.
leaveTimeLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
processBegin
)
controller
.
failureCauseLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
reason
)
controller
.
processModeLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
processMode
)
if
childBillDetailData
.
owner
!=
nil
{
controller
.
operatorNameLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
owner
.
name
)
controller
.
operatorNameLabel
.
text
=
disposeEmpty
2
(
childBillDetailData
.
owner
.
name
)
}
controller
.
materialCostLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
materielfee
)
controller
.
costLaborLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
labourfee
)
controller
.
describeLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
note
)
controller
.
safetyProtectionLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processMode
)
controller
.
backupsToolLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
property1
)
controller
.
billNumberTimeLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
ownerTime
)
controller
.
billNumberLab
.
text
=
disposeEmpty
(
childBillDetailData
.
executeNo
)
controller
.
materialCostLabel
.
text
=
disposeEmpty
2
(
childBillDetailData
.
materielfee
)
controller
.
costLaborLabel
.
text
=
disposeEmpty
2
(
childBillDetailData
.
labourfee
)
controller
.
describeLabel
.
text
=
disposeEmpty
2
(
childBillDetailData
.
note
)
controller
.
safetyProtectionLabel
.
text
=
disposeEmpty
2
(
childBillDetailData
.
property2
)
controller
.
backupsToolLabel
.
text
=
disposeEmpty
2
(
childBillDetailData
.
property1
)
controller
.
billNumberTimeLabel
.
text
=
disposeEmpty
2
(
childBillDetailData
.
ownerTime
)
controller
.
billNumberLab
.
text
=
disposeEmpty
2
(
childBillDetailData
.
executeNo
)
}
// MARK: - 处理空数据
...
...
@@ -236,6 +235,14 @@ extension ReparirChildBillViewModel {
return
string
}
// MARK: - 处理空数据
func
disposeEmpty2
(
_
string
:
String
)
->
String
?
{
if
string
.
isEmpty
{
return
"---"
}
return
string
}
// MARK: - 工单详情状态处理
func
billDetailStataDispose
(
_
controller
:
RepairOrderChildBillDetailViewController
)
{
switch
childBillDetailData
.
state
{
...
...
@@ -293,6 +300,10 @@ extension ReparirChildBillViewModel {
switch
indexPath
{
case
IndexPath
(
row
:
0
,
section
:
0
):
filterViewModel
.
queryToolOption
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
return
}
YXPickerManager
.
share
()
.
showGeneralPickerView
(
kMainColor
,
dataArray
:
result
,
defaultString
:
controller
.
toolOptionLabel
.
text
,
commit
:
{
(
text
,
index
)
in
controller
.
toolOptionLabel
.
text
=
text
controller
.
toolOptionLabel
.
textColor
=
kBlackColor
...
...
@@ -302,6 +313,10 @@ extension ReparirChildBillViewModel {
break
case
IndexPath
(
row
:
1
,
section
:
0
):
filterViewModel
.
queryProtectOption
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
return
}
YXPickerManager
.
share
()
.
showGeneralPickerView
(
kMainColor
,
dataArray
:
result
,
defaultString
:
controller
.
protectOptionLabel
.
text
,
commit
:
{
(
text
,
index
)
in
controller
.
protectOptionLabel
.
text
=
text
controller
.
protectOptionLabel
.
textColor
=
kBlackColor
...
...
@@ -311,6 +326,10 @@ extension ReparirChildBillViewModel {
break
case
IndexPath
(
row
:
2
,
section
:
0
):
filterViewModel
.
queryInitiator
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
return
}
let
publicFilterVc
=
FilterViewController
.
instantiateViewController
(
.
Function
)
as!
FilterViewController
for
model
in
result
{
let
filterModel
=
PublicFilterModel
(
uuid
:
model
.
uuid
,
title
:
model
.
name
,
isSelected
:
"
\(
kZERO
)
"
)
...
...
@@ -344,6 +363,10 @@ extension ReparirChildBillViewModel {
break
case
IndexPath
(
row
:
5
,
section
:
0
):
filterViewModel
.
queryBrokenOption
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
return
}
YXPickerManager
.
share
()
.
showGeneralPickerView
(
kMainColor
,
dataArray
:
result
,
defaultString
:
controller
.
failureCauseLabel
.
text
,
commit
:
{
(
text
,
index
)
in
controller
.
failureCauseLabel
.
text
=
text
controller
.
failureCauseLabel
.
textColor
=
kBlackColor
...
...
@@ -353,6 +376,10 @@ extension ReparirChildBillViewModel {
break
case
IndexPath
(
row
:
6
,
section
:
0
):
filterViewModel
.
queryProcessMethods
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
return
}
YXPickerManager
.
share
()
.
showGeneralPickerView
(
kMainColor
,
dataArray
:
result
,
defaultString
:
controller
.
processModeLabel
.
text
,
commit
:
{
(
text
,
index
)
in
controller
.
processModeLabel
.
text
=
text
controller
.
processModeLabel
.
textColor
=
kBlackColor
...
...
@@ -378,7 +405,7 @@ extension ReparirChildBillViewModel {
break
case
CHILD_BILL_DETAIL_SECTION
.
DESCRIBE
.
rawValue
:
sectionView
.
sectionStateLabel
.
text
=
"创建"
sectionView
.
stateTimeLabel
.
text
=
childBillDetailData
.
create
Time
sectionView
.
stateTimeLabel
.
text
=
childBillDetailData
.
lastModify
Time
break
default
:
break
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Business/Todo/Controller/TodoViewController.swift
View file @
714c2739
...
...
@@ -22,6 +22,12 @@ class TodoViewController: BaseTableViewPullController {
return
todoViewModel
}()
/// 工单详情ViewModel
lazy
final
var
orderDetailViewModel
:
RepairOrderDetailViewModel
=
{
var
orderDetailViewModel
=
RepairOrderDetailViewModel
()
return
orderDetailViewModel
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -60,14 +66,27 @@ class TodoViewController: BaseTableViewPullController {
}
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
:
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
:
let
childBillVc
=
RepairOrderEditSonOrderViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderEditSonOrderViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
pushVC
(
childBillVc
)
break
case
SUBMIT_REPAIR_ORDER_STATE
.
DONE
.
rawValue
:
let
childBillVc
=
RepairOrderChildBillDetailViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderChildBillDetailViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
pushVC
(
childBillVc
)
break
default
:
break
}
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Home/Controller/HomeTableViewController.swift
View file @
714c2739
...
...
@@ -22,6 +22,12 @@ class HomeTableViewController: BaseTableViewPullController {
return
todoViewModel
}()
/// 工单详情ViewModel
lazy
final
var
orderDetailViewModel
:
RepairOrderDetailViewModel
=
{
var
orderDetailViewModel
=
RepairOrderDetailViewModel
()
return
orderDetailViewModel
}()
/// 待办状态
open
var
todoState
:
TODO_STATE
!
...
...
@@ -63,6 +69,15 @@ class HomeTableViewController: BaseTableViewPullController {
tableView
.
deselectRow
(
at
:
indexPath
,
animated
:
true
)
let
model
=
todoViewModel
.
todoResultArray
[
indexPath
.
row
]
switch
model
.
state
{
case
SUBMIT_REPAIR_ORDER_STATE
.
INIT
.
rawValue
:
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
:
let
childBillVc
=
RepairOrderEditSonOrderViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderEditSonOrderViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Storyboards/Function.storyboard
View file @
714c2739
This diff is collapsed.
Click to expand it.
IFS/IFS/Other/Login/ViewModel/LoginViewModel.swift
View file @
714c2739
...
...
@@ -18,8 +18,10 @@ class LoginViewModel: BaseViewModel {
/// - login: 用户名
/// - password: 密码
func
loginRequest
(
_
login
:
String
,
_
password
:
String
)
->
Observable
<
String
>
{
let
userName
=
NSString
(
string
:
login
)
.
format
()
let
passWord
=
NSString
(
string
:
password
)
.
format
()
return
Observable
.
create
({(
observer
)
->
Disposable
in
Network
.
request
(
target
:
.
Login
(
login
,
password
.
md5
()),
success
:
{(
json
)
in
Network
.
request
(
target
:
.
Login
(
userName
!
,
passWord
!
.
md5
()),
success
:
{(
json
)
in
let
model
=
LoginResultModel
(
fromJson
:
json
)
if
model
.
success
{
model
.
data
.
password
=
password
...
...
This diff is collapsed.
Click to expand it.
IFS/Podfile
View file @
714c2739
...
...
@@ -23,6 +23,5 @@ target ‘IFS’ do
pod
'ObservableArray-RxSwift'
,
'~> 0.2.0'
pod
'PPBadgeViewSwift'
pod
'SVProgressHUD'
,
'~> 2.2.2'
pod
'AsyncSwift'
pod
'UMengAnalytics'
end
This diff is collapsed.
Click to expand it.
IFS/Podfile.lock
View file @
714c2739
PODS:
- Alamofire (4.6.0)
- AsyncSwift (2.0.4)
- DeviceKit (1.4.0)
- DZNEmptyDataSet (1.8.1)
- FDFullscreenPopGesture (1.1)
...
...
@@ -32,7 +31,6 @@ PODS:
- YXPickerView (2.0.0)
DEPENDENCIES:
- AsyncSwift
- DeviceKit
- DZNEmptyDataSet
- FDFullscreenPopGesture (~> 1.1)
...
...
@@ -58,7 +56,6 @@ DEPENDENCIES:
SPEC CHECKSUMS:
Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4
AsyncSwift: 65775a7b32e740609b24969ece3de58723b9dc3e
DeviceKit: fa74d97499660e88081718b16688e19217595dba
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
FDFullscreenPopGesture: a8a620179e3d9c40e8e00256dcee1c1a27c6d0f0
...
...
@@ -83,6 +80,6 @@ SPEC CHECKSUMS:
YXKit: 73d6ffbcf7530f1159e030460207286e9153b080
YXPickerView: 527ca74d8fbe73b4e9bd0bbff6e143133dced907
PODFILE CHECKSUM:
5196f50090d24cd5621742bc3c9182ea72ab06d6
PODFILE CHECKSUM:
3e33205a97f219ebdb5a9ce5e01c757323891d82
COCOAPODS: 1.3.0
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