// // MyApprovalPageDetail.m // smartRhino // // Created by tederen on 2019/11/4. // Copyright © 2019 tederen. All rights reserved. // #import "MyApprovalPageDetail.h" #import "DrawerView.h" #import "TabBarController.h" #import "MyApprovalDetailCell.h" #import "MyApprovalDetailModel.h" #import "TDNavigationBar.h" #import "MyWorkFlowFooterView.h" #import "GoDisscussView.h" #import "AgreeApprovalViewControllerSub.h" #import "DownFileViewController.h" #import "NextApprovalViewController.h" #import "MyApprovalFileCell.h" #import "NoteBookShareVC.h" #import "MyWorkWordVC.h" #import "MyTDTopicCreateVC.h" #import "MyTDGroupViewController.h" #import "MoveViewController.h" #import "HomeDetailController.h" #import "ChatMsgNoticeDetailVC.h" #import "MyTDTopicDetailVC.h" #import "TDInterLeterDetailVC.h" #import "NoteBookDetailVC.h" #import "TDGroupInfoListVC.h" #import "WorkFlowDetailsController.h" #import "ShareListVC.h" @interface MyApprovalPageDetail () @property (nonatomic, strong) TDNavigationBar *myNavigationBar; @property (nonatomic, strong) UIView *myBackImageView; @property (nonatomic, strong) TDTableView *mytableView; @property (nonatomic, strong) MyWorkFlowFooterView *myfooterView2; @property (nonatomic, strong) MyApprovalDetailModel *currentModel; @property (strong, nonatomic) NoteBookShareVC *noteBookShareVC; //@property (assign, nonatomic) NSInteger fristStatusIndex; @property (nonatomic, strong) DrawerView *drawerView; @end @implementation MyApprovalPageDetail - (void)viewDidLoad { [super viewDidLoad]; self.fd_prefersNavigationBarHidden = YES; self.view.backgroundColor = UIColorHex(eeeeee); self.myNavigationBar.titleLabel.text = self.title; self.myNavigationBar.titleLabel.font = [UIFont systemFontOfSize:19.0]; self.mytableView.backgroundColor = UIColorHex(eeeeee); [self.view addSubview:self.mytableView]; [self.view addSubview:self.myBackImageView]; [self.view addSubview:self.myNavigationBar]; [self getData]; [[UtilsTools getWindow] addSubview:self.noteBookShareVC.view]; } #pragma mark - 审核状态决定页面控件展示 - (void)loadCustomFooterFromStatus:(NSString *)stats{ switch (self.pageType) { case Type_ONEA: [self loadCustomFooterFromPageTypeA:stats]; break; case Type_ONEB: [self loadCustomFooterFromPageTypeB:stats]; break; case Type_ONEC: // [self loadCustomFooterFromPageTypeC]; break; } } #pragma mark - 底部按钮视图 - (void)loadCustomFooterFromPageTypeA:(NSString *)stats{ if ([stats isEqualToString:@"Wait"]) { [self footerVieWhenWaitApproval]; _myfooterView2.agreeView.nameLab.text = @"同意"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer1"); _myfooterView2.noAgreeView.nameLab.text = @"驳回"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer"); _myfooterView2.nextAggreView.nameLab.text = @"转审"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer3"); _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/3,75); _myfooterView2.noAgreeView.frame = CGRectMake(kGXScreenWidth/3,0,kGXScreenWidth/3,75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/3 * 2,0,kGXScreenWidth/3,75); _myfooterView2.agreeView.button.tag = 130; _myfooterView2.noAgreeView.button.tag = 131; _myfooterView2.nextAggreView.button.tag = 123; _myfooterView2.disscusView.hidden = YES; _myfooterView2.waitView.hidden = YES; _myfooterView2.noAgreeView.hidden = NO; _myfooterView2.nextAggreView.hidden = NO; _myfooterView2.agreeView.hidden = NO; }else if ([stats isEqualToString:@"Checked"]){ }else if ([stats isEqualToString:@"Meeting"]){ [self footerVieWhenWaitApproval]; _myfooterView2.agreeView.nameLab.text = @"同意"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer1"); _myfooterView2.noAgreeView.nameLab.text = @"驳回"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer"); _myfooterView2.waitView.nameLab.text = @"待定"; _myfooterView2.waitView.imageVIew.image = IMG(@"work_footer_wait"); _myfooterView2.disscusView.nameLab.text = @"撤会"; _myfooterView2.disscusView.imageVIew.image = IMG(@"work_footer2"); _myfooterView2.nextAggreView.nameLab.text = @"转审"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer3"); _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/5,75); _myfooterView2.noAgreeView.frame = CGRectMake(kGXScreenWidth/5,0, kGXScreenWidth/5, 75); _myfooterView2.waitView.frame = CGRectMake(kGXScreenWidth/5*2,0,kGXScreenWidth/5,75); _myfooterView2.disscusView.frame = CGRectMake(kGXScreenWidth/5*3,0, kGXScreenWidth/5, 75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/5*4,0, kGXScreenWidth/5, 75); _myfooterView2.agreeView.button.tag = 130; _myfooterView2.noAgreeView.button.tag = 131; _myfooterView2.disscusView.button.tag = 121; _myfooterView2.nextAggreView.button.tag = 123; _myfooterView2.waitView.button.tag = 124; _myfooterView2.disscusView.hidden = NO; _myfooterView2.waitView.hidden = NO; _myfooterView2.noAgreeView.hidden = NO; _myfooterView2.nextAggreView.hidden = NO; _myfooterView2.agreeView.hidden = NO; }else if ([stats isEqualToString:@"Checking"]){ [self footerVieWhenWaitApproval]; _myfooterView2.agreeView.nameLab.text = @"同意"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer1"); _myfooterView2.noAgreeView.nameLab.text = @"驳回"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer"); _myfooterView2.disscusView.nameLab.text = @"上会"; _myfooterView2.disscusView.imageVIew.image = IMG(@"work_footer2"); _myfooterView2.nextAggreView.nameLab.text = @"转审"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer3"); _myfooterView2.agreeView.button.tag = 130; _myfooterView2.noAgreeView.button.tag = 131; _myfooterView2.disscusView.button.tag = 132; _myfooterView2.nextAggreView.button.tag = 133; _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/4,75); _myfooterView2.noAgreeView.frame = CGRectMake(kGXScreenWidth/4,0,kGXScreenWidth/4,75); _myfooterView2.disscusView.frame = CGRectMake(kGXScreenWidth/4 * 2,0,kGXScreenWidth/4,75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/4 * 3,0,kGXScreenWidth/4,75); _myfooterView2.waitView.hidden = YES; _myfooterView2.disscusView.hidden = NO; _myfooterView2.noAgreeView.hidden = NO; _myfooterView2.nextAggreView.hidden = NO; _myfooterView2.agreeView.hidden = NO; }else{///Denied 拒绝 } } - (void)loadCustomFooterFromPageTypeB:(NSString *)stats{ if ([stats isEqualToString:@"Wait"]) { [self footerVieWhenWaitApproval]; _myfooterView2.agreeView.nameLab.text = @"催办"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer7"); _myfooterView2.noAgreeView.nameLab.text = @"撤销"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer9"); _myfooterView2.nextAggreView.nameLab.text = @"重新提交"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer3"); _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/3,75); _myfooterView2.noAgreeView.frame = CGRectMake(kGXScreenWidth/3,0,kGXScreenWidth/3,75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/3 + kGXScreenWidth/3-30,0,kGXScreenWidth/3,75); _myfooterView2.agreeView.button.tag = 220; _myfooterView2.noAgreeView.button.tag = 221; _myfooterView2.nextAggreView.button.tag = 223; _myfooterView2.disscusView.hidden = YES; _myfooterView2.waitView.hidden = YES; _myfooterView2.noAgreeView.hidden = NO; _myfooterView2.nextAggreView.hidden = NO; _myfooterView2.agreeView.hidden = NO; }else if ([stats isEqualToString:@"Checked"]){ [self footerVieWhenWaitApproval]; _myfooterView2.agreeView.nameLab.text = @"下载"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer6"); _myfooterView2.noAgreeView.hidden = YES; _myfooterView2.disscusView.hidden = YES; _myfooterView2.waitView.hidden = YES; _myfooterView2.nextAggreView.hidden = YES; _myfooterView2.agreeView.hidden = NO; _myfooterView2.agreeView.button.tag = 200; }else if ([stats isEqualToString:@"Meeting"]){ [self footerVieWhenWaitApproval]; _myfooterView2.agreeView.nameLab.text = @"催办"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer7"); _myfooterView2.noAgreeView.nameLab.text = @"撤销"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer9"); _myfooterView2.nextAggreView.nameLab.text = @"重新提交"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer3"); _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/3,75); _myfooterView2.noAgreeView.frame = CGRectMake(kGXScreenWidth/3,0,kGXScreenWidth/3,75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/3 * 2,0,kGXScreenWidth/3,75); _myfooterView2.agreeView.button.tag = 220; _myfooterView2.noAgreeView.button.tag = 221; _myfooterView2.disscusView.hidden = YES; _myfooterView2.waitView.hidden = YES; _myfooterView2.agreeView.hidden = NO; _myfooterView2.noAgreeView.hidden = NO; _myfooterView2.nextAggreView.hidden = NO; _myfooterView2.nextAggreView.button.tag = 223; }else if ([stats isEqualToString:@"Checking"]){ [self footerVieWhenWaitApproval]; _myfooterView2.agreeView.nameLab.text = @"催办"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer7"); _myfooterView2.noAgreeView.nameLab.text = @"撤销"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer9"); _myfooterView2.nextAggreView.nameLab.text = @"重新提交"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"重新加载"); _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/3,75); _myfooterView2.noAgreeView.frame = CGRectMake(kGXScreenWidth/3,0,kGXScreenWidth/3,75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/3 * 2,0,kGXScreenWidth/3,75); _myfooterView2.disscusView.hidden = YES; _myfooterView2.waitView.hidden = YES; _myfooterView2.agreeView.hidden = NO; _myfooterView2.noAgreeView.hidden = NO; _myfooterView2.nextAggreView.hidden = NO; _myfooterView2.agreeView.button.tag = 230; _myfooterView2.noAgreeView.button.tag = 231; _myfooterView2.nextAggreView.button.tag = 233; }else{///Denied 拒绝 [self footerVieWhenWaitApproval]; _myfooterView2.agreeView.nameLab.text = @"下载"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer6"); _myfooterView2.noAgreeView.hidden = YES; _myfooterView2.waitView.hidden = YES; _myfooterView2.disscusView.hidden = YES; _myfooterView2.nextAggreView.hidden = NO; _myfooterView2.agreeView.hidden = NO; _myfooterView2.nextAggreView.nameLab.text = @"重新提交"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer8"); _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/3,75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/3 * 2,0,kGXScreenWidth/3,75); _myfooterView2.agreeView.button.tag = 200; _myfooterView2.nextAggreView.button.tag = 203; } } - (void)loadCustomFooterFromPageTypeC{ [self footerVieWhenWaitApproval]; } - (void)footerVieWhenWaitApproval{ _mytableView.frame = CGRectMake(0,kNavigationHeight,kGXScreenWidth, kGXScreenHeigh - kNavigationHeight-75) ; self.myfooterView2.frame = CGRectMake(0,kGXScreenHeigh - 75, kGXScreenWidth, 75); [self.view addSubview:self.myfooterView2]; } - (void)footButtonHander:(UIButton *)sender{ } #pragma mark - 导航栏事件处理 -(void)back{ if (self.navigationController.viewControllers.count > 1) { [self.navigationController popViewControllerAnimated:YES]; }else{ [self dismissViewControllerAnimated:YES completion:nil]; } } #pragma mark - UITableViewDelegate,UITableViewDataSource - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return 4; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ if (section == 0) { return 1; } if (section == 1) { return self.currentModel.FlowAttachments.count > 0 ? self.currentModel.FormFields.count + 1 : self.currentModel.FormFields.count; } if (section == 2) { return 1 + self.currentModel.Nodes.count; } if (section == 3) { return 1; } return 1; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ switch (indexPath.section) { case 0: return 180; break; case 1:{ if (indexPath.row == self.currentModel.FormFields.count) { return self.currentModel.FlowAttachments.count > 0 ? 140 : 0.01f; } FormFieldsModel * formFieldsModel = self.currentModel.FormFields[indexPath.row]; if ([formFieldsModel.Type isEqualToString:@"Number"] || [formFieldsModel.Type isEqualToString:@"Currency"] || [formFieldsModel.Type isEqualToString:@"DateTime"] || [formFieldsModel.Type isEqualToString:@"Radio"])//单行文本 { if (self.currentModel.FlowAttachments.count == 0 && indexPath.row == self.currentModel.FormFields.count - 1) { return 50.f; } return 40; } else if ([formFieldsModel.Type isEqualToString:@"Text"])//单行文本 { UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH - 112.5, 10)]; label.numberOfLines = 0; label.text = formFieldsModel.Value; CGSize maxSize = CGSizeMake(label.frame.size.width, CGFLOAT_MAX); CGSize newSize = [label sizeThatFits:maxSize]; if (self.currentModel.FlowAttachments.count == 0 && indexPath.row == self.currentModel.FormFields.count - 1) { return newSize.height + 30; } return newSize.height + 20; } else if ([formFieldsModel.Type isEqualToString:@"TextArea"])//多行文本 { return formFieldsModel.getCellHeight; } else if ([formFieldsModel.Type isEqualToString:@"Picture"])//图片 { return 120; } return 0.01; }break; case 2: { if (indexPath.row == 0) { return 40; }else{ NodesModel * model = self.currentModel.Nodes[indexPath.row - 1]; UILabel * label = [UILabel new]; label.numberOfLines = 0; label.text = [NSString stringWithFormat:@"审批意见:%@",model.Message]; label.font = [UIFont systemFontOfSize:12]; CGSize size = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH - 85, 15)]; if (model.Message.length > 0) { return 70 + (size.height > 15 ? size.height : 15); }else{ return 70; } } }break; default: { NSString * title = [NSString stringWithFormat:@"抄送人:%@",self.currentModel.CarbonCopies.length > 0 ? self.currentModel.CarbonCopies : @"无"]; UILabel * label = [UILabel new]; label.numberOfLines = 0; label.text = title; label.font = [UIFont systemFontOfSize:16]; CGFloat H = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH - 30, 10)].height; return H + 10; } break; } } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ WS(weakSelf); if (indexPath.section == 0) { MyApprovalDetailCell *cell = [MyApprovalDetailCell cellWithTableView:tableView AndIndex:1]; [cell loadDetailData: self.currentModel]; return cell; }else if (indexPath.section == 1) { if (indexPath.row == self.currentModel.FormFields.count) { MyApprovalFileCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyApprovalFileCell"]; [cell loadFile:@"附件" forWithImageArray:self.currentModel.FlowAttachments]; cell.ClickCellModelBlock = ^(FlowAttachmentsModel * model) { [weakSelf pushFileOpenWithModel:model]; }; return cell; } FormFieldsModel * formFieldsModel = self.currentModel.FormFields[indexPath.row]; if ([formFieldsModel.Type isEqualToString:@"Radio"] || [formFieldsModel.Type isEqualToString:@"Number"] || [formFieldsModel.Type isEqualToString:@"Currency"] || [formFieldsModel.Type isEqualToString:@"DateTime"] )//单行文本 { MyApprovalDetailCell *cell = [MyApprovalDetailCell cellWithTableView:tableView AndIndex:6]; [cell loadTextCellKey:formFieldsModel.Label withValue:formFieldsModel.Value]; return cell; } else if ([formFieldsModel.Type isEqualToString:@"Text"] )//多行文本 { MyApprovalDetailCell *cell = [MyApprovalDetailCell cellWithTableView:tableView AndIndex:6]; [cell loadTextCellKey:formFieldsModel.Label withValue:formFieldsModel.Value]; return cell; } else if ([formFieldsModel.Type isEqualToString:@"TextArea"] )//多行文本 { MyApprovalDetailCell *cell = [MyApprovalDetailCell cellWithTableView:tableView AndIndex:9]; [cell loadMutbleTextCellKey:formFieldsModel.Label withValue:formFieldsModel.Value]; return cell; }else{ MyApprovalDetailCell *cell = [MyApprovalDetailCell cellWithTableView:tableView AndIndex:6]; cell.contentView.hidden = YES; // [cell loadTextCellKey:@"提交时间" withValue:self.currentModel.CreatedDate]; return cell; } }else if (indexPath.section == 2) { if (indexPath.row == 0){ MyApprovalDetailCell *cell = [MyApprovalDetailCell cellWithTableView:tableView AndIndex:8]; cell.nameLabel8.text = @"审批流程"; return cell; }else{ MyApprovalDetailCell *cell = [MyApprovalDetailCell cellWithTableView:tableView AndIndex:7]; if (self.currentModel.Nodes.count > 0) { [cell loadApprovalData:self.currentModel.Nodes[indexPath.row - 1]]; if (indexPath.row == 1) { cell.topLineView.hidden = YES; } if (indexPath.row == self.currentModel.Nodes.count) { cell.bottomLineView.hidden = YES; } } return cell; } }else{ MyApprovalDetailCell *cell = [MyApprovalDetailCell cellWithTableView:tableView AndIndex:8]; cell.nameLabel8.numberOfLines = 0; cell.nameLabel8.text = [NSString stringWithFormat:@"抄送人:%@",self.currentModel.CarbonCopies.length > 0 ? self.currentModel.CarbonCopies : @"无"]; return cell; } return nil; } - (void)pushFileOpenWithModel:(FlowAttachmentsModel *)model { WS(weakSelf); if (model.SoureId == 0) { model.SoureId = model.Id; } switch (model.SoureTypeId) { case CollectModel_Aritle: { SHOWLOADING [[HttpManager sharedHttpManager] GETWithUrl:[NSString stringWithFormat:@"%@%ld",Article_Detail_Get,(long)model.SoureId] parameters:@{} success:^(id _Nonnull responseObject) { REMOVESHOW; Item *itemModel = [[Item alloc]initWithDictionary:responseObject error:nil]; // HomeDetailController *homeDetail = [[HomeDetailController alloc] init]; // [homeDetail loadCurrentModel:itemModel]; // [weakSelf.navigationController pushViewController:homeDetail animated:YES]; MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_Aritle; vc.Id = itemModel.Id; [weakSelf.navigationController pushViewController:vc animated:YES]; } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]); }]; } break; case CollectModel_Toipc: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_Toipc; vc.Id = model.SoureId; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_NewTopic: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_NewTopic; vc.Id = model.SoureId; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_Collect: { } break; case CollectModel_NoteBook: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_NoteBook; vc.Id = model.SoureId; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_Notice: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_Notice; vc.Id = model.SoureId; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_InterMail: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_InterMail; vc.Id = model.SoureId; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_Group: { TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC]; vc.GroupId = model.SoureId; vc.titleStr = model.Title; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_meetMian: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_meetMian; vc.Id = model.SoureId; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_meetDetail: { WorkFlowDetailsController * vc = [[WorkFlowDetailsController alloc] initWithId:model.SoureId]; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_work: { MyApprovalPageDetail * vc = [[MyApprovalPageDetail alloc]init]; vc.pageType = Type_ONEC; vc.indexId = model.SoureId; vc.title = model.Title; vc.TodoId = self.currentModel.TodoId; [self.navigationController pushViewController:vc animated:YES]; } break; default: { DownFileViewController *vc = [[DownFileViewController alloc]init]; vc.model = model; [self.navigationController pushViewController:vc animated:YES]; } break; } } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.section == 1){ FormFieldsModel * formFieldsModel = self.currentModel.FormFields[indexPath.row]; if ([formFieldsModel.Type isEqualToString:@"Attachment"])//附件 { NSLog(@"%@",formFieldsModel.paraImage); } } } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return section == 2 ? 1 : 20; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return 0.01f; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 1)]; view.backgroundColor = [UIColor clearColor]; return view; } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, section == 2 ? 1 :20)]; view.backgroundColor = [UIColor clearColor]; return view; } - (void)rightButtonAction:(TDButton *)sender{ [self.noteBookShareVC initNoteBookShareData]; // self.noteBookShareVC.isWork = YES; self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden; } - (NoteBookShareVC *)noteBookShareVC{ if (_noteBookShareVC == nil) { _noteBookShareVC = [NoteBookShareVC initNoteBookShareVC]; [_noteBookShareVC.view setFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT)]; [_noteBookShareVC.view setHidden:YES]; _noteBookShareVC.delegate = self; } return _noteBookShareVC; } #pragma mark - 分享 -(void)userSelectType:(NSString *)typeName WithIndexPath:(NSIndexPath *)indexPath{ self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden; if ([typeName isEqualToString:@"发给微信好友"]) { [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession title:self.title desc:[NSString stringWithFormat:@"来自-%@",self.currentModel.UserName] url:[NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/approvalWx?"),(long)self.indexId]]; }else if ([typeName isEqualToString:@"发到朋友圈"]){ [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine title:self.title desc:[NSString stringWithFormat:@"来自-%@",self.currentModel.UserName] url:[NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/approvalWx?"),(long)self.indexId]]; }else if ([typeName isEqualToString:@"发到微博"]){ [self shareWebPageToPlatformType:UMSocialPlatformType_Sina title:self.title desc:[NSString stringWithFormat:@"来自-%@",self.currentModel.UserName] url:[NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/approvalWx?"),(long)self.indexId]]; }else if ([typeName isEqualToString:@"发给QQ好友"]){ [self shareWebPageToPlatformType:UMSocialPlatformType_QQ title:self.title desc:[NSString stringWithFormat:@"来自-%@",self.currentModel.UserName] url:[NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/approvalWx?"),(long)self.indexId]]; }else if ([typeName isEqualToString:@"发到消息"]){ [self returnToMessage]; }else if ([typeName isEqualToString:@"发到小组"]){ [self returnToGroup]; }else if ([typeName isEqualToString:@"发到笔记"]){ [self returnToNote]; }else if ([typeName isEqualToString:@"发到话题"]){ [self returnToTopic]; }else{ } } - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType title:(NSString *)title desc:(NSString *)desc url:(NSString *)url { //创建分享消息对象 UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject]; messageObject.title = title; //创建网页内容对象 UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:desc thumImage:[UIImage imageNamed:@"审批"]]; //设置网页地址 shareObject.webpageUrl = url; //分享消息对象设置分享内容对象 messageObject.shareObject = shareObject; //调用分享接口 [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) { if (error) { NSLog(@"************Share fail with error %@*********",error); }else{ NSLog(@"response data is %@",data); } }]; } - (void)returnToMessage { ShareListVC * vc = [ShareListVC initShareListVC]; FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init]; model.SoureId = self.indexId; model.SoureTypeId = CollectModel_work; model.Title = self.title; model.Author = self.currentModel.UserName; vc.sendModel = model; vc.isReturn = YES; [self.navigationController pushViewController:vc animated:YES]; } - (void)returnToGroup { MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init]; vc.type = CollectModel_Group; FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init]; model.SoureId = self.indexId; model.SoureTypeId = CollectModel_work; model.Title = self.title; model.Author = self.currentModel.UserName; vc.sendModel = model; vc.isReturn = YES; [self.navigationController pushViewController:vc animated:YES]; } - (void)returnToNote { MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC]; vc.type = CollectModel_NoteBook; FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init]; model.SoureId = self.indexId; model.SoureTypeId = CollectModel_work; model.Title = self.title; model.Author = self.currentModel.UserName; vc.sendModel = model; vc.isReturn = YES; [self.navigationController pushViewController:vc animated:YES]; } - (void)returnToTopic { MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC]; vc.type = CollectModel_NewTopic; FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init]; model.SoureId = self.indexId; model.SoureTypeId = CollectModel_work; model.Title = self.title; model.Author = self.currentModel.UserName; vc.sendModel = model; vc.isReturn = YES; [self.navigationController pushViewController:vc animated:YES]; } #pragma mark - setter - (TDTableView *)mytableView{ if (!_mytableView) { _mytableView = [[TDTableView alloc]init]; _mytableView.frame = CGRectMake(0,kNavigationHeight,kGXScreenWidth, kGXScreenHeigh - kNavigationHeight - kiphoneXBootomHeight); _mytableView.delegate = self; _mytableView.dataSource = self; _mytableView.sectionHeaderHeight = 0; // [_mytableView registerNib:[UINib nibWithNibName:@"MyApprovalBCell" bundle:nil] forCellReuseIdentifier:@"MyApprovalBCell"]; [_mytableView registerNib:[UINib nibWithNibName:@"MyApprovalFileCell" bundle:nil] forCellReuseIdentifier:@"MyApprovalFileCell"]; } return _mytableView; } - (MyWorkFlowFooterView *)myfooterView2{ if (!_myfooterView2) { _myfooterView2 = [[MyWorkFlowFooterView alloc]initWithFrame:CGRectMake(0,kGXScreenHeigh - 75, kGXScreenWidth, 75)]; _myfooterView2.agreeView.nameLab.text = @"同意"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer1"); _myfooterView2.noAgreeView.nameLab.text = @"驳回"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer"); _myfooterView2.disscusView.nameLab.text = @"上会"; _myfooterView2.disscusView.imageVIew.image = IMG(@"work_footer2"); _myfooterView2.nextAggreView.nameLab.text = @"转审"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer3"); _myfooterView2.delegate = self; } return _myfooterView2; } - (TDNavigationBar *)myNavigationBar{ if (!_myNavigationBar) { _myNavigationBar = [[TDNavigationBar alloc]initNavigationBar]; _myNavigationBar.delegate = self; _myNavigationBar.backButton2.hidden = NO; _myNavigationBar.titleLabel.textColor = UIColorHex(#FFFFFF); _myNavigationBar.titleLabel.font = [UIFont systemFontOfSize:19.f]; [_myNavigationBar.backButton2 setImage:IMG(@"快捷跳转") forState:UIControlStateNormal]; [_myNavigationBar.backButton setImage:IMG(@"工作_返回") forState:UIControlStateNormal]; _myNavigationBar.rightButton.hidden = NO; [_myNavigationBar.rightButton setImage:IMG(@"shareWhile") forState:UIControlStateNormal]; } return _myNavigationBar; } - (UIView *)myBackImageView{ if (!_myBackImageView) { _myBackImageView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kGXScreenHeigh, kNavigationHeight)]; _myBackImageView.backgroundColor = [UIColor colorWithRed:92/255.0 green:118.0/255.0 blue:167.0/255.f alpha:1.0]; } return _myBackImageView; } - (void)backButtonAction { [self back]; } - (void)backButtonAction2:(UIButton *)sender { [self secondBarButtonItems]; } - (void)secondBarButtonItems{ [self.view endEditing:YES]; [[UtilsTools getWindow] addSubview:self.drawerView]; WS(weakSelf); self.drawerView.SelectDrawerBlock = ^(NSIndexPath * _Nonnull indexPath) { if (![weakSelf.tabBarController isKindOfClass:[TabBarController class]]) { [TabBarController sharedTabBarController].tabBar.hidden = NO; [weakSelf.tabBarController.navigationController popViewControllerAnimated:NO]; } if ([weakSelf.navigationController.viewControllers count] > 1) { [weakSelf.navigationController popToRootViewControllerAnimated:NO]; } switch (indexPath.section) { case 0: { [[TabBarController sharedTabBarController] setSelectedIndex:indexPath.row]; } break; case 1: { switch (indexPath.row) { case 0: { [[TabBarController sharedTabBarController] setSelectedIndex:2]; } break; case 1: { [[TabBarController sharedTabBarController] setSelectedIndex:2]; } break; default: { [[TabBarController sharedTabBarController] setSelectedIndex:3]; } break; } dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [[NSNotificationCenter defaultCenter] postNotificationName:DRAWERPUSHVC object:nil userInfo:@{VCINDEX:@(indexPath.row)}]; }); } break; default: { [[TabBarController sharedTabBarController] setSelectedIndex:3]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [[NSNotificationCenter defaultCenter] postNotificationName:DRAWERPUSHVC object:nil userInfo:@{VCINDEX:@(4 + indexPath.row)}]; }); } break; } }; self.drawerView.frame = CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT);// - kNavigationHeight } - (MyApprovalDetailModel *)currentModel{ if (!_currentModel) { _currentModel = [[MyApprovalDetailModel alloc] init]; } return _currentModel; } #pragma mark - 审批操作事件处理 - (void)didMyWorkFlowFooterViewBack:(NSInteger)index { if (index == 130){ //同意 [self aggreeApprovalHander:@"审批意见"]; } if (index == 131 ){ //驳回 [self refuseApproval]; } if (index == 132){// 上会 [self goDisscuss]; } if (index == 133 || index == 123){// 转审 [self goNextApproval:@"转审"]; } if (index == 120){//会议结论 [self goDisscusText]; } if (index == 121){// 撤销上会 [self deleteDiscussText]; } if (index == 200 || index == 210){//下载 [self dowonLoadAddFile]; } if (index == 203|| index == 223 || index == 233){//重新提交 [self secondCommit]; } if (index == 220 || index == 230){//催办 [self goWorkWork]; } if (index == 221 ||index == 231){//撤销 [self deleteApproval]; } if (index == 124){//待定 [self waitDisscuss]; } } ///同意 - (void)aggreeApprovalHander:(NSString *)titleName{ AgreeApprovalViewControllerSub * agreeApprovalViewControllerSub = [[AgreeApprovalViewControllerSub alloc] init]; agreeApprovalViewControllerSub.title = titleName; agreeApprovalViewControllerSub.TodoId = self.currentModel.TodoId; agreeApprovalViewControllerSub.FlowId = self.indexId; agreeApprovalViewControllerSub.IsChecked = YES; [agreeApprovalViewControllerSub setActionSussBlock:self.ActionSussBlock]; [self.navigationController pushViewController:agreeApprovalViewControllerSub animated:YES]; } ///驳回 - (void)refuseApproval{ AgreeApprovalViewControllerSub * agreeApprovalViewControllerSub = [[AgreeApprovalViewControllerSub alloc] init]; agreeApprovalViewControllerSub.title = @"审批意见"; agreeApprovalViewControllerSub.TodoId = self.currentModel.TodoId; agreeApprovalViewControllerSub.FlowId = self.indexId; agreeApprovalViewControllerSub.IsChecked = NO; [agreeApprovalViewControllerSub setActionSussBlock:self.ActionSussBlock]; [self.navigationController pushViewController:agreeApprovalViewControllerSub animated:YES]; } ///上会 - (void)goDisscuss{ SHOWLOADING WEAKSELF [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowApprovalMetting_Post] parameters:@{@"FlowId":@(self.indexId)} responseStyle:DATA success:^(id _Nonnull responseObject) { if (weakSelf.ActionSussBlock) { weakSelf.ActionSussBlock(); } REMOVESHOW SHOWERROR2(@"已提交上会申请"); [weakSelf.navigationController popViewControllerAnimated:YES]; } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]); }]; } ///待定 - (void)waitDisscuss{ SHOWLOADING WEAKSELF [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/flow/action/wait"] parameters:@{@"FlowId":@(self.indexId)} responseStyle:DATA success:^(id _Nonnull responseObject) { REMOVESHOW if (weakSelf.ActionSussBlock) { weakSelf.ActionSussBlock(); } [weakSelf.navigationController popViewControllerAnimated:YES]; } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]); }]; } /// 催办成功页面处理 -(void)goDisscussSuccess{ _myfooterView2.agreeView.nameLab.text = @"会议结论"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer5"); _myfooterView2.noAgreeView.nameLab.text = @"撤销上会"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer"); _myfooterView2.nextAggreView.nameLab.text = @"转审"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer3"); _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/3,75); _myfooterView2.noAgreeView.frame = CGRectMake(kGXScreenWidth/3,0,kGXScreenWidth/3,75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/3 + kGXScreenWidth/3,0,kGXScreenWidth/3,75); _myfooterView2.disscusView.hidden = YES; _myfooterView2.agreeView.button.tag = 120; _myfooterView2.noAgreeView.button.tag = 121; _myfooterView2.disscusView.button.tag = 122; _myfooterView2.nextAggreView.button.tag = 123; } ///转审 - (void)goNextApproval:(NSString *)titleName{ NextApprovalViewController * nextApprovalViewController = [[NextApprovalViewController alloc]init]; nextApprovalViewController.title = @"审批"; nextApprovalViewController.userIds = @[@(self.userId),@([AppUserModel sharedAppUserModel].Id)]; nextApprovalViewController.TodoId = self.currentModel.TodoId; [nextApprovalViewController setActionSussBlock:self.ActionSussBlock]; [self.navigationController pushViewController:nextApprovalViewController animated:YES]; } ///会议结论 - (void)goDisscusText{ [self aggreeApprovalHander:@"审批意见"]; } ///撤销上会 - (void)deleteDiscussText{ SHOWLOADING WEAKSELF [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowApprovalCancelMetting_Post] parameters:@{@"FlowId":@(self.indexId)} responseStyle:DATA success:^(id _Nonnull responseObject) { // NSData *strData = responseObject; // NSString *nameStr = [[NSString alloc]initWithData:strData encoding:NSUTF8StringEncoding]; // NSLog(@"解析数据 ====%@",nameStr); SHOWERROR2(@"撤销上会"); if (self.ActionSussBlock) { self.ActionSussBlock(); } REMOVESHOW [weakSelf updateDisscussUI]; } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]); }]; } - (void)updateDisscussUI{ _myfooterView2.agreeView.button.tag = 130; _myfooterView2.noAgreeView.button.tag = 131; _myfooterView2.disscusView.button.tag = 132; _myfooterView2.nextAggreView.button.tag = 133; _myfooterView2.agreeView.nameLab.text = @"同意"; _myfooterView2.agreeView.imageVIew.image = IMG(@"work_footer1"); _myfooterView2.noAgreeView.nameLab.text = @"驳回"; _myfooterView2.noAgreeView.imageVIew.image = IMG(@"work_footer"); _myfooterView2.disscusView.nameLab.text = @"上会"; _myfooterView2.disscusView.imageVIew.image = IMG(@"work_footer2"); _myfooterView2.nextAggreView.nameLab.text = @"转审"; _myfooterView2.nextAggreView.imageVIew.image = IMG(@"work_footer3"); _myfooterView2.agreeView.frame = CGRectMake(0,0,kGXScreenWidth/4,75); _myfooterView2.noAgreeView.frame = CGRectMake(kGXScreenWidth/4,0,kGXScreenWidth/4,75); _myfooterView2.disscusView.frame = CGRectMake(kGXScreenWidth/2,0,kGXScreenWidth/4,75); _myfooterView2.nextAggreView.frame = CGRectMake(kGXScreenWidth/4 +kGXScreenWidth/4 + kGXScreenWidth/4,0,kGXScreenWidth/4,75); _myfooterView2.agreeView.hidden = NO; _myfooterView2.noAgreeView.hidden = NO; _myfooterView2.disscusView.hidden = NO; _myfooterView2.nextAggreView.hidden = NO; _myfooterView2.waitView.hidden = YES; } ///下载 - (void)dowonLoadAddFile{ SHOWLOADING WEAKSELF // NSString *homePath = NSHomeDirectory(); // //document目录 // NSString *documentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject; // //library目录 // NSString *libraryPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES).firstObject; // //caches目录 // NSString *cachesPath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject; // //application support目录 // NSString *applicationSupportPath = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES).firstObject; // //preference目录 // NSString *preferencePath = NSSearchPathForDirectoriesInDomains(NSPreferencePanesDirectory, NSUserDomainMask, YES).firstObject; //tem目录 NSString *temPath = NSTemporaryDirectory(); [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowApprovalDownLoad_Post] parameters:@{@"FlowId":@(self.indexId)} responseStyle:JOSN success:^(id _Nonnull responseObject) { STRONGSELF NSLog(@"已下载 ====%@",responseObject); REMOVESHOW FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init]; model.Url = responseObject[@"DownloadUrl"]; model.MinUrl = responseObject[@"PreviewUrl"]; model.SoureTypeId = CollectModel_file; model.SoureId = weakSelf.indexId; model.Id = weakSelf.indexId; model.Title = [NSString stringWithFormat:@"%@.doc",weakSelf.title]; [strongSelf downSucces:model]; [[HttpManager sharedHttpManager] downloadUrl:model.Url downloadFilePath:temPath success:^(id _Nonnull responseObject) { } failure:^(NSError * _Nonnull error) { }]; } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]); }]; } - (void)downSucces:(FlowAttachmentsModel *)model{ DownFileViewController *downFileViewController = [[DownFileViewController alloc]init]; downFileViewController.model = model; [self.navigationController pushViewController:downFileViewController animated:YES]; } ///重新提交 - (void)secondCommit{ WS(weakSelf); UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"重新提交后,当前审批单将自动撤销,确定继续?" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *actionYes = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { //需要先把数据传递到编辑界面 MyWorkWordVC *myWorkWordVC = [[MyWorkWordVC alloc] init]; myWorkWordVC.pageType = Type_GongWen; myWorkWordVC.detailsModel = weakSelf.currentModel; myWorkWordVC.Id = weakSelf.indexId; myWorkWordVC.title = weakSelf.currentModel.Name; myWorkWordVC.indexID = weakSelf.currentModel.ProcessId; [weakSelf.navigationController pushViewController:myWorkWordVC animated:YES]; }]; UIAlertAction *actionNo = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }]; [alert addAction:actionYes]; [alert addAction:actionNo]; [self presentViewController:alert animated:YES completion:^{ }]; } ///催办 - (void)goWorkWork{ [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowApprovalComeon_Post] parameters:@{@"FlowId":@(self.indexId)} responseStyle:DATA success:^(id _Nonnull responseObject) { NSData *strData = responseObject; NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:strData options:NSJSONReadingMutableLeaves error:nil]; if ([jsonDict[@"Value"] boolValue]) { SHOWWAIT(@"已提醒对方查看,请耐心等待") }else{ SHOWSUCCESS(@"已催办") } // if (self.ActionSussBlock) { // self.ActionSussBlock(); // } } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]); }]; } ///撤销 - (void)deleteApproval{ WS(weakSelf); UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"确定继续撤销申请?" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *actionYes = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSString * url = [NSString stringWithFormat:@"%@%ld",Host(API_APP_Flow_Action_Recall),(long)self.indexId]; [[HttpManager sharedHttpManager] GETUrl:url parameters:@{} responseStyle:DATA success:^(id _Nonnull responseObject) { if (weakSelf.ActionSussBlock) { weakSelf.ActionSussBlock(); } [weakSelf.navigationController popViewControllerAnimated:YES]; SHOWSUCCESS(@"撤销成功") } failure:^(NSError * _Nonnull error) { SHOWSUCCESS(@"撤销失败,稍候再试") }]; // [[HttpManager sharedHttpManager] DeleteUrl:[NSString stringWithFormat:@"%@%@/%ld",BaseUrl,WorkFlowAddApproval_Post,(long)self.indexId] parameters:@{} responseStyle:DATA success:^(id _Nonnull responseObject) { // if (self.ActionSussBlock) { // self.ActionSussBlock(); // } // [self.navigationController popViewControllerAnimated:YES]; // SHOWSUCCESS(@"撤销成功") // } failure:^(NSError * _Nonnull error) { // SHOWSUCCESS(@"撤销失败,稍候再试") // }]; }]; UIAlertAction *actionNo = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }]; [alert addAction:actionYes]; [alert addAction:actionNo]; [self presentViewController:alert animated:YES completion:^{ }]; } - (void)getData{ WS(weakSelf); NSLog(@"%@",[NSString stringWithFormat:@"%@%@/%ld",BaseUrl,WorkFlowAddApproval_Post,(long)self.indexId]); [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@/%ld",BaseUrl,WorkFlowAddApproval_Post,(long)self.indexId] parameters:@{} responseStyle:JOSN success:^(id _Nonnull responseObject) { NSLog(@"%@",responseObject); NSDictionary *dic = responseObject; weakSelf.currentModel = [[MyApprovalDetailModel alloc] initWithDictionary:dic error:nil]; NSMutableArray *tmpNodes = [weakSelf.currentModel.Nodes mutableCopy]; // [tmpNodes enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { // NodesModel *nodeModel = obj; // if ([nodeModel.Action isEqualToString:@"同意"]) { // [tmpNodes exchangeObjectAtIndex:idx withObjectAtIndex:1]; // } // }]; weakSelf.currentModel.Nodes = [tmpNodes mutableCopy]; //获取第一个审核中的位置 // [weakSelf.currentModel.Nodes enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { // NodesModel *nodeModel = obj; // if ([nodeModel.Action isEqualToString:@"审批中"]) { // weakSelf.fristStatusIndex = idx; // } // }]; dispatch_async(dispatch_get_main_queue(), ^{ if (self.title.length == 0) { weakSelf.myNavigationBar.titleLabel.text = weakSelf.currentModel.Name; } if (weakSelf.currentModel.IsRecall) { weakSelf.pageType = Type_ONEC; } if ([weakSelf.currentModel.State isEqualToString:@"Checking"]) { weakSelf.pageType = Type_ONEA; }else{ if (weakSelf.currentModel.IsAdmin) { weakSelf.pageType = Type_ONEB; }else{ weakSelf.pageType = Type_ONEC; } } switch (weakSelf.pageType) { case Type_ONEA: { [weakSelf loadCustomFooterFromStatus:weakSelf.currentModel.State]; } break; case Type_ONEB: { [weakSelf loadCustomFooterFromStatus:weakSelf.currentModel.FlowState]; } break; case Type_ONEC: // [self loadCustomFooterFromPageTypeC]; break; } }); for (NSInteger x = 0; x < weakSelf.currentModel.FormFields.count; x++) { FormFieldsModel *model = weakSelf.currentModel.FormFields[x]; if ([model.Type isEqualToString:@"所在部门"]) { model.Value = weakSelf.currentModel.DepartmentName; } } [weakSelf.mytableView reloadData]; } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]) }]; } - (DrawerView *)drawerView { if(!_drawerView) { _drawerView = [[DrawerView alloc] init]; } return _drawerView; } - (void)viewWillDisappear:(BOOL)animated { if (self.ActionSussBlock) { self.ActionSussBlock(); } } @end