Commit fdad17c2 authored by 哈南's avatar 哈南

更改位置树形结构,更改完成订单接口,添加个人订单筛选

parent 18b3d744
This diff is collapsed.
......@@ -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 @@ public let BaseAttachmentUrl: String="http://222.180.250.18:7080"
//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/%@"
......@@ -74,8 +74,11 @@ public let usefulWorkBill: String = "/work/submit/%@"
public let organizationUrl : String = "/organization/query"
/// 工单详情转交
public let batchTransferUrl : String = "/work/batchTransfer"
///// 工单详情完成
//public let completedBillUrl: String = "/work/finish"
/// 工单详情完成
public let completedBillUrl: String = "/work/finish"
public let completedBillUrl: String = "/work/finishWorkBill"
/// 主管指引/备件/工具
public let toolOptionUrl: String = "/config/getValue/toolOption"
/// 安全/防护/围封/环保
......@@ -108,6 +111,8 @@ public let floorlayerUrl: String = "/floorlayer/%@/floors"
public let submitMessageRemind: String = "/work/submitMessageRemind/%@/%@"
///子工单完成
public let drawMessageRemind: String = "/work/drawMessageRemind/%@/%@"
///查询树状位置信息
public let queryTreeLocationPath: String = "/information/position/getPositionTree?storeId=%@"
......
......@@ -123,7 +123,26 @@ extension UIViewController {
}
}
extension UIViewController{
//自定义Present 动画
func customPresentVC(viewController:UIViewController,style:MZFormSheetPresentationTransitionStyle = .slideAndBounceFromRight,viewControllerSize:CGSize = CGSize(width: 300, height: 350),showFrame: CGRect = CGRect.zero){
let formSheetController = MZFormSheetPresentationViewController(contentViewController: viewController)
formSheetController.contentViewControllerTransitionStyle = style
formSheetController.presentationController?.shouldDismissOnBackgroundViewTap = true;
formSheetController.presentationController?.contentViewSize = viewControllerSize
if showFrame == CGRect.zero{
formSheetController.presentationController?.portraitTopInset = kHeight - viewControllerSize.height
}else{
formSheetController.presentationController?.frameConfigurationHandler = { _,_,_ in
return showFrame
}
}
DispatchQueue.main.async(execute: {
self.presentVC(formSheetController)
})
}
}
......
......@@ -84,6 +84,8 @@ public enum Service {
case CompleteMessageRemind(String,String)
// MARK: - 子工单消息
case ChildOrderComplete(String,String)
// MARK: - 查询树状型位置信息
case queryTreeLocation(String)
}
extension Service: TargetType {
......@@ -150,8 +152,9 @@ extension Service: TargetType {
return brokenOptionUrl
case .QueryprocessMethods:
return processMethodsUrl
case .CompleteOrder:
let path = completedBillUrl + "?operator.operId=\(kUser().userCode!)&operator.operName=\(kUser().userName!)&time=\(NSDate().httpParameterString()!)"
case .CompleteOrder(let model):
// let path = completedBillUrl + "?operator.operId=\(kUser().userCode!)&operator.operName=\(kUser().userName!)&time=\(NSDate().httpParameterString()!)"
let path = completedBillUrl + "/\(model.uuid ?? "")"
return path.urlEncoded()
case .UploadAttachment(let model):
return String(format: uploadAttachmentUrl, model.entityType,model.entityUuid)
......@@ -176,6 +179,9 @@ extension Service: TargetType {
case .ChildOrderComplete(let uuid, let step):
let path = String(format: drawMessageRemind, uuid,step)
return path.urlEncoded()
case .queryTreeLocation(let uuid):
let path = String(format: queryTreeLocationPath, uuid)
return path.urlEncoded()
}
}
......@@ -215,6 +221,7 @@ extension Service: TargetType {
.QueryStoreSubOrgs(_),
.QueryInitiator(_),
.QueryPrority(),
.queryTreeLocation(_),
.ChildOrderComplete(_, _),
.CompleteMessageRemind(_,_):
return .get
......@@ -256,6 +263,7 @@ extension Service: TargetType {
.QueryStoreByUserId,
.Queryfloorlayer(_),
.QueryInitiator(_),
.queryTreeLocation(_),
.CompleteMessageRemind(_,_),
.ChildOrderComplete(_, _),
.QueryPrority():
......
......@@ -94,6 +94,7 @@ extension FilterViewModel {
})
}
// MARK: - 查询商户
func queryTenant(_ model: QueryModel) ->Observable<[TenantRecord]> {
return Observable.create({ (observer) -> Disposable in
......@@ -179,6 +180,23 @@ extension FilterViewModel {
})
}
// MARK: - 查询树状 位置数据
func queryTreeLocation(_ projectUUID:String) ->Observable<[TreeLocationModel]?>{
return Observable.create({ (observer) -> Disposable in
Network.request(target: Service.queryTreeLocation(projectUUID), success: { (respone) in
let resultModel = TreeLocationModelResult.deserialize(from: respone.dictionaryObject)
if (resultModel?.success ?? false) {
observer.onNext(resultModel?.data)
}else{
ShowMessage(resultModel?.message ?? "发生错误")
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
// MARK: - 查询设施
func queryDevice(_ model: DeviceQueryModel) ->Observable<[DeviceRecord]> {
return Observable.create({ (observer) -> Disposable in
......
//
// IFSPersonFilterController.swift
// IFS
//
// Created by Tiank on 2018/7/25.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
import RxCocoa
import RxSwift
class IFSPersonFilterController: UIViewController {
/// RxSwift自动释放
let disposeBag = DisposeBag()
var isShowPerson:Bool = false
@IBOutlet weak var sureButton: UIButton!
@IBOutlet weak var cancleButton: UIButton!
@IBOutlet weak var showSwitch: UISwitch!
var completeBlock:((Bool) -> ()) = {_ in}
override func viewDidLoad() {
super.viewDidLoad()
bindAction()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
showSwitch.isOn = isShowPerson
}
func bindAction(){
cancleButton.rx.controlEvent(UIControlEvents.touchUpInside).subscribe(onNext: {[weak self] (event) in
self?.dismiss(animated: true, completion: nil)
}).disposed(by: disposeBag)
sureButton.rx.controlEvent(UIControlEvents.touchUpInside).subscribe(onNext: {[weak self] (event) in
self?.completeBlock(self?.showSwitch.isOn ?? false)
self?.dismiss(animated: true, completion: nil)
}).disposed(by: disposeBag)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
//
// TreeFliteViewController.swift
// IFS
//
// Created by Tiank on 2018/7/26.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class TreeFliteViewController: BaseViewController {
var dataModels:[TreeLocationModel] = [TreeLocationModel]()
var lastSelectItem : TreeLocationModel?
var completeBlock:(TreeLocationModel)->() = {_ in}
let treeView = RATreeView()
override func viewDidLoad() {
super.viewDidLoad()
buildBaseUI()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
func buildBaseUI(){
self.navigationItem.title = "筛选楼层"
let rightBarbutton = UIBarButtonItem(title: "确定", style: UIBarButtonItemStyle.plain, target: self, action: #selector(sureAction(item:)))
self.navigationItem.rightBarButtonItem = rightBarbutton
view.addSubview(treeView)
treeView.frame = CGRect(x: 0, y: 0, width: kWidth, height: kHeight - WjySize.navHeitht - WjySize.extraBottom)
treeView.dataSource = self
treeView.delegate = self
treeView.register(UINib(nibName: String(describing: TreeFliteLocationCell.self), bundle: nil), forCellReuseIdentifier: String(describing: TreeFliteLocationCell.self))
}
@objc func sureAction(item:UIBarButtonItem){
guard lastSelectItem != nil else {
ShowMessage("请选择选项")
return
}
var tempItem = lastSelectItem!
var path = tempItem.name ?? ""
while (treeView.parent(forItem: tempItem) != nil) {
if let parentItem = treeView.parent(forItem: tempItem) as? TreeLocationModel{
path = (parentItem.name ?? "") + "/" + path
tempItem = parentItem
}
}
lastSelectItem!.name = path
completeBlock(lastSelectItem!)
self.navigationController?.popViewController(animated: true)
}
}
extension TreeFliteViewController:RATreeViewDataSource,RATreeViewDelegate{
func treeView(_ treeView: RATreeView, numberOfChildrenOfItem item: Any?) -> Int {
if let item = item as? TreeLocationModel {
return item.children?.count ?? 0
}else{
return dataModels.count
}
}
func treeView(_ treeView: RATreeView, cellForItem item: Any?) -> UITableViewCell {
guard let cell = treeView.dequeueReusableCell(withIdentifier: String(describing: TreeFliteLocationCell.self)) as? TreeFliteLocationCell,
let item = item as? TreeLocationModel else {
fatalError()
}
let level = treeView.levelForCell(forItem: item)
cell.updateUI(model: item, level: level)
return cell
}
func treeView(_ treeView: RATreeView, child index: Int, ofItem item: Any?) -> Any {
if item == nil {
return dataModels[index]
}else if let item = item as? TreeLocationModel {
return item.children?[index] ?? TreeLocationModel()
}else{
fatalError()
}
}
func treeView(_ treeView: RATreeView, didSelectRowForItem item: Any) {
if let item = item as? TreeLocationModel {
lastSelectItem?.isSelect = false
let tempItem = lastSelectItem
item.isSelect = true
item.isOpen = !item.isOpen
lastSelectItem = item
treeView.reloadRows(forItems: [tempItem ?? TreeLocationModel(),item], with: RATreeViewRowAnimationAutomatic)
}
}
}
//
// TreeFliteLocationCell.swift
// IFS
//
// Created by Tiank on 2018/7/26.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class TreeFliteLocationCell: UITableViewCell {
@IBOutlet weak var nameLabelLeft: NSLayoutConstraint!
@IBOutlet weak var hintImageView: UIImageView!
@IBOutlet weak var nameLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
func updateUI(model:TreeLocationModel,level:Int){
hintImageView.image = model.isOpen ? #imageLiteral(resourceName: "list_arrow_up") : #imageLiteral(resourceName: "list_arrow_right")
hintImageView.isHidden = (model.children?.count ?? 0) < 1
nameLabel.text = model.name
nameLabel.textColor = model.isSelect ? UIColor(r: 111, g: 150, b: 245, a: 1) : UIColor(r: 51, g: 51, b: 51, a: 1)
nameLabelLeft.constant = CGFloat(15 * level) + 15
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" 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="14088"/>
<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"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TreeFliteLocationCell" customModule="IFS" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="---" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6FQ-KE-nBV">
<rect key="frame" x="15" y="11.5" width="23" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.43529411764705883" green="0.58823529411764708" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="list_arrow_right" translatesAutoresizingMaskIntoConstraints="NO" id="jle-Gb-bR6">
<rect key="frame" x="297" y="14.5" width="8" height="15"/>
</imageView>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="jle-Gb-bR6" secondAttribute="trailing" constant="15" id="Ya5-i8-YQe"/>
<constraint firstItem="6FQ-KE-nBV" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="hrh-oX-oIj"/>
<constraint firstItem="jle-Gb-bR6" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="pxM-XI-wOQ"/>
<constraint firstItem="6FQ-KE-nBV" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="qV8-xc-dpF"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="hintImageView" destination="jle-Gb-bR6" id="pu6-tg-Jij"/>
<outlet property="nameLabel" destination="6FQ-KE-nBV" id="6MB-Iz-ghf"/>
<outlet property="nameLabelLeft" destination="hrh-oX-oIj" id="2n8-qh-fUN"/>
</connections>
<point key="canvasLocation" x="25" y="34"/>
</tableViewCell>
</objects>
<resources>
<image name="list_arrow_right" width="8" height="15"/>
</resources>
</document>
......@@ -24,7 +24,8 @@ class RepairOrderViewController: BaseTableViewPullController {
@IBOutlet weak var sourceChooseButton: UIButton!
/// 优先级选择
@IBOutlet weak var priorityChooseButton: UIButton!
/// 筛选按钮
@IBOutlet weak var filtrateButton: UIButton!
/// 工单列表ViewModel
lazy final var repairOrderViewModel: RepairOrderViewModel = {
var repairOrderViewModel = RepairOrderViewModel()
......@@ -46,6 +47,7 @@ class RepairOrderViewController: BaseTableViewPullController {
stateChooseButton.addBorder(1.0, kGaryColor)
sourceChooseButton.addBorder(1.0, kGaryColor)
priorityChooseButton.addBorder(1.0, kGaryColor)
filtrateButton.addBorder(1.0, kGaryColor)
dateChooseButton.horizontalCenterTitleAndImage(5)
dateChooseButton.titleLabel?.adjustsFontSizeToFitWidth = true
stateChooseButton.horizontalCenterTitleAndImage(5)
......@@ -90,8 +92,26 @@ class RepairOrderViewController: BaseTableViewPullController {
self?.tableView.mj_header.beginRefreshing()
}).disposed(by: (self?.disposeBag)!)
}).disposed(by: disposeBag)
filtrateButton.rx.controlEvent(UIControlEvents.touchUpInside).subscribe(onNext: {[weak self] (event) in
self?.showFilterVC()
}).disposed(by: disposeBag)
}
func showFilterVC(){
let filteVC = IFSPersonFilterController.instantiateViewController(.Function) as! IFSPersonFilterController
self.customPresentVC(viewController: filteVC, style: .slideFromRight, viewControllerSize: CGSize(width: kWidth - 100, height: kHeight), showFrame: CGRect(x: 100, y: 0, width: kWidth - 100, height: kHeight))
filteVC.completeBlock = { [weak self] result in
self?.repairOrderViewModel.queryModel.isShowPerson = result
if result{
self?.repairOrderViewModel.queryModel.creatorUuid = kUser().userCode
}else{
self?.repairOrderViewModel.queryModel.creatorUuid = nil
}
self?.repairOrderViewModel.queryModel.isShowPerson = result
self?.tableView.mj_header.beginRefreshing()
}
filteVC.isShowPerson = self.repairOrderViewModel.queryModel.isShowPerson
}
// MARK: - 通知刷新数据
func noticeRefreshDataAction() {
NotificationCenter.default.rx.notification(Notification.Name(rawValue: UPDATE_BILL_LIST)).subscribe(onNext: {[weak self] (notice) in
......
......@@ -40,7 +40,8 @@ open class ChildBillSaveOrUpdateModel : NSObject{
dictionary["beginAttachmentId"] = beginAttachmentId
}
if dept != nil{
dictionary["dept"] = dept.toDictionary()
dictionary["dept"] = dept.toDictionary()
}
if endAttachmentId != nil{
dictionary["endAttachmentId"] = endAttachmentId
......
......@@ -86,6 +86,8 @@ open class BillDetailData : NSObject{
var note : String!
var noteHeight: CGFloat! = 10
var position : UCN!
var positionUuid:String!
var positionName:String!
var receiveTime : String!
var reportOrg : String!
var reportUser : UCN!
......@@ -121,6 +123,8 @@ open class BillDetailData : NSObject{
cancleTime = json["cancleTime"].stringValue
cancleUser = json["cancleUser"].stringValue
createId = json["create_id"].stringValue
positionUuid = json["positionUuid"].stringValue
positionName = json["positionName"].stringValue
locationAttachmentId = json["locationAttachmentId"].stringValue
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
......
......@@ -17,7 +17,8 @@ open class RepairOrderQueryModel : NSObject{
var source : String!
var startCreateTime : String!
var state : String!
var creatorUuid:String?
var isShowPerson = false
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
......@@ -45,6 +46,9 @@ open class RepairOrderQueryModel : NSObject{
if state != nil{
dictionary["state"] = state
}
if creatorUuid != nil{
dictionary["creatorUuid"] = creatorUuid!
}
return dictionary
}
......
......@@ -29,7 +29,9 @@ open class SaveRepairOrderModel {
var source : String!
var state : String!
var workNo : String!
var positionUuid:String!
var positionName:String!
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
......@@ -60,8 +62,11 @@ open class SaveRepairOrderModel {
if level != nil{
dictionary["level"] = level
}
if position != nil{
dictionary["position"] = position.toDictionary()
if positionUuid != nil{
dictionary["positionUuid"] = positionUuid
}
if positionName != nil{
dictionary["positionName"] = positionName
}
if receiveTime != nil{
dictionary["receiveTime"] = receiveTime
......
//
// TreeLocationModel.swift
// IFS
//
// Created by Tiank on 2018/7/26.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class TreeLocationModelResult: BaseModel {
var message: String?
var data: [TreeLocationModel]?
var success: Bool?
}
class TreeLocationModel: BaseModel {
var uuid:String?
var version:String?
var code:String?
var name:String?
var upper:Bool?
var children:[TreeLocationModel]?
var isOpen:Bool = false
var isSelect:Bool = false
}
......@@ -90,7 +90,7 @@ extension RepairOrderAddViewModel {
// ShowMessage("请选择工单指定位置")
// return false
// }
guard saveOrderModel.position != nil else {
guard saveOrderModel.positionName != nil && saveOrderModel.positionUuid != nil else{
ShowMessage("请选择工单指定位置")
return false
}
......@@ -321,33 +321,47 @@ extension RepairOrderAddViewModel {
ShowMessage("请先选择项目")
return
}
let model = QueryModel()
model.storeUuidEquals = saveOrderModel.store.uuid
filterViewModel.queryLocation(model).subscribe(onNext: {[weak self] (result) in
if result.isEmpty {
ShowMessage("无数据")
filterViewModel.queryTreeLocation(self.saveOrderModel.store.uuid).subscribe(onNext: { [weak self] (result) in
guard result != nil else{
return
}
let publicFilterVc = FilterViewController.instantiateViewController(.Function) as! FilterViewController
for model in result {
let filterModel: PublicFilterModel?
if model.name == controller.specifiedLocationLabel.text {
filterModel = PublicFilterModel(uuid: model.uuid, title: model.name, isSelected: "\(kONE)")
}else {
filterModel = PublicFilterModel(uuid: model.uuid, title: model.name, isSelected: "\(kZERO)")
}
publicFilterVc.publicViewModel.filterArray.add(filterModel!)
}
controller.pushVC(publicFilterVc)
publicFilterVc.setNavigationTitle("筛选位置",.SINGLE, { (choices, index) in
let choiceModel = choices.first!
controller.specifiedLocationLabel.text = choiceModel.title
let fliteVC = TreeFliteViewController()
fliteVC.dataModels = result!
fliteVC.completeBlock = {[weak self] item in
controller.specifiedLocationLabel.text = item.name
controller.specifiedLocationLabel.textColor = kBlackColor
let model = result[index!]
let location = UCN(model.code, model.name, model.uuid)
self?.saveOrderModel.position = location
})
self?.saveOrderModel.positionUuid = item.uuid
self?.saveOrderModel.positionName = item.name
}
controller.pushVC(fliteVC)
}).disposed(by: disposeBag)
let model = QueryModel()
model.storeUuidEquals = saveOrderModel.store.uuid
// filterViewModel.queryLocation(model).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?
// if model.name == controller.specifiedLocationLabel.text {
// filterModel = PublicFilterModel(uuid: model.uuid, title: model.name, isSelected: "\(kONE)")
// }else {
// filterModel = PublicFilterModel(uuid: model.uuid, title: model.name, isSelected: "\(kZERO)")
// }
// publicFilterVc.publicViewModel.filterArray.add(filterModel!)
// }
// controller.pushVC(publicFilterVc)
// publicFilterVc.setNavigationTitle("筛选位置",.SINGLE, { (choices, index) in
// let choiceModel = choices.first!
// controller.specifiedLocationLabel.text = choiceModel.title
// controller.specifiedLocationLabel.textColor = kBlackColor
// let model = result[index!]
// let location = UCN(model.code, model.name, model.uuid)
// self?.saveOrderModel.position = location
// })
// }).disposed(by: disposeBag)
break
case IndexPath(row: 10, section: 0):
if saveOrderModel.locationAttachmentId != nil {
......
......@@ -235,9 +235,7 @@ extension RepairOrderDetailViewModel {
controller.deviceLab.text = disposeEmpty(billDetailModel.device.name)
controller.brokenTimeLab.text = disposeEmpty(billDetailModel.brokenTime)
}
if billDetailModel.position != nil {
controller.positionLabel.text = disposeEmpty(billDetailModel.position.name)
}
controller.positionLabel.text = disposeEmpty(billDetailModel.positionName)
controller.descriptionLab.text = disposeEmpty(billDetailModel.descriptionField)
controller.billNumberLab.text = billDetailModel.workNo
controller.isSolveLabel.text = billDetailModel.finish ? "是" : "否"
......
......@@ -100,7 +100,7 @@ extension RepairOrderViewModel {
case 3:
afterDay = -6 * 30
break
case 2:
case 5:
afterDay = -12 * 30
break
default:
......
//
// NRSomeTool.swift
// NewRetail
//
// Created by 飞迪1 on 2018/4/5.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import Foundation
extension UIFont{
open class func suitableSystemFont(ofSize fontSize: CGFloat) -> UIFont{
return UIFont.systemFont(ofSize:fontSize * WjySize.suitableScale)
}
open class func suitableBoldSystemFont(ofSize fontSize: CGFloat) -> UIFont{
return UIFont.boldSystemFont(ofSize: fontSize * WjySize.suitableScale)
}
}
struct WjySize {
//比例
static let suitableScale = kWidth / 375
//一个像素点
static public let screenWidth = UIScreen.main.bounds.width
static public let screenHeight = UIScreen.main.bounds.height
static let statusBar: CGFloat = UIApplication.shared.statusBarFrame.height
static var navigationBarHeight: CGFloat = 44
static var navHeitht: CGFloat{
return statusBar + navigationBarHeight
}
///iPhoneX 底部不可用区域
static var extraBottom: CGFloat {
if UIDevice.isScreenElongation {
return 34
}
return 0
}
}
extension CGSize: ExpressibleByStringLiteral {
public init(stringLiteral value: String) {
let size = CGSizeFromString(value)
self.init(width: size.width, height: size.height)
}
public init(extendedGraphemeClusterLiteral value: String) {
let size = CGSizeFromString(value)
self.init(width: size.width, height: size.height)
}
public init(unicodeScalarLiteral value: String) {
let size = CGSizeFromString(value)
self.init(width: size.width, height: size.height)
}
}
public extension UIDevice {
enum iPhones: CGSize, ExpressibleByNilLiteral {
case iPhone3GS = "{320, 480}"
case iPhone5 = "{320, 568}"
case iPhone6 = "{375, 667}"
case iPhone6Plus = "{414, 736}"
case iPhoneX = "{375, 812}"
case unKnown
public init(nilLiteral: Void) {
self = .unKnown
}
}
struct ScreenSize {
static let SCREEN_WIDTH = UIScreen.main.bounds.size.width
static let SCREEN_HEIGHT = UIScreen.main.bounds.size.height
static let SCREEN_MAX_LENGTH = max(ScreenSize.SCREEN_WIDTH, ScreenSize.SCREEN_HEIGHT)
static let SCREEN_MIN_LENGTH = min(ScreenSize.SCREEN_WIDTH, ScreenSize.SCREEN_HEIGHT)
}
static var iPhoneType: iPhones {
let deviceSize = CGSize(width: ScreenSize.SCREEN_MIN_LENGTH, height: ScreenSize.SCREEN_MAX_LENGTH)
return iPhones.init(rawValue: deviceSize) ?? .unKnown
}
static var isiPad: Bool {
return UIDevice.current.userInterfaceIdiom == .pad
}
static var isScreenElongation: Bool {
guard modelName != "Simulator" else {
return iPhoneType == .iPhoneX
}
// return iPhoneType == .iPhoneX
return modelName == "iPhone X"
}
static var modelName: String {
var systemInfo = utsname()
uname(&systemInfo)
let machineMirror = Mirror(reflecting: systemInfo.machine)
let identifier = machineMirror.children.reduce("") { identifier, element in
guard let value = element.value as? Int8, value != 0 else { return identifier }
return identifier + String(UnicodeScalar(UInt8(value)))
}
switch identifier {
case "iPod1,1": return "iPod Touch 1"
case "iPod2,1": return "iPod Touch 2"
case "iPod3,1": return "iPod Touch 3"
case "iPod4,1": return "iPod Touch 4"
case "iPod5,1": return "iPod Touch (5 Gen)"
case "iPod7,1": return "iPod Touch 6"
case "iPhone3,1", "iPhone3,2", "iPhone3,3": return "iPhone 4"
case "iPhone4,1": return "iPhone 4s"
case "iPhone5,1": return "iPhone 5"
case "iPhone5,2": return "iPhone 5 (GSM+CDMA)"
case "iPhone5,3": return "iPhone 5c (GSM)"
case "iPhone5,4": return "iPhone 5c (GSM+CDMA)"
case "iPhone6,1": return "iPhone 5s (GSM)"
case "iPhone6,2": return "iPhone 5s (GSM+CDMA)"
case "iPhone7,2": return "iPhone 6"
case "iPhone7,1": return "iPhone 6 Plus"
case "iPhone8,1": return "iPhone 6s"
case "iPhone8,2": return "iPhone 6s Plus"
case "iPhone8,4": return "iPhone SE"
case "iPhone9,1": return "国行、日版、港行iPhone 7"
case "iPhone9,2": return "港行、国行iPhone 7 Plus"
case "iPhone9,3": return "美版、台版iPhone 7"
case "iPhone9,4": return "美版、台版iPhone 7 Plus"
case "iPhone10,1","iPhone10,4": return "iPhone 8"
case "iPhone10,2","iPhone10,5": return "iPhone 8 Plus"
case "iPhone10,3","iPhone10,6": return "iPhone X"
case "iPad1,1": return "iPad"
case "iPad1,2": return "iPad 3G"
case "iPad2,1", "iPad2,2", "iPad2,3", "iPad2,4": return "iPad 2"
case "iPad2,5", "iPad2,6", "iPad2,7": return "iPad Mini"
case "iPad3,1", "iPad3,2", "iPad3,3": return "iPad 3"
case "iPad3,4", "iPad3,5", "iPad3,6": return "iPad 4"
case "iPad4,1", "iPad4,2", "iPad4,3": return "iPad Air"
case "iPad4,4", "iPad4,5", "iPad4,6": return "iPad Mini 2"
case "iPad4,7", "iPad4,8", "iPad4,9": return "iPad Mini 3"
case "iPad5,1", "iPad5,2": return "iPad Mini 4"
case "iPad5,3", "iPad5,4": return "iPad Air 2"
case "iPad6,3", "iPad6,4": return "iPad Pro 9.7"
case "iPad6,7", "iPad6,8": return "iPad Pro 12.9"
case "AppleTV2,1": return "Apple TV 2"
case "AppleTV3,1","AppleTV3,2": return "Apple TV 3"
case "AppleTV5,3": return "Apple TV 4"
case "i386", "x86_64": return "Simulator"
default: return identifier
}
}
}
precedencegroup DotProductPrecedence{
associativity: none
higherThan : MultiplicationPrecedence
}
infix operator ~=~ : DotProductPrecedence
func ~=~(lhs : String , rhs : String) -> Bool{
do{
return try RegexHelper(rhs).match(lhs)
}catch{
return false
}
}
struct RegexHelper{
let regex : NSRegularExpression
init(_ pattern : String)throws {
try regex = NSRegularExpression(pattern: pattern, options: NSRegularExpression.Options.caseInsensitive)
}
func match(_ input : String) -> Bool{
let matches = regex.matches(in: input, options: [], range: NSRange(location : 0 , length : input.utf16.count))
return matches.count > 0
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "list_arrow_right@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "list_arrow_right@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "list_arrow_up@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "list_arrow_up@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -13,6 +13,8 @@
#import "NSString+Helper.h"
#import <CommonCrypto/CommonCrypto.h>
#import <UMMobClick/MobClick.h>
@import RATreeView;
@import MZFormSheetPresentationController;
// 引入JPush功能所需头文件
#import "JPUSHService.h"
// iOS10注册APNs所需头文件
......
......@@ -24,4 +24,6 @@ target ‘IFS’ do
pod 'UMengAnalytics'
pod 'JPush'
pod 'swiftScan'
pod 'MZFormSheetPresentationController', '~> 2.4.2'
pod 'RATreeView'
end
......@@ -17,7 +17,11 @@ PODS:
- Moya/Core (10.0.1):
- Alamofire (~> 4.1)
- Result (~> 3.0)
- MZAppearance (1.1.6)
- MZFormSheetPresentationController (2.4.3):
- MZAppearance
- PPBadgeViewSwift (2.0.0)
- RATreeView (2.1.2)
- Result (3.2.4)
- RxCocoa (4.1.1):
- RxSwift (~> 4.0)
......@@ -43,7 +47,9 @@ DEPENDENCIES:
- Kingfisher
- MJRefresh (~> 3.1.15.1)
- Moya
- MZFormSheetPresentationController (~> 2.4.2)
- PPBadgeViewSwift
- RATreeView
- RxCocoa
- RxSwift
- SKPhotoBrowser (~> 5.0.0)
......@@ -70,7 +76,10 @@ SPEC REPOS:
- Kingfisher
- MJRefresh
- Moya
- MZAppearance
- MZFormSheetPresentationController
- PPBadgeViewSwift
- RATreeView
- Result
- RxCocoa
- RxSwift
......@@ -97,7 +106,10 @@ SPEC CHECKSUMS:
Kingfisher: 1f9157d9c02b380cbd0b7cc890161195164eb634
MJRefresh: 5f8552bc25ca8751c010f621c1098dbdaacbccd6
Moya: 9e621707ff754eeb51ff3ec51a3d54e517c0733a
MZAppearance: 0c06d3fa9cc55142f1da14bc8631fbe8fd6e19d5
MZFormSheetPresentationController: fbfdbad31884f16fac17fbe3c44c168306cc1095
PPBadgeViewSwift: dc520c183e11d87fbe19bdb223e8b47d158f3c6b
RATreeView: 380cde0090cfde21dc6ac29137f49d3b768fdd28
Result: d2d07204ce72856f1fd9130bbe42c35a7b0fea10
RxCocoa: fd0862fd2df95fa55562ad28ffd2522c25eb4a85
RxSwift: c6e3b1c7b325c7d121cd4327e9d98b7ed746b570
......@@ -110,6 +122,6 @@ SPEC CHECKSUMS:
YXAlertController: 37a54642cb8e8b43b79004fe9148bb8ff2fab814
YXKit: 73d6ffbcf7530f1159e030460207286e9153b080
PODFILE CHECKSUM: ca2deb99f65138a0ea1c4a431cc195f523594330
PODFILE CHECKSUM: e53e38d1b7ecd4918d26c8ad6db504ba34f88b2f
COCOAPODS: 1.5.3
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