CarList.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // CarList.m
  3. // LNManager
  4. //
  5. // Created by EchoShacolee on 2017/4/9.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "CarList.h"
  9. #import "CarDetail.h"
  10. #import "MengBanView.h"
  11. @interface CarList ()
  12. {
  13. NSMutableDictionary * _requsetDic;
  14. MengBanView * _mengBanView;
  15. NSString * _status;
  16. }
  17. @end
  18. @implementation CarList
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. self.navigationItem.title = @"车辆列表";
  22. // [self customRightBtn];
  23. _status = @"1";
  24. [self getData];
  25. __weak typeof(self) weakSelf = self;
  26. self.block = ^{
  27. [weakSelf getData];
  28. };
  29. }
  30. -(void)customRightBtn{
  31. UIBarButtonItem *item = [[UIBarButtonItem alloc]initWithTitle:@"筛选" style:UIBarButtonItemStylePlain target:self action:@selector(setMengbanView)];
  32. item.tintColor = COLOR_THEME;
  33. self.navigationItem.rightBarButtonItem = item;
  34. }
  35. -(void)setMengbanView{
  36. if (_mengBanView) {
  37. [_mengBanView showView];
  38. return;
  39. }
  40. NSArray * btnarr = @[@"待审核",@"审核通过",@"审核驳回"];
  41. _mengBanView = [[MengBanView alloc]initWithTitileStr:nil buttonsArray:@[btnarr] block:^(NSArray *array) {
  42. if ([array[0] isEqualToString:@"待审核"]) {
  43. _status = @"0";
  44. }else if ([array[0] isEqualToString:@"审核通过"]){
  45. _status = @"1";
  46. }else if ([array[0] isEqualToString:@"审核驳回"]){
  47. _status = @"2";
  48. }
  49. [self getData];
  50. }];
  51. [_mengBanView showView];
  52. }
  53. - (void)getData{
  54. NSMutableDictionary * mdic = [NSMutableDictionary new];
  55. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_DQBH"]] forKey:@"dqbh"];
  56. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_QXBH"]] forKey:@"qxbh"];
  57. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_INSCODE"]] forKey:@"inscode"];
  58. [mdic setValue:@"" forKey:@"licNum"];
  59. [mdic setValue:@"" forKey:@"isPage"];
  60. [mdic setValue:@"" forKey:@"pageSize"];
  61. [mdic setValue:@"" forKey:@"currentPage"];
  62. [mdic setValue:_status forKey:@"auditStatus"];
  63. _requsetDic = mdic;
  64. [self getDataWithDic:mdic method:@"cars"];
  65. }
  66. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  67. return self.dataurce.count;
  68. }
  69. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath{
  70. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellId"];
  71. if (!cell) {
  72. cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cellId"];
  73. }
  74. cell.textLabel.text = self.dataurce[indexPath.row][@"TCO_LICNUM"];
  75. return cell;
  76. }
  77. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  78. CarDetail * vc = [[CarDetail alloc]init];
  79. vc.objNum = self.dataurce[indexPath.row][@"TCO_CARNUM"];
  80. [_requsetDic setValue:self.dataurce[indexPath.row][@"TCO_LICNUM"] forKey:@"licNum"];
  81. vc.requesetDic = _requsetDic;
  82. [self.navigationController pushViewController:vc animated:YES];
  83. }
  84. - (void)didReceiveMemoryWarning {
  85. [super didReceiveMemoryWarning];
  86. // Dispose of any resources that can be recreated.
  87. }
  88. /*
  89. #pragma mark - Navigation
  90. // In a storyboard-based application, you will often want to do a little preparation before navigation
  91. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  92. // Get the new view controller using [segue destinationViewController].
  93. // Pass the selected object to the new view controller.
  94. }
  95. */
  96. @end