zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
//
//  PBCheckViewController.m
//  IphoneBIMe
//
//  Created by zjf on 2020/8/18.
//  Copyright © 2020 ProBIM. All rights reserved.
//
 
#import "PBCheckViewController.h"
#import "PBExamineListModel.h"
#import "PBExamineAddModel.h"
#import "PBExamineInputTableViewCell.h"
#import "PBTwoChooseTableViewCell.h"
#import "PBPersonTableViewCell.h"
#import "PBEditPersonView.h"
#import "PBProjectModel.h"
#import "PBEditTextController.h"
#import "PBTwoChooseView.h"
//#import "PBExamineTableHeaderView.h"
#import "PBPersonModel.h"
#import "PBTextInputTableViewCell.h"
#import "PBTopTitleTableViewCell.h"
#import "PBRadioTableViewCell.h"
#import "PBPersonChooseTableViewCell.h"
#import "PBInstructionsTableViewCell.h"
#import "PBStatusTableViewCell.h"
#import "PBCheckHeaderView.h"
#import "PBPersonListViewController.h"
#import "PBSelectedPersonController.h"
#import "LXFCameraController.h"
#import "PBVideoPlayViewController.h"
#import "PBExamineListViewController.h"
static NSString *const inputCellID = @"InputCellID";
static NSString *const titleCellID = @"titleCellID";
static NSString *const radioCellID = @"radioCellID";
static NSString *const statusCellID = @"statusCellID";
static NSString *const personCellID = @"personCellID";
static NSString *const instructionsCellID = @"instructionsCellID";
 
@interface PBCheckViewController ()<UITableViewDelegate, UITableViewDataSource, LFImagePickerControllerDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray<PBExamineAddModel *> *dataListM;
@property (nonatomic, strong) PBEditPersonView *editPersonView;
@property (nonatomic, strong) PBTwoChooseView *twoChooseView;
@property (nonatomic, strong) PBCheckHeaderView *tableheaderView;
@property (nonatomic, strong) NSMutableArray *selectedPhotos;
@property (nonatomic, strong) NSMutableArray *selectedVideo;
@property (nonatomic, assign) BOOL isQualified;
@property (nonatomic, strong) NSMutableArray *selectAssetArr;
@property (nonatomic, assign) NSInteger personIndex;
@end
 
