MyApprovalDetailCell.m 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. //
  2. // MyApprovalDetailCell.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/11/4.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "MyApprovalDetailCell.h"
  9. #import "MyApprovalDetailModel.h"
  10. #import "FormFieldsModel.h"
  11. #import "MyWordCell.h"
  12. @interface MyApprovalDetailCell()
  13. @property (nonatomic,assign) NSInteger index;
  14. @end
  15. @implementation MyApprovalDetailCell
  16. - (void)awakeFromNib {
  17. [super awakeFromNib];
  18. self.iconBackView.layer.cornerRadius = 20;
  19. self.iconBackView.layer.masksToBounds = YES;
  20. [self.namelab setHidden:YES];
  21. // self.iconImage.backgroundColor = [UIColor redColor];
  22. }
  23. - (void)loadTextCellKey:(NSString *)key withValue:(NSString *)valueString{
  24. if (!ISEmptyString(key)) {
  25. self.keyLabel6.text = key;
  26. }
  27. if (!ISEmptyString(valueString)) {
  28. self.valueLabel6.text = valueString;
  29. }
  30. }
  31. - (void)loadMutbleTextCellKey:(NSString *)key withValue:(NSString *)valueString{
  32. if (!ISEmptyString(key)) {
  33. self.nameLabel9.text = key;
  34. }
  35. if (!ISEmptyString(valueString)) {
  36. self.valueLabel9.text = valueString;
  37. }
  38. }
  39. - (void)loadDetailData:(MyApprovalDetailModel *)model {
  40. if (!ISEmptyString(model.AvatarUrl)) {
  41. [self.iconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
  42. }else {
  43. self.iconImage.image = kUserDefaultHeadImage;
  44. }
  45. self.nameValueLab.text = model.Name;
  46. if ([model.FlowState isEqualToString:@"Meeting"]) {
  47. self.approvalImagview.image = IMG(@"上会");
  48. }else if([model.FlowState isEqualToString:@"Wait"]){
  49. self.approvalImagview.image = IMG(@"待审核");
  50. }else if([model.FlowState isEqualToString:@"Checked"]){
  51. self.approvalImagview.image = IMG(@"审核通过");
  52. }else if([model.FlowState isEqualToString:@"Denied"]){
  53. self.approvalImagview.image = IMG(@"已拒绝");
  54. }else if([model.FlowState isEqualToString:@"Checking"]){
  55. self.approvalImagview.image = IMG(@"待审核");
  56. }
  57. self.departNumberValueLab.text = model.No;
  58. self.departNameValueLab.text = model.DepartmentName;
  59. self.departTimeValueLab.text = model.CreatedDate;
  60. }
  61. - (void)loadDetailDataFormFieldsModel:(FormFieldsModel *)model{
  62. self.keyLabel6.text = model.Label;
  63. self.valueLabel6.text = model.Value;
  64. }
  65. - (IBAction)addFileButtoncell4:(UIButton *)sender {
  66. if (self.touchBlockB1) {
  67. self.touchBlockB1(sender);
  68. }
  69. }
  70. - (IBAction)addPeopleCell5:(UIButton *)sender {
  71. if (self.touchBlockB2) {
  72. self.touchBlockB2(sender);
  73. }
  74. }
  75. + (instancetype)cellWithTableView:(UITableView *)tableView AndIndex:(NSInteger)index {
  76. NSString *ID = [NSString stringWithFormat:@"MyApprovalDetailCell%ld",(long)index];
  77. MyApprovalDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  78. cell.index = index;
  79. if (cell == nil || !cell) {
  80. cell = [[NSBundle mainBundle] loadNibNamed:@"MyApprovalDetailCell" owner:self options:nil][index-1];
  81. }
  82. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  83. return cell;
  84. }
  85. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  86. [super setSelected:selected animated:animated];
  87. }
  88. - (void)loadApprovalData:(NodesModel*)node{
  89. NSLog(@"%@",node);
  90. if (node.Name.length >= 5) {
  91. self.nameLable7.text = [NSString stringWithFormat:@"%@",[node.Name substringToIndex:5]];
  92. }else{
  93. self.nameLable7.text = node.Name;
  94. }
  95. [self.imagView7 setImageWithURL:[NSURL URLWithString:node.AvatarUrl] placeholder:IMG(@"imagePlaceholder")];
  96. self.imagView7.layer.cornerRadius = 20;
  97. self.imagView7.layer.masksToBounds = YES;
  98. if (ISEmptyString(node.Action)) {
  99. self.handerLabel7.text = [NSString stringWithFormat:@"%@",node.Action];
  100. }else{
  101. self.handerLabel7.text = [NSString stringWithFormat:@"%@",node.Action];
  102. }
  103. self.handerLabel27.hidden = YES;
  104. if (ISEmptyString(node.Message)) {
  105. }else{
  106. self.handerLabel37.text = [NSString stringWithFormat:@"审批意见:%@",node.Message];
  107. }
  108. if (node.Action.length == 0) {
  109. self.timeLabel7.text = @"";
  110. }else {
  111. self.timeLabel7.text = [ZYCTool yearMonthAndDayHourMinuesSecond:node.CreatedDate];
  112. }
  113. if ([node.Action isEqualToString:@"同意"]) {
  114. self.handerLabel7.textColor = UIColorHex(#60BE36);
  115. }else if ([node.Action isEqualToString:@"上会"]){
  116. self.handerLabel7.textColor =UIColorHex(#FFB20C);
  117. }else if([node.Action isEqualToString:@"驳回"]){
  118. self.handerLabel7.textColor = UIColorHex(#FF0000);
  119. }else if([node.Action isEqualToString:@"已转审"]){
  120. self.handerLabel7.textColor = UIColorHex(#60BE36);
  121. }else if([node.Action isEqualToString:@"审批中"]){
  122. self.handerLabel7.textColor = UIColorHex(#E9B436);
  123. self.timeLabel7.hidden = YES;
  124. }else{
  125. self.handerLabel7.textColor = k6;
  126. }
  127. }
  128. @end