AssessorList.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // AssessorList.m
  3. // LNManager
  4. //
  5. // Created by EchoShacolee on 2017/4/8.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "AssessorList.h"
  9. #import "AssessorDetail.h"
  10. @interface AssessorList ()
  11. @end
  12. @implementation AssessorList
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. self.navigationItem.title = @"考核员列表";
  16. [self getData];
  17. __weak typeof(self) weakSelf = self;
  18. _block = ^{
  19. [weakSelf getData];
  20. };
  21. }
  22. -(void)getData{
  23. NSMutableDictionary * mdic = [NSMutableDictionary new];
  24. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_DQBH"]] forKey:@"dqbh"];
  25. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_QXBH"]] forKey:@"qxbh"];
  26. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_INSCODE"]] forKey:@"inscode"];
  27. [mdic setValue:@"" forKey:@"examerName"];
  28. [mdic setValue:@"" forKey:@"idcard"];
  29. [mdic setValue:@"" forKey:@"isPage"];
  30. [mdic setValue:@"" forKey:@"pageSize"];
  31. [mdic setValue:@"" forKey:@"currentPage"];
  32. [self getDataWithDic:mdic method:@"examers" block:^(NSDictionary *successdic) {
  33. NSArray * arr = successdic[@"body"];
  34. if (arr.count != 0) {
  35. self.holderV.hidden = YES;
  36. }
  37. for (NSDictionary * dic in arr) {
  38. if (![_sectionTitles containsObject:dic[@"ZM"]]) {
  39. [_sectionTitles addObject:dic[@"ZM"]];
  40. [_dataSource addObject:[NSMutableArray new]];
  41. }
  42. }
  43. //排序
  44. [_sectionTitles sortUsingSelector:@selector(compare:)];
  45. for (NSDictionary * dic in arr) {
  46. NSInteger location = [_sectionTitles indexOfObject:dic[@"ZM"]];
  47. [_dataSource[location] addObject:dic];
  48. }
  49. [self.tableView reloadData];
  50. }];
  51. }
  52. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  53. {
  54. UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cellId" forIndexPath:indexPath];
  55. if ([_dataSource[indexPath.section] count] > 0) {
  56. cell.textLabel.text = _dataSource[indexPath.section][indexPath.row][@"EI_NAME"];
  57. }
  58. return cell;
  59. }
  60. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  61. AssessorDetail * vc = [[AssessorDetail alloc]init];
  62. vc.dataSource = _dataSource[indexPath.section][indexPath.row];
  63. [self.navigationController pushViewController:vc animated:YES];
  64. }
  65. - (void)didReceiveMemoryWarning {
  66. [super didReceiveMemoryWarning];
  67. // Dispose of any resources that can be recreated.
  68. }
  69. /*
  70. #pragma mark - Navigation
  71. // In a storyboard-based application, you will often want to do a little preparation before navigation
  72. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  73. // Get the new view controller using [segue destinationViewController].
  74. // Pass the selected object to the new view controller.
  75. }
  76. */
  77. @end