// // MyApprovalBCell.m // smartRhino // // Created by tederen on 2019/11/1. // Copyright © 2019 tederen. All rights reserved. // #import "MyApprovalBCell.h" #import "MyApprovalModel.h" @implementation MyApprovalBCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code self.falgLab.hidden = YES; self.nameBackView.layer.cornerRadius = 23; self.nameBackView.layer.masksToBounds = YES; } - (void)loadSearchData:(Item *)model { if (!ISEmptyString(model.Title)) { self.falgLab.hidden = YES; self.titleNameLab.text = model.Title; self.nameLab.hidden = YES;// ㊗️ switch (model.Summaries.count) { case 0:{ self.firstLab.text = @"请假类型:暂无"; self.secondLab.text = @"开始时间:暂无"; self.thirdLab.text = @"结束时间:暂无"; }break; case 1:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = @"开始时间:暂无"; self.thirdLab.text = @"结束时间:暂无"; }break; case 2:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]]; self.thirdLab.text = @"结束时间:暂无"; }break; default:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]]; self.thirdLab.text = [NSString stringWithFormat:@"%@",model.Summaries[2]]; }break; } self.timeLab.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; if ([model.State isEqualToString:@"Meeting"]) { model.approvalStatus = 2; model.approvalText = @"上会"; self.approvalStatusLab.text = model.approvalText; }else if ([model.State isEqualToString:@"Checked"]) { model.approvalStatus = 1; model.approvalText = @"审批通过"; self.approvalStatusLab.text = model.approvalText; }else if ([model.State isEqualToString:@"Denied"]) { model.approvalStatus = 0; model.approvalText = @"已拒绝"; self.approvalStatusLab.text = model.approvalText; }else if ([model.State isEqualToString:@"Checking"]){ model.approvalStatus = 3; model.approvalText = @"待审核"; self.approvalStatusLab.text = model.approvalText; }else{ model.approvalStatus = 4; model.approvalText = @"待定"; self.approvalStatusLab.text = model.approvalText; } switch (model.approvalStatus) { case 0:// 拒绝 self.approvalStatusLab.textColor = UIColorHex(FF0000); break; case 1:// 通过 self.approvalStatusLab.textColor = UIColorHex(60BE36); break; case 2:// 上会 self.approvalStatusLab.textColor = UIColorHex(#3395F6); break; case 3:// 待审核 self.approvalStatusLab.textColor = UIColorHex(#FFB20C); break; default: self.approvalStatusLab.textColor = UIColorHex(#FFB20C); break; } if (!ISEmptyString(model.AvatarUrl)){ if ([model.AvatarUrl containsString:@"http"]) { [self.iconImage setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholder:IMG(@"zhujun")]; }else{ [self.iconImage setImageWithURL:[NSURL URLWithString:IMGURL(model.AvatarUrl)] placeholder:IMG(@"zhujun")]; } } else { [self.iconImage setImage:kUserDefaultHeadImage]; } } } - (void)loadApprovalData:(MyApprovalModel *)model{ if (!ISEmptyString(model.Title)) { self.falgLab.hidden = model.IsRead; self.titleNameLab.text = model.Title; self.nameLab.hidden = YES;// ㊗️ switch (model.Summaries.count) { case 0:{ self.firstLab.text = @"请假类型:暂无"; self.secondLab.text = @"开始时间:暂无"; self.thirdLab.text = @"结束时间:暂无"; }break; case 1:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = @"开始时间:暂无"; self.thirdLab.text = @"结束时间:暂无"; }break; case 2:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]]; self.thirdLab.text = @"结束时间:暂无"; }break; default:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]]; self.thirdLab.text = [NSString stringWithFormat:@"%@",model.Summaries[2]]; }break; } self.timeLab.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; if ([model.State isEqualToString:@"Meeting"]) { model.approvalStatus = 2; model.approvalText = @"上会"; self.approvalStatusLab.text = model.approvalText; }else if ([model.State isEqualToString:@"Checked"]) { model.approvalStatus = 1; model.approvalText = @"审批通过"; self.approvalStatusLab.text = model.approvalText; }else if ([model.State isEqualToString:@"Denied"]) { model.approvalStatus = 0; model.approvalText = @"已拒绝"; self.approvalStatusLab.text = model.approvalText; }else if ([model.State isEqualToString:@"Checking"]){ model.approvalStatus = 3; model.approvalText = @"待审核"; self.approvalStatusLab.text = model.approvalText; }else{ model.approvalStatus = 4; model.approvalText = @"待定"; self.approvalStatusLab.text = model.approvalText; } switch (model.approvalStatus) { case 0:// 拒绝 self.approvalStatusLab.textColor = UIColorHex(FF0000); break; case 1:// 通过 self.approvalStatusLab.textColor = UIColorHex(60BE36); break; case 2:// 上会 self.approvalStatusLab.textColor = UIColorHex(#3395F6); break; case 3:// 待审核 self.approvalStatusLab.textColor = UIColorHex(#FFB20C); break; default: self.approvalStatusLab.textColor = UIColorHex(#FFB20C); break; } if (!ISEmptyString(model.AvatarUrl)){ if ([model.AvatarUrl containsString:@"http"]) { [self.iconImage setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholder:IMG(@"zhujun")]; }else{ [self.iconImage setImageWithURL:[NSURL URLWithString:IMGURL(model.AvatarUrl)] placeholder:IMG(@"zhujun")]; } } else { [self.iconImage setImage:kUserDefaultHeadImage]; } } } - (void)loadDictionArray:(HomeWaitWorkModel*)model{ if (!ISEmptyString(model.AvatarUrl)){ if ([model.AvatarUrl containsString:@"http"]) { [self.iconImage setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholder:IMG(@"zhujun")]; }else{ [self.iconImage setImageWithURL:[NSURL URLWithString:IMGURL(model.AvatarUrl)] placeholder:IMG(@"zhujun")]; } } if (!ISEmptyString(model.Title)) { self.titleNameLab.text = model.Title; if (!ISEmptyString(model.CreatedDate)){ self.timeLab.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; } self.nameLab.hidden = YES;// ㊗️ self.approvalStatusLab.text = @"待审核"; switch (model.Summaries.count) { case 0:{ self.firstLab.text = @"暂无"; self.secondLab.text = @"暂无"; self.thirdLab.text = @"暂无"; }break; case 1:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = @"暂无"; self.thirdLab.text = @"暂无"; }break; case 2:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]]; self.thirdLab.text = @"暂无"; }break; default:{ self.firstLab.text = [NSString stringWithFormat:@"%@",model.Summaries[0]]; self.secondLab.text = [NSString stringWithFormat:@"%@",model.Summaries[1]]; self.thirdLab.text = [NSString stringWithFormat:@"%@",model.Summaries[2]]; }break; } } if ([model.State isEqualToString:@"Checked"]) { // 审核通过 model.approvalText = @"审批通过"; self.approvalStatusLab.textColor = UIColorHex(60BE36); } else if ([model.State isEqualToString:@"Denied"]) { // 拒绝 model.approvalText = @"已拒绝"; self.approvalStatusLab.textColor = UIColorHex(FF0000); } else if ([model.State isEqualToString:@"Meeting"]) { // 上会 model.approvalText = @"上会"; self.approvalStatusLab.textColor = UIColorHex(#3395F6); }else if ([model.State isEqualToString:@"Checking"]) { // 上会 model.approvalText = @"待审核"; self.approvalStatusLab.textColor = UIColorHex(#FFB20C); } else{ // 待审核 model.approvalText = @"待定"; self.approvalStatusLab.textColor = UIColorHex(#FFB20C); } self.approvalStatusLab.text = model.approvalText; if ([model.Type isEqualToString:@"CarbonCopy"]) { self.approvalStatusLab.text = @"抄送"; self.approvalStatusLab.textColor = UIColorHex(#3395F6); } } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end