CheckCourseVC.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. //
  2. // CheckCourseVC.m
  3. // LN_School
  4. //
  5. // Created by apple on 2017/4/12.
  6. // Copyright © 2017年 Danson. All rights reserved.
  7. //
  8. #import "CheckCourseVC.h"
  9. #import "CkeckCourceCell.h"
  10. @interface CheckCourseVC ()<UITableViewDelegate,UITableViewDataSource>
  11. {
  12. UITableView *maintableView;
  13. UIButton *allSelectBtn, *moreSelectBtn;
  14. UIView *bottomBar;
  15. UIView *examerView;
  16. UITableView *examertableView;
  17. NSArray *dataArray;
  18. NSArray *examDataArray;
  19. NSString *examerID;
  20. NSMutableArray *sendIdArray;
  21. NSString *subjectString;
  22. HolderView * holderV;
  23. }
  24. @end
  25. @implementation CheckCourseVC
  26. - (void)viewDidLoad {
  27. [super viewDidLoad];
  28. self.title = @"学时送审";
  29. self.view.backgroundColor = KBackGroundColor;
  30. if (_isNotification == NO)
  31. {
  32. //正常状态
  33. [self goBackByNavigation];
  34. }
  35. else
  36. {
  37. //推送状态 要将根视图变回去
  38. UIBarButtonItem* backBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back.png"] style:UIBarButtonItemStylePlain target:self action:@selector(dismissNavgation)];
  39. [backBtn setTintColor:defGreen];
  40. [self.navigationItem setLeftBarButtonItem:backBtn];
  41. }
  42. UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
  43. btn.frame = CGRectMake(0, 0, 80, 44);
  44. btn.titleLabel.font = [UIFont systemFontOfSize:17];
  45. [btn setTitle:@"选择阶段" forState:UIControlStateNormal];
  46. [btn setTitleColor:defGreen forState:UIControlStateNormal];
  47. [btn addTarget:self action:@selector(selectSubject) forControlEvents:UIControlEventTouchUpInside];
  48. self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
  49. subjectString = @"1";
  50. dataArray = [NSArray array];
  51. sendIdArray = [NSMutableArray array];
  52. //tableView
  53. maintableView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStylePlain];
  54. maintableView.delegate = self;
  55. maintableView.dataSource = self;
  56. maintableView.rowHeight = 100;
  57. maintableView.estimatedSectionFooterHeight = 0;
  58. [self.view addSubview:maintableView];
  59. UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kSize.width, 50)];
  60. view.backgroundColor = KBackGroundColor;
  61. btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kSize.width/2.0, 50)];
  62. [btn setImage:[UIImage imageNamed:@"pointMark"] withTitle:@"全选" textColor:KContentTextColor Font:Font17 forState:UIControlStateNormal];
  63. [btn setImage:[UIImage imageNamed:@"pointMark_h"] withTitle:@"全选" textColor:defGreen Font:Font17 forState:UIControlStateSelected];
  64. [btn target:self Tag:1];
  65. [view addSubview:btn];
  66. allSelectBtn = btn;
  67. btn = [[UIButton alloc] initWithFrame:CGRectMake(kSize.width/2.0, 0, kSize.width/2.0, 50)];
  68. [btn setImage:[UIImage imageNamed:@"pointMark"] withTitle:@"多选" textColor:KContentTextColor Font:Font17 forState:UIControlStateNormal];
  69. [btn setImage:[UIImage imageNamed:@"pointMark_h"] withTitle:@"多选" textColor:defGreen Font:Font17 forState:UIControlStateSelected];
  70. [btn target:self Tag:2];
  71. [view addSubview:btn];
  72. moreSelectBtn = btn;
  73. maintableView.tableHeaderView = view;
  74. [self setRefresh];
  75. //bottomBar
  76. bottomBar = [[UIView alloc] initWithFrame:CGRectMake(0, kSize.height - kNavOffSet - 50, kSize.width, 50)];
  77. bottomBar.backgroundColor = defGreen;
  78. [self.view addSubview:bottomBar];
  79. btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kSize.width/2.0, 50)];
  80. [btn setTitle:@"批量考核" textColor:KTitleColor font:Font18 fotState:UIControlStateNormal];
  81. [btn target:self Tag:3];
  82. [bottomBar addSubview:btn];
  83. [btn addViewWithRect:CGRectMake(kSize.width/2.0, 0, 1, 50)];
  84. btn = [[UIButton alloc] initWithFrame:CGRectMake(kSize.width/2.0, 0, kSize.width/2.0, 50)];
  85. [btn setTitle:@"批量送审" textColor:KTitleColor font:Font18 fotState:UIControlStateNormal];
  86. [btn target:self Tag:4];
  87. [bottomBar addSubview:btn];
  88. bottomBar.hidden = YES;
  89. [self trainTimes];
  90. holderV = [[HolderView alloc]initWithFrame:kFrame];
  91. [holderV freshBlock:^{
  92. [self trainTimes];
  93. }];
  94. [self.view addSubview:holderV];
  95. }
  96. -(void)setRefresh{
  97. __weak typeof(self) weakSelf = self;
  98. MJRefreshNormalHeader *mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
  99. [weakSelf trainTimes];
  100. }];
  101. maintableView.mj_header = mj_header;
  102. }
  103. -(void)dismissNavgation
  104. {
  105. [myDelegate initHomeVC];
  106. }
  107. - (void)setExamer {
  108. //懒加载 没有的时候就init一个
  109. if (!examerView) {
  110. examerView = [[UIView alloc] initWithFrame:kFrame];
  111. examerView.backgroundColor = windowBlockColor;
  112. examertableView = [[UITableView alloc] initWithFrame:CGRectMake(30, (kSize.height - kNavOffSet - 200)/2.0, kSize.width - 60, 200) style:UITableViewStylePlain];
  113. [examertableView borderCornorRadios:7];
  114. examertableView.backgroundColor = KBackGroundColor;
  115. examertableView.delegate = self;
  116. examertableView.dataSource = self;
  117. [examerView addSubview:examertableView];
  118. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kSize.width - 60, 50)];
  119. [label setText:@"请选择考核员" Font:Font18 TextColor:KSubTitleColor Alignment:NSTextAlignmentCenter];
  120. [label addSelfViewWithRect:CGRectMake(10, 48, kSize.width - 80, 2) Color:kLineColor];
  121. examertableView.tableHeaderView = label;
  122. UIView *view = [[UIView alloc] initWithFrame:CGRectMake(30, examertableView.y + examertableView.height, kSize.width - 60, 40)];
  123. view.backgroundColor = KBackGroundColor;
  124. [examerView addSubview:view];
  125. [view borderCornorRadios:7];
  126. UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kSize.width/2.0 - 30, 40)];
  127. [btn setTitle:@"取消" textColor:KTitleColor font:Font18 fotState:UIControlStateNormal];
  128. [btn target:self Tag:5];
  129. [view addSubview:btn];
  130. [btn addViewWithRect:CGRectMake(0, 0, kSize.width - 60, 1)];
  131. [btn addViewWithRect:CGRectMake(kSize.width/2.0 - 30, 0, 1, 40)];
  132. btn = [[UIButton alloc] initWithFrame:CGRectMake(kSize.width/2.0 - 30, 0, kSize.width/2.0 - 30, 40)];
  133. [btn setTitle:@"确定" textColor:defGreen font:Font18 fotState:UIControlStateNormal];
  134. [btn target:self Tag:6];
  135. [view addSubview:btn];
  136. }
  137. examerID = @"";
  138. [self.view addSubview:examerView];
  139. examDataArray = [NSArray array];
  140. [self getTrainExams];
  141. }
  142. #pragma mark Action
  143. - (void)selectSubject {
  144. UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"请选择培训阶段" message:nil preferredStyle:UIAlertControllerStyleAlert];
  145. UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
  146. UIAlertAction *subjectOne = [UIAlertAction actionWithTitle:@"第一阶段" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  147. if (![subjectString isEqualToString:@"1"]) {
  148. subjectString = @"1";
  149. [self trainTimes];
  150. }
  151. }];
  152. UIAlertAction *subjectTwo = [UIAlertAction actionWithTitle:@"第二阶段" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  153. if (![subjectString isEqualToString:@"2"]) {
  154. subjectString = @"2";
  155. [self trainTimes];
  156. }
  157. }];
  158. UIAlertAction *subjectThree = [UIAlertAction actionWithTitle:@"第三阶段" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  159. if (![subjectString isEqualToString:@"3"]) {
  160. subjectString = @"3";
  161. [self trainTimes];
  162. }
  163. }];
  164. UIAlertAction *subjectFour = [UIAlertAction actionWithTitle:@"第四阶段" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  165. if (![subjectString isEqualToString:@"4"]) {
  166. subjectString = @"4";
  167. [self trainTimes];
  168. }
  169. }];
  170. [alert addAction:cancelAction];
  171. [alert addAction:subjectOne];
  172. [alert addAction:subjectTwo];
  173. [alert addAction:subjectThree];
  174. [alert addAction:subjectFour];
  175. [self presentViewController:alert animated:YES completion:nil];
  176. }
  177. - (void)btnClick:(UIButton *)sender {
  178. if (sender.tag == 1) {
  179. allSelectBtn.selected = !allSelectBtn.selected;
  180. if (allSelectBtn.selected == NO) {
  181. [sendIdArray removeAllObjects];
  182. }else {
  183. for (NSDictionary *dic in dataArray) {
  184. if (![sendIdArray containsObject:dic[@"ID"]]) {
  185. [sendIdArray addObject:dic[@"ID"]];
  186. }
  187. }
  188. moreSelectBtn.selected = YES;
  189. [self showBottomBar];
  190. }
  191. [maintableView reloadData];
  192. return;
  193. }
  194. if (sender.tag == 2) {
  195. moreSelectBtn.selected = !moreSelectBtn.selected;
  196. if (moreSelectBtn.selected == NO) {
  197. [sendIdArray removeAllObjects];
  198. allSelectBtn.selected = NO;
  199. [self hideBottomBar];
  200. }else {
  201. [self showBottomBar];
  202. }
  203. [maintableView reloadData];
  204. return;
  205. }
  206. if (sender.tag == 3) {
  207. if (sendIdArray.count < 1) {
  208. ShowMsg(@"请选择待考核学时");
  209. return;
  210. }
  211. [self setExamer];
  212. return;
  213. }
  214. if (sender.tag == 4) {
  215. [self trainSend];
  216. return;
  217. }
  218. if (sender.tag == 5) {
  219. //取消选择考核人
  220. examerID = @"";
  221. [examerView removeFromSuperview];
  222. return;
  223. }
  224. if (sender.tag == 6) {
  225. //选择考核人
  226. if (examerID.length < 1) {
  227. ShowMsg(@"请选择考核人");
  228. return;
  229. }
  230. [examerView removeFromSuperview];
  231. [self trainExamWithExamer:examerID];
  232. return;
  233. }
  234. }
  235. - (void) showBottomBar {
  236. if (bottomBar.isHidden) {
  237. bottomBar.hidden = NO;
  238. maintableView.height -= bottomBar.height;
  239. }
  240. maintableView.mj_header = nil;
  241. }
  242. - (void)hideBottomBar {
  243. if (!bottomBar.isHidden) {
  244. bottomBar.hidden = YES;
  245. maintableView.height += bottomBar.height;
  246. }
  247. [self setRefresh];
  248. }
  249. #pragma mark tableView
  250. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  251. if (tableView == examertableView) {
  252. return examDataArray.count;
  253. }
  254. return dataArray.count;
  255. }
  256. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  257. if (tableView == examertableView) {
  258. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"examCell"];
  259. if (cell == nil) {
  260. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"examCell"];
  261. cell.backgroundColor = KBackGroundColor;
  262. [cell.textLabel setTextAlignment:NSTextAlignmentCenter];
  263. }
  264. NSDictionary *dic = examDataArray[indexPath.row];
  265. cell.textLabel.text = [NSString stringWithFormat:@"%@ %@",dic[@"DQMC"],dic[@"EI_NAME"]];
  266. return cell;
  267. }
  268. CkeckCourceCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
  269. if (cell == nil) {
  270. cell = [[CkeckCourceCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
  271. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  272. }
  273. NSDictionary *dict = dataArray[indexPath.row];
  274. cell.dataDic = dict;
  275. [cell clickSendBtnWithBlock:^(NSString *cellString) {
  276. if (sendIdArray.count > 0) {
  277. [sendIdArray removeAllObjects];
  278. }
  279. [sendIdArray addObject:[[cellString componentsSeparatedByString:@"-"] lastObject]];
  280. NSString *cellType = [[cellString componentsSeparatedByString:@"-"] firstObject];
  281. if ([cellType isEqualToString:@"1"]) {
  282. //考核
  283. [self setExamer];
  284. }
  285. if ([cellType isEqualToString:@"2"]) {
  286. //送审
  287. [self trainSend];
  288. }
  289. }];
  290. if (moreSelectBtn.selected) {
  291. cell.isShowImg = YES;
  292. cell.checkBtn.userInteractionEnabled = NO;
  293. [cell.checkBtn setTitleColor:KContentTextColor forState:UIControlStateNormal];
  294. cell.checkBtn.layer.borderColor = KContentTextColor.CGColor;
  295. }else {
  296. cell.isShowImg = NO;
  297. cell.checkBtn.userInteractionEnabled = YES;
  298. [cell.checkBtn setTitleColor:defGreen forState:UIControlStateNormal];
  299. cell.checkBtn.layer.borderColor = defGreen.CGColor;
  300. }
  301. if (allSelectBtn.selected) {
  302. //全选
  303. cell.cellIsSelected = YES;
  304. }else {
  305. if (moreSelectBtn.selected) {
  306. if ([sendIdArray containsObject:[dict[@"STUDENT"] stringValue]]) {
  307. cell.cellIsSelected = YES;
  308. }else {
  309. cell.cellIsSelected = NO;
  310. }
  311. }else {
  312. cell.cellIsSelected = NO;
  313. }
  314. }
  315. return cell;
  316. }
  317. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  318. if (tableView == examertableView) {
  319. NSDictionary *dic = examDataArray[indexPath.row];
  320. examerID = [dic[@"EI_ID"] stringValue];
  321. return;
  322. }
  323. if (!moreSelectBtn.selected) {
  324. return;
  325. }
  326. NSDictionary *dict = dataArray[indexPath.row];
  327. CkeckCourceCell *cell = [tableView cellForRowAtIndexPath:indexPath];
  328. if (cell.cellIsSelected) {
  329. cell.cellIsSelected = NO;
  330. if ([sendIdArray containsObject:[dict[@"STUDENT"] stringValue]]) {
  331. [sendIdArray removeObject:[dict[@"STUDENT"] stringValue]];
  332. }
  333. if (allSelectBtn.selected) {
  334. allSelectBtn.selected = NO;
  335. }
  336. }else {
  337. cell.cellIsSelected = YES;
  338. if (![sendIdArray containsObject:[dict[@"STUDENT"] stringValue]]) {
  339. [sendIdArray addObject:[dict[@"STUDENT"] stringValue]];
  340. }
  341. if (sendIdArray.count == dataArray.count) {
  342. allSelectBtn.selected = YES;
  343. }
  344. }
  345. }
  346. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
  347. return 10;
  348. }
  349. - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
  350. return [UIView new];
  351. }
  352. #pragma mark 数据请求
  353. //送审列表
  354. - (void)trainTimes {
  355. if (![NetManager connectedToNetWork]) {
  356. [maintableView.mj_header endRefreshing];
  357. showMsgUnconnect();
  358. return;
  359. }
  360. NSMutableDictionary *dic = [NSMutableDictionary dictionary];
  361. [dic setObject:defUser.userDict[@"id"] forKey:@"userId"];
  362. [dic setObject:defUser.userDict[@"school"] forKey:@"schoolId"];
  363. [dic setObject:subjectString forKey:@"subject"];
  364. [dic setObject:@"0" forKey:@"isPage"];
  365. [dic setObject:@"" forKey:@"pageSize"];
  366. [dic setObject:@"" forKey:@"currentPage"];
  367. NSString *method = @"trainTimes";
  368. [MBProgressHUD showLoadToView:self.view];
  369. [NetManager requestAnythingWithURL:method dictionary:dic dataArray:nil completion:^(NSDictionary *root) {
  370. [MBProgressHUD hideHUDForView:self.view];
  371. holderV.hidden = NO;
  372. [maintableView.mj_header endRefreshing];
  373. if (!root) {
  374. ShowMsg(@"获取数据错误");
  375. return;
  376. }
  377. if ([root[@"code"] integerValue] == 1) {
  378. ShowMsg(root[@"msg"]);
  379. return;
  380. }
  381. dataArray = root[@"body"];
  382. if (dataArray.count > 0) {
  383. holderV.hidden = YES;
  384. }
  385. [maintableView reloadData];
  386. }];
  387. }
  388. //考核员列表
  389. - (void)getTrainExams {
  390. if (![NetManager connectedToNetWork]) {
  391. showMsgUnconnect();
  392. return;
  393. }
  394. NSMutableDictionary *dic = [NSMutableDictionary dictionary];
  395. [dic setObject:defUser.userDict[@"id"] forKey:@"userId"];
  396. NSString *method = @"getTrainExams";
  397. [MBProgressHUD showLoadToView:self.view];
  398. [NetManager requestAnythingWithURL:method dictionary:dic dataArray:nil completion:^(NSDictionary *root) {
  399. [MBProgressHUD hideHUDForView:self.view];
  400. if (!root) {
  401. ShowMsg(@"获取失败,请重试");
  402. return;
  403. }
  404. if ([root[@"code"] integerValue] == 1) {
  405. ShowMsg(root[@"msg"]);
  406. return;
  407. }
  408. examDataArray = root[@"body"];
  409. [examertableView reloadData];
  410. }];
  411. }
  412. //考核
  413. - (void)trainExamWithExamer:(NSString *)examerId {
  414. if (![NetManager connectedToNetWork]) {
  415. showMsgUnconnect();
  416. return;
  417. }
  418. if (sendIdArray.count < 1) {
  419. ShowMsg(@"请选择待考核学时");
  420. return;
  421. }
  422. NSString *ids = @"";
  423. for (NSString *str in sendIdArray) {
  424. for (NSDictionary *dict in dataArray) {
  425. if ([[dict[@"STUDENT"] stringValue] isEqualToString:str]) {
  426. if ([dict[@"EXAMERNAME"] length] < 1) {
  427. ids = [ids stringByAppendingString:[NSString stringWithFormat:@"%@,",str]];
  428. }
  429. break;
  430. }
  431. }
  432. }
  433. if (ids.length < 1) {
  434. ShowMsg(@"所选学时已考核");
  435. return;
  436. }
  437. ids = [ids substringToIndex:ids.length - 1];
  438. NSMutableDictionary *dic = [NSMutableDictionary dictionary];
  439. [dic setObject:examerId forKey:@"examerId"];
  440. [dic setObject:ids forKey:@"stuIds"];
  441. [dic setObject:subjectString forKey:@"subject"];
  442. NSString *method = @"trainExam";
  443. [MBProgressHUD showLoadToView:self.view];
  444. [NetManager requestAnythingWithURL:method dictionary:dic dataArray:nil completion:^(NSDictionary *root) {
  445. [MBProgressHUD hideHUDForView:self.view];
  446. if (!root) {
  447. ShowMsg(@"考核学时失败,请重试");
  448. return;
  449. }
  450. if ([root[@"code"] integerValue] == 1) {
  451. ShowMsg(root[@"msg"]);
  452. return;
  453. }
  454. [sendIdArray removeAllObjects];
  455. allSelectBtn.selected = NO;
  456. moreSelectBtn.selected = NO;
  457. maintableView.height += bottomBar.height;
  458. bottomBar.hidden = YES;
  459. [self trainTimes];
  460. }];
  461. }
  462. //送审
  463. - (void)trainSend {
  464. if ([defUser.userDict[@"qz"] length] < 1) {
  465. ShowMsg(@"当前账户没有送审学时权限!");
  466. return;
  467. }
  468. if (![NetManager connectedToNetWork]) {
  469. showMsgUnconnect();
  470. return;
  471. }
  472. if (sendIdArray.count < 1) {
  473. ShowMsg(@"请选择待审核学时");
  474. return;
  475. }
  476. NSString *ids = @"";
  477. for (NSString *str in sendIdArray) {
  478. for (NSDictionary *dict in dataArray) {
  479. if ([[dict[@"STUDENT"] stringValue] isEqualToString:str]) {
  480. if ([dict[@"EXAMERNAME"] length] > 1) {
  481. ids = [ids stringByAppendingString:[NSString stringWithFormat:@"%@,",str]];
  482. }
  483. break;
  484. }
  485. }
  486. }
  487. if (ids.length < 1) {
  488. ShowMsg(@"所选学时已送审");
  489. return;
  490. }
  491. ids = [ids substringToIndex:ids.length - 1];
  492. NSMutableDictionary *dic = [NSMutableDictionary dictionary];
  493. [dic setObject:defUser.userDict[@"id"] forKey:@"userId"];
  494. [dic setObject:ids forKey:@"stuIds"];
  495. [dic setObject:subjectString forKey:@"subject"];
  496. NSString *method = @"trainSend";
  497. [MBProgressHUD showLoadToView:self.view];
  498. [NetManager requestAnythingWithURL:method dictionary:dic dataArray:nil completion:^(NSDictionary *root) {
  499. [MBProgressHUD hideHUDForView:self.view];
  500. if (!root) {
  501. ShowMsg(@"审核学时失败,请重试");
  502. return;
  503. }
  504. if ([root[@"code"] integerValue] == 1) {
  505. ShowMsg(root[@"msg"]);
  506. return;
  507. }
  508. [sendIdArray removeAllObjects];
  509. allSelectBtn.selected = NO;
  510. moreSelectBtn.selected = NO;
  511. maintableView.height += bottomBar.height;
  512. bottomBar.hidden = YES;
  513. [self trainTimes];
  514. }];
  515. }
  516. - (void)didReceiveMemoryWarning {
  517. [super didReceiveMemoryWarning];
  518. }
  519. @end