MyApprovalBCell.m 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. //
  2. // MyApprovalBCell.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/11/1.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "MyApprovalBCell.h"
  9. #import "MyApprovalModel.h"
  10. @implementation MyApprovalBCell
  11. - (void)awakeFromNib {
  12. [super awakeFromNib];
  13. // Initialization code
  14. self.falgLab.hidden = YES;
  15. self.nameBackView.layer.cornerRadius = 23;
  16. self.nameBackView.layer.masksToBounds = YES;
  17. }
  18. - (void)loadSearchData:(Item *)model
  19. {
  20. if (!ISEmptyString(model.Title)) {
  21. self.falgLab.hidden = YES;
  22. self.titleNameLab.text = model.Title;
  23. self.nameLab.hidden = YES;// ㊗️
  24. switch (model.Summaries.count) {
  25. case 0:{
  26. self.firstLab.text = @"请假类型:暂无";
  27. self.secondLab.text = @"开始时间:暂无";
  28. self.thirdLab.text = @"结束时间:暂无";
  29. }break;
  30. case 1:{
  31. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  32. self.secondLab.text = @"开始时间:暂无";
  33. self.thirdLab.text = @"结束时间:暂无";
  34. }break;
  35. case 2:{
  36. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  37. self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]];
  38. self.thirdLab.text = @"结束时间:暂无";
  39. }break;
  40. default:{
  41. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  42. self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]];
  43. self.thirdLab.text = [NSString stringWithFormat:@"%@",model.Summaries[2]];
  44. }break;
  45. }
  46. self.timeLab.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  47. if ([model.State isEqualToString:@"Meeting"]) {
  48. model.approvalStatus = 2;
  49. model.approvalText = @"上会";
  50. self.approvalStatusLab.text = model.approvalText;
  51. }else if ([model.State isEqualToString:@"Checked"]) {
  52. model.approvalStatus = 1;
  53. model.approvalText = @"审批通过";
  54. self.approvalStatusLab.text = model.approvalText;
  55. }else if ([model.State isEqualToString:@"Denied"]) {
  56. model.approvalStatus = 0;
  57. model.approvalText = @"已拒绝";
  58. self.approvalStatusLab.text = model.approvalText;
  59. }else if ([model.State isEqualToString:@"Checking"]){
  60. model.approvalStatus = 3;
  61. model.approvalText = @"待审核";
  62. self.approvalStatusLab.text = model.approvalText;
  63. }else{
  64. model.approvalStatus = 4;
  65. model.approvalText = @"待定";
  66. self.approvalStatusLab.text = model.approvalText;
  67. }
  68. switch (model.approvalStatus) {
  69. case 0:// 拒绝
  70. self.approvalStatusLab.textColor = UIColorHex(FF0000);
  71. break;
  72. case 1:// 通过
  73. self.approvalStatusLab.textColor = UIColorHex(60BE36);
  74. break;
  75. case 2:// 上会
  76. self.approvalStatusLab.textColor = UIColorHex(#3395F6);
  77. break;
  78. case 3:// 待审核
  79. self.approvalStatusLab.textColor = UIColorHex(#FFB20C);
  80. break;
  81. default:
  82. self.approvalStatusLab.textColor = UIColorHex(#FFB20C);
  83. break;
  84. }
  85. if (!ISEmptyString(model.AvatarUrl)){
  86. if ([model.AvatarUrl containsString:@"http"]) {
  87. [self.iconImage setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholder:IMG(@"zhujun")];
  88. }else{
  89. [self.iconImage setImageWithURL:[NSURL URLWithString:IMGURL(model.AvatarUrl)] placeholder:IMG(@"zhujun")];
  90. }
  91. } else {
  92. [self.iconImage setImage:kUserDefaultHeadImage];
  93. }
  94. }
  95. }
  96. - (void)loadApprovalData:(MyApprovalModel *)model{
  97. if (!ISEmptyString(model.Title)) {
  98. self.falgLab.hidden = model.IsRead;
  99. self.titleNameLab.text = model.Title;
  100. self.nameLab.hidden = YES;// ㊗️
  101. switch (model.Summaries.count) {
  102. case 0:{
  103. self.firstLab.text = @"请假类型:暂无";
  104. self.secondLab.text = @"开始时间:暂无";
  105. self.thirdLab.text = @"结束时间:暂无";
  106. }break;
  107. case 1:{
  108. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  109. self.secondLab.text = @"开始时间:暂无";
  110. self.thirdLab.text = @"结束时间:暂无";
  111. }break;
  112. case 2:{
  113. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  114. self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]];
  115. self.thirdLab.text = @"结束时间:暂无";
  116. }break;
  117. default:{
  118. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  119. self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]];
  120. self.thirdLab.text = [NSString stringWithFormat:@"%@",model.Summaries[2]];
  121. }break;
  122. }
  123. self.timeLab.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  124. if ([model.State isEqualToString:@"Meeting"]) {
  125. model.approvalStatus = 2;
  126. model.approvalText = @"上会";
  127. self.approvalStatusLab.text = model.approvalText;
  128. }else if ([model.State isEqualToString:@"Checked"]) {
  129. model.approvalStatus = 1;
  130. model.approvalText = @"审批通过";
  131. self.approvalStatusLab.text = model.approvalText;
  132. }else if ([model.State isEqualToString:@"Denied"]) {
  133. model.approvalStatus = 0;
  134. model.approvalText = @"已拒绝";
  135. self.approvalStatusLab.text = model.approvalText;
  136. }else if ([model.State isEqualToString:@"Checking"]){
  137. model.approvalStatus = 3;
  138. model.approvalText = @"待审核";
  139. self.approvalStatusLab.text = model.approvalText;
  140. }else{
  141. model.approvalStatus = 4;
  142. model.approvalText = @"待定";
  143. self.approvalStatusLab.text = model.approvalText;
  144. }
  145. switch (model.approvalStatus) {
  146. case 0:// 拒绝
  147. self.approvalStatusLab.textColor = UIColorHex(FF0000);
  148. break;
  149. case 1:// 通过
  150. self.approvalStatusLab.textColor = UIColorHex(60BE36);
  151. break;
  152. case 2:// 上会
  153. self.approvalStatusLab.textColor = UIColorHex(#3395F6);
  154. break;
  155. case 3:// 待审核
  156. self.approvalStatusLab.textColor = UIColorHex(#FFB20C);
  157. break;
  158. default:
  159. self.approvalStatusLab.textColor = UIColorHex(#FFB20C);
  160. break;
  161. }
  162. if (!ISEmptyString(model.AvatarUrl)){
  163. if ([model.AvatarUrl containsString:@"http"]) {
  164. [self.iconImage setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholder:IMG(@"zhujun")];
  165. }else{
  166. [self.iconImage setImageWithURL:[NSURL URLWithString:IMGURL(model.AvatarUrl)] placeholder:IMG(@"zhujun")];
  167. }
  168. } else {
  169. [self.iconImage setImage:kUserDefaultHeadImage];
  170. }
  171. }
  172. }
  173. - (void)loadDictionArray:(HomeWaitWorkModel*)model{
  174. if (!ISEmptyString(model.AvatarUrl)){
  175. if ([model.AvatarUrl containsString:@"http"]) {
  176. [self.iconImage setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholder:IMG(@"zhujun")];
  177. }else{
  178. [self.iconImage setImageWithURL:[NSURL URLWithString:IMGURL(model.AvatarUrl)] placeholder:IMG(@"zhujun")];
  179. }
  180. }
  181. if (!ISEmptyString(model.Title)) {
  182. self.titleNameLab.text = model.Title;
  183. if (!ISEmptyString(model.CreatedDate)){
  184. self.timeLab.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  185. }
  186. self.nameLab.hidden = YES;// ㊗️
  187. self.approvalStatusLab.text = @"待审核";
  188. switch (model.Summaries.count) {
  189. case 0:{
  190. self.firstLab.text = @"暂无";
  191. self.secondLab.text = @"暂无";
  192. self.thirdLab.text = @"暂无";
  193. }break;
  194. case 1:{
  195. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  196. self.secondLab.text = @"暂无";
  197. self.thirdLab.text = @"暂无";
  198. }break;
  199. case 2:{
  200. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  201. self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]];
  202. self.thirdLab.text = @"暂无";
  203. }break;
  204. default:{
  205. self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]];
  206. self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]];
  207. self.thirdLab.text = [NSString stringWithFormat:@"%@",model.Summaries[2]];
  208. }break;
  209. }
  210. }
  211. if ([model.State isEqualToString:@"Checked"]) {
  212. // 审核通过
  213. model.approvalText = @"审批通过";
  214. self.approvalStatusLab.textColor = UIColorHex(60BE36);
  215. }
  216. else if ([model.State isEqualToString:@"Denied"]) {
  217. // 拒绝
  218. model.approvalText = @"已拒绝";
  219. self.approvalStatusLab.textColor = UIColorHex(FF0000);
  220. }
  221. else if ([model.State isEqualToString:@"Meeting"]) {
  222. // 上会
  223. model.approvalText = @"上会";
  224. self.approvalStatusLab.textColor = UIColorHex(#3395F6);
  225. }else if ([model.State isEqualToString:@"Checking"]) {
  226. // 上会
  227. model.approvalText = @"待审核";
  228. self.approvalStatusLab.textColor = UIColorHex(#FFB20C);
  229. }
  230. else{
  231. // 待审核
  232. model.approvalText = @"待定";
  233. self.approvalStatusLab.textColor = UIColorHex(#FFB20C);
  234. }
  235. self.approvalStatusLab.text = model.approvalText;
  236. if ([model.Type isEqualToString:@"CarbonCopy"]) {
  237. self.approvalStatusLab.text = @"抄送";
  238. self.approvalStatusLab.textColor = UIColorHex(#3395F6);
  239. }
  240. }
  241. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  242. [super setSelected:selected animated:animated];
  243. // Configure the view for the selected state
  244. }
  245. @end