@implementation PBCheckViewController
//- (void)viewWillAppear:(BOOL)animated {
//    [super viewWillAppear:animated];
//    [self.navigationController setNavigationBarHidden:YES animated:animated];
//}
- (void)viewDidLoad {
    [super viewDidLoad];
    [PBNoteCenter addObserver:self selector:@selector(updatePerson:) name:PBNoteCenterUpdatePerson object:nil];
    [self setupNav];
    [self loadData];
    [self setupUI];
}
- (void)dealloc {
    [PBNoteCenter removeObserver:self];
}
- (void)updatePerson:(NSNotification *)noti {
    PBExamineAddModel *examineAddModel = self.dataListM[self.personIndex];
    examineAddModel.personArr = noti.object;
    NSIndexPath *path = [NSIndexPath indexPathForRow:self.personIndex inSection:0];
    [self.tableView reloadRowsAtIndexPaths:@[path] withRowAnimation:UITableViewRowAnimationFade];
//    [self.tableView reloadRowsAtIndexPaths:@[path] withRowAnimation:UITableViewRowAnimationFade];
}
- (void)setupNav {
    self.view.backgroundColor = PBColor(244, 245, 246);
//    UIView *topV = [[UIView alloc] init];
//    topV.backgroundColor = [UIColor whiteColor];
//    [self.view addSubview:topV];
//    [topV mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.left.right.equalTo(self.view);
//        make.height.equalTo(@50);
//    }];
//    UIButton *cancelBtn = [UIButton z_textButton:@"取消" fontSize:16 normalColor:PBColor(97, 111, 125)];
//    [cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:cancelBtn];
//    [cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.view).offset(16);
//        make.left.equalTo(self.view).offset(20);
//        make.size.mas_equalTo(CGSizeMake(34, 18));
//    }];
//    UILabel *titleL = [UILabel z_labelWithText:@"检查" Color:PBColor(97, 111, 125) isBold:YES Font:16];
//    [self.view addSubview:titleL];
//    [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.view).offset(16);
//        make.size.mas_equalTo(CGSizeMake(34, 18));
//        make.centerX.equalTo(self.view);
//    }];
//    UIView *linV = [[UIView alloc] init];
//    linV.backgroundColor = PBColor(233, 235, 237);
//    [self.view addSubview:linV];
//    [linV mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(topV.mas_bottom);
//        make.left.right.equalTo(self.view);
//        make.height.equalTo(@1);
//    }];
    self.title = @"检查";
    UIBarButtonItem *backNavItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Doc_preview_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backItemAction)];
    self.navigationItem.leftBarButtonItem = backNavItem;
}
- (void)backItemAction {
    [self.navigationController popViewControllerAnimated:YES];
}
//- (void)cancelAction {
//    [self dismissViewControllerAnimated:YES completion:nil];
//}
- (void)loadData {
    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"examineAdd4" ofType:@"plist"];
    NSArray *list = [NSArray arrayWithContentsOfFile:plistPath];
    NSMutableArray *listM = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < list.count; i++) {
        NSDictionary *dict = list[i];
        PBExamineAddModel *model = [PBExamineAddModel yy_modelWithDictionary:dict];
        model.isAddExamine = YES;
//        model.isIssueManage = self.isIssueManage;
        [listM addObject:model];
    }
    self.dataListM = listM;
}
- (void)setupUI {
    __weak typeof(self) weakSelf = self;
    self.tableView = [[UITableView alloc] init];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 100.f;
    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.bounces = NO;
    self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
    [self.tableView registerClass:[PBTextInputTableViewCell class] forCellReuseIdentifier:inputCellID];
    [self.tableView registerClass:[PBTopTitleTableViewCell class] forCellReuseIdentifier:titleCellID];
    [self.tableView registerClass:[PBRadioTableViewCell class] forCellReuseIdentifier:radioCellID];
    [self.tableView registerClass:[PBStatusTableViewCell class] forCellReuseIdentifier:statusCellID];
    [self.tableView registerClass:[PBPersonChooseTableViewCell class] forCellReuseIdentifier:personCellID];
    [self.tableView registerClass:[PBInstructionsTableViewCell class] forCellReuseIdentifier:instructionsCellID];
    [self.view addSubview:self.tableView];
    CGFloat bottomH = 64.f;
    if (IS_IPHONE_X) {
        bottomH = 64.f + IPHONE_X_BOTTOM;
    }
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.bottom.equalTo(self.view).offset(-(bottomH));
    }];
    UIButton *checkBtn = [UIButton z_bgImageButton:[UIImage imageNamed:@"publish_check"]];
    [checkBtn addTarget:self action:@selector(checkAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:checkBtn];
    [checkBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.tableView.mas_bottom).offset(7);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.height.equalTo(@50);
    }];
    
    self.tableheaderView = [[PBCheckHeaderView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 100)];
    self.tableheaderView.ChooseImageBlock = ^{
        [weakSelf.view endEditing:YES];
        [weakSelf chooseImageOrVideo];
    };
    self.tableheaderView.DeleteImageBlock = ^(NSInteger index) {
        [weakSelf.selectedPhotos removeObjectAtIndex:index];
        [weakSelf setTableHeaderViewImage];
    };
    self.tableheaderView.DeleteVideoBlock = ^{
        [weakSelf.selectedVideo removeAllObjects];
        [weakSelf setTableHeaderViewImage];
    };
    self.tableheaderView.PlayVideoBlock = ^{
        [weakSelf.view endEditing:YES];
        NSLog(@"打开视频");
        PBVideoPlayViewController *playVC = [[PBVideoPlayViewController alloc] init];
        PBResultVideo *result = weakSelf.selectedVideo[0];
        playVC.filePath = result.url;
        [weakSelf.navigationController pushViewController:playVC animated:YES];
//        PBVideoPlayViewController *playVC = [[PBVideoPlayViewController alloc] init];
//        playVC.url = videoUrl;
//        [self.navigationController pushViewController:playVC animated:YES];
    };
    self.tableheaderView.projectModel = self.projectModel;
    self.tableheaderView.isAddExamine = YES;
    self.tableView.tableHeaderView = self.tableheaderView;
}
 
