CarList.m 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. #import "SYBaseCell.h"
  12. @interface CarList ()
  13. {
  14. NSMutableDictionary * _requsetDic;
  15. MengBanView * _mengBanView;
  16. NSString * _status;
  17. }
  18. @end
  19. @implementation CarList
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. self.navigationItem.title = @"车辆列表";
  23. // [self customRightBtn];
  24. _status = @"1";
  25. [self getData];
  26. __weak typeof(self) weakSelf = self;
  27. self.block = ^{
  28. [weakSelf getData];
  29. };
  30. [self.tableView registerNib:[UINib nibWithNibName:@"SYBaseCell" bundle:nil] forCellReuseIdentifier:@"SYBaseCellId"];
  31. }
  32. -(void)customRightBtn{
  33. UIBarButtonItem *item = [[UIBarButtonItem alloc]initWithTitle:@"筛选" style:UIBarButtonItemStylePlain target:self action:@selector(setMengbanView)];
  34. item.tintColor = COLOR_THEME;
  35. self.navigationItem.rightBarButtonItem = item;
  36. }
  37. -(void)setMengbanView{
  38. if (_mengBanView) {
  39. [_mengBanView showView];
  40. return;
  41. }
  42. NSArray * btnarr = @[@"待审核",@"审核通过",@"审核驳回"];
  43. _mengBanView = [[MengBanView alloc]initWithTitileStr:nil buttonsArray:@[btnarr] block:^(NSArray *array) {
  44. if ([array[0] isEqualToString:@"待审核"]) {
  45. _status = @"0";
  46. }else if ([array[0] isEqualToString:@"审核通过"]){
  47. _status = @"1";
  48. }else if ([array[0] isEqualToString:@"审核驳回"]){
  49. _status = @"2";
  50. }
  51. [self getData];
  52. }];
  53. [_mengBanView showView];
  54. }
  55. - (void)getData{
  56. NSMutableDictionary * mdic = [NSMutableDictionary new];
  57. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_DQBH"]] forKey:@"dqbh"];
  58. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_QXBH"]] forKey:@"qxbh"];
  59. [mdic setValue:[NSString stringWithFormat:@"%@",_shcDic[@"TSI_INSCODE"]] forKey:@"inscode"];
  60. [mdic setValue:@"" forKey:@"licNum"];
  61. [mdic setValue:@"" forKey:@"isPage"];
  62. [mdic setValue:@"" forKey:@"pageSize"];
  63. [mdic setValue:@"" forKey:@"currentPage"];
  64. [mdic setValue:_status forKey:@"auditStatus"];
  65. _requsetDic = mdic;
  66. [self getDataWithDic:mdic method:@"cars"];
  67. }
  68. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  69. return 44;
  70. }
  71. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  72. return self.dataurce.count;
  73. }
  74. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath{
  75. SYBaseCell * cell = [tableView dequeueReusableCellWithIdentifier:@"SYBaseCellId" forIndexPath:indexPath];
  76. cell.nameLab.text = self.dataurce[indexPath.row][@"TCO_LICNUM"];
  77. NSString *str = [NSString stringWithFormat:@"%@",self.dataurce[indexPath.row][@"TCO_LOCK_STATUS"]];
  78. cell.lockingImgV.hidden = [str intValue]==0;
  79. return cell;
  80. }
  81. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  82. CarDetail * vc = [[CarDetail alloc]init];
  83. vc.lockBlock = ^(NSDictionary *data) {
  84. [self.dataurce replaceObjectAtIndex:indexPath.row withObject:data];
  85. [self.tableView reloadData];
  86. };
  87. vc.objNum = self.dataurce[indexPath.row][@"TCO_CARNUM"];
  88. [_requsetDic setValue:self.dataurce[indexPath.row][@"TCO_LICNUM"] forKey:@"licNum"];
  89. vc.requesetDic = _requsetDic;
  90. [self.navigationController pushViewController:vc animated:YES];
  91. }
  92. - (void)didReceiveMemoryWarning {
  93. [super didReceiveMemoryWarning];
  94. // Dispose of any resources that can be recreated.
  95. }
  96. /*
  97. #pragma mark - Navigation
  98. // In a storyboard-based application, you will often want to do a little preparation before navigation
  99. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  100. // Get the new view controller using [segue destinationViewController].
  101. // Pass the selected object to the new view controller.
  102. }
  103. */
  104. @end