123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- //
- // StudentDetail.m
- // LNManager
- //
- // Created by EchoShacolee on 2017/4/10.
- // Copyright © 2017年 lee. All rights reserved.
- //
- #import "StudentDetail.h"
- #import "TeachLogCell.h"
- #import "SignsCell.h"
- #import "ShenHeCell.h"
- #import "FaceColloectVC.h"
- @interface StudentDetail ()
- {
- NSArray *_teachLogDataArr;//教学日志
- NSArray *_signDataArr;// 签到记录
- NSArray *_shenheDataArr;//审核记录
-
- HolderView * _holderV1;
- HolderView * _holderV2;
- HolderView * _holderV3;
- }
- @end
- @implementation StudentDetail
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.navigationItem.title = @"学员详情";
-
- _teachLogDataArr = [[NSArray alloc]init];
- _signDataArr = [[NSArray alloc]init];
- _shenheDataArr = [[NSArray alloc]init];
-
- [self setSegmentControllWithTitles:@[@"基本信息",@"教学日志",@"培训记录表"] isBttomBar:YES]; //,@"打卡记录",@"学时审核记录",@"锁定历史记录" 教学日志可能要gg
- [self createBottomBarWithtoolTitle:@"查看人脸采集照片"];
-
- // 第一次进来请求除基本信息[由上一级传进来]以外的数据
- [self getTrainTimesRecords];
- // [self getStudentSigns];
- // [self getStudentAuditRecords];
- UITableView * tabV = _tableViews[1];
- [self createHeaderViewWithTableView:tabV];
- _holderV1 = [[HolderView alloc] initWithFrame:tabV.frame];
- [_holderV1 freshBlock:^{
-
- [self getTrainTimesRecords];
- }];
- [_mainScroolView addSubview:_holderV1];
- }
- -(void)setData{
- _keysArr = @[
- // @[@"所属机构",@""],
- @[@"证件类型",@"TSO_CARDTYPE"],
- @[@"证件号码",@"TSO_IDCARD"],
- @[@"姓名",@"TSO_NAME"],
- @[@"性别",@"TSO_SEX"],
- @[@"手机号码",@"TSO_PHONE"],
- @[@"来源(推荐人)",@"TSO_SOURCE"],
- @[@"国籍",@"TSO_NATIONALITY"],
- @[@"业务类型",@"TSO_BUSITYPE"],
- @[@"培训车型",@"TSO_TRAINTYPE"],
- @[@"原准驾车型",@"TSO_PERDRITYPE"],
- @[@"驾驶证号",@"TSO_DRILICNUM"],
- @[@"驾驶证初领日期",@"TSO_FSTDRILICDATE"],
- @[@"培训模式",@"TSO_TRAIN_MODE"],
- @[@"报名日期",@"TSO_APPLYDATE"],
- @[@"全国统一编号",@"TSO_STUNUM"],
- @[@"备案时间",@"TSO_RECORD_DATE"],
- @[@"联系地址",@"TSO_ADDRESS"]
- ];
-
- [super setData];
- }
- -(void)createHeaderViewWithTableView:(UITableView *)tabV{
-
- UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kSize.width, 200)];
- view.backgroundColor = [UIColor whiteColor];
- tabV.tableHeaderView = view;
-
- NSArray *titles = @[@"科目",@"总计时长"];
- NSArray *kemuArr = @[@"科一",@"科二",@"科三",@"科四"];
- NSArray *keys = @[@"ONETIME",@"TWOTIME",@"THREETIME",@"FOURTIME"];
- CGFloat x = kSize.width/3;
- CGFloat height = 40;
- for (int i=0; i<4; i++) {
-
- if (i<2) {
- UILabel *lab1 = [[UILabel alloc]initWithFrame:CGRectMake(i*x, 0, x*(i+1), height)];
- [lab1 setText:titles[i] Font:14 TextColor:KTitleColor Alignment:NSTextAlignmentCenter];
- [view addSubview:lab1];
- }
-
- UILabel *lab2 = [[UILabel alloc]initWithFrame:CGRectMake(0, height*(i+1), x, height)];
- [lab2 setText:kemuArr[i] Font:14 TextColor:KSubTitleColor Alignment:NSTextAlignmentCenter];
- [view addSubview:lab2];
-
- UILabel *lab3 = [[UILabel alloc]initWithFrame:CGRectMake(x, height*(i+1), x*2, height)];
- [lab3 setText:self.dataSource[keys[i]] Font:14 TextColor:KSubTitleColor Alignment:NSTextAlignmentCenter];
- [view addSubview:lab3];
-
- }
-
- for (int i=0; i<6; i++) {
-
- if (i<2) {
- UILabel *vLine = [[UILabel alloc]initWithFrame:CGRectMake(1+(x-2/4)*i, 0, 1, 200)];
- vLine.backgroundColor = kLineColor;
- [view addSubview:vLine];
- }
-
-
-
- UILabel *vLine = [[UILabel alloc]initWithFrame:CGRectMake(2, height*i, kSize.width-4, 1)];
- vLine.backgroundColor = kLineColor;
- [view addSubview:vLine];
- }
- }
- #pragma mark 创建BottomBarButton
- -(void)createBottomBarWithtoolTitle:(NSString *)title{
-
- UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
- button.frame = CGRectMake(0, kSize.height-kNavOffSet-JOb_DETAIL_BOTTOMBAR_HEIGHT-kSafeAreaBottomHeight, kSize.width, JOb_DETAIL_BOTTOMBAR_HEIGHT);
- button.backgroundColor = RQMianColor;
- [button setTitle:title textColor:[UIColor whiteColor] font:Font18 fotState:UIControlStateNormal];
- [button addTarget:self action:@selector(goToFaceColloectVC) forControlEvents:UIControlEventTouchUpInside];
- [self.view addSubview:button];
- }
- -(void)goToFaceColloectVC {
-
- FaceColloectVC *faceVC = [[FaceColloectVC alloc] init];
- faceVC.keyWord = self.dataSource[@"TSO_IDCARD"];
- faceVC.currentDate = [NSDate date];
- [self navPushHideTabbarToVC:faceVC];
- }
- #pragma mark 重写代理方法
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- NSInteger index = [_tableViews indexOfObject:tableView];
- if (index == 1) {
- return _teachLogDataArr.count;
- }else if (index == 2+4396){
- return _signDataArr.count;
- }else if (index == 3+4396){
- return _shenheDataArr.count;
- }else if (index == 4-2){
- return 1;
- }
- return [_keysArr count];
- }
- -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
- NSInteger index = [_tableViews indexOfObject:tableView];
- if (index == 1) {
- return 150;
- }else if (index == 4-2){
- return kSize.height-kNavOffSet-JOb_DETAIL_BOTTOMBAR_HEIGHT-JOb_DETAIL_SEGBAR_HEIGHT-kSafeAreaBottomHeight;
- }
- return [super tableView:tableView heightForRowAtIndexPath:indexPath];
- }
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- if ([_tableViews indexOfObject:tableView] == 1) {
- TeachLogCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellTeach"];
-
- if (!cell) {
- //加载xib文件创建cell
- cell = [[[NSBundle mainBundle] loadNibNamed:@"TeachLogCell" owner:nil options:nil] lastObject];
- }
- [cell setDataWithDic:_teachLogDataArr[indexPath.row]];
-
- return cell;
- }
-
- if ([_tableViews indexOfObject:tableView] == 2+4396) {
- SignsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellSign"];
- if (!cell) {
- //加载xib文件创建cell
- cell = [[[NSBundle mainBundle] loadNibNamed:@"SignsCell" owner:nil options:nil] lastObject];
- }
- [cell updataWithDic:_signDataArr[indexPath.row]];
-
- return cell;
- }
-
- if ([_tableViews indexOfObject:tableView] == 3+4396) {
- ShenHeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellTShenhe"];
- if (!cell) {
- //加载xib文件创建cell
- cell = [[[NSBundle mainBundle] loadNibNamed:@"ShenHeCell" owner:nil options:nil] lastObject];
- }
- [cell updataWithDic:_shenheDataArr[indexPath.row]];
-
- return cell;
- }
-
- if ([_tableViews indexOfObject:tableView] == 4-2) {
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"pxjlbCellId"];
- if (!cell) {
- cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"pxjlbCellId"];
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- //培训记录表
- if ([self.dataSource[@"PDFPATH"] length] > 0) {
- UIWebView *webV = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, kSize.width, kSize.height-50-kNavOffSet-kSafeAreaBottomHeight)];
-
- //
- // webV.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);某种比例不变
- webV.scalesPageToFit=YES;
- webV.multipleTouchEnabled=YES;
- webV.userInteractionEnabled=YES;
-
- webV.backgroundColor = [UIColor whiteColor];
- [cell.contentView addSubview:webV];
-
- NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:self.dataSource[@"PDFPATH"]]];
- [webV loadRequest:request];
- }else{
- cell.textLabel.text = @"暂无数据";
- cell.textLabel.textAlignment = NSTextAlignmentCenter;
- }
- return cell;
- }
-
- //这里面有很多自己独有的key类型,所以就不麻烦父类去判定了
- UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cellId"];
-
- if (!cell) {
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellId"];
- }
-
- if ([_statusArr[indexPath.row] isEqualToNumber:@1]) {
- cell.detailTextLabel.numberOfLines = 0;
- cell.detailTextLabel.textAlignment = NSTextAlignmentLeft;
- }else{
- cell.detailTextLabel.numberOfLines = 1;
- cell.detailTextLabel.textAlignment = NSTextAlignmentRight;
- }
-
- NSString * key = _keysArr[indexPath.row][1];
- cell.textLabel.text = _keysArr[indexPath.row][0];
- if ([key isEqualToString:@"TSO_SEX"]) {
- NSString *sex = [NSString stringWithFormat:@"%@",self.dataSource[key]];
-
- cell.detailTextLabel.text = [sex isEqualToString:@"1"] ? @"男" : @"女" ;
- }else if ([key isEqualToString:@"TSO_BUSITYPE"]){
- NSString *status = [NSString stringWithFormat:@"%@",self.dataSource[key]];
-
- switch ([status integerValue]) {
- case 0:
- cell.detailTextLabel.text = @"初领";
- break;
- case 1:
- cell.detailTextLabel.text = @"增领";
- break;
- case 9:
- cell.detailTextLabel.text = @"其它";
- break;
-
- default:
- break;
- }
- }else if ([key isEqualToString:@"TSO_CARDTYPE"]){
- NSString *status = [NSString stringWithFormat:@"%@",self.dataSource[key]];
-
- switch ([status integerValue]) {
- case 1:
- cell.detailTextLabel.text = @"身份证";
- break;
- case 2:
- cell.detailTextLabel.text = @"护照";
- break;
- case 3:
- cell.detailTextLabel.text = @"军官证";
- break;
- case 0:
- cell.detailTextLabel.text = @"其它";
- break;
-
- default:
- break;
- }
- }else if ([key isEqualToString:@"TSO_TRAIN_MODE"]){//培训模式 0 传统模式 1 先学后付 2 分段式收费
- NSString *status = [NSString stringWithFormat:@"%@",self.dataSource[key]];
-
- switch ([status integerValue]) {
- case 0:
- cell.detailTextLabel.text = @"传统模式";
- break;
- case 1:
- cell.detailTextLabel.text = @"先学后付";
- break;
- case 2:
- cell.detailTextLabel.text = @"分段式收费";
- break;
-
- default:
- break;
- }
- }else{
- cell.detailTextLabel.text = [NSString stringWithFormat:@"%@",self.dataSource[_keysArr[indexPath.row][1]]];
- }
-
- return cell;
- }
- #pragma mark 数据请求
- -(void)getTrainTimesRecords{
-
- NSMutableDictionary * mdic = [[NSMutableDictionary alloc]init];
-
- [mdic setValue:@"" forKey:@"isPage"];
- [mdic setValue:@"" forKey:@"pageSize"];
- [mdic setValue:@"" forKey:@"currentPage"];
- [mdic setValue:defUser.userDict[@"dqbh"] forKey:@"dqbh"];
- [mdic setValue:defUser.userDict[@"qxbh"] forKey:@"qxbh"];
- [mdic setObject:defUser.userDict[@"school"] forKey:@"schoolId"];
- [mdic setObject:@"" forKey:@"isReport"];
- [mdic setObject:@"" forKey:@"trainSubject"];
- [mdic setObject:self.dataSource[@"TSO_NAME"] forKey:@"studentName"];
- [mdic setObject:@"" forKey:@"coachName"];
- [mdic setObject:defUser.userDict[@"id"] forKey:@"userId"];
- NSString *method = @"trainRecords";
- [NetManager requestAnythingWithURL:method dictionary:mdic dataArray:nil completion:^(NSDictionary *root) {
-
- [_holderV1 setHidden:NO];
-
- if (!root) {
- return;
- }
- if ([root[@"code"] integerValue] == 1) {
- return;
- }
-
- _teachLogDataArr = root[@"body"];
-
- if (_teachLogDataArr.count > 0) {
- _holderV1.hidden = YES;
- }
-
- [_tableViews[1] reloadData];
-
- }];
-
- }
- -(void)getStudentSigns{
- // NSMutableDictionary * mdic = [NSMutableDictionary new];
- // [mdic setValue:self.requesetDic[@"stunum"] forKey:@"stunum"];
- // [mdic setValue:@"" forKey:@"isPage"];
- // [mdic setValue:@"" forKey:@"pageSize"];
- // [mdic setValue:@"" forKey:@"currentPage"];
- //
- // [self getDataWithDic:mdic method:@"getStudentSigns" block:^(NSDictionary *successdic) {
- //
- // _signDataArr = successdic[@"body"];
- // [_tableViews[2] reloadData];
- // }];
- }
- -(void)getStudentAuditRecords{
- // NSMutableDictionary * mdic = [NSMutableDictionary new];
- // [mdic setValue:self.requesetDic[@"stunum"] forKey:@"stunum"];
- // [mdic setValue:@"" forKey:@"isPage"];
- // [mdic setValue:@"" forKey:@"pageSize"];
- // [mdic setValue:@"" forKey:@"currentPage"];
- //
- // [self getDataWithDic:mdic method:@"getStudentAuditRecords" block:^(NSDictionary *successdic) {
- //
- // _shenheDataArr = successdic[@"body"];
- // [_tableViews[3] reloadData];
- // }];
- }
- - (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
|