Commit d693d5c8 authored by 曹云霄's avatar 曹云霄

修复子工单不是全部已完成或已作废状态,还可以完成总工单、修复工单新建时闪退问题、部门工单编辑界面增加工单费用信息回写、修复子工单操作后,该工单排列顺序改变

parent 489718cc
...@@ -1395,6 +1395,7 @@ ...@@ -1395,6 +1395,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = W54V2VB863; DEVELOPMENT_TEAM = W54V2VB863;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "$(SRCROOT)/IFS/Resource/Info.plist"; INFOPLIST_FILE = "$(SRCROOT)/IFS/Resource/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
...@@ -1416,6 +1417,7 @@ ...@@ -1416,6 +1417,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = W54V2VB863; DEVELOPMENT_TEAM = W54V2VB863;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "$(SRCROOT)/IFS/Resource/Info.plist"; INFOPLIST_FILE = "$(SRCROOT)/IFS/Resource/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......
...@@ -87,13 +87,15 @@ public enum REPAIR_ORDER_DETAIL_SECTION: Int { ...@@ -87,13 +87,15 @@ public enum REPAIR_ORDER_DETAIL_SECTION: Int {
/// 子工单编辑界面分区 /// 子工单编辑界面分区
/// ///
/// - BASIC: 基本信息 /// - BASIC: 基本信息
/// - COST: 费用与设备信息 /// - COST: 费用信息
/// - BORROW: 借用信息
/// - DESCRIBE: 描述 /// - DESCRIBE: 描述
/// - AFTERATTACHMENT: 维修前照片 /// - AFTERATTACHMENT: 维修前照片
/// - BEFORATTACHMENT: 维修后照片 /// - BEFORATTACHMENT: 维修后照片
public enum CHILD_BILL_EDIT_SECTION: Int { public enum CHILD_BILL_EDIT_SECTION: Int {
case BASIC = 0 case BASIC = 0
case COST case COST
case BORROW
case DESCRIBE case DESCRIBE
case BEFORATTACHMENT case BEFORATTACHMENT
case AFTERATTACHMENT case AFTERATTACHMENT
......
...@@ -45,7 +45,7 @@ public let projectUrl: String = "/store/query" ...@@ -45,7 +45,7 @@ public let projectUrl: String = "/store/query"
/// 新建工单位置 /// 新建工单位置
public let positionUrl: String = "/information/position/query" public let positionUrl: String = "/information/position/query"
/// 新建工单设施 /// 新建工单设施
public let deviceUrl: String = "/information/device/query" public let deviceUrl: String = "/device/query"
/// 新建工单提交 /// 新建工单提交
public let saveRepairOrderUrl: String = "/work/saveOrUpdate" public let saveRepairOrderUrl: String = "/work/saveOrUpdate"
/// 工单列表查询 /// 工单列表查询
......
...@@ -147,7 +147,8 @@ extension Service: TargetType { ...@@ -147,7 +147,8 @@ extension Service: TargetType {
case .QueryprocessMethods: case .QueryprocessMethods:
return processMethodsUrl return processMethodsUrl
case .CompleteOrder: case .CompleteOrder:
return completedBillUrl let path = completedBillUrl + "?operator.operId=\(kUser().userCode!)&operator.operName=\(kUser().userName!)&time=\(NSDate().httpParameterString()!)"
return path.urlEncoded()
case .UploadAttachment(let model): case .UploadAttachment(let model):
return String(format: uploadAttachmentUrl, model.entityType,model.entityUuid) return String(format: uploadAttachmentUrl, model.entityType,model.entityUuid)
case .DownloadAttachment(let entity_type, let entity_uuid): case .DownloadAttachment(let entity_type, let entity_uuid):
......
...@@ -91,7 +91,11 @@ class PhotoAttachmentViewController: BaseViewController { ...@@ -91,7 +91,11 @@ class PhotoAttachmentViewController: BaseViewController {
open func attachmentHeight(_ count: Int, _ key: String?) ->CGFloat { open func attachmentHeight(_ count: Int, _ key: String?) ->CGFloat {
self.key = key self.key = key
let rows = (count + COUNT - kONE) / COUNT let rows = (count + COUNT - kONE) / COUNT
return CGFloat(rows) * imageHeight + CGFloat((rows - kONE) * SPACE) let height = CGFloat(rows) * imageHeight + CGFloat((rows - kONE) * SPACE)
if height < 20 {
return 20
}
return height
} }
} }
......
...@@ -50,18 +50,20 @@ class DeviceData{ ...@@ -50,18 +50,20 @@ class DeviceData{
class DeviceRecord{ class DeviceRecord{
var bussiness : String!
var code : String! var code : String!
var createId : String! var createId : String!
var createOperName : String! var createOperName : String!
var createTime : String! var createTime : String!
var deviceType : AnyObject!
var enabled : Bool! var enabled : Bool!
var lastModifyId : String! var lastModifyId : String!
var lastModifyOperName : String! var lastModifyOperName : String!
var lastModifyTime : String! var lastModifyTime : String!
var location : String!
var name : String! var name : String!
var position : UCN! var note : String!
var store : UCN! var store : UCN!
var type : UCN!
var uuid : String! var uuid : String!
var version : Int! var version : Int!
...@@ -73,28 +75,29 @@ class DeviceRecord{ ...@@ -73,28 +75,29 @@ class DeviceRecord{
if json.isEmpty{ if json.isEmpty{
return return
} }
bussiness = json["bussiness"].stringValue
code = json["code"].stringValue code = json["code"].stringValue
createId = json["create_id"].stringValue createId = json["create_id"].stringValue
createOperName = json["create_operName"].stringValue createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue createTime = json["create_time"].stringValue
deviceType = json["deviceType"] as AnyObject
enabled = json["enabled"].boolValue enabled = json["enabled"].boolValue
lastModifyId = json["lastModify_id"].stringValue lastModifyId = json["lastModify_id"].stringValue
lastModifyOperName = json["lastModify_operName"].stringValue lastModifyOperName = json["lastModify_operName"].stringValue
lastModifyTime = json["lastModify_time"].stringValue lastModifyTime = json["lastModify_time"].stringValue
location = json["location"].stringValue
name = json["name"].stringValue name = json["name"].stringValue
let positionJson = json["position"] note = json["note"].stringValue
if !positionJson.isEmpty{
position = UCN(fromJson: positionJson)
}
let storeJson = json["store"] let storeJson = json["store"]
if !storeJson.isEmpty{ if !storeJson.isEmpty{
store = UCN(fromJson: storeJson) store = UCN(fromJson: storeJson)
} }
let typeJson = json["type"]
if !typeJson.isEmpty{
type = UCN(fromJson: typeJson)
}
uuid = json["uuid"].stringValue uuid = json["uuid"].stringValue
version = json["version"].intValue version = json["version"].intValue
} }
} }
......
...@@ -18,7 +18,7 @@ open class DeviceQueryModel { ...@@ -18,7 +18,7 @@ open class DeviceQueryModel {
var page : Int! var page : Int!
var pageSize : Int! var pageSize : Int!
var stateEquals : String! = "true" var stateEquals : String! = "true"
var storeUuidEquals: String! var storeIdEquals: String!
func toDictionary() -> [String:Any] func toDictionary() -> [String:Any]
{ {
...@@ -29,8 +29,8 @@ open class DeviceQueryModel { ...@@ -29,8 +29,8 @@ open class DeviceQueryModel {
if nameLike != nil{ if nameLike != nil{
dictionary["nameLike"] = nameLike dictionary["nameLike"] = nameLike
} }
if storeUuidEquals != nil{ if storeIdEquals != nil{
dictionary["storeUuidEquals"] = storeUuidEquals dictionary["storeIdEquals"] = storeIdEquals
} }
if order != nil{ if order != nil{
dictionary["order"] = order.toDictionary() dictionary["order"] = order.toDictionary()
......
...@@ -161,7 +161,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController { ...@@ -161,7 +161,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
if indexPath.section == CHILD_BILL_DETAIL_SECTION.COST.rawValue { if indexPath.section == CHILD_BILL_DETAIL_SECTION.COST.rawValue {
if indexPath.row != kZERO { if indexPath.row != kZERO {
let costCell = tableView.dequeueReusableCell(withIdentifier: CostOrBorrowTableViewCell.name(), for: indexPath) as! CostOrBorrowTableViewCell let costCell = tableView.dequeueReusableCell(withIdentifier: CostOrBorrowTableViewCell.name(), for: indexPath) as! CostOrBorrowTableViewCell
let model = childBillViewModel.childBillDetailData.costArray[indexPath.row - kONE] let model = childBillViewModel.childBillDetailData.executeOutsources[indexPath.row - kONE]
costCell.updateCell(model, indexPath) costCell.updateCell(model, indexPath)
return costCell return costCell
} }
...@@ -191,13 +191,13 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController { ...@@ -191,13 +191,13 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section { switch section {
case CHILD_BILL_DETAIL_SECTION.COST.rawValue: case CHILD_BILL_DETAIL_SECTION.COST.rawValue:
if childBillViewModel.childBillDetailData.costArray == nil { if childBillViewModel.childBillDetailData.executeOutsources == nil {
return kZERO return kONE
} }
return childBillViewModel.childBillDetailData.costArray.count + kONE return childBillViewModel.childBillDetailData.executeOutsources.count + kONE
case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue: case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue:
if childBillViewModel.childBillDetailData.costArray == nil { if childBillViewModel.childBillDetailData.executeMateriels == nil {
return kZERO return kONE
} }
return childBillViewModel.childBillDetailData.executeMateriels.count + kONE return childBillViewModel.childBillDetailData.executeMateriels.count + kONE
case CHILD_BILL_DETAIL_SECTION.DESCRIBE.rawValue: case CHILD_BILL_DETAIL_SECTION.DESCRIBE.rawValue:
...@@ -257,7 +257,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController { ...@@ -257,7 +257,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
return return
} }
let costVc = ChildBillDetailCostViewController.instantiateViewController(.Function) as! ChildBillDetailCostViewController let costVc = ChildBillDetailCostViewController.instantiateViewController(.Function) as! ChildBillDetailCostViewController
costVc.costModel = childBillViewModel.childBillDetailData.costArray[indexPath.row - kONE] costVc.costModel = childBillViewModel.childBillDetailData.executeOutsources[indexPath.row - kONE]
pushVC(costVc) pushVC(costVc)
break break
case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue: case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue:
......
...@@ -58,10 +58,13 @@ class RepairOrderCompletedViewController: BaseTableViewController { ...@@ -58,10 +58,13 @@ class RepairOrderCompletedViewController: BaseTableViewController {
let finishModel = UCN(kUser().userCode, kUser().userName, kUser().userUuid) let finishModel = UCN(kUser().userCode, kUser().userName, kUser().userUuid)
billCompleteViewModel.billCompltedModel.finishUser = finishModel billCompleteViewModel.billCompltedModel.finishUser = finishModel
billCompleteViewModel.complteRepairOrderAction(billCompleteViewModel.billCompltedModel).subscribe(onNext: {[weak self] () in billCompleteViewModel.complteRepairOrderAction(billCompleteViewModel.billCompltedModel).subscribe(onNext: {[weak self] () in
ShowMessage("完成成功")
self?.stateBlock(SUBMIT_REPAIR_ORDER_STATE.FINISHED.rawValue) self?.stateBlock(SUBMIT_REPAIR_ORDER_STATE.FINISHED.rawValue)
NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: UPDATE_BILL_DETAIL_LIST))) /// 延时一秒调用
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0, execute: {
NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: UPDATE_BILL_LIST))) NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: UPDATE_BILL_LIST)))
})
NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: UPDATE_BILL_DETAIL_LIST)))
ShowMessage("完成成功")
self?.popVC() self?.popVC()
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
} }
......
...@@ -93,6 +93,14 @@ class RepairOrderDetailBgController: BaseViewController { ...@@ -93,6 +93,14 @@ class RepairOrderDetailBgController: BaseViewController {
ShowMessage("当前用户对此工单没有完成权限!") ShowMessage("当前用户对此工单没有完成权限!")
return; return;
} }
// 判断子工单是否是终止状态
for executeModel in detailVc.orderDetailViewModel.billDetailModel.executes {
if executeModel.state != SUBMIT_REPAIR_ORDER_STATE.CANCLED.rawValue && executeModel.state != SUBMIT_REPAIR_ORDER_STATE.DONE.rawValue {
ShowMessage("还有部门工单未完成")
return
}
}
let completeVc = RepairOrderCompletedViewController.instantiateViewController(.Function) as! RepairOrderCompletedViewController let completeVc = RepairOrderCompletedViewController.instantiateViewController(.Function) as! RepairOrderCompletedViewController
let model = BillCompletedRequestModel(fromJson: JSON(detailVc.orderDetailViewModel.billDetailModel.toDictionary())) let model = BillCompletedRequestModel(fromJson: JSON(detailVc.orderDetailViewModel.billDetailModel.toDictionary()))
completeVc.setStateBlock({[weak self] (state) in completeVc.setStateBlock({[weak self] (state) in
......
...@@ -203,7 +203,7 @@ class RepairOrderDetailViewController: BaseTableViewController { ...@@ -203,7 +203,7 @@ class RepairOrderDetailViewController: BaseTableViewController {
// MARK: - 获取图片附件通过entity uuid // MARK: - 获取图片附件通过entity uuid
fileprivate func disposeAttachment() { fileprivate func disposeAttachment() {
//获取照片面试附件 //获取照片描述附件
orderDetailViewModel.downloadAttachmentAction(ATTACHMENT_TYPE.BILL_ATTACHMENT_TYPE.rawValue).subscribe(onNext: {[weak self] (attachments) in orderDetailViewModel.downloadAttachmentAction(ATTACHMENT_TYPE.BILL_ATTACHMENT_TYPE.rawValue).subscribe(onNext: {[weak self] (attachments) in
self?.attachmentVc.attachmentViewModel.photoAttachments.removeAll() self?.attachmentVc.attachmentViewModel.photoAttachments.removeAll()
for model in attachments { for model in attachments {
...@@ -212,9 +212,7 @@ class RepairOrderDetailViewController: BaseTableViewController { ...@@ -212,9 +212,7 @@ class RepairOrderDetailViewController: BaseTableViewController {
} }
self?.attachmentVc.setItemSize(CGSize(width: self!.imageWidth, height: self!.imageWidth),self!.attachmentCount) self?.attachmentVc.setItemSize(CGSize(width: self!.imageWidth, height: self!.imageWidth),self!.attachmentCount)
let attHeight = self?.attachmentVc.attachmentHeight(attachments.count,nil) let attHeight = self?.attachmentVc.attachmentHeight(attachments.count,nil)
if attHeight! > self!.attachmentHeight {
self?.attachmentHeight = attHeight self?.attachmentHeight = attHeight
}
self?.tableView.reloadData() self?.tableView.reloadData()
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
...@@ -227,10 +225,8 @@ class RepairOrderDetailViewController: BaseTableViewController { ...@@ -227,10 +225,8 @@ class RepairOrderDetailViewController: BaseTableViewController {
self?.locationAttVc.attachmentViewModel.photoAttachments.append(PhotoAttachmentModel(url, ATTACHMENT_TYPE.BILL_ATTACHMENT_TYPE.rawValue, model.entityUuid, ATTACHMENT_LOCATION.ATTACHMENT_HTTP)) 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) self?.locationAttVc.setItemSize(CGSize(width: self!.imageWidth, height: self!.imageWidth),self!.attachmentCount)
let attHeight = self?.locationAttVc.attachmentHeight(kONE,nil) let attHeight = self?.locationAttVc.attachmentHeight(kONE,nil)
if attHeight! > self!.locationAttHeight {
self?.locationAttHeight = attHeight self?.locationAttHeight = attHeight
} }
}
self?.tableView.reloadData() self?.tableView.reloadData()
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
} }
......
...@@ -78,6 +78,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController { ...@@ -78,6 +78,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
describeTextView.placeholder = "描述" describeTextView.placeholder = "描述"
title = String(format: "完成%@工单", billModel.dept.name) title = String(format: "完成%@工单", billModel.dept.name)
describeTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0) describeTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0)
tableView.register(UINib(nibName: CostOrBorrowTableViewCell.name(), bundle: nil), forCellReuseIdentifier: CostOrBorrowTableViewCell.name())
} }
// MARK: - 设置附件VC // MARK: - 设置附件VC
...@@ -150,9 +151,11 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController { ...@@ -150,9 +151,11 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
if index == kZERO { return } if index == kZERO { return }
self?.uploadActtachmentAction().subscribe(onNext: { (result) in self?.uploadActtachmentAction().subscribe(onNext: { (result) in
self?.childBillViewModel.finishChildBillAction().subscribe(onNext: { () in self?.childBillViewModel.finishChildBillAction().subscribe(onNext: { () in
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0, execute: {
NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: UPDATE_BILL_DETAIL_LIST))) NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: UPDATE_BILL_DETAIL_LIST)))
self?.popVC() })
ShowMessage("子工单完成") ShowMessage("子工单完成")
self?.popVC()
}).disposed(by: self!.disposeBag) }).disposed(by: self!.disposeBag)
}).disposed(by: self!.disposeBag) }).disposed(by: self!.disposeBag)
}) })
...@@ -239,6 +242,25 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController { ...@@ -239,6 +242,25 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
return sectionHeight return sectionHeight
} }
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case CHILD_BILL_DETAIL_SECTION.COST.rawValue:
if childBillViewModel.childBillDetailData.executeOutsources == nil {
return kONE
}
return childBillViewModel.childBillDetailData.executeOutsources.count + kONE
case CHILD_BILL_DETAIL_SECTION.BORROW.rawValue:
if childBillViewModel.childBillDetailData.executeMateriels == nil {
return kONE
}
return childBillViewModel.childBillDetailData.executeMateriels.count + kONE
default:
break
}
return super.tableView(tableView, numberOfRowsInSection: section)
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == CHILD_BILL_EDIT_SECTION.BEFORATTACHMENT.rawValue { if indexPath.section == CHILD_BILL_EDIT_SECTION.BEFORATTACHMENT.rawValue {
return beforAttachmentHeight + 20 return beforAttachmentHeight + 20
......
...@@ -58,7 +58,7 @@ open class ChildBillDetailData : NSObject{ ...@@ -58,7 +58,7 @@ open class ChildBillDetailData : NSObject{
var dept : UCN! var dept : UCN!
var endAttachmentId : String! var endAttachmentId : String!
var executeMateriels : [ExecuteMateriel]! var executeMateriels : [ExecuteMateriel]!
var costArray : [ExecuteMateriel]! var executeOutsources : [ExecuteMateriel]!
var executeNo : String! var executeNo : String!
var hasOut : Bool! var hasOut : Bool!
var hasPaid : Bool! var hasPaid : Bool!
...@@ -105,15 +105,16 @@ open class ChildBillDetailData : NSObject{ ...@@ -105,15 +105,16 @@ open class ChildBillDetailData : NSObject{
dept = UCN(fromJson: deptJson) dept = UCN(fromJson: deptJson)
} }
executeMateriels = [ExecuteMateriel]() executeMateriels = [ExecuteMateriel]()
costArray = [ExecuteMateriel]() executeOutsources = [ExecuteMateriel]()
let executeMaterielsArray = json["executeMateriels"].arrayValue let executeMaterielsArray = json["executeMateriels"].arrayValue
for executeMaterielsJson in executeMaterielsArray{ for executeMaterielsJson in executeMaterielsArray{
let value = ExecuteMateriel(fromJson: executeMaterielsJson) let value = ExecuteMateriel(fromJson: executeMaterielsJson)
if value.sourceType == CHILDORDERCOST_TYPE.COST.rawValue {
costArray.append(value)
}else {
executeMateriels.append(value) executeMateriels.append(value)
} }
let executeOutsourcesArray = json["executeOutsources"].arrayValue
for executeMaterielsJson in executeOutsourcesArray{
let value = ExecuteMateriel(fromJson: executeMaterielsJson)
executeOutsources.append(value)
} }
endAttachmentId = json["endAttachmentId"].stringValue endAttachmentId = json["endAttachmentId"].stringValue
executeNo = json["executeNo"].stringValue executeNo = json["executeNo"].stringValue
...@@ -174,9 +175,9 @@ open class ChildBillDetailData : NSObject{ ...@@ -174,9 +175,9 @@ open class ChildBillDetailData : NSObject{
if executeNo != nil{ if executeNo != nil{
dictionary["executeNo"] = executeNo dictionary["executeNo"] = executeNo
} }
// if !executeOutsources.isEmpty { if !executeOutsources.isEmpty {
// dictionary["executeOutsources"] = executeOutsources dictionary["executeOutsources"] = executeOutsources
// } }
if hasOut != nil{ if hasOut != nil{
dictionary["hasOut"] = hasOut dictionary["hasOut"] = hasOut
} }
......
...@@ -25,6 +25,7 @@ open class SaveRepairOrderModel { ...@@ -25,6 +25,7 @@ open class SaveRepairOrderModel {
var serviceType : String! var serviceType : String!
var locationAttachmentId: String! var locationAttachmentId: String!
var locationAttachmentUrl: String! var locationAttachmentUrl: String!
var deviceadree: String!
var source : String! var source : String!
var state : String! var state : String!
var workNo : String! var workNo : String!
...@@ -35,6 +36,9 @@ open class SaveRepairOrderModel { ...@@ -35,6 +36,9 @@ open class SaveRepairOrderModel {
if attachmentId != nil{ if attachmentId != nil{
dictionary["attachmentId"] = attachmentId dictionary["attachmentId"] = attachmentId
} }
if deviceadree != nil{
dictionary["deviceadree"] = deviceadree
}
if brokenTime != nil{ if brokenTime != nil{
dictionary["brokenTime"] = brokenTime dictionary["brokenTime"] = brokenTime
} }
......
...@@ -22,7 +22,9 @@ class CostOrBorrowTableViewCell: UITableViewCell { ...@@ -22,7 +22,9 @@ class CostOrBorrowTableViewCell: UITableViewCell {
// MARK: - 更新cell // MARK: - 更新cell
open func updateCell(_ model: ExecuteMateriel,_ indexPath: IndexPath) { open func updateCell(_ model: ExecuteMateriel,_ indexPath: IndexPath) {
if model.materiel != nil {
titleLabel.text = model.materiel.name titleLabel.text = model.materiel.name
}
if model.sourceType == CHILDORDERCOST_TYPE.BORROW.rawValue { if model.sourceType == CHILDORDERCOST_TYPE.BORROW.rawValue {
detailLabel.text = model.outputbillno detailLabel.text = model.outputbillno
}else { }else {
......
...@@ -332,7 +332,7 @@ extension RepairOrderAddViewModel { ...@@ -332,7 +332,7 @@ extension RepairOrderAddViewModel {
return return
} }
let model = DeviceQueryModel() let model = DeviceQueryModel()
model.storeUuidEquals = saveOrderModel.store.uuid model.storeIdEquals = saveOrderModel.store.uuid
filterViewModel.queryDevice(model).subscribe(onNext: {[weak self] (result) in filterViewModel.queryDevice(model).subscribe(onNext: {[weak self] (result) in
if result.isEmpty { if result.isEmpty {
ShowMessage("无数据") ShowMessage("无数据")
...@@ -352,13 +352,12 @@ extension RepairOrderAddViewModel { ...@@ -352,13 +352,12 @@ extension RepairOrderAddViewModel {
let deviceModel = result[index!] let deviceModel = result[index!]
let choiceModel = choices.first! let choiceModel = choices.first!
controller.deviceTitleLabel.text = choiceModel.title controller.deviceTitleLabel.text = choiceModel.title
if deviceModel.position != nil { controller.deviceLocationLabel.text = deviceModel.location
controller.deviceLocationLabel.text = deviceModel.position.name
}
controller.deviceTitleLabel.textColor = kBlackColor controller.deviceTitleLabel.textColor = kBlackColor
controller.deviceLocationLabel.textColor = kBlackColor controller.deviceLocationLabel.textColor = kBlackColor
let device = UCN(deviceModel.code, deviceModel.name, deviceModel.uuid) let device = UCN(deviceModel.code, deviceModel.name, deviceModel.uuid)
self?.saveOrderModel.device = device self?.saveOrderModel.device = device
self?.saveOrderModel.deviceadree = deviceModel.location
}) })
controller.pushVC(publicFilterVc) controller.pushVC(publicFilterVc)
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
......
...@@ -64,6 +64,8 @@ extension ReparirChildBillViewModel { ...@@ -64,6 +64,8 @@ extension ReparirChildBillViewModel {
childBillDetailData.lastModifyTime = nil childBillDetailData.lastModifyTime = nil
childBillDetailData.lastModifyId = nil childBillDetailData.lastModifyId = nil
childBillDetailData.lastModifyOperName = nil childBillDetailData.lastModifyOperName = nil
childBillDetailData.executeOutsources = []
childBillDetailData.executeMateriels = []
return Observable.create({ (observer) -> Disposable in return Observable.create({ (observer) -> Disposable in
Network.request(target: .SaveChildBill(self.childBillDetailData), success: { (json) in Network.request(target: .SaveChildBill(self.childBillDetailData), success: { (json) in
let resultModel = PublicResultModel(fromJson: json) let resultModel = PublicResultModel(fromJson: json)
...@@ -87,6 +89,8 @@ extension ReparirChildBillViewModel { ...@@ -87,6 +89,8 @@ extension ReparirChildBillViewModel {
childBillDetailData.lastModifyTime = nil childBillDetailData.lastModifyTime = nil
childBillDetailData.lastModifyId = nil childBillDetailData.lastModifyId = nil
childBillDetailData.lastModifyOperName = nil childBillDetailData.lastModifyOperName = nil
childBillDetailData.executeOutsources = []
childBillDetailData.executeMateriels = []
return Observable.create({ (observer) -> Disposable in return Observable.create({ (observer) -> Disposable in
Network.request(target: .FinishChildBill(self.childBillDetailData), success: { (json) in Network.request(target: .FinishChildBill(self.childBillDetailData), success: { (json) in
let resultModel = PublicResultModel(fromJson: json) let resultModel = PublicResultModel(fromJson: json)
......
...@@ -1044,12 +1044,8 @@ ...@@ -1044,12 +1044,8 @@
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
</tableViewCell> </tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="费用与设备信息" id="Tp4-4j-lyh">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="G5Q-eW-Rem"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="G5Q-eW-Rem">
<rect key="frame" x="0.0" y="402.33333333333337" width="375" height="44"/> <rect key="frame" x="0.0" y="363.33333333333337" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="G5Q-eW-Rem" id="O3C-Ed-MVo"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="G5Q-eW-Rem" id="O3C-Ed-MVo">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666666666666664"/> <rect key="frame" x="0.0" y="0.0" width="375" height="43.666666666666664"/>
...@@ -1080,7 +1076,7 @@ ...@@ -1080,7 +1076,7 @@
</tableViewCellContentView> </tableViewCellContentView>
</tableViewCell> </tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="io0-XT-kHc"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="io0-XT-kHc">
<rect key="frame" x="0.0" y="446.33333333333337" width="375" height="44"/> <rect key="frame" x="0.0" y="407.33333333333337" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="io0-XT-kHc" id="gyg-sg-h2j"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="io0-XT-kHc" id="gyg-sg-h2j">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666666666666664"/> <rect key="frame" x="0.0" y="0.0" width="375" height="43.666666666666664"/>
...@@ -1108,10 +1104,74 @@ ...@@ -1108,10 +1104,74 @@
</tableViewCell> </tableViewCell>
</cells> </cells>
</tableViewSection> </tableViewSection>
<tableViewSection headerTitle="费用信息" id="Oo2-KM-37J">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="30" id="Lz8-Qj-hD9">
<rect key="frame" x="0.0" y="490.33333333333337" width="375" height="30"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Lz8-Qj-hD9" id="78e-7c-7gf">
<rect key="frame" x="0.0" y="0.0" width="375" height="29.666666666666668"/>
<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="mzR-pl-iVJ">
<rect key="frame" x="30" y="7" width="27" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="合计(元)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="612-Wl-4G3">
<rect key="frame" x="291" y="7" width="50" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="mzR-pl-iVJ" firstAttribute="centerY" secondItem="78e-7c-7gf" secondAttribute="centerY" id="TdA-5K-vmi"/>
<constraint firstItem="612-Wl-4G3" firstAttribute="centerY" secondItem="mzR-pl-iVJ" secondAttribute="centerY" id="XGm-0V-8gx"/>
<constraint firstItem="mzR-pl-iVJ" firstAttribute="leading" secondItem="78e-7c-7gf" secondAttribute="leading" constant="30" id="aP7-gp-u9Z"/>
<constraint firstAttribute="trailing" secondItem="612-Wl-4G3" secondAttribute="trailing" constant="34" id="hud-dn-zz7"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="借用信息" id="hNy-Kf-o4G">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="30" id="pzG-Ef-kys">
<rect key="frame" x="0.0" y="559.33333333333337" width="375" height="30"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="pzG-Ef-kys" id="8vB-M3-t6N">
<rect key="frame" x="0.0" y="0.0" width="375" height="29.666666666666668"/>
<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="1St-B3-VT3">
<rect key="frame" x="30" y="7" width="27" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="单号" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2PS-Lg-IG7">
<rect key="frame" x="314" y="7" width="27" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="1St-B3-VT3" firstAttribute="centerY" secondItem="8vB-M3-t6N" secondAttribute="centerY" id="8Ia-MW-qzT"/>
<constraint firstAttribute="trailing" secondItem="2PS-Lg-IG7" secondAttribute="trailing" constant="34" id="MFF-u8-azO"/>
<constraint firstItem="1St-B3-VT3" firstAttribute="leading" secondItem="8vB-M3-t6N" secondAttribute="leading" constant="30" id="MHs-us-5Cu"/>
<constraint firstItem="2PS-Lg-IG7" firstAttribute="centerY" secondItem="1St-B3-VT3" secondAttribute="centerY" id="v77-JN-8hb"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection id="cvP-te-yqy"> <tableViewSection id="cvP-te-yqy">
<cells> <cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="100" id="6dU-Yd-LFr"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="100" id="6dU-Yd-LFr">
<rect key="frame" x="0.0" y="509.33333333333337" width="375" height="100"/> <rect key="frame" x="0.0" y="608.33333333333337" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="6dU-Yd-LFr" id="h0x-1k-gXc"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="6dU-Yd-LFr" id="h0x-1k-gXc">
<rect key="frame" x="0.0" y="0.0" width="375" height="99.666666666666671"/> <rect key="frame" x="0.0" y="0.0" width="375" height="99.666666666666671"/>
...@@ -1145,7 +1205,7 @@ ...@@ -1145,7 +1205,7 @@
<tableViewSection headerTitle="维修前照片" id="C0j-Xq-zD3"> <tableViewSection headerTitle="维修前照片" id="C0j-Xq-zD3">
<cells> <cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="100" id="drC-5R-qld"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="100" id="drC-5R-qld">
<rect key="frame" x="0.0" y="648.33333333333337" width="375" height="100"/> <rect key="frame" x="0.0" y="747.33333333333337" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="drC-5R-qld" id="lIy-rt-yW2"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="drC-5R-qld" id="lIy-rt-yW2">
<rect key="frame" x="0.0" y="0.0" width="375" height="99.666666666666671"/> <rect key="frame" x="0.0" y="0.0" width="375" height="99.666666666666671"/>
...@@ -1157,7 +1217,7 @@ ...@@ -1157,7 +1217,7 @@
<tableViewSection headerTitle="维修后照片" id="n5s-jX-DgQ"> <tableViewSection headerTitle="维修后照片" id="n5s-jX-DgQ">
<cells> <cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="100" id="V7L-D9-XKX"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="100" id="V7L-D9-XKX">
<rect key="frame" x="0.0" y="787.33333333333337" width="375" height="100"/> <rect key="frame" x="0.0" y="886.33333333333337" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="V7L-D9-XKX" id="qlg-vC-gGa"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="V7L-D9-XKX" id="qlg-vC-gGa">
<rect key="frame" x="0.0" y="0.0" width="375" height="99.666666666666671"/> <rect key="frame" x="0.0" y="0.0" width="375" height="99.666666666666671"/>
...@@ -3245,6 +3305,6 @@ ...@@ -3245,6 +3305,6 @@
<image name="todo_icon" width="23" height="24"/> <image name="todo_icon" width="23" height="24"/>
</resources> </resources>
<inferredMetricsTieBreakers> <inferredMetricsTieBreakers>
<segue reference="ui0-ve-aBK"/> <segue reference="eK1-nw-kV4"/>
</inferredMetricsTieBreakers> </inferredMetricsTieBreakers>
</document> </document>
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