123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- //
- // AssessorList.m
- // LNManager
- //
- // Created by EchoShacolee on 2017/4/8.
- // Copyright © 2017年 lee. All rights reserved.
- //
- #import "AssessorList.h"
- #import "AssessorDetail.h"
- @interface AssessorList ()
- @end
- @implementation AssessorList
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.navigationItem.title = @"考核员列表";
-
- [self getData];
-
- __weak typeof(self) weakSelf = self;
- self.holdervBlock = ^{
- [weakSelf getData];
- };
- }
- -(void)getData{
-
- NSMutableDictionary * mDic = [[NSMutableDictionary alloc]init];
- [mDic setValue:defUser.userDict[@"dqbh"] forKey:@"dqbh"];
- [mDic setValue:defUser.userDict[@"qxbh"] forKey:@"qxbh"];
- [mDic setValue:defUser.userDict[@"school"] forKey:@"schoolId"];
- [mDic setValue:@"" forKey:@"name"];
- [mDic setValue:@"" forKey:@"idcard"];
- [mDic setValue:@"" forKey:@"mobile"];
-
- _requsetDic = mDic;
- [self getDataWithDic:mDic method:@"examers" block:^(NSDictionary *successdic) {
- NSArray * arr = successdic[@"body"];
- if (arr.count != 0) {
- self.holderV.hidden = YES;
- }
-
- for (NSDictionary * dic in arr) {
- if (![_sectionTitles containsObject:dic[@"ZM"]]) {
- [_sectionTitles addObject:dic[@"ZM"]];
- [_dataSource addObject:[NSMutableArray new]];
- }
- }
-
- //排序
- [_sectionTitles sortUsingSelector:@selector(compare:)];
-
- for (NSDictionary * dic in arr) {
- NSInteger location = [_sectionTitles indexOfObject:dic[@"ZM"]];
- [_dataSource[location] addObject:dic];
- }
-
- [self.tableView reloadData];
- }];
- }
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cellId" forIndexPath:indexPath];
- if ([_dataSource[indexPath.section] count] > 0) {
- cell.textLabel.text = _dataSource[indexPath.section][indexPath.row][@"EI_NAME"];
- }
- return cell;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
-
- AssessorDetail * vc = [[AssessorDetail alloc]init];
- vc.dataSource = _dataSource[indexPath.section][indexPath.row];
- [_requsetDic setValue:_dataSource[indexPath.section][indexPath.row][@"EI_IDCARD"] forKey:@"idcard"];
- vc.requesetDic = _requsetDic;
- [self navPushHideTabbarToVC:vc];
-
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|