ICDetailDisplayViewController.swift 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. //
  2. // ICDetailDisplayViewController.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2016/11/1.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. import Eureka
  10. ///显示指定的考核视图
  11. class ICDetailDisplayViewController: FormViewController {
  12. var detailData:AttendanceDetailData?
  13. override func viewDidLoad() {
  14. super.viewDidLoad()
  15. self.initFormStyle()
  16. self.initFormValue()
  17. }
  18. func initFormValue(){
  19. form +++ Section()
  20. <<< LabelRow("empName"){
  21. row in
  22. row.title = "姓名"
  23. row.value = self.detailData?.empName
  24. }
  25. <<< LabelRow("appealDate"){
  26. row in
  27. row.title = "考勤日期"
  28. row.value = self.detailData?.recordDateString
  29. }
  30. <<< LabelRow("onDutyTime"){
  31. row in
  32. row.title = "上班打卡时间"
  33. row.value = self.detailData?.onDutyTime
  34. }
  35. <<< LabelRow("offDutyTime"){
  36. row in
  37. row.title = "下班打卡时间"
  38. row.value = self.detailData?.offDutyTime
  39. }
  40. <<< LabelRow("statusType"){
  41. row in
  42. row.title = "考勤状态"
  43. let t = calcAttendanceStatus(attendance: self.detailData!)
  44. row.value = t.statusType.rawValue
  45. }
  46. <<< LabelRow("appealStatus"){
  47. row in
  48. row.title = "审批状态"
  49. row.value = "发起"
  50. }
  51. <<< SegmentedRow<String>("appealType") {
  52. $0.title = "申诉类型"
  53. $0.options = ["临时请假", "出差", "因公外出","其他"]
  54. $0.value = self.detailData?.appealReason
  55. }
  56. +++ Section(header:"临时请假",footer:"") {
  57. $0.tag = "a1"
  58. $0.hidden = "$appealType!='临时请假'"
  59. }
  60. <<< LabelRow("selfHolidayType"){
  61. $0.title = "请假类型"
  62. $0.value = self.detailData?.appealDescription
  63. }
  64. <<< LabelRow("startTime"){
  65. $0.title = "开始日期"
  66. $0.value = self.detailData?.startTime
  67. }
  68. <<< LabelRow("endTime"){
  69. $0.title = "结束日期"
  70. $0.value = self.detailData?.endTime
  71. }
  72. +++ Section(header:"出差",footer:"") {
  73. $0.tag = "a2"
  74. $0.hidden = "$appealType!='出差'"
  75. }
  76. <<< LabelRow("address1"){
  77. $0.title = "地点"
  78. $0.value = self.detailData?.address
  79. }
  80. <<< LabelRow("startTime1"){
  81. $0.title = "开始日期"
  82. $0.value = self.detailData?.startTime
  83. }
  84. <<< LabelRow("endTime1"){
  85. $0.title = "结束日期"
  86. $0.value = self.detailData?.endTime
  87. }
  88. +++ Section(header:"因公外出",footer:"") {
  89. $0.tag = "a3"
  90. $0.hidden = "$appealType!='因公外出'"
  91. }
  92. <<< LabelRow("address2"){
  93. $0.title = "地点"
  94. $0.value = self.detailData?.address
  95. }
  96. <<< LabelRow("startTime2"){
  97. $0.title = "开始日期"
  98. $0.value = self.detailData?.startTime
  99. }
  100. <<< LabelRow("endTime2"){
  101. $0.title = "结束日期"
  102. $0.value = self.detailData?.endTime
  103. }
  104. <<< LabelRow("appealReson2"){
  105. $0.title = "事由"
  106. $0.value = self.detailData?.appealDescription
  107. }
  108. +++ Section(header:"其他",footer:"") {
  109. $0.tag = "a4"
  110. $0.hidden = "$appealType!='其他'"
  111. }
  112. <<< LabelRow("appealReson3"){
  113. $0.title = "事由"
  114. $0.value = self.detailData?.appealDescription
  115. }
  116. }
  117. func initFormStyle(){
  118. LabelRow.defaultCellUpdate = {
  119. cell,row in
  120. cell.textLabel?.font = setting_content_textFont
  121. cell.textLabel?.textColor = setting_content_textColor
  122. //cell.accessoryType = .disclosureIndicator
  123. }
  124. EmailRow.defaultCellUpdate = {
  125. cell,row in
  126. cell.textLabel?.font = setting_content_textFont
  127. cell.textLabel?.textColor = setting_content_textColor
  128. //cell.accessoryType = .disclosureIndicator
  129. }
  130. PhoneRow.defaultCellUpdate = {
  131. cell,row in
  132. cell.textLabel?.font = setting_content_textFont
  133. cell.textLabel?.textColor = setting_content_textColor
  134. //cell.accessoryType = .disclosureIndicator
  135. }
  136. TextRow.defaultCellUpdate = {
  137. cell,row in
  138. cell.textLabel?.font = setting_content_textFont
  139. cell.textLabel?.textColor = setting_content_textColor
  140. }
  141. DateRow.defaultCellUpdate = {
  142. cell,row in
  143. cell.textLabel?.font = setting_content_textFont
  144. cell.textLabel?.textColor = setting_content_textColor
  145. }
  146. ButtonRow.defaultCellUpdate = {
  147. cell,row in
  148. cell.textLabel?.font = setting_item_textFont
  149. cell.textLabel?.theme_textColor = ThemeColorPicker(keyPath: "Base.base_color")
  150. }
  151. ActionSheetRow<String>.defaultCellUpdate = {
  152. cell,row in
  153. cell.textLabel?.font = setting_content_textFont
  154. cell.textLabel?.textColor = setting_content_textColor
  155. }
  156. SegmentedRow<String>.defaultCellUpdate = {
  157. cell,row in
  158. cell.textLabel?.font = setting_content_textFont
  159. cell.textLabel?.textColor = setting_content_textColor
  160. cell.segmentedControl.theme_backgroundColor = ThemeColorPicker(keyPath: "Base.base_color")
  161. cell.segmentedControl.tintColor = UIColor.white
  162. }
  163. }
  164. @IBAction func closeDisplayAction(_ sender: UIBarButtonItem) {
  165. self.dismiss(animated: true, completion: nil)
  166. }
  167. override func didReceiveMemoryWarning() {
  168. super.didReceiveMemoryWarning()
  169. // Dispose of any resources that can be recreated.
  170. }
  171. }