- (void)chooseImageOrVideo {
    if (self.selectedPhotos.count > 0) {
        [self takePhotoLibrary];
        return;;
    }
    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"" message:@"请选择" preferredStyle:UIAlertControllerStyleActionSheet];
    UIAlertAction *videoAction  = [UIAlertAction actionWithTitle:@"拍摄" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [self videoBtnFunc];
    }];
    UIAlertAction *imageAction  = [UIAlertAction actionWithTitle:@"从手机相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [self takePhotoLibrary];
    }];
    UIAlertAction *cancelAction  = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
    [alertVC addAction:videoAction];
    [alertVC addAction:imageAction];
    [alertVC addAction:cancelAction];
    [self presentViewController:alertVC animated:YES completion:nil];
}
- (void)videoBtnFunc {
    LXFCameraController *cameraController = [LXFCameraController defaultCameraController];
    
    __weak LXFCameraController *weakCameraController = cameraController;
    
    cameraController.takePhotosCompletionBlock = ^(UIImage *image, NSError *error) {
        NSLog(@"takePhotosCompletionBlock");
        [weakCameraController dismissViewControllerAnimated:YES completion:nil];
        NSData *imageData = UIImageJPEGRepresentation(image, 0.5);
        UIImage *originalImage = [UIImage imageWithData:imageData];
        [self.selectedPhotos addObject:originalImage];
        [self setTableHeaderViewImage];
    };
    
    cameraController.shootCompletionBlock = ^(NSURL *videoUrl, CGFloat videoTimeLength, UIImage *thumbnailImage, NSError *error) {
        NSLog(@"shootCompletionBlock");
        [weakCameraController dismissViewControllerAnimated:YES completion:nil];
        PBResultVideo *video = [[PBResultVideo alloc] init];
        video.coverImage = thumbnailImage;
        video.url = videoUrl;
        video.data = [NSData dataWithContentsOfURL:videoUrl];
        [self.selectedVideo addObject:video];
        [self setTableHeaderViewImage];
    };
    
    cameraController.modalPresentationStyle = UIModalPresentationFullScreen;
    [self presentViewController:cameraController animated:YES completion:nil];
}
 
//新增图片选择图片后填充
- (void)setTableHeaderViewImage {
    if (self.selectedVideo.count > 0) {
        self.tableheaderView.videoArr = self.selectedVideo;
    }else {
        self.tableheaderView.imageArr = self.selectedPhotos;
    }
}
- (void)takePhotoLibrary {
    PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];
    if (status == PHAuthorizationStatusNotDetermined) {//未作出回应
        [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
            if(status == PHAuthorizationStatusAuthorized) {
                dispatch_async(dispatch_get_main_queue(), ^{//用户点击ok
                    [self pushLFImagePickerController];
                });
            } else {
                dispatch_async(dispatch_get_main_queue(), ^{//点击不允许访问
                    NSLog(@"点击不允许访问");
                });
            }
        }];
    }else if (status == PHAuthorizationStatusRestricted) {//没有被授权访问 可能家长控制
 
    }else if (status == PHAuthorizationStatusDenied) {//已明确否认相册权限
        UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"无法访问相册" message:@"请在iPhone的""设置-隐私-相册""中允许访问相册" preferredStyle:UIAlertControllerStyleAlert];
        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
        UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"设置" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            if (@available(iOS 10.0, *)) {
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
            } else {
                NSLog(@"选择取消");
            }
        }];
        [alertController addAction:cancelAction];
        [alertController addAction:okAction];
        [self presentViewController:alertController animated:YES completion:nil];
    }else if (status == PHAuthorizationStatusAuthorized){//有权限访问
        [self pushLFImagePickerController];
    }
}
 
