//
|
// 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
|