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
80b34594
Commit
80b34594
authored
Jul 22, 2018
by
哈南
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
85ccf26f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
557 additions
and
181 deletions
+557
-181
project.pbxproj
IFS/IFS.xcodeproj/project.pbxproj
+2
-0
Notification.swift
IFS/IFS/Expand/Const/Notification.swift
+3
-0
Urls.swift
IFS/IFS/Expand/Const/Urls.swift
+5
-5
NetworkAPI.swift
IFS/IFS/Expand/Network/NetworkAPI.swift
+2
-0
PhotoAttachmentViewController.swift
...Attachment/Controller/PhotoAttachmentViewController.swift
+14
-1
PublicFilterModel.swift
IFS/IFS/Expand/Public/SearchVc/Model/PublicFilterModel.swift
+5
-2
FunctionViewController.swift
...ain/Business/Mian/Controller/FunctionViewController.swift
+1
-0
FunctionViewModel.swift
IFS/IFS/Main/Business/Mian/ViewModel/FunctionViewModel.swift
+8
-1
RepairOrderAddTableViewController.swift
...rOrder/Controller/RepairOrderAddTableViewController.swift
+1
-0
RepairOrderChildBillDetailViewController.swift
...Controller/RepairOrderChildBillDetailViewController.swift
+4
-0
RepairOrderDetailViewController.swift
...airOrder/Controller/RepairOrderDetailViewController.swift
+23
-21
RepairOrderEditSonOrderViewController.swift
...er/Controller/RepairOrderEditSonOrderViewController.swift
+24
-15
ChildBillDetailResultModel.swift
...siness/RepairOrder/Model/ChildBillDetailResultModel.swift
+150
-5
RepairOrderDetailSuspendView.swift
...iness/RepairOrder/View/RepairOrderDetailSuspendView.swift
+4
-0
RepairOrderDetailSuspendView.xib
...usiness/RepairOrder/View/RepairOrderDetailSuspendView.xib
+3
-2
RepairOrderAddViewModel.swift
...iness/RepairOrder/ViewModel/RepairOrderAddViewModel.swift
+42
-12
RepairOrderDetailViewModel.swift
...ss/RepairOrder/ViewModel/RepairOrderDetailViewModel.swift
+3
-0
ReparirChildBillViewModel.swift
...ess/RepairOrder/ViewModel/ReparirChildBillViewModel.swift
+53
-26
TodoViewController.swift
...FS/Main/Business/Todo/Controller/TodoViewController.swift
+8
-8
TodoViewModel.swift
IFS/IFS/Main/Business/Todo/ViewModel/TodoViewModel.swift
+0
-1
HomeTableViewController.swift
IFS/IFS/Main/Home/Controller/HomeTableViewController.swift
+16
-19
Function.storyboard
IFS/IFS/Main/Storyboards/Function.storyboard
+178
-60
Info.plist
IFS/IFS/Resource/Info.plist
+2
-2
Podfile
IFS/Podfile
+1
-0
Podfile.lock
IFS/Podfile.lock
+5
-1
No files found.
IFS/IFS.xcodeproj/project.pbxproj
View file @
80b34594
...
...
@@ -1134,6 +1134,7 @@
"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework"
,
"${BUILT_PRODUCTS_DIR}/YXAlertController/YXAlertController.framework"
,
"${BUILT_PRODUCTS_DIR}/YXKit/YXKit.framework"
,
"${BUILT_PRODUCTS_DIR}/swiftScan/swiftScan.framework"
,
);
name
=
"[CP] Embed Pods Frameworks"
;
outputPaths
=
(
...
...
@@ -1158,6 +1159,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework"
,
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YXAlertController.framework"
,
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YXKit.framework"
,
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/swiftScan.framework"
,
);
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
...
...
IFS/IFS/Expand/Const/Notification.swift
View file @
80b34594
...
...
@@ -17,3 +17,6 @@ public let UPDATE_BILL_DETAIL_LIST: String = "UPDATE_BILL_DETAIL_LIST"
/// 更新新建工单列表
public
let
UPDATE_REPAIRORDER_ADD_LIST
:
String
=
"UPDATE_REPAIRORDER_ADD_LIST"
/// 更新新建工单列表
public
let
UPDATE_RECEIVE_ORDER_LIST
:
String
=
"UPDATE_RECEIVE_ORDER_LIST"
IFS/IFS/Expand/Const/Urls.swift
View file @
80b34594
...
...
@@ -14,8 +14,8 @@ import Foundation
//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"
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"
...
...
@@ -32,8 +32,8 @@ import Foundation
//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/%@"
...
...
@@ -42,7 +42,7 @@ public let updateUrl = "/ipapk?type=ipa";
/// 修改密码
public
let
changePassword
=
"/user/change_password/%@?time=%@&operId=%@&operName=%@"
;
/// 待办事项
public
let
todoUrl
:
String
=
"/todo/
workExecute
/query"
public
let
todoUrl
:
String
=
"/todo/
messageRemind
/query"
/// 新建工单来源
public
let
sourceUrl
:
String
=
"/config/getValue/source"
/// 新建工单服务类型
...
...
IFS/IFS/Expand/Network/NetworkAPI.swift
View file @
80b34594
...
...
@@ -284,8 +284,10 @@ extension Service: TargetType {
let
data
=
MultipartFormData
(
provider
:
.
file
(
URL
(
fileURLWithPath
:
attachmentModel
.
fileUrl
)),
name
:
"file"
,
fileName
:
attachmentModel
.
fileName
,
mimeType
:
"image/jpeg"
)
return
.
uploadMultipart
([
data
])
case
.
SaveChildBill
(
let
model
):
print
(
model
.
toDictionary
())
return
.
requestParameters
(
parameters
:
model
.
toDictionary
(),
encoding
:
JSONEncoding
.
default
)
case
.
FinishChildBill
(
let
model
):
print
(
model
.
toDictionary
())
return
.
requestParameters
(
parameters
:
model
.
toDictionary
(),
encoding
:
JSONEncoding
.
default
)
case
.
QueryProjectOption
(
let
model
):
return
.
requestParameters
(
parameters
:
model
.
toDictionary
(),
encoding
:
JSONEncoding
.
default
)
...
...
IFS/IFS/Expand/Public/PhotoAttachment/Controller/PhotoAttachmentViewController.swift
View file @
80b34594
...
...
@@ -116,6 +116,7 @@ extension PhotoAttachmentViewController: UICollectionViewDelegate,UICollectionVi
if
attachment
.
attachmentType
==
.
ATTACHMENT_ADD
{
let
imagePickerController
=
ImagePickerController
()
imagePickerController
.
delegate
=
self
imagePickerController
.
galleryView
.
isHidden
=
true
let
count
=
attachmentViewModel
.
photoAttachments
.
count
if
count
-
kONE
>=
imageCount
{
ShowMessage
(
String
(
format
:
"最多只能拍摄%d张照片"
,
imageCount
))
...
...
@@ -163,7 +164,8 @@ extension PhotoAttachmentViewController: ImagePickerDelegate {
}
func
doneButtonDidPress
(
_
imagePicker
:
ImagePickerController
,
images
:
[
UIImage
])
{
for
image
in
images
{
let
remarkImages
=
imageAddRemark
(
images
:
images
)
for
image
in
remarkImages
{
attachmentViewModel
.
photoAttachments
.
insert
(
PhotoAttachmentModel
(
image
,
.
ATTACHMENT_LOCAL
),
at
:
kZERO
)
dismiss
(
animated
:
true
,
completion
:
{[
weak
self
]
()
->
()
in
let
count
=
self
?
.
attachmentViewModel
.
photoAttachments
.
count
...
...
@@ -179,6 +181,17 @@ extension PhotoAttachmentViewController: ImagePickerDelegate {
func
cancelButtonDidPress
(
_
imagePicker
:
ImagePickerController
)
{
dismiss
(
animated
:
true
,
completion
:
nil
)
}
func
imageAddRemark
(
images
:[
UIImage
])
->
[
UIImage
]{
var
remarkImages
=
[
UIImage
]()
let
dic
=
[
NSAttributedStringKey
.
foregroundColor
:
UIColor
.
yellow
,
NSAttributedStringKey
.
font
:
UIFont
.
systemFont
(
ofSize
:
17
)]
let
timeString
=
Date
()
.
toString
(
dateStyle
:
DateFormatter
.
Style
.
medium
,
timeStyle
:
DateFormatter
.
Style
.
medium
)
for
image
in
images
{
let
waterImage
=
image
.
imageWaterMark
(
with
:
timeString
,
point
:
CGPoint
(
x
:
20
,
y
:
image
.
size
.
height
-
20
),
attribute
:
dic
)
??
UIImage
()
remarkImages
.
append
(
waterImage
)
}
return
remarkImages
}
}
// MARK: - 删除附件
...
...
IFS/IFS/Expand/Public/SearchVc/Model/PublicFilterModel.swift
View file @
80b34594
...
...
@@ -15,11 +15,14 @@ class PublicFilterModel: NSObject {
// 0 表示为选中
// 1 表示选中
@objc
var
isSelected
:
String
!
var
index
=
0
init
(
uuid
:
String
,
title
:
String
,
isSelected
:
String
)
{
self
.
uuid
=
uuid
self
.
title
=
title
self
.
isSelected
=
isSelected
}
convenience
init
(
uuid
:
String
,
title
:
String
,
isSelected
:
String
,
index
:
Int
)
{
self
.
init
(
uuid
:
uuid
,
title
:
title
,
isSelected
:
isSelected
)
self
.
index
=
index
}
}
IFS/IFS/Main/Business/Mian/Controller/FunctionViewController.swift
View file @
80b34594
...
...
@@ -22,6 +22,7 @@ class FunctionViewController: BaseViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
functionViewModel
.
updateItemArray
()
setupCollectionView
()
}
...
...
IFS/IFS/Main/Business/Mian/ViewModel/FunctionViewModel.swift
View file @
80b34594
...
...
@@ -23,7 +23,14 @@ class FunctionViewModel: BaseViewModel {
return
itemImgArrays
}()
func
updateItemArray
(){
if
!
PermissionsManager
.
todoViewPermissions
()
{
itemArrays
.
removeFirst
()
}
if
!
PermissionsManager
.
billViewPermissions
()
{
itemArrays
.
removeLast
()
}
}
}
extension
FunctionViewModel
{
...
...
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderAddTableViewController.swift
View file @
80b34594
...
...
@@ -93,6 +93,7 @@ class RepairOrderAddTableViewController: BaseTableViewController {
}
self
?
.
tableView
.
reloadData
()
})
.
disposed
(
by
:
disposeBag
)
repairOrderAddViewModel
.
repairOrderinit
(
controller
:
self
)
}
// MARK: - 提交工单--上传附件
...
...
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderChildBillDetailViewController.swift
View file @
80b34594
...
...
@@ -50,6 +50,10 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
@IBOutlet
weak
var
describeLabel
:
UILabel
!
/// 设备名称
@IBOutlet
weak
var
deviceNameLabel
:
UILabel
!
/// 条形码 ImageView
@IBOutlet
weak
var
codeImageView
:
UIImageView
!
/// 条形码 Label
@IBOutlet
weak
var
codeLabel
:
UILabel
!
/// 附件宽度
let
imageWidth
=
((
kWidth
-
90
)
-
CGFloat
((
3
+
kONE
)
*
5
))
/
3
...
...
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderDetailViewController.swift
View file @
80b34594
...
...
@@ -57,7 +57,9 @@ class RepairOrderDetailViewController: BaseTableViewController {
@IBOutlet
weak
var
completionLabel
:
UILabel
!
/// 备注
@IBOutlet
weak
var
remarkLabel
:
UILabel
!
//条形码
@IBOutlet
weak
var
codeImageView
:
UIImageView
!
@IBOutlet
weak
var
codeLabel
:
UILabel
!
/// 附件宽度
let
imageWidth
=
((
kWidth
-
90
)
-
CGFloat
((
3
+
kONE
)
*
5
))
/
3
/// 工单状态回调
...
...
@@ -124,7 +126,7 @@ class RepairOrderDetailViewController: BaseTableViewController {
}
// MARK: - 前往子工单完成界面
fileprivate
func
gotoEditingSonOrderVc
(
_
indexPath
:
IndexPath
)
{
fileprivate
func
gotoEditingSonOrderVc
(
_
indexPath
:
IndexPath
,
isEditable
:
Bool
=
true
)
{
self
.
performSegue
(
withIdentifier
:
RepairOrderEditSonOrderViewController
.
name
(),
sender
:
indexPath
)
}
...
...
@@ -297,14 +299,14 @@ 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
==
9
{
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
10
{
let
attachmentCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
RepairOrderAttachmentTableViewCell
.
name
(),
for
:
indexPath
)
as!
RepairOrderAttachmentTableViewCell
attachmentCell
.
titleLabel
.
text
=
"位置图"
locationAttVc
.
view
.
frame
=
CGRect
(
x
:
80
,
y
:
5
,
width
:
kWidth
-
90
,
height
:
locationAttHeight
)
attachmentCell
.
contentView
.
addSubview
(
locationAttVc
.
view
)
return
attachmentCell
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
1
4
{
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
1
5
{
let
attachmentCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
RepairOrderAttachmentTableViewCell
.
name
(),
for
:
indexPath
)
as!
RepairOrderAttachmentTableViewCell
attachmentCell
.
titleLabel
.
text
=
"照片描述"
attachmentVc
.
view
.
frame
=
CGRect
(
x
:
80
,
y
:
5
,
width
:
kWidth
-
90
,
height
:
attachmentHeight
)
...
...
@@ -353,19 +355,19 @@ extension RepairOrderDetailViewController {
}
return
childBillCellHeight
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
9
{
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
10
{
return
locationAttHeight
+
20
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
13
{
return
orderDetailViewModel
.
billDetailModel
.
descriptionFieldHeight
+
20
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
1
4
{
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
1
5
{
return
attachmentHeight
+
20
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
1
5
{
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
SOURCE
.
rawValue
&&
indexPath
.
row
==
1
6
{
return
orderDetailViewModel
.
billDetailModel
.
noteHeight
+
20
}
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
COMPLETED
.
rawValue
&&
indexPath
.
row
==
1
{
if
indexPath
.
section
==
REPAIR_ORDER_DETAIL_SECTION
.
COMPLETED
.
rawValue
&&
indexPath
.
row
==
2
{
return
orderDetailViewModel
.
billDetailModel
.
finishNoteHeight
+
20
}
return
super
.
tableView
(
tableView
,
heightForRowAt
:
indexPath
)
...
...
@@ -402,28 +404,28 @@ extension RepairOrderDetailViewController {
break
case
SUBMIT_REPAIR_ORDER_STATE
.
DREW
.
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
{
if
!
PermissionsManager
.
childViewPermissions
()
{
ShowMessage
(
"当前用户对此工单没有查看权限!"
)
return
;
}
//
if !PermissionsManager.childViewPermissions() {
//
ShowMessage("当前用户对此工单没有查看权限!")
//
return;
//
}
self
.
performSegue
(
withIdentifier
:
RepairOrderChildBillDetailViewController
.
name
(),
sender
:
indexPath
)
return
}
if
!
model
.
isEditable
&&
!
PermissionsManager
.
childViewPermissions
()
{
ShowMessage
(
"当前用户对此工单没有操作权限!"
)
return
;
}
if
!
model
.
isEditable
&&
PermissionsManager
.
childView
Permissions
()
{
//
if !model.isEditable && !PermissionsManager.childViewPermissions() {
//
ShowMessage("当前用户对此工单没有操作权限!")
//
return;
//
}
if
!
model
.
isEditable
&&
!
PermissionsManager
.
finishChild
Permissions
()
{
self
.
performSegue
(
withIdentifier
:
RepairOrderChildBillDetailViewController
.
name
(),
sender
:
indexPath
)
return
;
}
gotoEditingSonOrderVc
(
indexPath
)
break
case
SUBMIT_REPAIR_ORDER_STATE
.
DONE
.
rawValue
,
SUBMIT_REPAIR_ORDER_STATE
.
CANCLED
.
rawValue
:
if
!
PermissionsManager
.
childViewPermissions
()
{
ShowMessage
(
"当前用户对此工单没有查看权限!"
)
return
;
}
//
if !PermissionsManager.childViewPermissions() {
//
ShowMessage("当前用户对此工单没有查看权限!")
//
return;
//
}
self
.
performSegue
(
withIdentifier
:
RepairOrderChildBillDetailViewController
.
name
(),
sender
:
indexPath
)
break
default
:
...
...
IFS/IFS/Main/Business/RepairOrder/Controller/RepairOrderEditSonOrderViewController.swift
View file @
80b34594
...
...
@@ -43,6 +43,11 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
@IBOutlet
weak
var
materialCostLabel
:
UILabel
!
/// 描述
@IBOutlet
weak
var
describeTextView
:
IQTextView
!
@IBOutlet
weak
var
codeImageView
:
UIImageView
!
@IBOutlet
weak
var
codeLabel
:
UILabel
!
/// 维修前图片附件
lazy
final
var
beforAttachmentVc
:
PhotoAttachmentViewController
=
{
var
attachmentVc
=
PhotoAttachmentViewController
.
instantiateViewController
(
.
Function
)
as!
PhotoAttachmentViewController
...
...
@@ -107,9 +112,15 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
childBillViewModel
.
queryChildBillDetailAction
(
billModel
.
uuid
)
.
subscribe
{[
weak
self
]
(
event
)
in
self
?
.
childBillViewModel
.
childBillDetailAssignment
(
self
!
)
self
?
.
disposeAttachment
()
self
?
.
updateUI
()
}
.
disposed
(
by
:
disposeBag
)
}
func
updateUI
(){
if
self
.
childBillViewModel
.
childBillDetailData
.
isEditable
&&
PermissionsManager
.
saveChildPermissions
()
{
navigationItem
.
rightBarButtonItem
=
createButtonItem
(
"保存"
,
nil
,
self
,
#selector(
RepairOrderEditSonOrderViewController.saveButtonClickAction
)
)
}
}
// MARK: - 获取图片附件通过entity uuid
fileprivate
func
disposeAttachment
()
{
if
!
childBillViewModel
.
childBillDetailData
.
beginAttachmentId
.
isEmpty
{
...
...
@@ -163,26 +174,24 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
if
PermissionsManager
.
finishChildPermissions
()
{
tableView
.
tableFooterView
=
completeView
}
if
PermissionsManager
.
saveChildPermissions
()
{
navigationItem
.
rightBarButtonItem
=
createButtonItem
(
"保存"
,
nil
,
self
,
#selector(
RepairOrderEditSonOrderViewController.saveButtonClickAction
)
)
}
// if self.billModel.isEditable
{
//
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
()
Network
.
request
(
target
:
Service
.
ChildOrderComplete
(
self
.
childBillViewModel
.
childBillDetailData
.
uuid
,
"done"
),
success
:
{[
weak
self
]
(
json
)
in
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
UPDATE_RECEIVE_ORDER_LIST
),
object
:
nil
)
self
?
.
popVC
()
},
failure
:
{[
weak
self
]
(
error
)
in
self
?
.
popVC
()
})
}
// MARK: - 提交、保存子工单
@objc
fileprivate
func
saveButtonClickAction
()
{
if
!
PermissionsManager
.
saveChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有保存权限!"
)
return
;
}
//
if !PermissionsManager.saveChildPermissions() {
//
ShowMessage("当前用户对此工单没有保存权限!")
//
return;
//
}
ShowAlertView
(
hint
,
"确定保存此子工单吗?"
,
[
cancel
,
sure
],
.
alert
)
{[
weak
self
]
(
index
)
in
if
index
==
kZERO
{
return
}
self
?
.
uploadActtachmentAction
()
.
subscribe
(
onNext
:
{
(
result
)
in
...
...
IFS/IFS/Main/Business/RepairOrder/Model/ChildBillDetailResultModel.swift
View file @
80b34594
...
...
@@ -7,6 +7,133 @@
import
Foundation
import
SwiftyJSON
class
ChildBillWorkPeople
:
NSObject
{
var
uuid
:
String
!
var
login
:
String
!
var
name
:
String
!
var
password
:
String
!
var
mobile
:
String
!
var
email
:
String
!
var
enabled
:
Bool
!
var
position
:
String
!
var
address
:
String
!
var
belongOrg
:
String
!
var
remark
:
String
!
var
state
:
String
!
var
businessType
:
String
!
var
thirdLogin
:
String
!
var
jobGrade
:
String
!
var
jobLeavel
:
String
!
var
jobPost
:
String
!
var
positions
:[
String
]
!
init
(
model
:
InitiatorResultData
){
self
.
uuid
=
model
.
uuid
self
.
login
=
model
.
login
self
.
name
=
model
.
name
self
.
password
=
model
.
password
self
.
mobile
=
model
.
mobile
self
.
email
=
model
.
email
self
.
enabled
=
model
.
enabled
self
.
position
=
model
.
position
self
.
address
=
model
.
address
self
.
belongOrg
=
model
.
belongOrg
self
.
remark
=
model
.
remark
self
.
state
=
model
.
state
self
.
businessType
=
model
.
businessType
self
.
thirdLogin
=
model
.
thirdLogin
self
.
jobGrade
=
model
.
jobGrade
self
.
jobLeavel
=
model
.
jobLeavel
self
.
jobPost
=
model
.
jobPost
self
.
positions
=
model
.
positions
}
init
(
fromJson
json
:
JSON
!
){
if
json
.
isEmpty
{
return
}
self
.
uuid
=
json
[
"uuid"
]
.
stringValue
self
.
login
=
json
[
"login"
]
.
stringValue
self
.
name
=
json
[
"name"
]
.
stringValue
self
.
password
=
json
[
"password"
]
.
stringValue
self
.
mobile
=
json
[
"mobile"
]
.
stringValue
self
.
email
=
json
[
"email"
]
.
stringValue
self
.
enabled
=
json
[
"enabled"
]
.
boolValue
self
.
position
=
json
[
"position"
]
.
stringValue
self
.
address
=
json
[
"address"
]
.
stringValue
self
.
belongOrg
=
json
[
"belongOrg"
]
.
stringValue
self
.
remark
=
json
[
"remark"
]
.
stringValue
self
.
state
=
json
[
"state"
]
.
stringValue
self
.
businessType
=
json
[
"businessType"
]
.
stringValue
self
.
thirdLogin
=
json
[
"thirdLogin"
]
.
stringValue
self
.
jobGrade
=
json
[
"jobGrade"
]
.
stringValue
self
.
jobLeavel
=
json
[
"jobLeavel"
]
.
stringValue
self
.
jobPost
=
json
[
"jobPost"
]
.
stringValue
positions
=
[
String
]()
let
positionsArray
=
json
[
"positions"
]
.
arrayValue
for
positionsJson
in
positionsArray
{
positions
.
append
(
positionsJson
.
stringValue
)
}
}
func
toDictionary
()
->
[
String
:
Any
]
{
var
dictionary
=
[
String
:
Any
]()
if
address
!=
nil
{
dictionary
[
"address"
]
=
address
}
if
belongOrg
!=
nil
{
dictionary
[
"belongOrg"
]
=
belongOrg
}
if
businessType
!=
nil
{
dictionary
[
"businessType"
]
=
businessType
}
if
email
!=
nil
{
dictionary
[
"email"
]
=
email
}
if
enabled
!=
nil
{
dictionary
[
"enabled"
]
=
enabled
}
if
jobGrade
!=
nil
{
dictionary
[
"jobGrade"
]
=
jobGrade
}
if
jobLeavel
!=
nil
{
dictionary
[
"jobLeavel"
]
=
jobLeavel
}
if
jobPost
!=
nil
{
dictionary
[
"jobPost"
]
=
jobPost
}
if
login
!=
nil
{
dictionary
[
"login"
]
=
login
}
if
mobile
!=
nil
{
dictionary
[
"mobile"
]
=
mobile
}
if
name
!=
nil
{
dictionary
[
"name"
]
=
name
}
if
password
!=
nil
{
dictionary
[
"password"
]
=
password
}
if
position
!=
nil
&&
position
!=
""
{
dictionary
[
"position"
]
=
position
}
if
positions
!=
nil
{
dictionary
[
"positions"
]
=
positions
}
if
remark
!=
nil
{
dictionary
[
"remark"
]
=
remark
}
if
state
!=
nil
{
dictionary
[
"state"
]
=
state
}
if
thirdLogin
!=
nil
{
dictionary
[
"thirdLogin"
]
=
thirdLogin
}
if
uuid
!=
nil
{
dictionary
[
"uuid"
]
=
uuid
}
return
dictionary
}
}
class
ChildBillDetailResultModel
:
NSObject
{
...
...
@@ -74,6 +201,7 @@ open class ChildBillDetailData : NSObject{
var
processBegin
:
String
!
var
processEnd
:
String
!
var
processMode
:
String
!
var
processors
:
[
ChildBillWorkPeople
]
=
[
ChildBillWorkPeople
]()
var
processor
:
String
!
var
property1
:
String
!
var
property2
:
String
!
...
...
@@ -82,8 +210,7 @@ open class ChildBillDetailData : NSObject{
var
uuid
:
String
!
var
version
:
Int
!
var
workid
:
String
!
var
isEditable
:
Bool
!
init
(
_
state
:
String
)
{
self
.
state
=
state
...
...
@@ -130,6 +257,14 @@ open class ChildBillDetailData : NSObject{
if
!
ownerJson
.
isEmpty
{
owner
=
UCN
(
fromJson
:
ownerJson
)
}
let
workerJson
=
json
[
"processors"
]
.
arrayValue
if
!
workerJson
.
isEmpty
{
var
workPeoples
:
[
ChildBillWorkPeople
]
=
[
ChildBillWorkPeople
]()
for
json
in
workerJson
{
workPeoples
.
append
(
ChildBillWorkPeople
(
fromJson
:
json
))
}
processors
=
workPeoples
}
ownerTime
=
json
[
"ownerTime"
]
.
stringValue
processBegin
=
json
[
"processBegin"
]
.
stringValue
processEnd
=
json
[
"processEnd"
]
.
stringValue
...
...
@@ -142,6 +277,7 @@ open class ChildBillDetailData : NSObject{
uuid
=
json
[
"uuid"
]
.
stringValue
version
=
json
[
"version"
]
.
intValue
workid
=
json
[
"workid"
]
.
stringValue
isEditable
=
json
[
"isEditable"
]
.
boolValue
}
/**
...
...
@@ -216,9 +352,9 @@ open class ChildBillDetailData : NSObject{
if
processMode
!=
nil
{
dictionary
[
"processMode"
]
=
processMode
}
if
processor
!=
nil
{
dictionary
[
"processor"
]
=
processor
}
//
if processor != nil{
//
dictionary["processor"] = processor
//
}
if
property1
!=
nil
{
dictionary
[
"property1"
]
=
property1
}
...
...
@@ -240,6 +376,15 @@ open class ChildBillDetailData : NSObject{
if
workid
!=
nil
{
dictionary
[
"workid"
]
=
workid
}
if
isEditable
!=
nil
{
dictionary
[
"isEditable"
]
=
isEditable
}
if
processors
.
count
>
0
{
let
array
=
processors
.
map
({
(
model
)
->
[
String
:
Any
]
in
return
model
.
toDictionary
()
})
dictionary
[
"processors"
]
=
array
}
return
dictionary
}
}
...
...
IFS/IFS/Main/Business/RepairOrder/View/RepairOrderDetailSuspendView.swift
View file @
80b34594
...
...
@@ -21,6 +21,7 @@ class RepairOrderDetailSuspendView: UIView {
/// 转交时间
@IBOutlet
weak
var
operationTimeLab
:
UILabel
!
@IBOutlet
weak
var
buttonWidth
:
NSLayoutConstraint
!
/// 数据源
var
model
:
BillDetailExecute
!
...
...
@@ -54,6 +55,9 @@ class RepairOrderDetailSuspendView: UIView {
case
SUBMIT_REPAIR_ORDER_STATE
.
DREW
.
rawValue
:
operationOrderBtn
.
setTitle
(
SUSPEND_BUTTON_TYPE
.
COMPLETED
.
rawValue
,
for
:
.
normal
)
operationOrderBtn
.
backgroundColor
=
kYellowColor
if
!
PermissionsManager
.
finishChildPermissions
(){
buttonWidth
.
constant
=
0
}
break
default
:
break
...
...
IFS/IFS/Main/Business/RepairOrder/View/RepairOrderDetailSuspendView.xib
View file @
80b34594
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"13
771
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"13
529
"
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=
"13
772
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"13
527
"
/>
<capability
name=
"Constraints with non-1.0 multipliers"
minToolsVersion=
"5.1"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
...
...
@@ -82,6 +82,7 @@
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"vUN-kp-3ea"
/>
<connections>
<outlet
property=
"buttonWidth"
destination=
"hwM-34-dPe"
id=
"58i-Rz-RZ5"
/>
<outlet
property=
"contentBgView"
destination=
"Mq2-FF-B2L"
id=
"4Ue-ir-jtf"
/>
<outlet
property=
"departmentLab"
destination=
"9hT-Fx-col"
id=
"MzW-Dg-7Kj"
/>
<outlet
property=
"operationOrderBtn"
destination=
"4Ae-kJ-XQN"
id=
"vln-FL-YrN"
/>
...
...
IFS/IFS/Main/Business/RepairOrder/ViewModel/RepairOrderAddViewModel.swift
View file @
80b34594
...
...
@@ -29,6 +29,29 @@ class RepairOrderAddViewModel: BaseViewModel {
extension
RepairOrderAddViewModel
{
func
repairOrderinit
(
controller
:
RepairOrderAddTableViewController
){
filterViewModel
.
queryProjectType
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
return
}
if
result
.
count
==
1
{
let
model
=
result
[
0
]
controller
.
projectLabel
.
text
=
model
.
name
controller
.
projectLabel
.
textColor
=
kBlackColor
let
user
=
UCN
(
model
.
code
,
model
.
name
,
model
.
uuid
)
self
?
.
saveOrderModel
.
store
=
user
}
})
.
disposed
(
by
:
disposeBag
)
controller
.
originatorLabel
.
text
=
kUser
()
.
userName
controller
.
originatorLabel
.
textColor
=
kBlackColor
let
user
=
UCN
(
kUser
()
.
userCode
,
kUser
()
.
userName
,
kUser
()
.
userUuid
)
self
.
saveOrderModel
.
reportUser
=
user
}
// MARK: - 是否允许提交工单
func
repairOrderAvailable
(
_
sender
:
UISwitch
)
->
Bool
{
guard
saveOrderModel
.
store
!=
nil
else
{
...
...
@@ -47,10 +70,10 @@ extension RepairOrderAddViewModel {
// ShowMessage("请选择工单优先级")
// return false
// }
//
guard saveOrderModel.reportUser != nil else {
//
ShowMessage("请选择工单报事人")
//
return false
//
}
guard
saveOrderModel
.
reportUser
!=
nil
else
{
ShowMessage
(
"请选择工单报事人"
)
return
false
}
// guard saveOrderModel.receiveTime != nil else {
// ShowMessage("请选择工单接报时间")
// return false
...
...
@@ -59,18 +82,22 @@ extension RepairOrderAddViewModel {
// ShowMessage("请选择工单指定时间")
// return false
// }
// guard NSString(string: saveOrderModel.reporterPhone).isTelephone() != false else {
// ShowMessage("报事人电话格式不正确")
// return false
// }
// guard saveOrderModel.position != 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
}
guard
saveOrderModel
.
descriptionField
!=
nil
&&
saveOrderModel
.
descriptionField
!=
""
else
{
ShowMessage
(
"请填写工单描述"
)
return
false
}
// if sender.isOn {
// guard saveOrderModel.device != nil else {
// ShowMessage("请选择故障设施")
...
...
@@ -113,6 +140,9 @@ extension RepairOrderAddViewModel {
ShowMessage
(
"无数据"
)
return
}
guard
controller
.
projectLabel
.
text
==
"选择项目"
&&
result
.
count
!=
1
else
{
return
}
let
publicFilterVc
=
FilterViewController
.
instantiateViewController
(
.
Function
)
as!
FilterViewController
for
model
in
result
{
let
filterModel
:
PublicFilterModel
?
...
...
IFS/IFS/Main/Business/RepairOrder/ViewModel/RepairOrderDetailViewModel.swift
View file @
80b34594
...
...
@@ -10,6 +10,7 @@ import UIKit
import
RxSwift
import
Moya
import
SwiftyJSON
import
swiftScan
class
RepairOrderDetailViewModel
:
BaseViewModel
{
...
...
@@ -245,6 +246,8 @@ extension RepairOrderDetailViewModel {
if
billDetailModel
.
store
!=
nil
{
controller
.
projectLabel
.
text
=
disposeEmpty
(
billDetailModel
.
store
.
name
)
}
controller
.
codeImageView
.
image
=
LBXScanWrapper
.
createCode128
(
codeString
:
billDetailModel
.
workNo
,
size
:
CGSize
(
width
:
kWidth
-
120
,
height
:
80
),
qrColor
:
UIColor
.
black
,
bkColor
:
UIColor
.
white
)
controller
.
codeLabel
.
text
=
billDetailModel
.
workNo
}
// MARK: - 处理空数据
...
...
IFS/IFS/Main/Business/RepairOrder/ViewModel/ReparirChildBillViewModel.swift
View file @
80b34594
...
...
@@ -10,6 +10,7 @@ import UIKit
import
RxSwift
import
RxCocoa
import
Moya
import
swiftScan
class
ReparirChildBillViewModel
:
BaseViewModel
{
...
...
@@ -200,21 +201,31 @@ extension ReparirChildBillViewModel {
// MARK: - 子工单赋值.编辑
func
childBillDetailAssignment
(
_
controller
:
RepairOrderEditSonOrderViewController
)
{
controller
.
toolOptionLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
property1
)
controller
.
protectOptionLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
property2
)
controller
.
workPersonLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processor
)
controller
.
placeTimeLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processBegin
)
controller
.
leaveTimeLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processEnd
)
controller
.
failureCauseLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
reason
)
controller
.
processModeLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
processMode
)
let
workers
=
childBillDetailData
.
processors
.
map
{
(
model
)
->
String
in
return
model
.
name
}
.
joined
(
separator
:
","
)
disposeEmpty
(
label
:
controller
.
workPersonLabel
,
string
:
workers
)
disposeEmpty
(
label
:
controller
.
toolOptionLabel
,
string
:
childBillDetailData
.
property1
)
disposeEmpty
(
label
:
controller
.
protectOptionLabel
,
string
:
childBillDetailData
.
property2
)
disposeEmpty
(
label
:
controller
.
placeTimeLabel
,
string
:
childBillDetailData
.
processBegin
)
disposeEmpty
(
label
:
controller
.
leaveTimeLabel
,
string
:
childBillDetailData
.
processEnd
)
disposeEmpty
(
label
:
controller
.
failureCauseLabel
,
string
:
childBillDetailData
.
reason
)
disposeEmpty
(
label
:
controller
.
processModeLabel
,
string
:
childBillDetailData
.
processMode
)
controller
.
costLaborText
.
text
=
childBillDetailData
.
labourfee
.
isEmpty
?
nil
:
childBillDetailData
.
labourfee
controller
.
materialCostLabel
.
text
=
disposeEmpty
(
childBillDetailData
.
materielfee
)
disposeEmpty
(
label
:
controller
.
materialCostLabel
,
string
:
childBillDetailData
.
materielfee
)
controller
.
describeTextView
.
text
=
childBillDetailData
.
note
.
isEmpty
?
nil
:
childBillDetailData
.
note
disposeEmpty
(
label
:
controller
.
workPersonLabel
,
string
:
workers
)
disposeEmpty
(
label
:
controller
.
workPersonLabel
,
string
:
workers
)
controller
.
codeImageView
.
image
=
LBXScanWrapper
.
createCode128
(
codeString
:
childBillDetailData
.
executeNo
,
size
:
CGSize
(
width
:
kWidth
-
120
,
height
:
80
),
qrColor
:
UIColor
.
black
,
bkColor
:
UIColor
.
white
)
controller
.
codeLabel
.
text
=
childBillDetailData
.
executeNo
}
// MARK: - 子工单赋值.查看
func
childBillDetailAssignment
(
_
controller
:
RepairOrderChildBillDetailViewController
)
{
controller
.
workPersonLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
processor
)
let
workers
=
childBillDetailData
.
processors
.
map
{
(
model
)
->
String
in
return
model
.
name
}
.
joined
(
separator
:
","
)
controller
.
workPersonLabel
.
text
=
disposeEmpty2
(
workers
)
controller
.
placeTimeLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
processBegin
)
controller
.
leaveTimeLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
processEnd
)
controller
.
failureCauseLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
reason
)
...
...
@@ -229,14 +240,21 @@ extension ReparirChildBillViewModel {
controller
.
backupsToolLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
property1
)
controller
.
billNumberTimeLabel
.
text
=
disposeEmpty2
(
childBillDetailData
.
ownerTime
)
controller
.
billNumberLab
.
text
=
disposeEmpty2
(
childBillDetailData
.
executeNo
)
controller
.
codeImageView
.
image
=
LBXScanWrapper
.
createCode128
(
codeString
:
childBillDetailData
.
executeNo
,
size
:
CGSize
(
width
:
kWidth
-
120
,
height
:
80
),
qrColor
:
UIColor
.
black
,
bkColor
:
UIColor
.
white
)
controller
.
codeLabel
.
text
=
childBillDetailData
.
executeNo
controller
.
tableView
.
reloadData
()
}
// MARK: - 处理空数据
func
disposeEmpty
(
_
string
:
String
)
->
String
?
{
func
disposeEmpty
(
label
:
UILabel
,
string
:
String
)
{
if
string
.
isEmpty
{
return
"请选择"
label
.
text
=
"请选择"
label
.
textColor
=
UIColor
.
lightGray
return
}
else
{
label
.
text
=
string
label
.
textColor
=
UIColor
.
black
}
return
string
}
// MARK: - 处理空数据
...
...
@@ -302,7 +320,7 @@ extension ReparirChildBillViewModel {
/// 完成部门工单界面item对应事件
func
didSelectRowAtIndexPath
(
_
indexPath
:
IndexPath
,
_
controller
:
RepairOrderEditSonOrderViewController
)
{
switch
indexPath
{
case
IndexPath
(
row
:
0
,
section
:
0
):
case
IndexPath
(
row
:
1
,
section
:
0
):
filterViewModel
.
queryToolOption
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
...
...
@@ -315,7 +333,7 @@ extension ReparirChildBillViewModel {
},
cancel
:
nil
)
})
.
disposed
(
by
:
disposeBag
)
break
case
IndexPath
(
row
:
1
,
section
:
0
):
case
IndexPath
(
row
:
2
,
section
:
0
):
filterViewModel
.
queryProtectOption
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
...
...
@@ -328,7 +346,7 @@ extension ReparirChildBillViewModel {
},
cancel
:
nil
)
})
.
disposed
(
by
:
disposeBag
)
break
case
IndexPath
(
row
:
2
,
section
:
0
):
case
IndexPath
(
row
:
3
,
section
:
0
):
let
model
=
QueryModel
()
model
.
storeUuidEquals
=
childBillDetailData
.
dept
.
uuid
filterViewModel
.
queryInitiator
(
model
)
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
...
...
@@ -337,21 +355,30 @@ extension ReparirChildBillViewModel {
return
}
let
publicFilterVc
=
FilterViewController
.
instantiateViewController
(
.
Function
)
as!
FilterViewController
for
model
in
result
{
let
filterModel
=
PublicFilterModel
(
uuid
:
model
.
uuid
,
title
:
model
.
name
,
isSelected
:
"
\(
kZERO
)
"
)
for
(
index
,
model
)
in
result
.
enumerated
(){
let
uuidS
=
self
?
.
childBillDetailData
.
processors
.
map
({
(
model
)
->
String
in
return
model
.
uuid
})
let
isSelect
=
(
uuidS
?
.
contains
(
model
.
uuid
)
??
false
)
?
kONE
:
kZERO
let
filterModel
=
PublicFilterModel
(
uuid
:
model
.
uuid
,
title
:
model
.
name
,
isSelected
:
"
\(
isSelect
)
"
,
index
:
index
)
publicFilterVc
.
publicViewModel
.
filterArray
.
add
(
filterModel
)
}
controller
.
pushVC
(
publicFilterVc
)
publicFilterVc
.
setNavigationTitle
(
"选择出工人"
,
.
SINGLE
,
{
(
choices
,
index
)
in
let
choiceModel
=
choices
.
first
!
controller
.
workPersonLabel
.
text
=
choiceModel
.
title
publicFilterVc
.
setNavigationTitle
(
"选择出工人"
,
.
MULTIPLE
,
{
(
choices
,
index
)
in
let
nameTitle
=
choices
.
map
({
(
model
)
->
String
in
return
model
.
title
})
.
joined
(
separator
:
","
)
controller
.
workPersonLabel
.
text
=
nameTitle
controller
.
workPersonLabel
.
textColor
=
kBlackColor
let
model
=
result
[
index
!
]
self
?
.
childBillDetailData
.
processor
=
model
.
name
controller
.
tableView
.
reloadRow
(
at
:
indexPath
,
with
:
UITableViewRowAnimation
.
none
)
let
workModels
=
choices
.
map
({
(
model
)
->
ChildBillWorkPeople
in
return
ChildBillWorkPeople
(
model
:
result
[
model
.
index
])
})
self
?
.
childBillDetailData
.
processors
=
workModels
})
})
.
disposed
(
by
:
disposeBag
)
break
case
IndexPath
(
row
:
3
,
section
:
0
):
case
IndexPath
(
row
:
4
,
section
:
0
):
let
defaultDate
=
controller
.
placeTimeLabel
.
text
==
"请选择"
?
NSDate
()
.
httpParameterString
()
:
controller
.
placeTimeLabel
.
text
var
date
:
Date
?
if
!
childBillDetailData
.
processEnd
.
isEmpty
{
...
...
@@ -363,7 +390,7 @@ extension ReparirChildBillViewModel {
self
?
.
childBillDetailData
.
processBegin
=
time
},
cancel
:
nil
)
break
case
IndexPath
(
row
:
4
,
section
:
0
):
case
IndexPath
(
row
:
5
,
section
:
0
):
let
defaultDate
=
controller
.
leaveTimeLabel
.
text
==
"请选择"
?
NSDate
()
.
httpParameterString
()
:
controller
.
leaveTimeLabel
.
text
var
date
=
Date
()
if
!
childBillDetailData
.
processBegin
.
isEmpty
{
...
...
@@ -375,7 +402,7 @@ extension ReparirChildBillViewModel {
self
?
.
childBillDetailData
.
processEnd
=
time
},
cancel
:
nil
)
break
case
IndexPath
(
row
:
5
,
section
:
0
):
case
IndexPath
(
row
:
6
,
section
:
0
):
filterViewModel
.
queryBrokenOption
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
...
...
@@ -388,7 +415,7 @@ extension ReparirChildBillViewModel {
},
cancel
:
nil
)
})
.
disposed
(
by
:
disposeBag
)
break
case
IndexPath
(
row
:
6
,
section
:
0
):
case
IndexPath
(
row
:
7
,
section
:
0
):
filterViewModel
.
queryProcessMethods
()
.
subscribe
(
onNext
:
{[
weak
self
]
(
result
)
in
if
result
.
isEmpty
{
ShowMessage
(
"无数据"
)
...
...
IFS/IFS/Main/Business/Todo/Controller/TodoViewController.swift
View file @
80b34594
...
...
@@ -97,20 +97,20 @@ class TodoViewController: BaseTableViewPullController {
})
break
case
TODO_STATE
.
DREW
:
if
!
PermissionsManager
.
saveChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有编辑权限!"
)
return
;
}
//
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
;
}
//
if !PermissionsManager.childViewPermissions() {
//
ShowMessage("当前用户对此工单没有查看权限!")
//
return;
//
}
let
childBillVc
=
RepairOrderChildBillDetailViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderChildBillDetailViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
childBillVc
.
billModel
.
uuid
=
model
.
entityUuid
...
...
IFS/IFS/Main/Business/Todo/ViewModel/TodoViewModel.swift
View file @
80b34594
...
...
@@ -19,7 +19,6 @@ class TodoViewModel: BaseViewModel {
queryModel
.
userId
=
kUser
()
.
userUuid
return
queryModel
}()
/// 待办事项结果
lazy
final
var
todoResultArray
:
Array
<
TodoData
>
=
{
var
todoResultArray
=
Array
<
TodoData
>
()
...
...
IFS/IFS/Main/Home/Controller/HomeTableViewController.swift
View file @
80b34594
...
...
@@ -33,11 +33,13 @@ class HomeTableViewController: BaseTableViewPullController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
if
todoState
==
TODO_STATE
.
DREW
{
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
loadWebDataSource
)
,
name
:
Notification
.
Name
(
UPDATE_RECEIVE_ORDER_LIST
),
object
:
nil
)
}
}
// MARK: - 获取数据
override
func
loadWebDataSource
()
{
@objc
override
func
loadWebDataSource
()
{
if
!
PermissionsManager
.
todoViewPermissions
()
{
endRefresh
()
tableView
.
reloadData
()
...
...
@@ -57,12 +59,6 @@ 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
)
}
...
...
@@ -95,30 +91,31 @@ class HomeTableViewController: BaseTableViewPullController {
self
?
.
orderDetailViewModel
.
getChildBillAction
(
model
.
entityUuid
)
.
subscribe
(
onNext
:
{
()
in
self
?
.
loadWebDataSource
()
Network
.
request
(
target
:
Service
.
ChildOrderComplete
(
model
.
entityUuid
,
"drew"
),
success
:
{
(
json
)
in
self
?
.
loadWebDataSource
()
},
failure
:
{
(
error
)
in
self
?
.
loadWebDataSource
()
})
ShowMessage
(
"领取成功"
)
self
?
.
delyLoadData
()
})
.
disposed
(
by
:
self
!.
disposeBag
)
})
break
case
TODO_STATE
.
DREW
:
if
!
PermissionsManager
.
saveChildPermissions
()
{
ShowMessage
(
"当前用户对此工单没有编辑权限!"
)
return
;
}
// 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
;
}
//
if !PermissionsManager.childViewPermissions() {
//
ShowMessage("当前用户对此工单没有查看权限!")
//
return;
//
}
let
childBillVc
=
RepairOrderChildBillDetailViewController
.
instantiateViewController
(
.
Function
)
as!
RepairOrderChildBillDetailViewController
childBillVc
.
billModel
=
BillDetailExecute
(
fromJson
:
JSON
(
model
.
toDictionary
()))
childBillVc
.
billModel
.
uuid
=
model
.
entityUuid
...
...
IFS/IFS/Main/Storyboards/Function.storyboard
View file @
80b34594
This diff is collapsed.
Click to expand it.
IFS/IFS/Resource/Info.plist
View file @
80b34594
...
...
@@ -17,9 +17,9 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0.
6
<
/string
>
<
string
>
1.0.
5
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.0.
6
<
/string
>
<
string
>
1.0.
5
<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
...
...
IFS/Podfile
View file @
80b34594
...
...
@@ -23,4 +23,5 @@ target ‘IFS’ do
pod
'SVProgressHUD'
,
'~> 2.2.2'
pod
'UMengAnalytics'
pod
'JPush'
pod
'swiftScan'
end
IFS/Podfile.lock
View file @
80b34594
...
...
@@ -25,6 +25,7 @@ PODS:
- SKPhotoBrowser (5.0.3)
- SnapKit (4.0.0)
- SVProgressHUD (2.2.2)
- swiftScan (1.1.3)
- SwiftyJSON (4.0.0)
- UMengAnalytics (4.2.4)
- YXAlertController (1.0.8)
...
...
@@ -48,6 +49,7 @@ DEPENDENCIES:
- SKPhotoBrowser (~> 5.0.0)
- SnapKit
- SVProgressHUD (~> 2.2.2)
- swiftScan
- SwiftyJSON
- UMengAnalytics
- YXAlertController
...
...
@@ -75,6 +77,7 @@ SPEC REPOS:
- SKPhotoBrowser
- SnapKit
- SVProgressHUD
- swiftScan
- SwiftyJSON
- UMengAnalytics
- YXAlertController
...
...
@@ -101,11 +104,12 @@ SPEC CHECKSUMS:
SKPhotoBrowser: 6de77f7004442e79059f19d86e2e7e6a03b43a13
SnapKit: a42d492c16e80209130a3379f73596c3454b7694
SVProgressHUD: 59b2d3dabacbd051576d21d32293ca7228dc18b0
swiftScan: ad753846f4292c19a376dd159db035d62b689458
SwiftyJSON: 070dabdcb1beb81b247c65ffa3a79dbbfb3b48aa
UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2
YXAlertController: 37a54642cb8e8b43b79004fe9148bb8ff2fab814
YXKit: 73d6ffbcf7530f1159e030460207286e9153b080
PODFILE CHECKSUM:
f129d1e18957ae13e839f8aa18e676cc404743df
PODFILE CHECKSUM:
ca2deb99f65138a0ea1c4a431cc195f523594330
COCOAPODS: 1.5.0
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