- (void)pushLFImagePickerController {
    NSInteger maxImageCount = 9 - self.selectedPhotos.count;
    LFImagePickerController *imagePicker = [[LFImagePickerController alloc] initWithMaxImagesCount:maxImageCount delegate:self];
    imagePicker.maxVideosCount = 1;
    imagePicker.allowTakePicture = YES;//内部显示相机
    imagePicker.isSelectOriginalPhoto = YES;//是否选择原图
    if (self.selectedPhotos.count > 0) {
        imagePicker.allowPickingType = LFPickingMediaTypePhoto;//用户是否可以选择视频
    }else {
        imagePicker.allowPickingType = LFPickingMediaTypeALL;//用户是否可以选择视频
    }
    imagePicker.allowPickingOriginalPhoto = NO;//原图按钮将隐藏,用户将不能发送原图
    imagePicker.maxPhotoBytes = 1024 * 1024 * 100;//最大图片所选字节大小
    if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f) {
        imagePicker.syncAlbum = YES; /** 实时同步相册 */
    }
//    imagePicker.selectedAssets = self.selectAssetArr.copy;
    [self presentViewController:imagePicker animated:YES completion:nil];
}
#pragma mark - LFImagePickerControllerDelegate
 
- (void)lf_imagePickerController:(LFImagePickerController *)picker didFinishPickingResult:(NSArray <LFResultObject /* <LFResultImage/LFResultVideo> */*> *)results {
//    NSMutableArray *assetArr = [[NSMutableArray alloc] init];
    NSMutableArray *videoArr = [[NSMutableArray alloc] init];
    NSMutableArray *imageArrM = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < results.count; i++) {
        LFResultObject *result = results[i];
        if ([result isKindOfClass:[LFResultImage class]]){
            LFResultImage *resultImage = (LFResultImage *)result;
            NSData *imageData = UIImageJPEGRepresentation(resultImage.originalImage, 0.5);
            UIImage *originalImage = [UIImage imageWithData:imageData];
            [imageArrM addObject:originalImage];
        }else {
            LFResultVideo *resultVideo = (LFResultVideo *)result;
            PBResultVideo *video = [[PBResultVideo alloc] init];
            video.coverImage = resultVideo.coverImage;
            video.url = resultVideo.url;
            video.data = resultVideo.data;
            [videoArr addObject:video];
        }
    }
    if (videoArr.count > 0) {
        self.selectedVideo = videoArr;
        [self.selectedPhotos removeAllObjects];
    }else {
        [self.selectedPhotos addObjectsFromArray:imageArrM.copy];
    }
//    self.selectAssetArr = assetArr;
    [self setTableHeaderViewImage];
}
 
