123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- //
- // MyApprovalDetailCell.m
- // smartRhino
- //
- // Created by tederen on 2019/11/4.
- // Copyright © 2019 tederen. All rights reserved.
- //
- #import "MyApprovalDetailCell.h"
- #import "MyApprovalDetailModel.h"
- #import "FormFieldsModel.h"
- #import "MyWordCell.h"
- @interface MyApprovalDetailCell()
- @property (nonatomic,assign) NSInteger index;
- @end
- @implementation MyApprovalDetailCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- self.iconBackView.layer.cornerRadius = 20;
- self.iconBackView.layer.masksToBounds = YES;
- [self.namelab setHidden:YES];
- // self.iconImage.backgroundColor = [UIColor redColor];
- }
- - (void)loadTextCellKey:(NSString *)key withValue:(NSString *)valueString{
- if (!ISEmptyString(key)) {
- self.keyLabel6.text = key;
- }
- if (!ISEmptyString(valueString)) {
- self.valueLabel6.text = valueString;
- }
- }
- - (void)loadMutbleTextCellKey:(NSString *)key withValue:(NSString *)valueString{
- if (!ISEmptyString(key)) {
- self.nameLabel9.text = key;
- }
- if (!ISEmptyString(valueString)) {
- self.valueLabel9.text = valueString;
- }
- }
- - (void)loadDetailData:(MyApprovalDetailModel *)model {
- if (!ISEmptyString(model.AvatarUrl)) {
- [self.iconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
- }else {
- self.iconImage.image = kUserDefaultHeadImage;
- }
- self.nameValueLab.text = model.Name;
- if ([model.FlowState isEqualToString:@"Meeting"]) {
- self.approvalImagview.image = IMG(@"上会");
- }else if([model.FlowState isEqualToString:@"Wait"]){
- self.approvalImagview.image = IMG(@"待审核");
- }else if([model.FlowState isEqualToString:@"Checked"]){
- self.approvalImagview.image = IMG(@"审核通过");
- }else if([model.FlowState isEqualToString:@"Denied"]){
- self.approvalImagview.image = IMG(@"已拒绝");
- }else if([model.FlowState isEqualToString:@"Checking"]){
- self.approvalImagview.image = IMG(@"待审核");
- }
- self.departNumberValueLab.text = model.No;
- self.departNameValueLab.text = model.DepartmentName;
- self.departTimeValueLab.text = model.CreatedDate;
- }
- - (void)loadDetailDataFormFieldsModel:(FormFieldsModel *)model{
- self.keyLabel6.text = model.Label;
- self.valueLabel6.text = model.Value;
- }
- - (IBAction)addFileButtoncell4:(UIButton *)sender {
-
- if (self.touchBlockB1) {
- self.touchBlockB1(sender);
- }
- }
- - (IBAction)addPeopleCell5:(UIButton *)sender {
-
- if (self.touchBlockB2) {
- self.touchBlockB2(sender);
- }
- }
- + (instancetype)cellWithTableView:(UITableView *)tableView AndIndex:(NSInteger)index {
- NSString *ID = [NSString stringWithFormat:@"MyApprovalDetailCell%ld",(long)index];
- MyApprovalDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
- cell.index = index;
- if (cell == nil || !cell) {
- cell = [[NSBundle mainBundle] loadNibNamed:@"MyApprovalDetailCell" owner:self options:nil][index-1];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- }
- - (void)loadApprovalData:(NodesModel*)node{
- NSLog(@"%@",node);
- if (node.Name.length >= 5) {
- self.nameLable7.text = [NSString stringWithFormat:@"%@",[node.Name substringToIndex:5]];
- }else{
- self.nameLable7.text = node.Name;
- }
-
- [self.imagView7 setImageWithURL:[NSURL URLWithString:node.AvatarUrl] placeholder:IMG(@"imagePlaceholder")];
- self.imagView7.layer.cornerRadius = 20;
- self.imagView7.layer.masksToBounds = YES;
- if (ISEmptyString(node.Action)) {
- self.handerLabel7.text = [NSString stringWithFormat:@"%@",node.Action];
- }else{
- self.handerLabel7.text = [NSString stringWithFormat:@"%@",node.Action];
- }
- self.handerLabel27.hidden = YES;
- if (ISEmptyString(node.Message)) {
- }else{
- self.handerLabel37.text = [NSString stringWithFormat:@"审批意见:%@",node.Message];
- }
- if (node.Action.length == 0) {
- self.timeLabel7.text = @"";
- }else {
- self.timeLabel7.text = [ZYCTool yearMonthAndDayHourMinuesSecond:node.CreatedDate];
- }
- if ([node.Action isEqualToString:@"同意"]) {
- self.handerLabel7.textColor = UIColorHex(#60BE36);
- }else if ([node.Action isEqualToString:@"上会"]){
- self.handerLabel7.textColor =UIColorHex(#FFB20C);
- }else if([node.Action isEqualToString:@"驳回"]){
- self.handerLabel7.textColor = UIColorHex(#FF0000);
- }else if([node.Action isEqualToString:@"已转审"]){
- self.handerLabel7.textColor = UIColorHex(#60BE36);
- }else if([node.Action isEqualToString:@"审批中"]){
- self.handerLabel7.textColor = UIColorHex(#E9B436);
- self.timeLabel7.hidden = YES;
- }else{
- self.handerLabel7.textColor = k6;
- }
- }
- @end
|