123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- //
- // 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
|