#pragma mark - 检查方法
- (void)checkAction {
    [self.view endEditing:YES];
    [YJProgressHUD showProgress:@"" inView:self.view];
    NSMutableDictionary *dictM = [[NSMutableDictionary alloc] init];
    for (PBExamineAddModel *examineAddModel in self.dataListM) {
        if ([examineAddModel.cellType isEqualToString:@"input"]) {
            if ([examineAddModel.dataStr isEqualToString:@""] || examineAddModel.dataStr == nil) {
                [YJProgressHUD showMessage:@"请填写完整" inView:self.view];
                return;
            }
            [dictM setObject:examineAddModel.dataStr forKey:examineAddModel.key];
        }else if ([examineAddModel.cellType isEqualToString:@"choose"]){
            if ([examineAddModel.dataStr isEqualToString:@""] || examineAddModel.dataStr == nil) {
                [YJProgressHUD showMessage:@"请填写完整" inView:self.view];
                return;
            }
            if ([examineAddModel.key isEqualToString:@"aede_severitylevel"]) {
                if ([examineAddModel.dataStr isEqualToString:statuChoosequalified]) {
                    examineAddModel.dataStr = @"";
                }
                [dictM setObject:examineAddModel.dataStr forKey:examineAddModel.key];
            }else {
                NSString *chooseValue;
                if ([examineAddModel.dataStr isEqualToString:@"已合格"]) {
                    chooseValue = @"1";
                    self.isQualified = YES;
                }else {
                    chooseValue = @"0";
                }
                [dictM setObject:chooseValue forKey:examineAddModel.key];
            }
        }else if ([examineAddModel.cellType isEqualToString:@"person"]) {
            if (self.isQualified) {
                [dictM setObject:@"" forKey:examineAddModel.key];
            }else {
                NSMutableString *userIdStrM = [[NSMutableString alloc] init];
                for (PBPersonModel *obj in examineAddModel.personArr) {
                    [userIdStrM appendString:[NSString stringWithFormat:@"%@,",obj.UserId]];
                }
                if (userIdStrM.length == 0) {
                    if([examineAddModel.key isEqualToString:@"RelationMemberID"]) {
                        [YJProgressHUD showMessage:@"请填写完整" inView:self.view];
                        return;
                    }else {
                        [dictM setObject:@"" forKey:examineAddModel.key];
                    }
                }else {
                    [dictM setObject:userIdStrM.copy forKey:examineAddModel.key];
                }
            }
        }
    }
    NSMutableArray *arrM;
    if (self.selectedVideo.count > 0) {
        arrM = self.selectedVideo;
    }else {
        arrM = self.selectedPhotos;
    }
    [[PBNetworkTools sharedTools] checkMissionWithExamineID:self.examineListModel.ExamineID andOrganizeId:self.projectModel.organizeid andData:dictM andImageArr:arrM andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
            return;
        }
        NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSLog(@"%@",str);
        PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
        if (networkModel.Ret == 1) {
            [YJProgressHUD hide];
//            if (self.CkeckCompleteBlock) {
//                self.CkeckCompleteBlock();
//            }
            [self backAction];
        }else {
            [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
        }
    }];
}
- (void)backAction{
    UINavigationController *navVC = self.navigationController;
    NSMutableArray *viewControllers = [[NSMutableArray alloc] init];
    for (UIViewController *vc in [navVC viewControllers]) {
        [viewControllers addObject:vc];
        if ([vc isKindOfClass:[PBExamineListViewController class]]) {
            break;
         }
    }
    [navVC setViewControllers:viewControllers animated:YES];
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 9;
}
 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//    __weak typeof(self) weakSelf = self;
    if (indexPath.row == 0) {
        PBTextInputTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:inputCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if (indexPath.row == 1 || indexPath.row == 3 || indexPath.row == 5) {
        PBTopTitleTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:titleCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if (indexPath.row == 6) {
        PBInstructionsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:instructionsCellID forIndexPath:indexPath];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if (indexPath.row == 2) {
        PBRadioTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:radioCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if (indexPath.row == 4) {
        PBStatusTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:statusCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        cell.statusChange = ^(NSString * _Nonnull statu) {
            NSInteger severityLevelIndex = 2;
            PBExamineAddModel *levelExamineAddModel = self.dataListM[severityLevelIndex];
            if ([statu isEqualToString:@"已合格"]) {
                levelExamineAddModel.dataStr = statuChoosequalified;
            }else {
                levelExamineAddModel.dataStr = @"";
            }
            NSIndexPath *path = [NSIndexPath indexPathForRow:severityLevelIndex inSection:0];
            [self.tableView reloadRowsAtIndexPaths:@[path] withRowAnimation:(UITableViewRowAnimationFade)];
        };
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }else if (indexPath.row == 7) {
        PBPersonChooseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:personCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        cell.ChooseBlock = ^{
              [self.view endEditing:YES];
              self.personIndex = indexPath.row;
              PBPersonListViewController *personListVC = [[PBPersonListViewController alloc] init];
              personListVC.projectModel = self.projectModel;
              if (indexPath.row == 7) {
                  personListVC.isMultiSelect = YES;
              }else {
                  personListVC.isMultiSelect = NO;
              }
              personListVC.selectList = examineAddModel.personArr.mutableCopy;
              [self.navigationController pushViewController:personListVC animated:YES];
          };
          cell.LookAllBlock = ^{
              PBSelectedPersonController *selectedPersonVC = [[PBSelectedPersonController alloc] init];
              selectedPersonVC.selectList = examineAddModel.personArr.mutableCopy;
              [self.navigationController pushViewController:selectedPersonVC animated:YES];
          };
          cell.selectionStyle = UITableViewCellSelectionStyleNone;
          return cell;
    }else if (indexPath.row == 8) {
        PBPersonChooseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:personCellID forIndexPath:indexPath];
        PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
        cell.examineAddModel = examineAddModel;
        cell.ChooseBlock = ^{
              [self.view endEditing:YES];
              self.personIndex = indexPath.row;
              PBPersonListViewController *personListVC = [[PBPersonListViewController alloc] init];
              personListVC.projectModel = self.projectModel;
              if (indexPath.row == 7) {
                  personListVC.isMultiSelect = YES;
              }else {
                  personListVC.isMultiSelect = NO;
              }
              personListVC.selectList = examineAddModel.personArr.mutableCopy;
              [self.navigationController pushViewController:personListVC animated:YES];
          };
          cell.LookAllBlock = ^{
              PBSelectedPersonController *selectedPersonVC = [[PBSelectedPersonController alloc] init];
              selectedPersonVC.selectList = examineAddModel.personArr.mutableCopy;
              [self.navigationController pushViewController:selectedPersonVC animated:YES];
          };
          cell.selectionStyle = UITableViewCellSelectionStyleNone;
          return cell;
    }else {
        return nil;
    }
}
- (void)setExamineListModel:(PBExamineListModel *)examineListModel {
    _examineListModel = examineListModel;
}
- (void)setStateArr:(NSArray *)stateArr {
    _stateArr = stateArr;
}
- (void)setLevelArr:(NSArray *)levelArr {
    _levelArr = levelArr;
}
 
- (NSMutableArray *)selectedPhotos {
    if (_selectedPhotos == nil) {
        _selectedPhotos = [[NSMutableArray alloc] init];
    }
    return _selectedPhotos;
}
- (NSMutableArray *)selectedVideo {
    if (_selectedVideo == nil) {
        _selectedVideo = [[NSMutableArray alloc] init];
    }
    return _selectedVideo;
}
 
- (PBEditPersonView *)editPersonView {
    if (_editPersonView == nil) {
        _editPersonView = [[PBEditPersonView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        CGFloat bottomH = 0.f;
        if (IS_IPHONE_X) {
            bottomH = 34.f;
        }
        _editPersonView.visualViewHeight = 468.f + bottomH;
        _editPersonView.isExamineChoose = YES;
    }
    return _editPersonView;
}
- (PBTwoChooseView *)twoChooseView {
    if (_twoChooseView == nil) {
        _twoChooseView = [[PBTwoChooseView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _twoChooseView.visualViewHeight = 468.f;
//        _twoChooseView.unitDict = self.engineeringArr;
    }
    return _twoChooseView;
}
 
/*
#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