//
|
// PBExamineDetailController.m
|
// IphoneBIMe
|
//
|
// Created by zjf on 2020/8/19.
|
// Copyright © 2020 ProBIM. All rights reserved.
|
//
|
|
#import "PBExamineDetailController.h"
|
#import "PBExamineAddModel.h"
|
#import "PBExamineListModel.h"
|
#import "PBExamineInputTableViewCell.h"
|
#import "PBTextShowTableViewCell.h"
|
#import "PBTwoChooseTableViewCell.h"
|
#import "PBPersonTableViewCell.h"
|
#import "PBListTableViewCell.h"
|
#import "PBCheckTableViewCell.h"
|
#import "PBRecordViewController.h"
|
#import "PBRoleModel.h"
|
#import "PBAddRecordViewController.h"
|
#import "PBApplyInspectionViewController.h"
|
#import "PBEditPersonView.h"
|
#import "PBPersonModel.h"
|
#import "PBProjectModel.h"
|
#import "PBOneChooseTableViewCell.h"
|
#import "PBVideoPlayViewController.h"
|
#import "PBComponentHierarchyView.h"
|
#import "PBTextInputTableViewCell.h"
|
#import "PBTopTitleTableViewCell.h"
|
#import "PBTimeChooseTableViewCell.h"
|
#import "PBPersonChooseTableViewCell.h"
|
#import "PBArtifactsListTableViewCell.h"
|
#import "PBRadioTableViewCell.h"
|
#import "PBCheckInfoTableViewCell.h"
|
#import "PBCheckImageTableViewCell.h"
|
static NSString *const inputCellID = @"InputCellID";
|
static NSString *const topTitleCellID = @"topTitleCellID";
|
static NSString *const timeChooseCellID = @"timeChooseCellID";
|
static NSString *const textCellID = @"textCellID";
|
static NSString *const listCellID = @"listCellID";
|
static NSString *const personCellID = @"personCellID";
|
static NSString *const imageCellID = @"imageCellID";
|
static NSString *const radioCellID = @"radioCellID";
|
static NSString *const checkInfoCellID = @"checkInfoCellID";
|
static NSString *const checkImageCellID = @"checkImageCellID";
|
@interface PBExamineDetailController ()<UITableViewDelegate, UITableViewDataSource>
|
@property (nonatomic, strong) UITableView *tableView;
|
@property (nonatomic, strong) NSMutableArray<PBExamineAddModel *> *dataListM;
|
@property (nonatomic, strong) NSDictionary *examinDetailDic;
|
@property (nonatomic, strong) PBRoleModel *roleModel;
|
@property (nonatomic, strong) PBEditPersonView *editPersonView;
|
@property (nonatomic, strong) PBComponentHierarchyView *componentHierarchyView;
|
@property (nonatomic, strong) NSDictionary *typeDict;
|
@property (nonatomic, weak) UIButton *typeListBtn;
|
@property (nonatomic, weak) UIButton *functionBtn;
|
@end
|
|
@implementation PBExamineDetailController
|
- (void)viewWillAppear:(BOOL)animated {
|
[super viewWillAppear:animated];
|
// [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
|
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.f) {
|
self.edgesForExtendedLayout = UIRectEdgeNone;
|
self.navigationController.interactivePopGestureRecognizer.enabled = NO; //让rootView禁止滑动
|
}
|
}
|
- (void)viewDidLoad {
|
[super viewDidLoad];
|
self.view.backgroundColor = PBColor(244, 245, 246);
|
[self setupNav];
|
[self loadData];
|
[self loadRelevantData];
|
}
|
- (void)setupNav {
|
UIBarButtonItem *backNavItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Doc_preview_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backItemAction)];
|
self.navigationItem.leftBarButtonItem = backNavItem;
|
UIBarButtonItem *stateNavItem = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:self action:nil];
|
[stateNavItem setImage:[[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
[stateNavItem setImageInsets:UIEdgeInsetsMake(0, 20, 0, -20)];
|
self.navigationItem.rightBarButtonItem = stateNavItem;
|
}
|
- (void)typeListShow {
|
}
|
- (void)backItemAction {
|
[self.navigationController popViewControllerAnimated:YES];
|
}
|
- (void)loadData {
|
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"examineAdd5" 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 = NO;
|
// model.isIssueManage = self.isIssueManage;
|
|
[listM addObject:model];
|
}
|
self.dataListM = listM;
|
}
|
#pragma mark - 加载检查相关数据
|
- (void)loadRelevantData {
|
[YJProgressHUD showProgress:@"" inView:self.view];
|
[[PBNetworkTools sharedTools] RequestGetItemWithExamineID:self.examineListModel.ExamineID andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
|
if (error) {
|
[YJProgressHUD showMessage:@"加载详情失败" inView:self.view];
|
return;
|
}
|
NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
|
NSLog(@"%@",str);
|
PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
|
if (networkModel.Ret == 1) {
|
self.examinDetailDic = networkModel.Data;
|
self.roleModel = [PBRoleModel yy_modelWithDictionary:networkModel.Data];
|
[self collatingDetailedData];
|
}else {
|
[YJProgressHUD showMessage:networkModel.Msg inView:self.view];
|
}
|
}];
|
}
|
|
- (void)collatingDetailedData {
|
for (PBExamineAddModel *examineAddModel in self.dataListM) {
|
if ([examineAddModel.cellType isEqualToString:@"time"] || [examineAddModel.cellType isEqualToString:@"input"]){
|
NSString *dataStr = [self.examinDetailDic valueForKey:examineAddModel.key];
|
if ([dataStr isKindOfClass:[NSNull class]]) {
|
examineAddModel.dataStr = nil;
|
}else {
|
if ([examineAddModel.cellType isEqualToString:@"time"]) {
|
NSRange range = [dataStr rangeOfString:@"T"];
|
dataStr = [dataStr substringToIndex:range.location];
|
|
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
//需要设置为和字符串相同的格式
|
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
|
NSDate *localDate = [dateFormatter dateFromString:dataStr];
|
NSDateFormatter *dateFormat1 = [[NSDateFormatter alloc] init];
|
[dateFormat1 setDateFormat:@"yyyy年M月d日"];
|
NSString *timeStr = [dateFormat1 stringFromDate:localDate];
|
examineAddModel.dataStr = timeStr;
|
}else {
|
examineAddModel.dataStr = dataStr;
|
}
|
}
|
}else if ([examineAddModel.cellType isEqualToString:@"list"]) {
|
examineAddModel.dataArr = [self.examinDetailDic valueForKey:examineAddModel.key];
|
}else if ([examineAddModel.cellType isEqualToString:@"person"]) {
|
if ([examineAddModel.key isEqualToString:@"CheckerName"]) {
|
PBPersonModel *personModel = [[PBPersonModel alloc] init];
|
personModel.RealName = [self.examinDetailDic valueForKey:examineAddModel.key];
|
examineAddModel.personArr = @[personModel];
|
}else {
|
NSMutableArray *arrM = [[NSMutableArray alloc] init];
|
NSArray *personArr = [self.examinDetailDic valueForKey:examineAddModel.key];
|
for (NSDictionary *obj in personArr) {
|
PBPersonModel *personModel = [PBPersonModel yy_modelWithDictionary:obj];
|
[arrM addObject:personModel];
|
};
|
examineAddModel.personArr = arrM.copy;
|
}
|
}else if ([examineAddModel.cellType isEqualToString:@"choose"]) {
|
NSString *dataStr = [self.examinDetailDic valueForKey:examineAddModel.key];
|
if ([dataStr isKindOfClass:[NSNull class]] || dataStr == nil || [dataStr isEqualToString:@""]) {
|
examineAddModel.dataStr = statuChoosequalified;
|
}else {
|
examineAddModel.dataStr = dataStr;
|
}
|
}else if ([examineAddModel.cellType isEqualToString:@"checkTitle"]) {
|
NSArray *arr = [self.examinDetailDic valueForKey:examineAddModel.key];
|
if (arr.count > 0) {
|
NSDictionary *dict = arr[arr.count - 1];
|
examineAddModel.dataStr = [dict valueForKey:@"RectificationRemark"];
|
}
|
}else if ([examineAddModel.cellType isEqualToString:@"image"]) {
|
NSArray *arr = [self.examinDetailDic valueForKey:examineAddModel.key];
|
if (arr.count > 0) {
|
NSDictionary *dict = arr[arr.count - 1];
|
examineAddModel.dataArr = [dict valueForKey:@"Attachments"];
|
}
|
}
|
}
|
[self setupUI];
|
}
|
- (void)setupUI {
|
// __weak typeof(self) weakSelf = self;
|
self.title = [self.examinDetailDic valueForKey:@"aedt_name"];
|
self.view.backgroundColor = PBColor(244, 245, 246);
|
// self.view.backgroundColor = [UIColor blackColor];
|
// UIView *bgView = [[UIView alloc] init];
|
// bgView.backgroundColor = PBColor(244, 245, 246);
|
// [self.view addSubview:bgView];
|
// [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
// make.top.equalTo(self.view).offset(70);
|
// make.left.right.bottom.equalTo(self.view);
|
// }];
|
self.tableView = [[UITableView alloc] init];
|
self.tableView.dataSource = self;
|
self.tableView.delegate = self;
|
self.tableView.rowHeight = UITableViewAutomaticDimension;
|
self.tableView.estimatedRowHeight = 100.f;
|
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
self.tableView.bounces = NO;
|
[self.tableView registerClass:[PBTextInputTableViewCell class] forCellReuseIdentifier:inputCellID];
|
[self.tableView registerClass:[PBTopTitleTableViewCell class] forCellReuseIdentifier:topTitleCellID];
|
[self.tableView registerClass:[PBTimeChooseTableViewCell class] forCellReuseIdentifier:timeChooseCellID];
|
[self.tableView registerClass:[PBTextShowTableViewCell class] forCellReuseIdentifier:textCellID];
|
[self.tableView registerClass:[PBArtifactsListTableViewCell class] forCellReuseIdentifier:listCellID];
|
[self.tableView registerClass:[PBPersonChooseTableViewCell class] forCellReuseIdentifier:personCellID];
|
[self.tableView registerClass:[PBCheckTableViewCell class] forCellReuseIdentifier:imageCellID];
|
[self.tableView registerClass:[PBRadioTableViewCell class] forCellReuseIdentifier:radioCellID];
|
[self.tableView registerClass:[PBCheckInfoTableViewCell class] forCellReuseIdentifier:checkInfoCellID];
|
[self.tableView registerClass:[PBCheckImageTableViewCell class] forCellReuseIdentifier:checkImageCellID];
|
[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));
|
}];
|
UIView *linV = [[UIView alloc] init];
|
linV.backgroundColor = PBColor(246, 246, 247);
|
[self.view addSubview:linV];
|
[linV mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(self.tableView.mas_bottom);
|
make.left.right.equalTo(self.view);
|
make.height.equalTo(@1);
|
}];
|
UIButton *recordBtn = [UIButton z_bgImageButton:[UIImage imageNamed:@"recording"]];
|
[recordBtn addTarget:self action:@selector(recordAction) forControlEvents:UIControlEventTouchUpInside];
|
[self.view addSubview:recordBtn];
|
[recordBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(self.tableView.mas_bottom).offset(15);
|
make.left.equalTo(self.view).offset(20);
|
make.size.mas_equalTo(CGSizeMake(93, 24));
|
}];
|
UIButton *functionBtn = [[UIButton alloc] init];
|
self.functionBtn = functionBtn;
|
[self.view addSubview:functionBtn];
|
[functionBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(self.tableView.mas_bottom).offset(15);
|
make.right.equalTo(self.view).offset(-10);
|
}];
|
NSString *result = [self.examinDetailDic valueForKey:@"ExamineResult"];
|
NSString *flagStr = [result substringToIndex:1];
|
UIImage *image;
|
if ([flagStr isEqualToString:@"A"]) {
|
image = [UIImage imageNamed:@"Rectify_ check"];
|
}else if ([flagStr isEqualToString:@"B"]) {
|
image = [UIImage imageNamed:@"Rectify_ rectification"];
|
[functionBtn setImage:[UIImage imageNamed:@"btn_applyforreexamination"] forState:UIControlStateNormal];
|
[functionBtn setImage:[UIImage imageNamed:@"btn_applyforreexamination_disable"] forState:UIControlStateDisabled];
|
if (self.roleModel.User_InRelation) {
|
functionBtn.enabled = YES;
|
}else {
|
functionBtn.enabled = NO;
|
}
|
[functionBtn addTarget:self action:@selector(apply) forControlEvents:UIControlEventTouchUpInside];
|
}else if ([flagStr isEqualToString:@"C"]) {
|
image = [UIImage imageNamed:@"Rectify_ acceptance"];
|
[functionBtn setImage:[UIImage imageNamed:@"checkacceptance"] forState:UIControlStateNormal];
|
[functionBtn setImage:[UIImage imageNamed:@"checkacceptance_disable"] forState:UIControlStateDisabled];
|
if (self.roleModel.User_InPrincipal) {
|
functionBtn.enabled = YES;
|
}else {
|
functionBtn.enabled = NO;
|
}
|
[functionBtn addTarget:self action:@selector(acceptance) forControlEvents:UIControlEventTouchUpInside];
|
}else if ([flagStr isEqualToString:@"D"]) {
|
image = [UIImage imageNamed:@"Rectify_ qualified"];
|
[functionBtn setImage:[UIImage imageNamed:@"qualified_disable"] forState:UIControlStateDisabled];
|
functionBtn.enabled = NO;
|
}else if ([flagStr isEqualToString:@"E"]) {
|
image = [UIImage imageNamed:@"Rectify_close"];
|
[functionBtn setImage:[UIImage imageNamed:@"closed_disable"] forState:UIControlStateDisabled];
|
functionBtn.enabled = NO;
|
}else {
|
image = [UIImage imageNamed:@""];
|
}
|
[self.navigationItem.rightBarButtonItem setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
}
|
#pragma mark - 申请复检
|
- (void)apply {
|
PBApplyInspectionViewController *applyInspectionVC = [[PBApplyInspectionViewController alloc] init];
|
applyInspectionVC.examineListModel = self.examineListModel;
|
applyInspectionVC.projectModel = self.projectModel;
|
applyInspectionVC.isBackList = YES;
|
applyInspectionVC.UpdateRecordListBlock = ^{
|
//更改任务当前状态 及 底部按钮
|
UIImage *image = [UIImage imageNamed:@"Rectify_ acceptance"];
|
[self.navigationItem.rightBarButtonItem setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
[self.functionBtn setImage:[UIImage imageNamed:@"acceptance"] forState:UIControlStateNormal];
|
[self.functionBtn setImage:[UIImage imageNamed:@"acceptance_dis"] forState:UIControlStateDisabled];
|
if (self.roleModel.User_InPrincipal) {
|
self.functionBtn.enabled = YES;
|
}else {
|
self.functionBtn.enabled = NO;
|
}
|
[self.functionBtn addTarget:self action:@selector(acceptance) forControlEvents:UIControlEventTouchUpInside];
|
};
|
[self presentViewController:applyInspectionVC animated:YES completion:nil];
|
}
|
#pragma mark - 验收
|
- (void)acceptance {
|
PBAddRecordViewController *addRecordVC = [[PBAddRecordViewController alloc] init];
|
addRecordVC.examineListModel = self.examineListModel;
|
addRecordVC.projectModel = self.projectModel;
|
addRecordVC.isBackList = YES;
|
addRecordVC.UpdateRecordListBlock = ^(BOOL isQualified) {
|
if (isQualified) {
|
UIImage *image = [UIImage imageNamed:@"Rectify_ qualified"];
|
[self.navigationItem.rightBarButtonItem setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
[self.functionBtn setImage:[UIImage imageNamed:@"qualified_disable"] forState:UIControlStateDisabled];
|
self.functionBtn.enabled = NO;
|
}else {
|
UIImage *image = [UIImage imageNamed:@"Rectify_ rectification"];
|
[self.navigationItem.rightBarButtonItem setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
[self.functionBtn setImage:[UIImage imageNamed:@"apply_reinspection"] forState:UIControlStateNormal];
|
[self.functionBtn setImage:[UIImage imageNamed:@"apply_reinspection_dis"] forState:UIControlStateDisabled];
|
if (self.roleModel.User_InRelation) {
|
self.functionBtn.enabled = YES;
|
}else {
|
self.functionBtn.enabled = NO;
|
}
|
[self.functionBtn addTarget:self action:@selector(apply) forControlEvents:UIControlEventTouchUpInside];
|
}
|
};
|
[self presentViewController:addRecordVC animated:YES completion:nil];
|
}
|
#pragma mark - 流转记录
|
- (void)recordAction {
|
PBRecordViewController *recordVC = [[PBRecordViewController alloc] init];
|
recordVC.examineListModel = self.examineListModel;
|
recordVC.examineDetailDic = self.examinDetailDic;
|
recordVC.projectModel = self.projectModel;
|
recordVC.roleModel = self.roleModel;
|
recordVC.ModifyStateBlock = ^(NSString * _Nonnull flagStr) {
|
if ([flagStr isEqualToString:@"B"]) {
|
//申请复检
|
UIImage *image = [UIImage imageNamed:@"Rectify_ rectification"];
|
[self.navigationItem.rightBarButtonItem setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
[self.functionBtn setImage:[UIImage imageNamed:@"apply_reinspection"] forState:UIControlStateNormal];
|
[self.functionBtn setImage:[UIImage imageNamed:@"apply_reinspection_dis"] forState:UIControlStateDisabled];
|
[self.functionBtn addTarget:self action:@selector(apply) forControlEvents:UIControlEventTouchUpInside];
|
if (self.roleModel.User_InRelation) {
|
self.functionBtn.enabled = YES;
|
}else {
|
self.functionBtn.enabled = NO;
|
}
|
}else if ([flagStr isEqualToString:@"C"]) {
|
//验收
|
UIImage *image = [UIImage imageNamed:@"Rectify_ acceptance"];
|
[self.navigationItem.rightBarButtonItem setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
[self.functionBtn setImage:[UIImage imageNamed:@"acceptance"] forState:UIControlStateNormal];
|
[self.functionBtn setImage:[UIImage imageNamed:@"acceptance_dis"] forState:UIControlStateDisabled];
|
[self.functionBtn addTarget:self action:@selector(acceptance) forControlEvents:UIControlEventTouchUpInside];
|
if (self.roleModel.User_InPrincipal) {
|
self.functionBtn.enabled = YES;
|
}else {
|
self.functionBtn.enabled = NO;
|
}
|
}else if ([flagStr isEqualToString:@"D"]) {
|
UIImage *image = [UIImage imageNamed:@"Rectify_ qualified"];
|
[self.navigationItem.rightBarButtonItem setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
|
[self.functionBtn setImage:[UIImage imageNamed:@"qualified_disable"] forState:UIControlStateDisabled];
|
self.functionBtn.enabled = NO;
|
}
|
};
|
// recordVC.recordListM = [[self.examinDetailDic valueForKey:@"RecordWithAttachments"] mutableCopy];
|
[self.navigationController pushViewController:recordVC animated:YES];
|
|
}
|
#pragma mark - UITableViewDataSource
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
return 16;
|
}
|
|
- (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 == 5 || indexPath.row == 8 || indexPath.row == 10 || indexPath.row == 13) {
|
PBTopTitleTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:topTitleCellID forIndexPath:indexPath];
|
PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
|
cell.examineAddModel = examineAddModel;
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
return cell;
|
}else if (indexPath.row == 2 || indexPath.row == 3) {
|
PBTimeChooseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:timeChooseCellID forIndexPath:indexPath];
|
PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
|
cell.examineAddModel = examineAddModel;
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
return cell;
|
}else if (indexPath.row == 4 || indexPath.row == 11 || indexPath.row == 12) {
|
PBPersonChooseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:personCellID forIndexPath:indexPath];
|
PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
|
cell.examineAddModel = examineAddModel;
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
return cell;
|
}else if (indexPath.row == 14 || indexPath.row == 15) {
|
PBArtifactsListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:listCellID forIndexPath:indexPath];
|
PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
|
cell.examineAddModel = examineAddModel;
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
if (indexPath.row == 14) {
|
cell.ToViewBlock = ^(NSInteger index) {
|
NSLog(@"查看模型========");
|
NSDictionary *dict = examineAddModel.dataArr[index];
|
[self getCategoryArrayByBmGuidWithGuid:[dict valueForKey:@"bm_guid"]];
|
};
|
}
|
return cell;
|
}else if (indexPath.row == 6) {
|
PBCheckInfoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:checkInfoCellID forIndexPath:indexPath];
|
PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
|
cell.examineAddModel = examineAddModel;
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
return cell;
|
}else if (indexPath.row == 7) {
|
PBCheckImageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:checkImageCellID forIndexPath:indexPath];
|
PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
|
cell.examineAddModel = examineAddModel;
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
cell.PlayVideoBlock = ^(NSString * _Nonnull videoUrl) {
|
NSLog(@"%@",videoUrl);
|
PBVideoPlayViewController *playVC = [[PBVideoPlayViewController alloc] init];
|
playVC.url = videoUrl;
|
playVC.hidesBottomBarWhenPushed = YES;
|
[self.navigationController pushViewController:playVC animated:YES];
|
};
|
return cell;
|
}else if (indexPath.row == 9) {
|
PBRadioTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:radioCellID forIndexPath:indexPath];
|
PBExamineAddModel *examineAddModel = self.dataListM[indexPath.row];
|
cell.examineAddModel = examineAddModel;
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
return cell;
|
}else {
|
return nil;
|
}
|
}
|
|
- (void)getCategoryArrayByBmGuidWithGuid:(NSString *)guid {
|
[YJProgressHUD showProgress:@"" inView:self.view];
|
[[PBNetworkTools sharedTools] GetCategoryArrayByBmGuidWithGuid:guid andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
|
if (error) {
|
NSLog(@"%@",error);
|
[YJProgressHUD showMessage:@"修改失败" inView:self.view];
|
return;
|
}
|
NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
|
NSLog(@"%@",str);
|
PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
|
if (networkModel.Ret == 1) {
|
[YJProgressHUD hide];
|
[PBKeyWindow addSubview:self.componentHierarchyView];
|
self.componentHierarchyView.dataArr = networkModel.Data;
|
[self.componentHierarchyView show];
|
}else {
|
[YJProgressHUD showMessage:networkModel.Msg inView:self.view];
|
}
|
|
}];
|
}
|
#pragma mark - 检查人修改
|
- (void)ModifyExamineTextDataWith:(NSMutableDictionary *)dictM andIndexPath:(NSIndexPath *)indexPath {
|
[YJProgressHUD showProgress:@"" inView:self.view];
|
[[PBNetworkTools sharedTools] modifyMissionMemberWithExamineID:self.examineListModel.ExamineID andOrganizeId:self.projectModel.organizeid andData:dictM andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
|
if (error) {
|
NSLog(@"%@",error);
|
[YJProgressHUD showMessage:@"修改失败" inView:self.view];
|
return;
|
}
|
NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
|
NSLog(@"%@",str);
|
PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
|
if (networkModel.Ret == 1) {
|
[YJProgressHUD hide];
|
[YJProgressHUD showMessage:@"修改成功" inView:self.view];
|
[self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
|
}else {
|
[YJProgressHUD showMessage:networkModel.Msg inView:self.view];
|
}
|
}];
|
}
|
#pragma mark - 检查人修改严重等级
|
- (void)presentSeveritylevelWithIndexPath:(NSIndexPath *)indexPath andExamineAddModel:(PBExamineAddModel *)examineAddModel {
|
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"请选择严重等级" message:@"" preferredStyle:UIAlertControllerStyleActionSheet];
|
UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"一般" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
[self ModifySeveritylevelWithIndexPath:indexPath andLevel:@"一般" andExamineAddModel:examineAddModel];
|
}];
|
UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"严重" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
[self ModifySeveritylevelWithIndexPath:indexPath andLevel:@"严重" andExamineAddModel:examineAddModel];
|
}];
|
UIAlertAction *action3 = [UIAlertAction actionWithTitle:@"非常严重" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
[self ModifySeveritylevelWithIndexPath:indexPath andLevel:@"非常严重" andExamineAddModel:examineAddModel];
|
}];
|
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
|
[alertVC addAction:action1];
|
[alertVC addAction:action2];
|
[alertVC addAction:action3];
|
[alertVC addAction:cancel];
|
[self presentViewController:alertVC animated:YES completion:nil];
|
}
|
- (void)ModifySeveritylevelWithIndexPath:(NSIndexPath *)indexPath andLevel:(NSString *)level andExamineAddModel:(PBExamineAddModel *)examineAddModel {
|
[YJProgressHUD showProgress:@"" inView:self.view];
|
[[PBNetworkTools sharedTools] ModifySeveritylevelWithExamineID:self.examineListModel.ExamineID andOrganizeId:self.projectModel.organizeid andSeveritylevel:level andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
|
if (error) {
|
NSLog(@"%@",error);
|
[YJProgressHUD showMessage:@"修改失败" inView:self.view];
|
return;
|
}
|
NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
|
NSLog(@"%@",str);
|
PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str];
|
if (networkModel.Ret == 1) {
|
[YJProgressHUD hide];
|
[YJProgressHUD showMessage:@"修改成功" inView:self.view];
|
examineAddModel.dataDict = @{
|
@"ec_name":level
|
};
|
[self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
|
}else {
|
[YJProgressHUD showMessage:networkModel.Msg inView:self.view];
|
}
|
}];
|
}
|
- (void)setProjectModel:(PBProjectModel *)projectModel {
|
_projectModel = projectModel;
|
}
|
- (void)setIsAddExamine:(BOOL)isAddExamine {
|
_isAddExamine = isAddExamine;
|
}
|
|
- (void)setExamineListModel:(PBExamineListModel *)examineListModel {
|
_examineListModel = examineListModel;
|
}
|
|
- (void)dealloc {
|
[PBNoteCenter removeObserver:self];
|
}
|
|
- (void)setStateArr:(NSArray *)stateArr {
|
_stateArr = stateArr;
|
}
|
- (void)setLevelArr:(NSArray *)levelArr {
|
_levelArr = levelArr;
|
}
|
- (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;
|
}
|
- (PBComponentHierarchyView *)componentHierarchyView {
|
if (_componentHierarchyView == nil) {
|
_componentHierarchyView = [[PBComponentHierarchyView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
CGFloat bottomH = 0.f;
|
if (IS_IPHONE_X) {
|
bottomH = 34.f;
|
}
|
_componentHierarchyView.visualViewHeight = 214.f + bottomH;
|
}
|
return _componentHierarchyView;
|
}
|
/*
|
#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
|