Commit e0abf551 authored by 哈南's avatar 哈南

no message

parent 252f9315
......@@ -150,7 +150,9 @@
29F6B9042008B5B400EE4630 /* DepartmentResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B9032008B5B300EE4630 /* DepartmentResultModel.swift */; };
29F6B908200C4F1500EE4630 /* BillCompletedRequestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B907200C4F1500EE4630 /* BillCompletedRequestModel.swift */; };
29F6B90A200C54CD00EE4630 /* RepairOrderCompletedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B909200C54CD00EE4630 /* RepairOrderCompletedViewController.swift */; };
3429FE55214001AC0084BDF9 /* HomeLinDanController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3429FE54214001AC0084BDF9 /* HomeLinDanController.swift */; };
345FC5AA2108549D00291E41 /* IFSPersonFilterController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345FC5A92108549D00291E41 /* IFSPersonFilterController.swift */; };
348741D2214274FD008113A2 /* SBSkipTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 348741D1214274FD008113A2 /* SBSkipTool.swift */; };
34CB3FAC210978A500E41667 /* TreeFliteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34CB3FAB210978A500E41667 /* TreeFliteViewController.swift */; };
34CB3FAF21097B0400E41667 /* TreeFliteLocationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34CB3FAD21097B0400E41667 /* TreeFliteLocationCell.swift */; };
34CB3FB021097B0400E41667 /* TreeFliteLocationCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CB3FAE21097B0400E41667 /* TreeFliteLocationCell.xib */; };
......@@ -317,7 +319,9 @@
29F6B9032008B5B300EE4630 /* DepartmentResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DepartmentResultModel.swift; sourceTree = "<group>"; };
29F6B907200C4F1500EE4630 /* BillCompletedRequestModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BillCompletedRequestModel.swift; sourceTree = "<group>"; };
29F6B909200C54CD00EE4630 /* RepairOrderCompletedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepairOrderCompletedViewController.swift; sourceTree = "<group>"; };
3429FE54214001AC0084BDF9 /* HomeLinDanController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeLinDanController.swift; sourceTree = "<group>"; };
345FC5A92108549D00291E41 /* IFSPersonFilterController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IFSPersonFilterController.swift; sourceTree = "<group>"; };
348741D1214274FD008113A2 /* SBSkipTool.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SBSkipTool.swift; sourceTree = "<group>"; };
34CB3FAB210978A500E41667 /* TreeFliteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreeFliteViewController.swift; sourceTree = "<group>"; };
34CB3FAD21097B0400E41667 /* TreeFliteLocationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreeFliteLocationCell.swift; sourceTree = "<group>"; };
34CB3FAE21097B0400E41667 /* TreeFliteLocationCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TreeFliteLocationCell.xib; sourceTree = "<group>"; };
......@@ -774,6 +778,7 @@
296FE43B1FFB2D1D00810820 /* HomeViewController.swift */,
296FE4491FFB5C9600810820 /* HomeContentViewController.swift */,
296FE44B1FFB5CAB00810820 /* HomeTableViewController.swift */,
3429FE54214001AC0084BDF9 /* HomeLinDanController.swift */,
);
path = Controller;
sourceTree = "<group>";
......@@ -915,6 +920,7 @@
29EA0BD21FEA3156005A6170 /* Expand */ = {
isa = PBXGroup;
children = (
348741D0214274F6008113A2 /* Tool */,
29EA0BD31FEA3156005A6170 /* Base */,
29EA0BDA1FEA3156005A6170 /* Category */,
29EA0BDD1FEA3156005A6170 /* Const */,
......@@ -1018,6 +1024,14 @@
path = WebView;
sourceTree = "<group>";
};
348741D0214274F6008113A2 /* Tool */ = {
isa = PBXGroup;
children = (
348741D1214274FD008113A2 /* SBSkipTool.swift */,
);
path = Tool;
sourceTree = "<group>";
};
34CB3FB12109957800E41667 /* Tool */ = {
isa = PBXGroup;
children = (
......@@ -1242,6 +1256,7 @@
29F6B9002008A34700EE4630 /* RepairOrderDetailBgController.swift in Sources */,
29EA0C0D1FEA3156005A6170 /* Color+Extension.swift in Sources */,
29D5307F1FFF626500851F00 /* RepairOrderAddTableViewController.swift in Sources */,
348741D2214274FD008113A2 /* SBSkipTool.swift in Sources */,
29EA0C061FEA3156005A6170 /* BaseViewModel.swift in Sources */,
29DA418620046E86002762A2 /* AboutUsTableViewController.swift in Sources */,
29EA0BFF1FEA3156005A6170 /* TabBarViewController.swift in Sources */,
......@@ -1271,6 +1286,7 @@
296DAD7C2006F63B00615A2D /* ProjectSponsorsModel.swift in Sources */,
29D5307E1FFF626500851F00 /* FunctionViewModel.swift in Sources */,
29DA417020035610002762A2 /* RepairOrderEditSonOrderViewController.swift in Sources */,
3429FE55214001AC0084BDF9 /* HomeLinDanController.swift in Sources */,
29D530831FFF626500851F00 /* RepairOrderTableViewCell.swift in Sources */,
34D514292109683600E0B577 /* TreeLocationModel.swift in Sources */,
29EA0C111FEA3156005A6170 /* UIImage+Extension.swift in Sources */,
......
......@@ -21,21 +21,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
UIApplication.shared.applicationIconBadgeNumber = 0
JPUSHService.resetBadge()
}
......@@ -45,6 +42,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let nsdataStr = NSData.init(data: deviceToken)
let device = nsdataStr.description.replacingOccurrences(of: "<", with: "").replacingOccurrences(of: ">", with: "").replacingOccurrences(of: " ", with: "")
print(device)
//注册 DeviceToken
JPUSHService.registerDeviceToken(deviceToken)
}
......@@ -54,12 +54,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
NSLog("did Fail To Register For Remote Notifications With Error: \(error)")
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
JPUSHService.handleRemoteNotification(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
JPUSHService.handleRemoteNotification(userInfo)
}
// func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
// JPUSHService.handleRemoteNotification(userInfo)
// completionHandler(UIBackgroundFetchResult.newData)
// }
// func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
// JPUSHService.handleRemoteNotification(userInfo)
// }
}
......@@ -6,6 +6,7 @@
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import Foundation
var NRIsTouch: Bool = false
extension AppDelegate:JPUSHRegisterDelegate{
@available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter!, willPresent notification: UNNotification!, withCompletionHandler completionHandler: ((Int) -> Void)!) {
......@@ -20,19 +21,37 @@ extension AppDelegate:JPUSHRegisterDelegate{
@available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter!, didReceive response: UNNotificationResponse!, withCompletionHandler completionHandler: (() -> Void)!) {
let userInfo = response.notification.request.content.userInfo
NRIsTouch = true
SBSkipTool.share.skipViewController(parameters: userInfo)
if response.notification.request.trigger is UNPushNotificationTrigger {
JPUSHService.handleRemoteNotification(userInfo)
}
// 系统要求执行这个方法
completionHandler()
}
@objc func networkDidReceiveMessage(notification:Notification){
guard notification.userInfo != nil else {
return
}
let userInfo = notification.userInfo!["extras"]
// SBSkipTool.share.skipViewController(parameters: userInfo as? [AnyHashable : Any])
}
func registerPush(launchOptions: [UIApplicationLaunchOptionsKey: Any]?){
NotificationCenter.default.addObserver(self, selector: #selector(networkDidReceiveMessage(notification:)), name: NSNotification.Name.jpfNetworkDidReceiveMessage, object: nil)
let entity = JPUSHRegisterEntity()
entity.types = Int(JPAuthorizationOptions.alert.rawValue|JPAuthorizationOptions.badge.rawValue|JPAuthorizationOptions.sound.rawValue)
JPUSHService.register(forRemoteNotificationConfig: entity, delegate: self)
JPUSHService.setup(withOption: launchOptions, appKey: "6554c0463b6a9ff2262f4d3d", channel: "App Store", apsForProduction: false)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
SBSkipTool.share.skipViewController(parameters: userInfo)
JPUSHService.handleRemoteNotification(userInfo)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
JPUSHService.handleRemoteNotification(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
SBSkipTool.share.skipViewController(parameters: userInfo)
}
}
......@@ -20,3 +20,6 @@ public let UPDATE_REPAIRORDER_ADD_LIST: String = "UPDATE_REPAIRORDER_ADD_LIST"
/// 更新新建工单列表
public let UPDATE_RECEIVE_ORDER_LIST: String = "UPDATE_RECEIVE_ORDER_LIST"
/// 更新代办消息
public let UPDATE_TODO_LIST: String = "UPDATE_TODO_LIST"
......@@ -20,20 +20,20 @@ import Foundation
//public let BaseUrl: String="http://183.221.125.236:7080/ifs-server/rest/"
//public let BaseAttachmentUrl: String="http://183.221.125.236:7080"
////重庆IFS正式环境
public let BaseUrl: String="http://222.180.250.18:7090/ifs-server/rest/"
public let BaseAttachmentUrl: String="http://222.180.250.18:7090"
//public let BaseUrl: String="http://222.180.250.18:7090/ifs-server/rest/"
//public let BaseAttachmentUrl: String="http://222.180.250.18:7090"
//正式环境
//public let BaseUrl: String = "http://222.180.250.18:7090/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://222.180.250.18:7090"
//测试环境
//public let BaseUrl: String = "http://183.221.125.236:7080/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://183.221.125.236:7080"
//public let BaseUrl: String="http://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/%@"
......@@ -113,6 +113,8 @@ public let submitMessageRemind: String = "/work/submitMessageRemind/%@/%@"
public let drawMessageRemind: String = "/work/drawMessageRemind/%@/%@"
///查询树状位置信息
public let queryTreeLocationPath: String = "/information/position/getPositionTree?storeId=%@"
///查询用户电话
public let queryMobile: String = "/ifsUserOrganization/query/getUserId/%@"
......
......@@ -86,6 +86,8 @@ public enum Service {
case ChildOrderComplete(String,String)
// MARK: - 查询树状型位置信息
case queryTreeLocation(String)
// MARK: - 查询用户电话
case queryUserMobile(String)
}
extension Service: TargetType {
......@@ -182,6 +184,9 @@ extension Service: TargetType {
case .queryTreeLocation(let uuid):
let path = String(format: queryTreeLocationPath, uuid)
return path.urlEncoded()
case .queryUserMobile(let uuid):
let path = String(format: queryMobile, uuid)
return path.urlEncoded()
}
}
......@@ -223,6 +228,7 @@ extension Service: TargetType {
.QueryPrority(),
.queryTreeLocation(_),
.ChildOrderComplete(_, _),
.queryUserMobile(_),
.CompleteMessageRemind(_,_):
return .get
}
......@@ -264,6 +270,7 @@ extension Service: TargetType {
.Queryfloorlayer(_),
.QueryInitiator(_),
.queryTreeLocation(_),
.queryUserMobile(_),
.CompleteMessageRemind(_,_),
.ChildOrderComplete(_, _),
.QueryPrority():
......
//
// SBSkipTool.swift
// LanStoreBusiness
//
// Created by 飞迪1 on 2018/7/20.
// Copyright © 2018年 勾芒. All rights reserved.
//
import SwiftyJSON
import Foundation
class SBSkipTool {
static let share = SBSkipTool()
func skipViewController(parameters:[AnyHashable : Any]?){
if parameters == nil{
return
}
let sourceType:String = (parameters?["sourceType"] as? String) ?? ""
let uuid:String = (parameters?["id"] as? String) ?? ""
let state:String = (parameters?["workBillState"] as? String) ?? ""
switch sourceType {
case "workExecute":
self.toBillVC(state: state, uuid: uuid)
// let childBillVc = RepairOrderEditSonOrderViewController.instantiateViewController(.Function) as! RepairOrderEditSonOrderViewController
// childBillVc.billModel = BillDetailExecute(fromJson:"")
// childBillVc.billModel.uuid = uuid
// zj_getCurrentVC()?.pushVC(childBillVc)
case "workBill":
if uuid != ""{
let detailBgController = UIStoryboard(name: "Function", bundle: nil).instantiateViewController(withIdentifier: RepairOrderDetailBgController.name()) as! RepairOrderDetailBgController
detailBgController.billModel = RepairOrderRecord(fromJson: JSON(rawValue: ""))
detailBgController.billModel.uuid = uuid
zj_getCurrentVC()?.pushVC(detailBgController)
}
default:
break
}
}
func toBillVC(state:String,uuid:String){
switch state {
case "submit":
let lindanVC = HomeLinDanController.instantiateViewController(.Function) as! HomeLinDanController
lindanVC.model = TodoData(fromJson: JSON(rawValue: ""))
lindanVC.model.entityUuid = uuid
zj_getCurrentVC()?.pushVC(lindanVC)
case "drew":
let childBillVc = RepairOrderEditSonOrderViewController.instantiateViewController(.Function) as! RepairOrderEditSonOrderViewController
childBillVc.billModel = BillDetailExecute(fromJson: JSON(rawValue: ""))
childBillVc.billModel.uuid = uuid
zj_getCurrentVC()?.pushVC(childBillVc)
case "done":
let childBillVc = RepairOrderChildBillDetailViewController.instantiateViewController(.Function) as! RepairOrderChildBillDetailViewController
childBillVc.billModel = BillDetailExecute(fromJson: JSON(rawValue: ""))
childBillVc.billModel.uuid = uuid
zj_getCurrentVC()?.pushVC(childBillVc)
default:
break
}
}
}
func zj_getCurrentVC() -> UIViewController? {
if let vc = kWindow.rootViewController {
var currentVC = vc
if let presentedVC = currentVC.presentedViewController {
currentVC = presentedVC
}
if currentVC.isKind(of: UITabBarController.self) {
currentVC = (currentVC as! UITabBarController).selectedViewController!
}
if currentVC.isKind(of: UINavigationController.self) {
currentVC = (currentVC as! UINavigationController).visibleViewController!
}
return currentVC
}else{
return nil
}
}
......@@ -62,7 +62,8 @@ class RepairOrderAddTableViewController: BaseTableViewController {
attachmentVc.delegate = self
return attachmentVc
}()
//接口请求电话
var getMobile = ""
/// RepairOrderAddViewModel
/// 新建工单ViewModel
lazy final var repairOrderAddViewModel: RepairOrderAddViewModel = {
......@@ -76,8 +77,25 @@ class RepairOrderAddTableViewController: BaseTableViewController {
uiConfigAction()
setupPhotoAttachmentVc()
bindingRxAction()
getUserMobile()
}
//设置初始值
func getUserMobile(){
originatorTimeLabel.text = Date().toString(format: "yyyy-MM-dd HH:mm:ss")
self.repairOrderAddViewModel.saveOrderModel.requestTime = Date().toString(format: "yyyy-MM-dd HH:mm:ss")
self.originatorTimeLabel.textColor = kBlackColor
Network.request(target: Service.queryUserMobile(kUser().userCode), success: {[weak self] (respone) in
print(respone)
if respone["data"] != nil{
let personDic = respone["data"].dictionaryValue
self?.phoneNumberText.text = personDic["mobile"]?.stringValue
self?.repairOrderAddViewModel.saveOrderModel.reporterPhone = self?.phoneNumberText.text
}
}) { (error) in
}
}
// MARK: - UI
fileprivate func uiConfigAction() {
describeTextView.placeholder = "工单描述"
......
......@@ -94,7 +94,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
// MARK: - UI
fileprivate func uiConfigAction() {
title = String(format: "%@工单详情", 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())
......@@ -108,11 +108,14 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
childBillViewModel.queryChildBillDetailAction(billModel.uuid).subscribe {[weak self] (event) in
self?.childBillViewModel.childBillDetailAssignment(self!)
self?.childBillViewModel.billDetailStataDispose(self!)
self?.updateUI()
self?.disposeAttachment()
self?.tableView.reloadData()
}.disposed(by: disposeBag)
}
func updateUI(){
self.navigationItem.title = String(format: "完成%@工单", self.childBillViewModel.childBillDetailData.dept.name)
}
// MARK: - 获取图片附件通过entity uuid
fileprivate func disposeAttachment() {
if !childBillViewModel.childBillDetailData.beginAttachmentId.isEmpty {
......
......@@ -116,7 +116,7 @@ class RepairOrderDetailViewController: BaseTableViewController {
tableView.register(UINib(nibName: RepairOrderAttachmentTableViewCell.name(), bundle: nil), forCellReuseIdentifier: RepairOrderAttachmentTableViewCell.name())
tableView.register(UINib(nibName: RepairOrderSubOrderTableViewCell.name(), bundle: nil), forCellReuseIdentifier: RepairOrderSubOrderTableViewCell.name())
addChildViewController(attachmentVc)
orderDetailViewModel.billDetailModel = BillDetailData(billModel.state)
orderDetailViewModel.billDetailModel = BillDetailData("")
}
// MARK: - 获取tableView显示内容高度
......@@ -153,7 +153,6 @@ class RepairOrderDetailViewController: BaseTableViewController {
self?.tableView.reloadData()
}.disposed(by: disposeBag)
}
// MARK: - 悬浮框状态判断
fileprivate func suspendViewStateAction() {
for i in 0..<orderDetailViewModel.billDetailModel.executes.count {
......
......@@ -81,7 +81,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
// MARK: - UI
fileprivate func uiConfigAction() {
describeTextView.placeholder = "描述"
title = String(format: "完成%@工单", billModel.dept.name)
// title = String(format: "完成%@工单", billModel.dept.name)
describeTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0)
tableView.register(UINib(nibName: CostOrBorrowTableViewCell.name(), bundle: nil), forCellReuseIdentifier: CostOrBorrowTableViewCell.name())
}
......@@ -116,7 +116,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
}.disposed(by: disposeBag)
}
func updateUI(){
self.navigationItem.title = String(format: "完成%@工单", self.childBillViewModel.childBillDetailData.dept.name)
if self.childBillViewModel.childBillDetailData.isEditable && PermissionsManager.saveChildPermissions() {
navigationItem.rightBarButtonItem = createButtonItem("保存", nil, self, #selector(RepairOrderEditSonOrderViewController.saveButtonClickAction))
}
......
......@@ -25,6 +25,7 @@ class RepairOrderAddViewModel: BaseViewModel {
var saveOrderModel = SaveRepairOrderModel()
return saveOrderModel
}()
}
extension RepairOrderAddViewModel {
......@@ -58,10 +59,10 @@ extension RepairOrderAddViewModel {
ShowMessage("请选择项目")
return false
}
// guard saveOrderModel.source != nil else {
// ShowMessage("请选择工单来源")
// return false
// }
guard saveOrderModel.source != nil else {
ShowMessage("请选择工单来源")
return false
}
// guard saveOrderModel.serviceType != nil else {
// ShowMessage("请选择工单服务类型")
// return false
......@@ -293,12 +294,13 @@ extension RepairOrderAddViewModel {
}).disposed(by: disposeBag)
break
case IndexPath(row: 7, section: 0):
let defaultDate = controller.originatorTimeLabel.text == "工单接报时间" ? NSDate().httpParameterString() : controller.originatorTimeLabel.text
// let defaultDate = controller.originatorTimeLabel.text == "工单接报时间" ? NSDate().httpParameterString() : controller.originatorTimeLabel.text
let defaultDate = controller.originatorTimeLabel.text
var date: Date?
if saveOrderModel.requestTime != nil {
date = Date(fromString: saveOrderModel.requestTime, format: "yyyy-MM-dd HH:mm:ss")!
}
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: date, defaultDate: defaultDate, commit: {[weak self] (time) in
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
controller.originatorTimeLabel.text = time
controller.originatorTimeLabel.textColor = kBlackColor
self?.saveOrderModel.receiveTime = time
......
......@@ -30,10 +30,14 @@ class TodoViewController: BaseTableViewPullController {
override func viewDidLoad() {
super.viewDidLoad()
addNot()
tableViewAnimationHeight()
}
func addNot(){
NotificationCenter.default.rx.notification(Notification.Name(rawValue: UPDATE_TODO_LIST)).subscribe(onNext: {[weak self] (notice) in
self?.loadDataWhenDraw()
}).disposed(by: disposeBag)
}
// MARK: - 加载数据
override func loadWebDataSource() {
todoViewModel.queryTodoAction(.ALL).subscribe {[weak self] (event) in
......@@ -83,18 +87,21 @@ class TodoViewController: BaseTableViewPullController {
ShowMessage("当前用户对此工单没有领取权限!")
return
}
ShowAlertView(hint, "请确认是否领单?", [cancel,sure], .alert, {[weak self] (index) in
if index == kZERO { return }
self?.orderDetailViewModel.getChildBillAction(model.entityUuid).subscribe(onNext: { () in
self?.loadDataWhenDraw()
ShowMessage("领取成功")
Network.request(target: Service.ChildOrderComplete(model.entityUuid, "drew"), success: { (json) in
}, failure: { (error) in
})
}).disposed(by: self!.disposeBag)
})
let lindanVC = HomeLinDanController.instantiateViewController(.Function) as! HomeLinDanController
lindanVC.model = model
pushVC(lindanVC)
// ShowAlertView(hint, "请确认是否领单?", [cancel,sure], .alert, {[weak self] (index) in
// if index == kZERO { return }
// self?.orderDetailViewModel.getChildBillAction(model.entityUuid).subscribe(onNext: { () in
// self?.loadDataWhenDraw()
// ShowMessage("领取成功")
// Network.request(target: Service.ChildOrderComplete(model.entityUuid, "drew"), success: { (json) in
//
// }, failure: { (error) in
//
// })
// }).disposed(by: self!.disposeBag)
// })
break
case TODO_STATE.DREW:
// if !PermissionsManager.saveChildPermissions() {
......
//
// HomeLinDanController.swift
// IFS
//
// Created by Tiank on 2018/9/5.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
import SwiftyJSON
class HomeLinDanController: UIViewController {
/// RxSwift自动释放
let disposeBag = DisposeBag()
var model:TodoData!
/// 工单详情ViewModel
lazy final var orderDetailViewModel: RepairOrderDetailViewModel = {
var orderDetailViewModel = RepairOrderDetailViewModel()
return orderDetailViewModel
}()
@IBOutlet weak var orderNumLabel: UILabel!
@IBOutlet weak var timeLabel: UILabel!
/// 子工单详情ViewModel
lazy final var childBillViewModel: ReparirChildBillViewModel = {
var childBillViewModel = ReparirChildBillViewModel()
return childBillViewModel
}()
override func viewDidLoad() {
super.viewDidLoad()
}
func requestDetail(){
childBillViewModel.queryChildBillDetailAction(self.model.entityUuid).subscribe {[weak self] (event) in
self?.updateUI()
}.disposed(by: disposeBag)
}
func updateUI(){
orderNumLabel.text = self.childBillViewModel.childBillDetailData.executeNo
timeLabel.text = self.childBillViewModel.childBillDetailData.createTime
}
@IBAction func linDanAction(_ sender: UIButton) {
ShowAlertView(hint, "请确认是否领单?", [cancel,sure], .alert, {[weak self] (index) in
if index == kZERO { return }
self?.orderDetailViewModel.getChildBillAction(self?.model.entityUuid ?? "").subscribe(onNext: {[weak self] () in
self?.requestMessage()
self?.goDetail()
}).disposed(by: self!.disposeBag)
})
// self.orderDetailViewModel.getChildBillAction(model.entityUuid).subscribe(onNext: {[weak self] () in
// self?.requestMessage()
// self?.goDetail()
// }).disposed(by: self.disposeBag)
}
func goDetail(){
NotificationCenter.default.post(name: Notification.Name(rawValue: UPDATE_TODO_LIST), object: nil)
let childBillVc = RepairOrderEditSonOrderViewController.instantiateViewController(.Function) as! RepairOrderEditSonOrderViewController
childBillVc.billModel = BillDetailExecute(fromJson: JSON(model.toDictionary()))
childBillVc.billModel.uuid = model.entityUuid
pushVC(childBillVc)
self.navigationController?.viewControllers = (self.navigationController?.viewControllers.filter({ (vc) -> Bool in
return vc != self
}))!
}
func requestMessage(){
Network.request(target: Service.ChildOrderComplete(self.model.entityUuid, "drew"), success: { (json) in
}, failure: { (error) in
})
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
......@@ -36,8 +36,13 @@ class HomeTableViewController: BaseTableViewPullController {
if todoState == TODO_STATE.DREW{
NotificationCenter.default.addObserver(self, selector: #selector(loadWebDataSource), name: Notification.Name(UPDATE_RECEIVE_ORDER_LIST), object: nil)
}
addNot()
}
func addNot(){
NotificationCenter.default.rx.notification(Notification.Name(rawValue: UPDATE_TODO_LIST)).subscribe(onNext: {[weak self] (notice) in
self?.loadWebDataSource()
}).disposed(by: disposeBag)
}
// MARK: - 获取数据
@objc override func loadWebDataSource() {
if !PermissionsManager.todoViewPermissions() {
......@@ -86,19 +91,9 @@ class HomeTableViewController: BaseTableViewPullController {
ShowMessage("当前用户对此工单没有领取权限!")
return
}
ShowAlertView(hint, "请确认是否领单?", [cancel,sure], .alert, {[weak self] (index) in
if index == kZERO { return }
self?.orderDetailViewModel.getChildBillAction(model.entityUuid).subscribe(onNext: { () in
self?.loadWebDataSource()
Network.request(target: Service.ChildOrderComplete(model.entityUuid, "drew"), success: { (json) in
self?.loadWebDataSource()
}, failure: { (error) in
self?.loadWebDataSource()
})
ShowMessage("领取成功")
}).disposed(by: self!.disposeBag)
})
let lindanVC = HomeLinDanController.instantiateViewController(.Function) as! HomeLinDanController
lindanVC.model = model
pushVC(lindanVC)
break
case TODO_STATE.DREW:
......
......@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.0</string>
<string>1.1.3</string>
<key>CFBundleVersion</key>
<string>1.0.7</string>
<string>1.1.3</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment