Commit 392c40c0 authored by 曹云霄's avatar 曹云霄

IFSbug修改

parent 67c8a843
......@@ -31,7 +31,7 @@
29516A94200E3A9900C3A17E /* UpdateVersionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29516A93200E3A9900C3A17E /* UpdateVersionModel.swift */; };
29516A97200EE05900C3A17E /* NSString+Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = 29516A96200EE05900C3A17E /* NSString+Helper.m */; };
296968062007142B0049B5CC /* PublicFilterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296968052007142B0049B5CC /* PublicFilterModel.swift */; };
29696808200728F50049B5CC /* EmptyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29696807200728F50049B5CC /* EmptyModel.swift */; };
29696808200728F50049B5CC /* QueryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29696807200728F50049B5CC /* QueryModel.swift */; };
296AAC5A1FFCB2A4008BE04C /* BaseTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC591FFCB2A4008BE04C /* BaseTableViewController.swift */; };
296AAC9D1FFDF533008BE04C /* FilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC991FFDF532008BE04C /* FilterViewController.swift */; };
296AAC9F1FFDF54A008BE04C /* FilterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC9E1FFDF54A008BE04C /* FilterTableViewCell.swift */; };
......@@ -53,6 +53,12 @@
29A8D9A72011C602001E865C /* RepairAttachmentTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29A8D9A52011C602001E865C /* RepairAttachmentTableViewCell.xib */; };
29B0C66A1FEA382F00FF37ED /* MBProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B0C6691FEA382F00FF37ED /* MBProgressView.swift */; };
29B0C66C1FEA3A7000FF37ED /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 29B0C66B1FEA3A7000FF37ED /* LaunchScreen.storyboard */; };
29CD9D9F20562CB200BB7C8D /* TenantResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29CD9D9E20562CB200BB7C8D /* TenantResultModel.swift */; };
29CD9DA12056466A00BB7C8D /* InitiatorResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29CD9DA02056466900BB7C8D /* InitiatorResultModel.swift */; };
29CD9DAA205676AD00BB7C8D /* CostOrBorrowTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29CD9DA8205676AD00BB7C8D /* CostOrBorrowTableViewCell.swift */; };
29CD9DAB205676AD00BB7C8D /* CostOrBorrowTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29CD9DA9205676AD00BB7C8D /* CostOrBorrowTableViewCell.xib */; };
29CD9DAD2056855200BB7C8D /* ChildBillDetailCostViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29CD9DAC2056855200BB7C8D /* ChildBillDetailCostViewController.swift */; };
29CD9DAF2056856000BB7C8D /* ChildBillDetailBorrowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29CD9DAE2056856000BB7C8D /* ChildBillDetailBorrowViewController.swift */; };
29D5307A1FFF626500851F00 /* FunctionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29D530671FFF626500851F00 /* FunctionViewController.swift */; };
29D5307B1FFF626500851F00 /* FunctionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29D530691FFF626500851F00 /* FunctionModel.swift */; };
29D5307C1FFF626500851F00 /* FunctionCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29D5306B1FFF626500851F00 /* FunctionCollectionReusableView.swift */; };
......@@ -166,7 +172,7 @@
29516A95200EE05900C3A17E /* NSString+Helper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+Helper.h"; sourceTree = "<group>"; };
29516A96200EE05900C3A17E /* NSString+Helper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+Helper.m"; sourceTree = "<group>"; };
296968052007142B0049B5CC /* PublicFilterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicFilterModel.swift; sourceTree = "<group>"; };
29696807200728F50049B5CC /* EmptyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyModel.swift; sourceTree = "<group>"; };
29696807200728F50049B5CC /* QueryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueryModel.swift; sourceTree = "<group>"; };
296AAC591FFCB2A4008BE04C /* BaseTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTableViewController.swift; sourceTree = "<group>"; };
296AAC991FFDF532008BE04C /* FilterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterViewController.swift; sourceTree = "<group>"; };
296AAC9E1FFDF54A008BE04C /* FilterTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterTableViewCell.swift; sourceTree = "<group>"; };
......@@ -189,6 +195,12 @@
29A8D9A52011C602001E865C /* RepairAttachmentTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RepairAttachmentTableViewCell.xib; sourceTree = "<group>"; };
29B0C6691FEA382F00FF37ED /* MBProgressView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBProgressView.swift; sourceTree = "<group>"; };
29B0C66B1FEA3A7000FF37ED /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
29CD9D9E20562CB200BB7C8D /* TenantResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TenantResultModel.swift; sourceTree = "<group>"; };
29CD9DA02056466900BB7C8D /* InitiatorResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InitiatorResultModel.swift; sourceTree = "<group>"; };
29CD9DA8205676AD00BB7C8D /* CostOrBorrowTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CostOrBorrowTableViewCell.swift; sourceTree = "<group>"; };
29CD9DA9205676AD00BB7C8D /* CostOrBorrowTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CostOrBorrowTableViewCell.xib; sourceTree = "<group>"; };
29CD9DAC2056855200BB7C8D /* ChildBillDetailCostViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChildBillDetailCostViewController.swift; sourceTree = "<group>"; };
29CD9DAE2056856000BB7C8D /* ChildBillDetailBorrowViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChildBillDetailBorrowViewController.swift; sourceTree = "<group>"; };
29D530671FFF626500851F00 /* FunctionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FunctionViewController.swift; sourceTree = "<group>"; };
29D530691FFF626500851F00 /* FunctionModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FunctionModel.swift; sourceTree = "<group>"; };
29D5306B1FFF626500851F00 /* FunctionCollectionReusableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FunctionCollectionReusableView.swift; sourceTree = "<group>"; };
......@@ -327,7 +339,7 @@
296968052007142B0049B5CC /* PublicFilterModel.swift */,
296DAD7B2006F63B00615A2D /* ProjectSponsorsModel.swift */,
296DAD81200711CA00615A2D /* InitiatorModel.swift */,
29696807200728F50049B5CC /* EmptyModel.swift */,
29696807200728F50049B5CC /* QueryModel.swift */,
29F6B8E72007452B00EE4630 /* LocationModel.swift */,
29F6B8EB2007488C00EE4630 /* DeviceModel.swift */,
29F6B8F9200884F900EE4630 /* PublicModel.swift */,
......@@ -338,6 +350,8 @@
2942D6FA202305A200CB07F9 /* FlooryuResultModel.swift */,
2942D6FE20230A2500CB07F9 /* FloorLayerResultModel.swift */,
2942D70020230D8000CB07F9 /* StoreResultModel.swift */,
29CD9D9E20562CB200BB7C8D /* TenantResultModel.swift */,
29CD9DA02056466900BB7C8D /* InitiatorResultModel.swift */,
);
path = Model;
sourceTree = "<group>";
......@@ -474,6 +488,8 @@
29F6B909200C54CD00EE4630 /* RepairOrderCompletedViewController.swift */,
29DA416F20035610002762A2 /* RepairOrderEditSonOrderViewController.swift */,
29DA417720036763002762A2 /* RepairOrderChildBillDetailViewController.swift */,
29CD9DAC2056855200BB7C8D /* ChildBillDetailCostViewController.swift */,
29CD9DAE2056856000BB7C8D /* ChildBillDetailBorrowViewController.swift */,
2942D70420231C3200CB07F9 /* EditImageViewController.swift */,
);
path = Controller;
......@@ -522,6 +538,8 @@
29516A8C200DEC5A00C3A17E /* MaintainAfterAttachmentTableViewCell.xib */,
29516A8F200DEE9500C3A17E /* RepairOrderAttachmentTableViewCell.swift */,
29516A90200DEE9500C3A17E /* RepairOrderAttachmentTableViewCell.xib */,
29CD9DA8205676AD00BB7C8D /* CostOrBorrowTableViewCell.swift */,
29CD9DA9205676AD00BB7C8D /* CostOrBorrowTableViewCell.xib */,
);
path = View;
sourceTree = "<group>";
......@@ -1030,6 +1048,7 @@
29DA416E2003419F002762A2 /* RepairOrderDetailSuspendView.xib in Resources */,
296FE4421FFB36D600810820 /* Me.storyboard in Resources */,
29EA0BF81FEA3156005A6170 /* Assets.xcassets in Resources */,
29CD9DAB205676AD00BB7C8D /* CostOrBorrowTableViewCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1171,6 +1190,7 @@
29F6B8EE2007498A00EE4630 /* DeviceQueryModel.swift in Sources */,
296968062007142B0049B5CC /* PublicFilterModel.swift in Sources */,
29DA417A200367EF002762A2 /* RepairOrderEditSonOrderCompleteView.swift in Sources */,
29CD9D9F20562CB200BB7C8D /* TenantResultModel.swift in Sources */,
29D530931FFF715D00851F00 /* PhotoAttachmentViewModel.swift in Sources */,
296DAD7C2006F63B00615A2D /* ProjectSponsorsModel.swift in Sources */,
29D5307E1FFF626500851F00 /* FunctionViewModel.swift in Sources */,
......@@ -1178,12 +1198,14 @@
29D530831FFF626500851F00 /* RepairOrderTableViewCell.swift in Sources */,
29EA0C111FEA3156005A6170 /* UIImage+Extension.swift in Sources */,
29EA0C0F1FEA3156005A6170 /* String+Extension.swift in Sources */,
29CD9DAA205676AD00BB7C8D /* CostOrBorrowTableViewCell.swift in Sources */,
29D5307D1FFF626500851F00 /* FunctionCollectionViewCell.swift in Sources */,
2942D6F92023056600CB07F9 /* FlooryuQueryModel.swift in Sources */,
29DA4169200334BC002762A2 /* RepairOrderSubOrderTableViewCell.swift in Sources */,
29F6B8F62007747900EE4630 /* RepairOrderResultModel.swift in Sources */,
29F6B90A200C54CD00EE4630 /* RepairOrderCompletedViewController.swift in Sources */,
294B8646201AECAD0035BF32 /* ProjectQueryModel.swift in Sources */,
29CD9DAD2056855200BB7C8D /* ChildBillDetailCostViewController.swift in Sources */,
29516A89200DEC4400C3A17E /* MaintainBeforAttachmentTableViewCell.swift in Sources */,
29DA418B200475AC002762A2 /* AccountViewModel.swift in Sources */,
296DAD82200711CA00615A2D /* InitiatorModel.swift in Sources */,
......@@ -1195,6 +1217,7 @@
294B8642201974930035BF32 /* PermissionsManager.swift in Sources */,
29D5307B1FFF626500851F00 /* FunctionModel.swift in Sources */,
29EA0C141FEA3156005A6170 /* UIViewController+Extension.swift in Sources */,
29CD9DAF2056856000BB7C8D /* ChildBillDetailBorrowViewController.swift in Sources */,
29EA0C0E1FEA3156005A6170 /* Date+Extensions.swift in Sources */,
29A8D9A62011C602001E865C /* RepairAttachmentTableViewCell.swift in Sources */,
29F6B8FE20088B2B00EE4630 /* RepairOrderDetailResultModel.swift in Sources */,
......@@ -1214,11 +1237,12 @@
29D530861FFF628A00851F00 /* TodoViewController.swift in Sources */,
29EA0BFC1FEA3156005A6170 /* AppManager.swift in Sources */,
29DA4180200373C3002762A2 /* LoginViewModel.swift in Sources */,
29696808200728F50049B5CC /* EmptyModel.swift in Sources */,
29696808200728F50049B5CC /* QueryModel.swift in Sources */,
296FE44C1FFB5CAB00810820 /* HomeTableViewController.swift in Sources */,
29EA0C131FEA3156005A6170 /* UIView+Extension.swift in Sources */,
29D5308A1FFF635C00851F00 /* TodoViewModel.swift in Sources */,
2942D6FF20230A2600CB07F9 /* FloorLayerResultModel.swift in Sources */,
29CD9DA12056466A00BB7C8D /* InitiatorResultModel.swift in Sources */,
296AAC5A1FFCB2A4008BE04C /* BaseTableViewController.swift in Sources */,
29516A94200E3A9900C3A17E /* UpdateVersionModel.swift in Sources */,
29EA0C001FEA3156005A6170 /* UserModel.swift in Sources */,
......
......@@ -94,6 +94,13 @@ class BaseTableViewPullController: BaseViewController {
}
}
// MARK: - 刷新数据源
func reloadData() {
tableView.reloadData()
if tableView.isEmptyDataSetVisible {
tableView.reloadEmptyDataSet()
} }
// MARK: - 结束刷新切显示无更多的数据
func endRefreshNomoreData() {
endRefresh()
......
......@@ -60,11 +60,13 @@ public enum REPAIR_ORDER_SECTION: Int {
/// - STATE: 工单状态
/// - SOURCE: 工单来源
/// - COST: 费用
/// - BORROW: 借用
/// - DESCRIBE: 描述
public enum CHILD_BILL_DETAIL_SECTION: Int {
case STATE = 0
case SOURCE
case COST
case BORROW
case DESCRIBE
}
......@@ -233,11 +235,24 @@ public enum LOCATION_IMAGE_TYPE: Int {
}
/// 新建工单是否显示门店
///
/// - SHOW: 显示
/// - HIDE: 隐藏
public enum REPAIRORDER_STORE: Int {
case HIDE = 0
case SHOW
}
/// 子工单详情费用信息和借用信息区分
///
/// - COST: 费用信息
/// - BORROW: 借用信息
public enum CHILDORDERCOST_TYPE: String {
case COST = "outputBill"
case BORROW = "borrowbill"
}
......
......@@ -12,5 +12,8 @@ import Foundation
/// 更新工单列表数据
public let UPDATE_BILL_LIST: String = "UPDATE_BILL_LIST"
/// 更新工单列表数据
/// 更新工单详情数据
public let UPDATE_BILL_DETAIL_LIST: String = "UPDATE_BILL_DETAIL_LIST"
/// 更新新建工单列表
public let UPDATE_REPAIRORDER_ADD_LIST: String = "UPDATE_REPAIRORDER_ADD_LIST"
......@@ -9,17 +9,17 @@
import Foundation
/// BaseUrl
public let BaseUrl: String = "http://192.168.1.176:9030/ifs-server/rest"
public let BaseAttachmentUrl: String = "http://192.168.1.176:9030"
///内网开发环境
//public let BaseUrl: String = "http://192.168.1.176:9030/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://192.168.1.176:9030"
//测试环境
//public let BaseUrl: String = "http://222.180.250.18:7080/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://222.180.250.18:7080"
//外网开发环境
//public let BaseUrl: String = "http://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/%@"
......@@ -37,6 +37,9 @@ public let serviceTypeUrl: String = "/config/getValue/serviceType"
public let prorityUrl: String = "/config/getValue/prorityOption"
/// 新建工单报事人
public let initiatorUrl: String = "/user/query"
public let initiatorUrl2: String = "/store/getSubUsers/%@"
/// 新建工单查询商户
public let queryTenant: String = "/information/tenant/query"
/// 项目
public let projectUrl: String = "/store/query"
/// 新建工单位置
......@@ -51,6 +54,8 @@ public let repairOrderUrl: String = "/work/query"
public let getBillDetailUrl: String = "/work/get/%@"
/// 子单详情get
public let getChildBillDetailUrl: String = "/work/getWorkExecute/%@"
/// 生效工单
public let usefulWorkBill: String = "/work/submit/%@"
/// 工单详情转交部门
public let organizationUrl : String = "/organization/query"
/// 工单详情转交
......
......@@ -20,16 +20,20 @@ public enum Service {
case QuerySource()
// MARK: - 新建工单服务类型
case QueryServerType()
// MARK: - 新建工单商户
case QueryTenant(QueryModel)
// MARK: - 新建工单优先级
case QueryPrority()
// MARK: - 查询报事人
case QueryInitiator()
case QueryInitiator(QueryModel)
// MARK: - 查询位置
case QueryPosition()
case QueryPosition(QueryModel)
// MARK: - 查询设施
case QueryDevice(DeviceQueryModel)
// MARK: - 提交工单
case SubmitOrder(SaveRepairOrderModel)
// MARK: - 生效工单
case UsefulWorkBill(String)
// MARK: - 查询工单列表
case QueryRepairOrder(RepairOrderQueryModel)
// MARK: - 查询工单详情
......@@ -37,7 +41,7 @@ public enum Service {
// MARK: - 查询子单详情
case GetChildBillDetail(String)
// MARK: - 查询工单详情转交部门
case GetRepairOrderDepartment()
case GetRepairOrderDepartment(QueryModel)
// MARK: - 工单详情转交
case TransferOrder(DepartmentQueryModel)
// MARK: - 工单详情完成
......@@ -95,9 +99,9 @@ extension Service: TargetType {
return serviceTypeUrl
case .QueryPrority:
return prorityUrl
case .QueryInitiator():
return initiatorUrl
case .QueryPosition():
case .QueryInitiator(let model):
return String(format: initiatorUrl2, model.storeUuidEquals)
case .QueryPosition(_):
return positionUrl
case .QueryProjectOption(_):
return projectUrl
......@@ -156,6 +160,11 @@ extension Service: TargetType {
case .ChangePassword(_):
let path = String(format: changePassword, kUser().userUuid,NSDate().httpParameterString(),kUser().userCode,kUser().userName)
return path.urlEncoded()
case .QueryTenant(_):
return queryTenant
case .UsefulWorkBill(let uuid):
let path = String(format: usefulWorkBill, uuid) + "?operator.operId=\(kUser().userCode!)&operator.operName=\(kUser().userName!)&time=\(NSDate().httpParameterString()!)"
return path.urlEncoded()
}
}
......@@ -163,11 +172,11 @@ extension Service: TargetType {
switch self {
case .Login(_, _),
.QueryTodo(_),
.QueryPosition(),
.QueryPosition(_),
.QueryDevice(_),
.SubmitOrder(_),
.QueryRepairOrder(_),
.GetRepairOrderDepartment(),
.GetRepairOrderDepartment(_),
.TransferOrder(_),
.CompleteOrder(_),
.UploadAttachment(_),
......@@ -175,8 +184,9 @@ extension Service: TargetType {
.ChangePassword(_),
.FinishChildBill(_),
.QueryProjectOption(_),
.Queryflooryu(_),
.QueryInitiator(_):
.UsefulWorkBill(_),
.QueryTenant(_),
.Queryflooryu(_):
return .post
case .QuerySource(),
.QueryServerType(),
......@@ -192,6 +202,7 @@ extension Service: TargetType {
.Queryfloorlayer(_),
.QueryStoreByUserId,
.QueryStoreSubOrgs(_),
.QueryInitiator(_),
.QueryPrority():
return .get
}
......@@ -223,6 +234,7 @@ extension Service: TargetType {
.QueryProtectOption(),
.QuerybrokenOption(),
.QueryprocessMethods(),
.UsefulWorkBill(_),
.GetChildBillDetail(_),
.DownloadAttachment(_,_),
.UpdateVersion(),
......@@ -230,13 +242,13 @@ extension Service: TargetType {
.QueryStoreSubOrgs(_),
.QueryStoreByUserId,
.Queryfloorlayer(_),
.QueryInitiator(_),
.QueryPrority():
return .requestPlain
case .QueryInitiator(),
.GetRepairOrderDepartment(),
.QueryPosition():
let model = EmptyModel()
return .requestParameters(parameters: model.toJSON()!,
case .GetRepairOrderDepartment(let model),
.QueryTenant(let model),
.QueryPosition(let model):
return .requestParameters(parameters: model.toDictionary(),
encoding: JSONEncoding.default)
case .QueryDevice(let queryModel):
return .requestParameters(parameters: queryModel.toDictionary(),
......
......@@ -41,6 +41,9 @@ class PhotoAttachmentViewController: BaseViewController {
let SPACE: Int = 5
/// 每行个数
var COUNT: Int = 2
/// 图片数量默认最多五张
var imageCount: Int = 5
/// 图片高度
lazy final var imageHeight: CGFloat = {
// 30表示UICollectionView距左右边距
......@@ -109,7 +112,13 @@ extension PhotoAttachmentViewController: UICollectionViewDelegate,UICollectionVi
if attachment.attachmentType == .ATTACHMENT_ADD {
let imagePickerController = ImagePickerController()
imagePickerController.delegate = self
imagePickerController.imageLimit = 5
let count = attachmentViewModel.photoAttachments.count
if count - kONE >= imageCount {
ShowMessage(String(format: "最多只能拍摄%d张照片", imageCount))
return
}else {
imagePickerController.imageLimit = imageCount - (count - kONE)
}
present(imagePickerController, animated: true, completion: nil)
}else {
var images = [SKPhoto]()
......
......@@ -17,8 +17,8 @@ open class DeviceQueryModel {
var order : DeviceOrder!
var page : Int!
var pageSize : Int!
var stateEquals : String!
var stateEquals : String! = "true"
var storeUuidEquals: String!
func toDictionary() -> [String:Any]
{
......@@ -29,6 +29,9 @@ open class DeviceQueryModel {
if nameLike != nil{
dictionary["nameLike"] = nameLike
}
if storeUuidEquals != nil{
dictionary["storeUuidEquals"] = storeUuidEquals
}
if order != nil{
dictionary["order"] = order.toDictionary()
}
......
//
// EmptyModel.swift
// IFS
//
// Created by 曹云霄 on 2018/1/11.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class EmptyModel: BaseModel {
}
//
// InitiatorResultModel.swift
//
// Create by 云霄 曹 on 12/3/2018
// Copyright © 2018. All rights reserved.
// Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
import Foundation
import SwiftyJSON
class InitiatorResultModel : NSObject{
var data : [InitiatorResultData]!
var message : String!
var success : Bool!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
data = [InitiatorResultData]()
let dataArray = json["data"].arrayValue
for dataJson in dataArray{
let value = InitiatorResultData(fromJson: dataJson)
data.append(value)
}
message = json["message"].stringValue
success = json["success"].boolValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if data != nil{
var dictionaryElements = [[String:Any]]()
for dataElement in data {
dictionaryElements.append(dataElement.toDictionary())
}
dictionary["data"] = dictionaryElements
}
if message != nil{
dictionary["message"] = message
}
if success != nil{
dictionary["success"] = success
}
return dictionary
}
}
class InitiatorResultData : NSObject{
var address : String!
var belongOrg : String!
var businessType : String!
var createId : String!
var createOperName : String!
var createTime : String!
var email : String!
var enabled : Bool!
var enterprise : String!
var jobGrade : String!
var jobLeavel : String!
var jobPost : String!
var lastModifyId : String!
var lastModifyOperName : String!
var lastModifyTime : String!
var login : String!
var mobile : String!
var name : String!
var password : String!
var position : String!
var positions : [String]!
var remark : String!
var state : String!
var thirdLogin : String!
var uuid : String!
var version : Int!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
address = json["address"].stringValue
belongOrg = json["belongOrg"].stringValue
businessType = json["businessType"].stringValue
createId = json["create_id"].stringValue
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
email = json["email"].stringValue
enabled = json["enabled"].boolValue
enterprise = json["enterprise"].stringValue
jobGrade = json["jobGrade"].stringValue
jobLeavel = json["jobLeavel"].stringValue
jobPost = json["jobPost"].stringValue
lastModifyId = json["lastModify_id"].stringValue
lastModifyOperName = json["lastModify_operName"].stringValue
lastModifyTime = json["lastModify_time"].stringValue
login = json["login"].stringValue
mobile = json["mobile"].stringValue
name = json["name"].stringValue
password = json["password"].stringValue
position = json["position"].stringValue
positions = [String]()
let positionsArray = json["positions"].arrayValue
for positionsJson in positionsArray{
positions.append(positionsJson.stringValue)
}
remark = json["remark"].stringValue
state = json["state"].stringValue
thirdLogin = json["thirdLogin"].stringValue
uuid = json["uuid"].stringValue
version = json["version"].intValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if address != nil{
dictionary["address"] = address
}
if belongOrg != nil{
dictionary["belongOrg"] = belongOrg
}
if businessType != nil{
dictionary["businessType"] = businessType
}
if createId != nil{
dictionary["create_id"] = createId
}
if createOperName != nil{
dictionary["create_operName"] = createOperName
}
if createTime != nil{
dictionary["create_time"] = createTime
}
if email != nil{
dictionary["email"] = email
}
if enabled != nil{
dictionary["enabled"] = enabled
}
if enterprise != nil{
dictionary["enterprise"] = enterprise
}
if jobGrade != nil{
dictionary["jobGrade"] = jobGrade
}
if jobLeavel != nil{
dictionary["jobLeavel"] = jobLeavel
}
if jobPost != nil{
dictionary["jobPost"] = jobPost
}
if lastModifyId != nil{
dictionary["lastModify_id"] = lastModifyId
}
if lastModifyOperName != nil{
dictionary["lastModify_operName"] = lastModifyOperName
}
if lastModifyTime != nil{
dictionary["lastModify_time"] = lastModifyTime
}
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{
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
}
if version != nil{
dictionary["version"] = version
}
return dictionary
}
}
//
// QueryModel.swift
// IFS
//
// Created by 曹云霄 on 2018/1/11.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
import SwiftyJSON
open class QueryModel: NSObject {
var stateEquals : String! = "true"
var storeUuidEquals : String!
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if stateEquals != nil{
dictionary["stateEquals"] = stateEquals
}
if storeUuidEquals != nil{
dictionary["storeUuidEquals"] = storeUuidEquals
}
return dictionary
}
}
//
// TenantResultModel.swift
//
// Create by 云霄 曹 on 12/3/2018
// Copyright © 2018. All rights reserved.
// Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
import Foundation
import SwiftyJSON
class TenantResultModel : NSObject{
var data : TenantData!
var message : String!
var success : Bool!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let dataJson = json["data"]
if !dataJson.isEmpty{
data = TenantData(fromJson: dataJson)
}
message = json["message"].stringValue
success = json["success"].boolValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if data != nil{
dictionary["data"] = data.toDictionary()
}
if message != nil{
dictionary["message"] = message
}
if success != nil{
dictionary["success"] = success
}
return dictionary
}
}
class TenantData : NSObject{
var paging : TenantPaging!
var records : [TenantRecord]!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let pagingJson = json["paging"]
if !pagingJson.isEmpty{
paging = TenantPaging(fromJson: pagingJson)
}
records = [TenantRecord]()
let recordsArray = json["records"].arrayValue
for recordsJson in recordsArray{
let value = TenantRecord(fromJson: recordsJson)
records.append(value)
}
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if paging != nil{
dictionary["paging"] = paging.toDictionary()
}
if records != nil{
var dictionaryElements = [[String:Any]]()
for recordsElement in records {
dictionaryElements.append(recordsElement.toDictionary())
}
dictionary["records"] = dictionaryElements
}
return dictionary
}
}
class TenantRecord : NSObject{
var code : String!
var contractCode : String!
var contractId : String!
var contractName : String!
var createId : String!
var createOperName : String!
var createTime : String!
var enabled : Bool!
var lastModifyId : String!
var lastModifyOperName : String!
var lastModifyTime : String!
var name : String!
var shopSigns : String!
var store : UCN!
var uuid : String!
var version : Int!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
code = json["code"].stringValue
contractCode = json["contractCode"].stringValue
contractId = json["contractId"].stringValue
contractName = json["contractName"].stringValue
createId = json["create_id"].stringValue
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
enabled = json["enabled"].boolValue
lastModifyId = json["lastModify_id"].stringValue
lastModifyOperName = json["lastModify_operName"].stringValue
lastModifyTime = json["lastModify_time"].stringValue
name = json["name"].stringValue
shopSigns = json["shopSigns"].stringValue
let storeJson = json["store"]
if !storeJson.isEmpty{
store = UCN(fromJson: storeJson)
}
uuid = json["uuid"].stringValue
version = json["version"].intValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if code != nil{
dictionary["code"] = code
}
if contractCode != nil{
dictionary["contractCode"] = contractCode
}
if contractId != nil{
dictionary["contractId"] = contractId
}
if contractName != nil{
dictionary["contractName"] = contractName
}
if createId != nil{
dictionary["create_id"] = createId
}
if createOperName != nil{
dictionary["create_operName"] = createOperName
}
if createTime != nil{
dictionary["create_time"] = createTime
}
if enabled != nil{
dictionary["enabled"] = enabled
}
if lastModifyId != nil{
dictionary["lastModify_id"] = lastModifyId
}
if lastModifyOperName != nil{
dictionary["lastModify_operName"] = lastModifyOperName
}
if lastModifyTime != nil{
dictionary["lastModify_time"] = lastModifyTime
}
if name != nil{
dictionary["name"] = name
}
if shopSigns != nil{
dictionary["shopSigns"] = shopSigns
}
if store != nil{
dictionary["store"] = store.toDictionary()
}
if uuid != nil{
dictionary["uuid"] = uuid
}
if version != nil{
dictionary["version"] = version
}
return dictionary
}
}
class TenantPaging : NSObject{
var page : Int!
var pageCount : Int!
var pageSize : Int!
var recordCount : Int!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
page = json["page"].intValue
pageCount = json["pageCount"].intValue
pageSize = json["pageSize"].intValue
recordCount = json["recordCount"].intValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if page != nil{
dictionary["page"] = page
}
if pageCount != nil{
dictionary["pageCount"] = pageCount
}
if pageSize != nil{
dictionary["pageSize"] = pageSize
}
if recordCount != nil{
dictionary["recordCount"] = recordCount
}
return dictionary
}
}
......@@ -76,8 +76,8 @@ extension FilterViewModel {
func queryProjectType() ->Observable<[ProjectResultRecord]> {
let queryModel = ProjectQueryModel()
queryModel.userId = kUser().userUuid
queryModel.nameLike = "重庆IFS项目"
queryModel.codeEquals = "CQIFS"
queryModel.nameLike = AppManager.shareInstance.userStoreModel?.name
queryModel.codeEquals = AppManager.shareInstance.userStoreModel?.code
queryModel.enabled = true
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryProjectOption(queryModel), success: { (json) in
......@@ -94,6 +94,23 @@ extension FilterViewModel {
})
}
// MARK: - 查询商户
func queryTenant(_ model: QueryModel) ->Observable<[TenantRecord]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryTenant(model), success: { (json) in
let resultModel = TenantResultModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data.records)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
// MARK: - 查询服务类型
func queryServerType() ->Observable<[String]> {
return Observable.create({ (observer) -> Disposable in
......@@ -129,12 +146,12 @@ extension FilterViewModel {
}
// MARK: - 查询报事人
func queryInitiator() ->Observable<[InitiatorRecord]> {
func queryInitiator(_ model: QueryModel) ->Observable<[InitiatorResultData]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryInitiator(), success: { (json) in
let resultModel = InitiatorModel(fromJson: json)
Network.request(target: .QueryInitiator(model), success: { (json) in
let resultModel = InitiatorResultModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data.records)
observer.onNext(resultModel.data)
}else {
ShowMessage(resultModel.message)
}
......@@ -146,9 +163,9 @@ extension FilterViewModel {
}
// MARK: - 查询报事人位置
func queryLocation() ->Observable<[LocationRecord]> {
func queryLocation(_ model: QueryModel) ->Observable<[LocationRecord]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryPosition(), success: { (json) in
Network.request(target: .QueryPosition(model), success: { (json) in
let resultModel = LocationModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data.records)
......@@ -163,10 +180,9 @@ extension FilterViewModel {
}
// MARK: - 查询设施
func queryDevice() ->Observable<[DeviceRecord]> {
let queryModel = DeviceQueryModel()
func queryDevice(_ model: DeviceQueryModel) ->Observable<[DeviceRecord]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryDevice(queryModel), success: { (json) in
Network.request(target: .QueryDevice(model), success: { (json) in
let resultModel = DeviceModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data.records)
......@@ -266,13 +282,13 @@ extension FilterViewModel {
}
// MARK: - 通过获取楼层导览图
func queryFloorlayer(_ uuid: String) ->Observable<FloorLayerData> {
func queryFloorlayer(_ uuid: String) ->Observable<[FloorLayerData]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .Queryfloorlayer(uuid), success: { (json) in
let resultModel = FloorLayerResultModel(fromJson: json)
if resultModel.success {
if !resultModel.data.isEmpty {
observer.onNext(resultModel.data.first!)
observer.onNext(resultModel.data!)
}
}else {
ShowMessage(resultModel.message)
......
//
// ChildBillDetailBorrowViewController.swift
// IFS
//
// Created by 曹云霄 on 2018/3/12.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class ChildBillDetailBorrowViewController: BaseTableViewController {
/// 设备
@IBOutlet weak var deviceLabel: UILabel!
/// 借用单单号
@IBOutlet weak var orderNumberLabel: UILabel!
/// 借用数量
@IBOutlet weak var extractCountLabel: UILabel!
/// 归回数量
@IBOutlet weak var returnCountLabel: UILabel!
open var borrowModel: ExecuteMateriel!
override func viewDidLoad() {
super.viewDidLoad()
setupDataAction()
}
// MARK: - 设置数据源
fileprivate func setupDataAction() {
deviceLabel.text = borrowModel.materiel.name
orderNumberLabel.text = borrowModel.outputbillno
extractCountLabel.text = String(format: "%.0f", borrowModel.getQty)
returnCountLabel.text = String(format: "%.0f", borrowModel.useQty)
}
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return kSectionTen
}
}
//
// ChildBillDetailCostViewController.swift
// IFS
//
// Created by 曹云霄 on 2018/3/12.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class ChildBillDetailCostViewController: BaseTableViewController {
/// 物料
@IBOutlet weak var logisticsLabel: UILabel!
/// 单价
@IBOutlet weak var priceLabel: UILabel!
/// 数量
@IBOutlet weak var countLabel: UILabel!
/// 合计
@IBOutlet weak var totalPriceLabel: UILabel!
/// 提取数量
@IBOutlet weak var extractCountLabel: UILabel!
/// 退料数量
@IBOutlet weak var returnCountLabel: UILabel!
open var costModel: ExecuteMateriel!
override func viewDidLoad() {
super.viewDidLoad()
setupDataAction()
}
// MARK: - 设置数据源
fileprivate func setupDataAction() {
logisticsLabel.text = costModel.materiel.name
priceLabel.text = String(format: "%.2f", costModel.unitPrice)
countLabel.text = String(format: "%.2f", costModel.getQty)
totalPriceLabel.text = String(format: "%.2f", costModel.getQty * costModel.unitPrice)
extractCountLabel.text = String(format: "%.0f", costModel.getQty)
returnCountLabel.text = String(format: "%.0f", costModel.useQty)
}
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return kSectionTen
}
}
......@@ -15,13 +15,23 @@ class EditImageViewController: BaseViewController {
var type: LOCATION_IMAGE_TYPE!
/// 图片路径,查看时为本地路径,编辑时为网络路径
var imageString :String!
open var imageString: String?
open var imageArray: [FloorLayerData]!
var attachmentImg: BaseEditImageView!
/// 回调
var saveImageBlock: SaveImageBlock?
/// 楼层区分TableView
final lazy var selectedTableView: UITableView = {
var selectedTableView = UITableView(frame: CGRect(x: 20, y: 30, width: 60, height: 150), style: .plain)
selectedTableView.delegate = self
selectedTableView.showsVerticalScrollIndicator = false
selectedTableView.dataSource = self
return selectedTableView
}()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -42,10 +52,21 @@ class EditImageViewController: BaseViewController {
locationImg.image = UIImage(named: "location_red")
locationImg.center = attachmentImg.center
attachmentImg.addSubview(locationImg)
let attachment = imageArray.first!.attachments.first
if attachment == nil {
ShowMessage("无楼层图片数据")
return
}
let imageString = String(format: attachmentUrl, attachment!.entityType,attachment!.entityUuid,attachment!.fileName)
attachmentImg.kf.setImage(with: URL(string: imageString), placeholder: loadingImage)
selectedTableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: UITableViewCell.name())
view.addSubview(selectedTableView)
selectedTableView.selectRow(at: IndexPath(row: 0, section: 0), animated: true, scrollPosition: .top)
}else {
title = "查看位置图"
attachmentImg.image = UIImage(contentsOfFile: imageString)
if let imageString = imageString {
attachmentImg.image = UIImage(contentsOfFile: imageString)
}
}
}
......@@ -84,3 +105,57 @@ class EditImageViewController: BaseViewController {
return image!
}
}
extension EditImageViewController: UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if imageString != nil {
return kZERO
}
return imageArray.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let towerCell = tableView.dequeueReusableCell(withIdentifier: UITableViewCell.name(), for: indexPath)
towerCell.textLabel?.textAlignment = .center
towerCell.textLabel?.text = imageArray[indexPath.row].name!
towerCell.textLabel?.font = UIFont.systemFont(ofSize: 12)
return towerCell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let attachment = imageArray[indexPath.row].attachments.first!
let imageString = String(format: attachmentUrl, attachment.entityType,attachment.entityUuid,attachment.fileName)
if type == .EDIT {
attachmentImg.kf.setImage(with: URL(string: imageString), placeholder: loadingImage)
}else {
attachmentImg.image = UIImage(contentsOfFile: imageString)
}
}
}
......@@ -28,6 +28,8 @@ class RepairOrderAddTableViewController: BaseTableViewController {
@IBOutlet weak var originatorLabel: UILabel!
/// 接报时间
@IBOutlet weak var originatorTimeLabel: UILabel!
/// 商户
@IBOutlet weak var tenantLabel: UILabel!
/// 指定时间
@IBOutlet weak var specifiedTimeLabel: UILabel!
/// 位置
......@@ -52,7 +54,8 @@ class RepairOrderAddTableViewController: BaseTableViewController {
var attachmentHeight: CGFloat! = 0
/// 默认section高度
let sectionHeight: CGFloat! = 30
/// 是否显示门店选择cell
var isShowStoreItem: Bool = false
/// 图片附件
lazy final var attachmentVc: PhotoAttachmentViewController = {
var attachmentVc = PhotoAttachmentViewController.instantiateViewController(.Function) as! PhotoAttachmentViewController
......@@ -81,6 +84,15 @@ class RepairOrderAddTableViewController: BaseTableViewController {
describeTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0)
tableView.register(UINib(nibName: RepairAttachmentTableViewCell.name(), bundle: nil), forCellReuseIdentifier: RepairAttachmentTableViewCell.name())
navigationItem.rightBarButtonItem = createButtonItem("提交", nil, self, #selector(RepairOrderAddTableViewController.submitButtonClickAction))
NotificationCenter.default.rx.notification(Notification.Name(rawValue: UPDATE_REPAIRORDER_ADD_LIST)).subscribe(onNext: {[weak self] (notice) in
let isShow = notice.object as! Int
if isShow == kONE {
self?.isShowStoreItem = true
}else {
self?.isShowStoreItem = false
}
self?.tableView.reloadData()
}).disposed(by: disposeBag)
}
// MARK: - 提交工单--上传附件
......@@ -188,6 +200,12 @@ class RepairOrderAddTableViewController: BaseTableViewController {
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == REPAIR_ORDER_SECTION.BASIC.rawValue && indexPath.row == 2 {
if isShowStoreItem {
return kCellHeight
}
return 0
}
if indexPath.section == REPAIR_ORDER_SECTION.ATTACHMENT.rawValue {
return attachmentHeight + 50
}
......
......@@ -94,6 +94,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
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())
tableView.register(UINib(nibName: CostOrBorrowTableViewCell.name(), bundle: nil), forCellReuseIdentifier: CostOrBorrowTableViewCell.name())
addChildViewController(afterAttachmentVc)
addChildViewController(beforAttachmentVc)
}
......@@ -157,6 +158,22 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
return afterCell
}
}
if indexPath.section == CHILD_BILL_DETAIL_SECTION.COST.rawValue {
if indexPath.row != kZERO {
let costCell = tableView.dequeueReusableCell(withIdentifier: CostOrBorrowTableViewCell.name(), for: indexPath) as! CostOrBorrowTableViewCell
let model = childBillViewModel.childBillDetailData.costArray[indexPath.row - kONE]
costCell.updateCell(model, indexPath)
return costCell
}
}
if indexPath.section == CHILD_BILL_DETAIL_SECTION.BORROW.rawValue {
if indexPath.row != kZERO {
let brrowCell = tableView.dequeueReusableCell(withIdentifier: CostOrBorrowTableViewCell.name(), for: indexPath) as! CostOrBorrowTableViewCell
let model = childBillViewModel.childBillDetailData.executeMateriels[indexPath.row - kONE]
brrowCell.updateCell(model, indexPath)
return brrowCell
}
}
return super.tableView(tableView, cellForRowAt: indexPath)
}
......@@ -172,8 +189,21 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == CHILD_BILL_DETAIL_SECTION.DESCRIBE.rawValue {
switch section {
case CHILD_BILL_DETAIL_SECTION.COST.rawValue:
if childBillViewModel.childBillDetailData.costArray == nil {
return kZERO
}
return childBillViewModel.childBillDetailData.costArray.count + kONE
case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue:
if childBillViewModel.childBillDetailData.costArray == nil {
return kZERO
}
return childBillViewModel.childBillDetailData.executeMateriels.count + kONE
case CHILD_BILL_DETAIL_SECTION.DESCRIBE.rawValue:
return 3
default:
break
}
return super.tableView(tableView, numberOfRowsInSection: section)
}
......@@ -185,6 +215,19 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
return childBillViewModel.dequeueReusableHeaderFooterView(RepairOrderDetailSectionView.name(),tableView,section)
}
//cell的缩进级别,动态静态cell必须重写,否则会造成崩溃
override func tableView(_ tableView: UITableView, indentationLevelForRowAt indexPath: IndexPath) -> Int {
switch indexPath.section {
case CHILD_BILL_DETAIL_SECTION.COST.rawValue:
return super.tableView(tableView, indentationLevelForRowAt: IndexPath(row: 0, section: CHILD_BILL_DETAIL_SECTION.COST.rawValue))
case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue:
return super.tableView(tableView, indentationLevelForRowAt: IndexPath(row: 0, section: CHILD_BILL_DETAIL_SECTION.BORROW.rawValue))
default:
break
}
return super.tableView(tableView, indentationLevelForRowAt: indexPath)
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == CHILD_BILL_DETAIL_SECTION.DESCRIBE.rawValue {
if indexPath.row == kZERO {
......@@ -197,7 +240,51 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
return afterAttachmentHeight + 15
}
}
if indexPath.section == CHILD_BILL_DETAIL_SECTION.COST.rawValue || indexPath.section == CHILD_BILL_DETAIL_SECTION.BORROW.rawValue {
if indexPath.row == kZERO {
return 30
}
return kCellHeight
}
return super.tableView(tableView, heightForRowAt: indexPath)
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
switch indexPath.section {
case CHILD_BILL_DETAIL_SECTION.COST.rawValue:
if indexPath.row == kZERO {
return
}
let costVc = ChildBillDetailCostViewController.instantiateViewController(.Function) as! ChildBillDetailCostViewController
costVc.costModel = childBillViewModel.childBillDetailData.costArray[indexPath.row - kONE]
pushVC(costVc)
break
case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue:
if indexPath.row == kZERO {
return
}
let borrowVc = ChildBillDetailBorrowViewController.instantiateViewController(.Function) as! ChildBillDetailBorrowViewController
borrowVc.borrowModel = childBillViewModel.childBillDetailData.executeMateriels[indexPath.row - kONE]
pushVC(borrowVc)
break
default:
break
}
}
}
......@@ -104,7 +104,7 @@ class RepairOrderDetailBgController: BaseViewController {
// MARK: - 工单底部view
fileprivate func rapairBillBottomViewAction(_ state: String) {
if state == SUBMIT_REPAIR_ORDER_STATE.FINISHED.rawValue || state == SUBMIT_REPAIR_ORDER_STATE.DELETED.rawValue || state == SUBMIT_REPAIR_ORDER_STATE.CANCLED.rawValue {
if state == SUBMIT_REPAIR_ORDER_STATE.FINISHED.rawValue || state == SUBMIT_REPAIR_ORDER_STATE.DELETED.rawValue || state == SUBMIT_REPAIR_ORDER_STATE.CANCLED.rawValue || state == SUBMIT_REPAIR_ORDER_STATE.CREATED.rawValue {
bottomLayoutHeight.constant = 0
UIView.animate(withDuration: kAnimationTime, animations: {
self.view.layoutIfNeeded()
......@@ -115,6 +115,24 @@ class RepairOrderDetailBgController: BaseViewController {
self.view.layoutIfNeeded()
})
}
if state == SUBMIT_REPAIR_ORDER_STATE.CREATED.rawValue {
setupSendButtonItem()
}
}
// MARK: - 设置发出按钮
fileprivate func setupSendButtonItem() {
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "发出", style: .done, target: self, action: #selector(RepairOrderDetailBgController.sendBtnAction))
}
// MARK: - 发出工单
@objc func sendBtnAction() {
orderDetailViewModel.usefulWorkBillAction(billModel.uuid).subscribe(onNext: {[weak self] () in
NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: UPDATE_BILL_LIST)))
self?.popVC()
ShowMessage("工单已发出")
}).disposed(by: disposeBag)
}
// MARK: - 设置悬浮框
......
......@@ -43,7 +43,6 @@ class RepairOrderDetailViewController: BaseTableViewController {
@IBOutlet weak var requestTimeLab: UILabel!
/// 位置
@IBOutlet weak var positionLabel: UILabel!
/// 设施
@IBOutlet weak var deviceLab: UILabel!
/// 设施位置
......@@ -56,6 +55,9 @@ class RepairOrderDetailViewController: BaseTableViewController {
@IBOutlet weak var isSolveLabel: UILabel!
/// 完成情况
@IBOutlet weak var completionLabel: UILabel!
/// 备注
@IBOutlet weak var remarkLabel: UILabel!
/// 附件宽度
let imageWidth = ((kWidth - 90) - CGFloat((3 + kONE) * 5)) / 3
/// 工单状态回调
......@@ -94,8 +96,8 @@ class RepairOrderDetailViewController: BaseTableViewController {
/// 位置图图片附件
lazy final var locationAttVc: PhotoAttachmentViewController = {
var attachmentVc = PhotoAttachmentViewController.instantiateViewController(.Function) as! PhotoAttachmentViewController
return attachmentVc
var locationAttVc = PhotoAttachmentViewController.instantiateViewController(.Function) as! PhotoAttachmentViewController
return locationAttVc
}()
override func viewDidLoad() {
......@@ -219,14 +221,15 @@ class RepairOrderDetailViewController: BaseTableViewController {
//获取位置图附件
orderDetailViewModel.downloadLocationAttAction(ATTACHMENT_TYPE.BILL_ATTACHMENT_TYPE.rawValue).subscribe(onNext: {[weak self] (attachments) in
self?.locationAttVc.attachmentViewModel.photoAttachments.removeAll()
for model in attachments {
let model = attachments.first
if let model = model {
let url = String(format: attachmentUrl, model.entityType,model.entityUuid,model.fileName)
self?.locationAttVc.attachmentViewModel.photoAttachments.append(PhotoAttachmentModel(url, ATTACHMENT_TYPE.BILL_ATTACHMENT_TYPE.rawValue, model.entityUuid, ATTACHMENT_LOCATION.ATTACHMENT_HTTP))
}
self?.locationAttVc.setItemSize(CGSize(width: self!.imageWidth, height: self!.imageWidth),self!.attachmentCount)
let attHeight = self?.locationAttVc.attachmentHeight(attachments.count,nil)
if attHeight! > self!.locationAttHeight {
self?.locationAttHeight = attHeight
self?.locationAttVc.setItemSize(CGSize(width: self!.imageWidth, height: self!.imageWidth),self!.attachmentCount)
let attHeight = self?.locationAttVc.attachmentHeight(kONE,nil)
if attHeight! > self!.locationAttHeight {
self?.locationAttHeight = attHeight
}
}
self?.tableView.reloadData()
}).disposed(by: disposeBag)
......@@ -249,7 +252,9 @@ class RepairOrderDetailViewController: BaseTableViewController {
// MARK: - 转交工单...查询、选择部门
func transferRepairOrder() {
orderDetailViewModel.queryRepairOrderDepartmentAction().subscribe(onNext: {[weak self] (resuleModel) in
let model = QueryModel()
model.storeUuidEquals = orderDetailViewModel.billDetailModel.store.uuid
orderDetailViewModel.queryRepairOrderDepartmentAction(model).subscribe(onNext: {[weak self] (resuleModel) in
self?.orderDetailViewModel.repairOrderDepartmentChoice(resuleModel, self!).subscribe(onNext: { (result) in
ShowAlertView(hint, result.0, [cancel,sure], .alert, { (index) in
self?.transferRepairOrderAction(result.1)
......@@ -350,6 +355,9 @@ extension RepairOrderDetailViewController {
if indexPath.section == REPAIR_ORDER_DETAIL_SECTION.SOURCE.rawValue && indexPath.row == 14 {
return attachmentHeight + 20
}
if indexPath.section == REPAIR_ORDER_DETAIL_SECTION.SOURCE.rawValue && indexPath.row == 15 {
return orderDetailViewModel.billDetailModel.noteHeight + 20
}
if indexPath.section == REPAIR_ORDER_DETAIL_SECTION.COMPLETED.rawValue && indexPath.row == 1 {
return orderDetailViewModel.billDetailModel.finishNoteHeight + 20
}
......
......@@ -119,7 +119,7 @@ class RepairOrderViewController: BaseTableViewPullController {
default:
break
}
self?.tableView.reloadData()
self?.reloadData()
}.disposed(by: disposeBag)
}
......
......@@ -57,9 +57,9 @@ open class ChildBillDetailData : NSObject{
var createTime : String!
var dept : UCN!
var endAttachmentId : String!
// var executeMateriels : [AnyObject]!
var executeMateriels : [ExecuteMateriel]!
var costArray : [ExecuteMateriel]!
var executeNo : String!
// var executeOutsources : [AnyObject]!
var hasOut : Bool!
var hasPaid : Bool!
var labourfee : String!
......@@ -104,6 +104,17 @@ open class ChildBillDetailData : NSObject{
if !deptJson.isEmpty{
dept = UCN(fromJson: deptJson)
}
executeMateriels = [ExecuteMateriel]()
costArray = [ExecuteMateriel]()
let executeMaterielsArray = json["executeMateriels"].arrayValue
for executeMaterielsJson in executeMaterielsArray{
let value = ExecuteMateriel(fromJson: executeMaterielsJson)
if value.sourceType == CHILDORDERCOST_TYPE.COST.rawValue {
costArray.append(value)
}else {
executeMateriels.append(value)
}
}
endAttachmentId = json["endAttachmentId"].stringValue
executeNo = json["executeNo"].stringValue
hasOut = json["hasOut"].boolValue
......@@ -157,9 +168,9 @@ open class ChildBillDetailData : NSObject{
if endAttachmentId != nil{
dictionary["endAttachmentId"] = endAttachmentId
}
// if !executeMateriels.isEmpty {
// dictionary["executeMateriels"] = executeMateriels
// }
if !executeMateriels.isEmpty {
dictionary["executeMateriels"] = executeMateriels
}
if executeNo != nil{
dictionary["executeNo"] = executeNo
}
......@@ -231,6 +242,126 @@ open class ChildBillDetailData : NSObject{
}
return dictionary
}
}
class ExecuteMateriel : NSObject{
var backQty : String!
var batchNo : String!
var createId : String!
var createOperName : String!
var createTime : String!
var getQty : Float!
var lastModifyId : String!
var lastModifyOperName : String!
var lastModifyTime : String!
var materiel : UCN!
var outputbillno : String!
var outputid : String!
var sourceId : String!
var sourceType : String!
var unitPrice : Float!
var useQty : Double!
var uuid : String!
var version : Int!
var workexecuteid : String!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
backQty = json["backQty"].stringValue
batchNo = json["batchNo"].stringValue
createId = json["create_id"].stringValue
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
getQty = json["getQty"].floatValue
lastModifyId = json["lastModify_id"].stringValue
lastModifyOperName = json["lastModify_operName"].stringValue
lastModifyTime = json["lastModify_time"].stringValue
let materielJson = json["materiel"]
if !materielJson.isEmpty{
materiel = UCN(fromJson: materielJson)
}
outputbillno = json["outputbillno"].stringValue
outputid = json["outputid"].stringValue
sourceId = json["sourceId"].stringValue
sourceType = json["sourceType"].stringValue
unitPrice = json["unitPrice"].floatValue
useQty = json["useQty"].doubleValue
uuid = json["uuid"].stringValue
version = json["version"].intValue
workexecuteid = json["workexecuteid"].stringValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if backQty != nil{
dictionary["backQty"] = backQty
}
if batchNo != nil{
dictionary["batchNo"] = batchNo
}
if createId != nil{
dictionary["create_id"] = createId
}
if createOperName != nil{
dictionary["create_operName"] = createOperName
}
if createTime != nil{
dictionary["create_time"] = createTime
}
if getQty != nil{
dictionary["getQty"] = getQty
}
if lastModifyId != nil{
dictionary["lastModify_id"] = lastModifyId
}
if lastModifyOperName != nil{
dictionary["lastModify_operName"] = lastModifyOperName
}
if lastModifyTime != nil{
dictionary["lastModify_time"] = lastModifyTime
}
if materiel != nil{
dictionary["materiel"] = materiel.toDictionary()
}
if outputbillno != nil{
dictionary["outputbillno"] = outputbillno
}
if outputid != nil{
dictionary["outputid"] = outputid
}
if sourceId != nil{
dictionary["sourceId"] = sourceId
}
if sourceType != nil{
dictionary["sourceType"] = sourceType
}
if unitPrice != nil{
dictionary["unitPrice"] = unitPrice
}
if useQty != nil{
dictionary["useQty"] = useQty
}
if uuid != nil{
dictionary["uuid"] = uuid
}
if version != nil{
dictionary["version"] = version
}
if workexecuteid != nil{
dictionary["workexecuteid"] = workexecuteid
}
return dictionary
}
}
......@@ -4,7 +4,7 @@
// Create by 云霄 曹 on 12/1/2018
// Copyright © 2018. All rights reserved.
import Foundation
import Foundation
import SwiftyJSON
......@@ -84,6 +84,7 @@ open class BillDetailData : NSObject{
var level : String!
var materielfee : AnyObject!
var note : String!
var noteHeight: CGFloat! = 10
var position : UCN!
var receiveTime : String!
var reportOrg : String!
......@@ -124,7 +125,7 @@ open class BillDetailData : NSObject{
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
descriptionField = json["description"].stringValue
descriptionFieldHeight = descriptionField.calculateStringSize(CGSize(width: kWidth - 105, height: CGFloat.greatestFiniteMagnitude), font: UIFont.systemFont(ofSize: 13)).height
descriptionFieldHeight = descriptionField.calculateStringSize(CGSize(width: kWidth - 105, height: CGFloat.greatestFiniteMagnitude), font: UIFont.systemFont(ofSize: 13)).height
let deviceJson = json["device"]
if !deviceJson.isEmpty{
device = UCN(fromJson: deviceJson)
......@@ -154,6 +155,8 @@ open class BillDetailData : NSObject{
level = json["level"].stringValue
materielfee = json["materielfee"] as AnyObject
note = json["note"].stringValue
noteHeight = note.calculateStringSize(CGSize(width: kWidth - 105, height: CGFloat.greatestFiniteMagnitude), font: UIFont.systemFont(ofSize: 13)).height
let positionJson = json["position"]
if !positionJson.isEmpty{
position = UCN(fromJson: positionJson)
......
......@@ -19,6 +19,7 @@ open class SaveRepairOrderModel {
var reportOrg : String!
var reportUser : UCN!
var store: UCN!
var tenant: UCN!
var reporterPhone : String!
var requestTime : String!
var serviceType : String!
......@@ -49,6 +50,9 @@ open class SaveRepairOrderModel {
if store != nil{
dictionary["store"] = store.toDictionary()
}
if tenant != nil{
dictionary["tenant"] = tenant.toDictionary()
}
if level != nil{
dictionary["level"] = level
}
......
//
// CostOrBorrowTableViewCell.swift
// IFS
//
// Created by 曹云霄 on 2018/3/12.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class CostOrBorrowTableViewCell: UITableViewCell {
/// item 标题
@IBOutlet weak var titleLabel: UILabel!
/// item 详情
@IBOutlet weak var detailLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
}
// MARK: - 更新cell
open func updateCell(_ model: ExecuteMateriel,_ indexPath: IndexPath) {
titleLabel.text = model.materiel.name
if model.sourceType == CHILDORDERCOST_TYPE.BORROW.rawValue {
detailLabel.text = model.outputbillno
}else {
detailLabel.text = String(format: "%.2f", model.getQty)
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" id="KGk-i7-Jjw" customClass="CostOrBorrowTableViewCell" customModule="IFS" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="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="286" 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="udf-Xr-Jev">
<rect key="frame" x="30" y="14" width="27" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lRF-hd-RRs">
<rect key="frame" x="277" y="14" width="9" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="udf-Xr-Jev" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="Jls-kE-DuC"/>
<constraint firstItem="lRF-hd-RRs" firstAttribute="centerY" secondItem="udf-Xr-Jev" secondAttribute="centerY" id="TYP-G4-1UJ"/>
<constraint firstItem="udf-Xr-Jev" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="30" id="bmV-3Q-CxJ"/>
<constraint firstAttribute="trailing" secondItem="lRF-hd-RRs" secondAttribute="trailing" id="dbH-2Z-guv"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="detailLabel" destination="lRF-hd-RRs" id="tvr-jN-hKH"/>
<outlet property="titleLabel" destination="udf-Xr-Jev" id="Eff-4D-AJy"/>
</connections>
</tableViewCell>
</objects>
</document>
......@@ -144,10 +144,50 @@ extension RepairOrderAddViewModel {
controller.sourceLabel.text = text
controller.sourceLabel.textColor = kBlackColor
self?.saveOrderModel.source = text
if text == "租区" {
NotificationCenter.default.post(name: NSNotification.Name(rawValue: UPDATE_REPAIRORDER_ADD_LIST), object: REPAIRORDER_STORE.SHOW.rawValue)
}else {
self?.saveOrderModel.tenant = nil
controller.tenantLabel.text = nil
NotificationCenter.default.post(name: NSNotification.Name(rawValue: UPDATE_REPAIRORDER_ADD_LIST), object: REPAIRORDER_STORE.HIDE.rawValue)
}
}, cancel: nil)
}).disposed(by: disposeBag)
break
case IndexPath(row: 2, section: 0):
if saveOrderModel.store == nil {
ShowMessage("请先选择项目")
return
}
let model = QueryModel()
model.storeUuidEquals = saveOrderModel.store.uuid
filterViewModel.queryTenant(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.tenantLabel.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.tenantLabel.text = choiceModel.title
controller.tenantLabel.textColor = kBlackColor
let model = result[index!]
let tenant = UCN(model.code, model.name, model.uuid)
self?.saveOrderModel.tenant = tenant
})
}).disposed(by: disposeBag)
break
case IndexPath(row: 3, section: 0):
filterViewModel.queryServerType().subscribe(onNext: {[weak self] (result) in
if result.isEmpty {
ShowMessage("无数据")
......@@ -160,7 +200,7 @@ extension RepairOrderAddViewModel {
}, cancel: nil)
}).disposed(by: disposeBag)
break
case IndexPath(row: 3, section: 0):
case IndexPath(row: 4, section: 0):
filterViewModel.queryProrityOption().subscribe(onNext: {[weak self] (result) in
if result.isEmpty {
ShowMessage("无数据")
......@@ -173,8 +213,14 @@ extension RepairOrderAddViewModel {
}, cancel: nil)
}).disposed(by: disposeBag)
break
case IndexPath(row: 4, section: 0):
filterViewModel.queryInitiator().subscribe(onNext: {[weak self] (result) in
case IndexPath(row: 5, section: 0):
if saveOrderModel.store == nil {
ShowMessage("请先选择项目")
return
}
let model = QueryModel()
model.storeUuidEquals = saveOrderModel.store.uuid
filterViewModel.queryInitiator(model).subscribe(onNext: {[weak self] (result) in
if result.isEmpty {
ShowMessage("无数据")
return
......@@ -200,24 +246,38 @@ extension RepairOrderAddViewModel {
})
}).disposed(by: disposeBag)
break
case IndexPath(row: 6, section: 0):
case IndexPath(row: 7, section: 0):
let defaultDate = controller.originatorTimeLabel.text == "工单接报时间" ? NSDate().httpParameterString() : controller.originatorTimeLabel.text
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
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
controller.originatorTimeLabel.text = time
controller.originatorTimeLabel.textColor = kBlackColor
self?.saveOrderModel.receiveTime = time
}, cancel: nil)
break
case IndexPath(row: 7, section: 0):
case IndexPath(row: 8, section: 0):
let defaultDate = controller.specifiedTimeLabel.text == "工单指定时间" ? NSDate().httpParameterString() : controller.originatorTimeLabel.text
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
var date = Date()
if saveOrderModel.receiveTime != nil {
date = Date(fromString: saveOrderModel.receiveTime, format: "yyyy-MM-dd HH:mm:ss")!
}
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: date, maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
controller.specifiedTimeLabel.text = time
controller.specifiedTimeLabel.textColor = kBlackColor
self?.saveOrderModel.requestTime = time
}, cancel: nil)
break
case IndexPath(row: 8, section: 0):
filterViewModel.queryLocation().subscribe(onNext: {[weak self] (result) in
case IndexPath(row: 9, section: 0):
if saveOrderModel.store == nil {
ShowMessage("请先选择项目")
return
}
let model = QueryModel()
model.storeUuidEquals = saveOrderModel.store.uuid
filterViewModel.queryLocation(model).subscribe(onNext: {[weak self] (result) in
if result.isEmpty {
ShowMessage("无数据")
return
......@@ -243,7 +303,7 @@ extension RepairOrderAddViewModel {
})
}).disposed(by: disposeBag)
break
case IndexPath(row: 9, section: 0):
case IndexPath(row: 10, section: 0):
if saveOrderModel.locationAttachmentId != nil {
ShowAlertView(hint, "请选择操作类型", ["取消","重新编辑","查看"], .actionSheet, {[weak self] (index) in
switch index {
......@@ -267,7 +327,13 @@ extension RepairOrderAddViewModel {
}
break
case IndexPath(row: 0, section: 1):
filterViewModel.queryDevice().subscribe(onNext: {[weak self] (result) in
if saveOrderModel.store == nil {
ShowMessage("请先选择项目")
return
}
let model = DeviceQueryModel()
model.storeUuidEquals = saveOrderModel.store.uuid
filterViewModel.queryDevice(model).subscribe(onNext: {[weak self] (result) in
if result.isEmpty {
ShowMessage("无数据")
return
......@@ -336,11 +402,15 @@ extension RepairOrderAddViewModel {
publicFilterVc.setNavigationTitle("筛选楼宇",.SINGLE, { (choices, index) in
let choiceModel = choices.first!
self?.filterViewModel.queryFloorlayer(choiceModel.uuid!).subscribe(onNext: { (result) in
if result.isEmpty {
self?.saveOrderModel.locationAttachmentId = nil
self?.saveOrderModel.locationAttachmentUrl = nil
ShowMessage("无楼层数据")
return
}
let editVc = EditImageViewController()
let attachment = result.attachments.first!
editVc.type = .EDIT
let urlString = String(format: attachmentUrl, attachment.entityType,attachment.entityUuid,attachment.fileName)
editVc.imageString = urlString
editVc.imageArray = result
controller.pushVC(editVc)
editVc.setSaveImageBlock({ (imageUrl) in
controller.specifiedLocationImg.image = UIImage(contentsOfFile: imageUrl)
......
......@@ -32,6 +32,24 @@ class RepairOrderDetailViewModel: BaseViewModel {
extension RepairOrderDetailViewModel {
/// 发出工单
func usefulWorkBillAction(_ billUuid: String) ->Observable<Void> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .UsefulWorkBill(billUuid), success: { (json) in
let resultModel = PublicResultModel(fromJson: json)
if resultModel.success {
observer.onNext(())
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
observer.onError(MoyaError.requestMapping(error.localizedDescription))
})
return Disposables.create()
})
}
/// 查询工单详情
func queryRepairOrderDetailAction(_ billUuid: String) ->Observable<Void>{
return Observable.create({ (observer) -> Disposable in
......@@ -90,12 +108,12 @@ extension RepairOrderDetailViewModel {
}
// MARK: - 查询工单转交部门
func queryRepairOrderDepartmentAction() ->Observable<DepartmentData> {
func queryRepairOrderDepartmentAction(_ model: QueryModel) ->Observable<DepartmentData> {
if AppManager.shareInstance.userStoreModel != nil {
return queryRepairOrderDepartmentAction2()
}else {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .GetRepairOrderDepartment(), success: { (json) in
Network.request(target: .GetRepairOrderDepartment(model), success: { (json) in
let resultModel = DepartmentResultModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data)
......@@ -113,7 +131,7 @@ extension RepairOrderDetailViewModel {
// MARK: - 查询工单转交部门2(当前登录人所属项目不为空时调用)
func queryRepairOrderDepartmentAction2() ->Observable<DepartmentData> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryStoreSubOrgs(AppManager.shareInstance.userStoreModel!.uuid), success: { (json) in
Network.request(target: .QueryStoreSubOrgs(self.billDetailModel.store.uuid), success: { (json) in
let resultModel = DepartmentResultModel2(fromJson: json)
if resultModel.success {
let model = DepartmentData(fromJson: json)
......@@ -190,7 +208,15 @@ extension RepairOrderDetailViewModel {
// MARK: - 工单详情赋值
func billDetailAssignment(_ controller: RepairOrderDetailViewController) {
controller.sourceLab.text = disposeEmpty(billDetailModel.source)
var source: String?
if billDetailModel.source == "租区" {
source = String(format: "%@,商户: (%@)", billDetailModel.source,billDetailModel.tenant.name)
}else {
source = String(format: "%@", billDetailModel.source)
}
controller.descriptionLab.adjustsFontSizeToFitWidth = true
controller.remarkLabel.adjustsFontSizeToFitWidth = true
controller.sourceLab.text = source
controller.serverTypeLab.text = disposeEmpty(billDetailModel.serviceType)
controller.priorityLab.text = disposeEmpty(billDetailModel.level)
if billDetailModel.reportUser != nil {
......@@ -211,6 +237,7 @@ extension RepairOrderDetailViewModel {
controller.descriptionLab.text = disposeEmpty(billDetailModel.descriptionField)
controller.billNumberLab.text = billDetailModel.workNo
controller.isSolveLabel.text = billDetailModel.finish ? "是" : "否"
controller.remarkLabel.text = disposeEmpty(billDetailModel.note)
controller.completionLabel.text = disposeEmpty(billDetailModel.finishNote)
if billDetailModel.store != nil {
controller.projectLabel.text = disposeEmpty(billDetailModel.store.name)
......
......@@ -325,7 +325,9 @@ extension ReparirChildBillViewModel {
}).disposed(by: disposeBag)
break
case IndexPath(row: 2, section: 0):
filterViewModel.queryInitiator().subscribe(onNext: {[weak self] (result) in
let model = QueryModel()
model.storeUuidEquals = childBillDetailData.dept.uuid
filterViewModel.queryInitiator(model).subscribe(onNext: {[weak self] (result) in
if result.isEmpty {
ShowMessage("无数据")
return
......@@ -347,7 +349,11 @@ extension ReparirChildBillViewModel {
break
case IndexPath(row: 3, section: 0):
let defaultDate = controller.placeTimeLabel.text == "请选择" ? NSDate().httpParameterString() : controller.placeTimeLabel.text
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
var date: Date?
if !childBillDetailData.processEnd.isEmpty {
date = Date(fromString: childBillDetailData.processEnd, 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
controller.placeTimeLabel.text = time
controller.placeTimeLabel.textColor = kBlackColor
self?.childBillDetailData.processBegin = time
......@@ -355,7 +361,11 @@ extension ReparirChildBillViewModel {
break
case IndexPath(row: 4, section: 0):
let defaultDate = controller.leaveTimeLabel.text == "请选择" ? NSDate().httpParameterString() : controller.leaveTimeLabel.text
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
var date = Date()
if !childBillDetailData.processBegin.isEmpty {
date = Date(fromString: childBillDetailData.processBegin, format: "yyyy-MM-dd HH:mm:ss")!
}
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: date, maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
controller.leaveTimeLabel.text = time
controller.leaveTimeLabel.textColor = kBlackColor
self?.childBillDetailData.processEnd = time
......@@ -401,10 +411,15 @@ extension ReparirChildBillViewModel {
sectionView.stateTimeLabel.text = childBillDetailData.createTime
break
case CHILD_BILL_DETAIL_SECTION.COST.rawValue:
sectionView.sectionStateLabel.text = "费用与设备信息"
sectionView.sectionStateLabel.text = "费用信息"
sectionView.stateTimeLabel.text = nil
break
case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue:
sectionView.sectionStateLabel.text = "借用信息"
sectionView.stateTimeLabel.text = nil
break
case CHILD_BILL_DETAIL_SECTION.DESCRIBE.rawValue:
sectionView.sectionStateLabel.text = "创建"
sectionView.sectionStateLabel.text = "描述信息"
sectionView.stateTimeLabel.text = childBillDetailData.lastModifyTime
break
default:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<string>1.0.3</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<string>1.0.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