Commit 9ee92af1 authored by Sandy's avatar Sandy

bug fix

parent 0dc73808
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#import "GTOAnswer.h" #import "GTOAnswer.h"
#import "GTOQuestion.h" #import "GTOQuestion.h"
#define TopMargin 44 #define TopMargin 44
#define TableHeight 150 #define TableHeight 170
#define LeftMargin 20 #define LeftMargin 20
#define BtnWidth 60 #define BtnWidth 60
#define BtnHeight 24 #define BtnHeight 24
...@@ -475,7 +475,9 @@ static NSString *cellID = @"licenceListCell"; ...@@ -475,7 +475,9 @@ static NSString *cellID = @"licenceListCell";
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
return TableHeight; //如果是审批拒绝状态,就显示拒绝理由,所以增加一个label的高度
GTOLicence *licence = _dataArr[indexPath.section];
return [licence.state isEqualToString:@"rejected"] ? TableHeight + 20: TableHeight;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{ {
......
...@@ -483,7 +483,7 @@ typedef NS_ENUM(NSUInteger,alertViewTag) { ...@@ -483,7 +483,7 @@ typedef NS_ENUM(NSUInteger,alertViewTag) {
if(!isLocal) { if(!isLocal) {
attachView.isDownImg = YES; attachView.isDownImg = YES;
attV.m_imageView.backgroundColor = [UIColor grayColor]; attV.m_imageView.backgroundColor = [UIColor grayColor];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
if ((_d_pioneering && [_d_pioneering.state isEqualToString:GTO_PIONEERING_STATE_INITIAL]) if ((_d_pioneering && [_d_pioneering.state isEqualToString:GTO_PIONEERING_STATE_INITIAL])
|| (_d_licence && [_d_licence.state isEqualToString:GTO_LICENCE_STATE_INITIAL])) { || (_d_licence && [_d_licence.state isEqualToString:GTO_LICENCE_STATE_INITIAL])) {
[attV updateWithType:kATTCloseBtn masker:nil placeHolder:nil image:iconImg title:nil]; [attV updateWithType:kATTCloseBtn masker:nil placeHolder:nil image:iconImg title:nil];
...@@ -491,7 +491,7 @@ typedef NS_ENUM(NSUInteger,alertViewTag) { ...@@ -491,7 +491,7 @@ typedef NS_ENUM(NSUInteger,alertViewTag) {
[attV updateWithType:kATTNormal masker:nil placeHolder:nil image:iconImg title:nil]; [attV updateWithType:kATTNormal masker:nil placeHolder:nil image:iconImg title:nil];
} }
}); // });
} else { } else {
[attV updateWithType:kATTCloseBtn masker:nil placeHolder:nil image:iconImg title:nil]; [attV updateWithType:kATTCloseBtn masker:nil placeHolder:nil image:iconImg title:nil];
......
...@@ -129,7 +129,7 @@ UITextFieldDelegate> ...@@ -129,7 +129,7 @@ UITextFieldDelegate>
} }
- (void)initData { //答案的个数 - (void)initData { //答案的个数
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) { ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE %@ = ? ORDER BY %@", [GTOAnswer TableName], @"licenceUuid",@"questionUuid" ]; NSString * sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE %@ = ?", [GTOAnswer TableName], @"licenceUuid" ];
//答案的排序按照问题的uuid来,(此事的排序关系到结果页中答案的显示,按道理应该是根据答题的顺序,是不是后台给的问题应该排序?????) //答案的排序按照问题的uuid来,(此事的排序关系到结果页中答案的显示,按道理应该是根据答题的顺序,是不是后台给的问题应该排序?????)
NSLog(@"%@",sql); NSLog(@"%@",sql);
return [db executeQuery:sql,_d_licence.uuid]; return [db executeQuery:sql,_d_licence.uuid];
...@@ -179,32 +179,6 @@ UITextFieldDelegate> ...@@ -179,32 +179,6 @@ UITextFieldDelegate>
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
[self configureCell:cell forRowAtIndexPath:indexPath]; [self configureCell:cell forRowAtIndexPath:indexPath];
// static NSString * Id = @"cellId";
// UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:Id];
//
// if (!cell) {
// cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Id];
//
// } else {
// while ([cell.contentView.subviews lastObject] != nil) {
// [(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
// }
//
// }
//
// GTOCategoryItemView *categoryItem = [[GTOCategoryItemView alloc]initWithFrame:CGRectMake(0, 0, cell.contentView.width, cell.contentView.height)];//cell.bounds];
// // if (_d_arrProcesses.count > 0) {
// // GTOPioneeingProcess *process = _d_arrProcesses[indexPath.row];
// if (_d_licence.arrDisplayResults.count > 0) {
// GTODisplayResult *displayR = [GTODisplayResult DBObject];
// [displayR praseFromJsonDict:_d_licence.arrDisplayResults[indexPath.row]];
//
//
// [categoryItem updateWithLicence:_d_licence licenceDisplayResults:displayR];
//
// }
//
// [cell.contentView addSubview:categoryItem];
return cell; return cell;
} }
- (void)configureCell:(UITableViewCell *)cell - (void)configureCell:(UITableViewCell *)cell
...@@ -221,7 +195,6 @@ UITextFieldDelegate> ...@@ -221,7 +195,6 @@ UITextFieldDelegate>
if (_d_licence.arrDisplayResults.count > 0) { if (_d_licence.arrDisplayResults.count > 0) {
GTODisplayResult *displayR = [GTODisplayResult DBObject]; GTODisplayResult *displayR = [GTODisplayResult DBObject];
[displayR praseFromJsonDict:_d_licence.arrDisplayResults[indexPath.row]]; [displayR praseFromJsonDict:_d_licence.arrDisplayResults[indexPath.row]];
[categoryItem updateWithLicence:_d_licence licenceDisplayResults:displayR]; [categoryItem updateWithLicence:_d_licence licenceDisplayResults:displayR];
} }
......
...@@ -12,9 +12,13 @@ ...@@ -12,9 +12,13 @@
//@property (strong, nonatomic) IBTUILabel *m_repairTitleLabel; //@property (strong, nonatomic) IBTUILabel *m_repairTitleLabel;
@property (strong, nonatomic) IBTUILabel *m_billNumberLabel; @property (strong, nonatomic) IBTUILabel *m_billNumberLabel;
@property (strong, nonatomic) IBTUILabel *m_storeNameLabel;//油站 @property (strong, nonatomic) IBTUILabel *m_storeNameLabel;//油站
@property (strong, nonatomic) IBTUILabel *labelStation;//油站
@property (strong, nonatomic) IBTUILabel *m_stateLabel;//完成状态 @property (strong, nonatomic) IBTUILabel *m_stateLabel;//完成状态
@property (strong, nonatomic) IBTUILabel *m_stateValueLabel;//完成状态
@property (nonatomic, strong) IBTUILabel *labelRejectReason;
@property (nonatomic, assign) CGFloat reasonHeight;
@property (strong, nonatomic) UIImageView *m_riskImgView; @property (strong, nonatomic) UIImageView *m_riskImgView;
//@property (strong, nonatomic) IBTUILabel *m_repairDateLabel;//开始时间
@end @end
@implementation GTOLicenceListSimpleCellContentView @implementation GTOLicenceListSimpleCellContentView
...@@ -23,7 +27,7 @@ ...@@ -23,7 +27,7 @@
if (!self) { if (!self) {
return nil; return nil;
} }
self.reasonHeight = 0;
[self initSubViews]; [self initSubViews];
return self; return self;
} }
...@@ -35,8 +39,10 @@ ...@@ -35,8 +39,10 @@
UIFont *font = [UIFont systemFontOfSize:17]; UIFont *font = [UIFont systemFontOfSize:17];
self.m_billNumberLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_billNumberLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_storeNameLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_storeNameLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.labelStation = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_stateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_stateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
//self.m_repairDateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_stateValueLabel = [[IBTUILabel alloc] initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.labelRejectReason = [[IBTUILabel alloc] initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_riskImgView = [[UIImageView alloc]init]; self.m_riskImgView = [[UIImageView alloc]init];
...@@ -44,7 +50,11 @@ ...@@ -44,7 +50,11 @@
//[self addSubview:_m_repairTitleLabel]; //[self addSubview:_m_repairTitleLabel];
[self addSubview:_m_billNumberLabel]; [self addSubview:_m_billNumberLabel];
[self addSubview:_m_storeNameLabel]; [self addSubview:_m_storeNameLabel];
[self addSubview:self.labelStation];
[self addSubview:_m_stateLabel]; [self addSubview:_m_stateLabel];
[self addSubview:_m_stateValueLabel];
[self addSubview:self.labelRejectReason];
[self addSubview:_m_riskImgView]; [self addSubview:_m_riskImgView];
// [self addSubview:_m_repairDateLabel]; // [self addSubview:_m_repairDateLabel];
...@@ -71,13 +81,28 @@ ...@@ -71,13 +81,28 @@
.size.width = _m_billNumberLabel.width, .size.width = _m_billNumberLabel.width,
.size.height = lblH, .size.height = lblH,
}; };
_labelStation.frame = CGRectMake(leftX,
_m_storeNameLabel.bottom + GTO_VERTICAL_PADDING,
self.width,
lblH);
_m_stateLabel.frame = (CGRect){ _m_stateLabel.frame = (CGRect){
.origin.x = leftX, .origin.x = leftX,
.origin.y = _m_storeNameLabel.bottom + GTO_VERTICAL_PADDING, .origin.y = _labelStation.bottom + GTO_VERTICAL_PADDING,
.size.width = self.width, .size.width = 80,
.size.height = lblH, .size.height = lblH,
}; [_m_stateLabel sizeToFit]; }; [_m_stateLabel sizeToFit];
_m_stateValueLabel.frame = (CGRect){
.origin.x = _m_stateLabel.right,
.origin.y = _labelStation.bottom + GTO_VERTICAL_PADDING,
.size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING - _m_stateLabel.width,
.size.height = lblH,
};
_labelRejectReason.frame = CGRectMake(_m_billNumberLabel.x,
_m_stateLabel.bottom + GTO_VERTICAL_PADDING,
SCREEN_SIZE.width - GTO_LEFT_PADDING,
self.reasonHeight);
CGFloat imgW = 40; CGFloat imgW = 40;
_m_riskImgView.frame = (CGRect){ _m_riskImgView.frame = (CGRect){
.origin.x = self.width - imgW, .origin.x = self.width - imgW,
...@@ -100,9 +125,15 @@ ...@@ -100,9 +125,15 @@
- (void)updateWithLicence:(GTOLicence *)licence { - (void)updateWithLicence:(GTOLicence *)licence {
// self.m_repairTitleLabel.text = [NSString stringWithFormat:@"许可证类型:%@ ",licence.licenceType]; // self.m_repairTitleLabel.text = [NSString stringWithFormat:@"许可证类型:%@ ",licence.licenceType];
self.m_billNumberLabel.text = [NSString stringWithFormat:@"许可证单号:%@ ",licence.billnumber]; self.m_billNumberLabel.text = [NSString stringWithFormat:@"许可证类型:%@ ",licence.licenceType];
self.m_storeNameLabel.text = [NSString stringWithFormat:@"油站名称:%@ ",licence.store_name]; self.m_storeNameLabel.text = [NSString stringWithFormat:@"许可证单号:%@ ",licence.billnumber];
self.m_stateLabel.text = [NSString stringWithFormat:@"许可证状态: %@",[GTOCommonTools licenceStateChineseWithEnglish:licence.state] ]; self.labelStation.text = [NSString stringWithFormat:@"油站名称:%@",
licence.store_name];
self.m_stateLabel.text = [NSString stringWithFormat:@"许可证状态: "];
self.m_stateValueLabel.text = [GTOCommonTools licenceStateChineseWithEnglish:licence.state];
self.m_stateValueLabel.textColor = [GTOCommonTools textColorWithState:licence.state];
self.labelRejectReason.text = [NSString stringWithFormat:@"拒绝理由:%@",
licence.rejectCause];
// self.m_repairDateLabel.text = [NSString stringWithFormat:@"申请时间:%@",licence.requestDate ]; // self.m_repairDateLabel.text = [NSString stringWithFormat:@"申请时间:%@",licence.requestDate ];
if ([licence.riskGrade isEqualToString:@"高"]) { if ([licence.riskGrade isEqualToString:@"高"]) {
self.m_riskImgView.image = [UIImage imageNamed:@"licence_hight"]; self.m_riskImgView.image = [UIImage imageNamed:@"licence_hight"];
...@@ -110,6 +141,16 @@ ...@@ -110,6 +141,16 @@
self.m_riskImgView.image = [UIImage imageNamed:@"licence_middle"]; self.m_riskImgView.image = [UIImage imageNamed:@"licence_middle"];
} }
if ([licence.state isEqualToString:@"rejected"]) {
self.reasonHeight = 17;
self.labelRejectReason.height = 17;
self.labelRejectReason.hidden = NO;
}else{
self.reasonHeight = 0;
self.labelRejectReason.height = 0;
self.labelRejectReason.hidden = YES;
}
[self layoutIfNeeded];
} }
@end @end
......
...@@ -161,12 +161,15 @@ ...@@ -161,12 +161,15 @@
- (void)updateWithLicence: (GTOLicence *)licence arrayDictDisplayResults: (NSArray *)arrDisplayResults - (void)updateWithLicence: (GTOLicence *)licence arrayDictDisplayResults: (NSArray *)arrDisplayResults
{ {
self.m_billNumberLabel.text = [NSString stringWithFormat:@"报修单号:%@",licence.repairNumber ]; self.m_billNumberLabel.text = [NSString stringWithFormat:@"报修单号:%@",licence.repairNumber ];
self.m_riskGradeLabel.text = [NSString stringWithFormat:@"险等级:%@",licence.riskGrade]; self.m_riskGradeLabel.text = [NSString stringWithFormat:@"险等级:%@",licence.riskGrade];
self.m_storeNameLabel.text = [NSString stringWithFormat:@"油站:%@",licence.store_name ]; self.m_storeNameLabel.text = [NSString stringWithFormat:@"油站:%@",licence.store_name ];
self.m_licenceTypeLabel.text = [NSString stringWithFormat:@"许可证类型:%@",licence.licenceType]; self.m_licenceTypeLabel.text = [NSString stringWithFormat:@"许可证类型:%@",licence.licenceType];
self.m_valideTimeStartLabel.text = [NSString stringWithFormat:@"开始时间:%@",[GTOCommonTools nullChangedWithId:licence.beginDate]]; self.m_valideTimeStartLabel.text = [NSString stringWithFormat:@"申请时间:%@",licence.requestDate];
self.m_valideTimeEndLabel.text = [NSString stringWithFormat:@"截止时间:%@",[GTOCommonTools nullChangedWithId:licence.endDate]]; NSDateFormatter *f = [[NSDateFormatter alloc] init];
self.m_requestDateLabel.text = [NSString stringWithFormat:@"申请时间:%@",licence.requestDate]; [f setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *date = [f dateFromString:licence.requestDate];
NSDate *endDate = [NSDate dateWithTimeInterval:licence.validHours * 60 * 60 sinceDate:date];
self.m_valideTimeEndLabel.text = [NSString stringWithFormat:@"截止时间:%@",[f stringFromDate:endDate]];
self.m_rejectCauseLabel.text = [NSString stringWithFormat:@"拒绝理由:%@",licence.rejectCause]; self.m_rejectCauseLabel.text = [NSString stringWithFormat:@"拒绝理由:%@",licence.rejectCause];
...@@ -174,7 +177,6 @@ ...@@ -174,7 +177,6 @@
self.m_processLabel.text = [NSString stringWithFormat:@"拓站总进度:" ]; self.m_processLabel.text = [NSString stringWithFormat:@"拓站总进度:" ];
NSUInteger totalNumber = arrDisplayResults.count; NSUInteger totalNumber = arrDisplayResults.count;
NSUInteger finishNumber = 0; NSUInteger finishNumber = 0;
for(NSDictionary *dictDisplayR in arrDisplayResults){ for(NSDictionary *dictDisplayR in arrDisplayResults){
......
...@@ -193,13 +193,13 @@ static NSString *headerProblemItemID = @"headerItem"; ...@@ -193,13 +193,13 @@ static NSString *headerProblemItemID = @"headerItem";
if (displayR.arrAnswers.count != displayR.arrQuestions.count) noFinishNumber++; if (displayR.arrAnswers.count != displayR.arrQuestions.count) noFinishNumber++;
} }
if (noFinishNumber > 0) { if (noFinishNumber > 0) {
bottomV = [[GXFBottomView alloc] initOneButtonWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40) buttonColor:GTO_RED_COLOR buttonTitle:@"返回"]; bottomV = [[GXFBottomView alloc] initOneButtonWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40) buttonColor:GTO_BLUE_DEEP_COLOR buttonTitle:@"返回"];
bottomV.tag = kBottomViewOneBackTag; bottomV.tag = kBottomViewOneBackTag;
} else { } else {
bottomV = [[GXFBottomView alloc] initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40) bottomV = [[GXFBottomView alloc] initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40)
leftButtonColor:GTO_RED_COLOR leftButtonColor:GTO_BLUE_DEEP_COLOR
rightButtonColor:GTO_BLUE_DEEP_COLOR rightButtonColor:GTO_RED_COLOR
LeftBtnTitle:@"保存" LeftBtnTitle:@"保存"
rightBtnTitle:@"提交"]; rightBtnTitle:@"提交"];
bottomV.tag = kBottomViewTwoSaveSubmitTag; bottomV.tag = kBottomViewTwoSaveSubmitTag;
...@@ -210,19 +210,18 @@ static NSString *headerProblemItemID = @"headerItem"; ...@@ -210,19 +210,18 @@ static NSString *headerProblemItemID = @"headerItem";
bottomV.tag = kBOttomViewAskForApprove; bottomV.tag = kBOttomViewAskForApprove;
}else if (isAskForApprove) { }else if (isAskForApprove) {
bottomV = [[GXFBottomView alloc] initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40) bottomV = [[GXFBottomView alloc] initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40)
leftButtonColor:GTO_RED_COLOR leftButtonColor:GTO_BLUE_DEEP_COLOR
rightButtonColor:GTO_BLUE_DEEP_COLOR rightButtonColor:GTO_RED_COLOR
LeftBtnTitle:@"审批拒绝" LeftBtnTitle:@"审批拒绝"
rightBtnTitle:@"审批通过"]; rightBtnTitle:@"审批通过"];
bottomV.tag = kBottomViewTwoRejectedApprovedTag; bottomV.tag = kBottomViewTwoRejectedApprovedTag;
}else { }else {
bottomV = [[GXFBottomView alloc] initOneButtonWithFrame:rect buttonColor:GTO_RED_COLOR buttonTitle:@"返 回"]; bottomV = [[GXFBottomView alloc] initOneButtonWithFrame:rect buttonColor:GTO_BLUE_DEEP_COLOR buttonTitle:@"返 回"];
bottomV.tag = kBottomViewOneBackTag; bottomV.tag = kBottomViewOneBackTag;
} }
bottomV.backgroundColor = XXFBgColor; bottomV.backgroundColor = XXFBgColor;
bottomV.delegate = self; bottomV.delegate = self;
[self.view addSubview:bottomV]; [self.view addSubview:bottomV];
} }
...@@ -343,7 +342,7 @@ static NSString *headerProblemItemID = @"headerItem"; ...@@ -343,7 +342,7 @@ static NSString *headerProblemItemID = @"headerItem";
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if (indexPath.section == 0) { if (indexPath.section == 0) {
return 176; return 156;
} else { } else {
return 55; return 55;
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#define TopMargin 44 #define TopMargin 44
#define TableHeight 150 #define TableHeight 140
#define LeftMargin 20 #define LeftMargin 20
#define BtnWidth 60 #define BtnWidth 60
#define BtnHeight 24 #define BtnHeight 24
...@@ -67,12 +67,8 @@ static NSString *cellID = @"repairListCell"; ...@@ -67,12 +67,8 @@ static NSString *cellID = @"repairListCell";
- (void)initData{ - (void)initData{
self.dataArr = [NSMutableArray array]; self.dataArr = [NSMutableArray array];
// if (self.assessorVendor.length > 0) {
// self.vendorLike = self.assessorVendor;
// }
} }
- (void)getData{ - (void)getData{
// [ICRUserUtil sharedInstance].needFresh = NO;
__weak typeof(self)weakSelf = self; __weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) { void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil]; [IBTLoadingView hideHUDWithText:nil];
...@@ -125,20 +121,12 @@ static NSString *cellID = @"repairListCell"; ...@@ -125,20 +121,12 @@ static NSString *cellID = @"repairListCell";
if (self.titleLike.length > 0) { if (self.titleLike.length > 0) {
titleObject = self.titleLike; titleObject = self.titleLike;
} }
// id vendorObject = [NSNull null];
// if (self.vendorLike.length > 0) {
// vendorObject = self.vendorLike;
// }
NSDictionary *dict = @{ NSDictionary *dict = @{
@"engineerUuid": [ICRUserUtil sharedInstance].f_user_uuid, @"engineerUuid": [ICRUserUtil sharedInstance].f_user_uuid,
@"billNumberLike":billObject, @"billNumberLike":billObject,
@"state":stateObject, @"state":stateObject,
@"titleLike":titleObject, @"titleLike":titleObject,
@"queryOrders":orderArr, @"queryOrders":orderArr,
@"pageNumber":@(_currentPage), @"pageNumber":@(_currentPage),
@"pageSize":@(20)}; @"pageSize":@(20)};
ICRHTTPController *httpC = [ICRHTTPController sharedController]; ICRHTTPController *httpC = [ICRHTTPController sharedController];
...@@ -423,35 +411,18 @@ static NSString *cellID = @"repairListCell"; ...@@ -423,35 +411,18 @@ static NSString *cellID = @"repairListCell";
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
// static NSString *cellID = @"SurveyID";
// PurchaseCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
// if (cell == nil) {
// cell = [[PurchaseCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
// tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
// }
// if (self.dataArr.count > 0) {
// PurchaseBill *bill = self.dataArr[indexPath.row];
// [cell setPurchaseBill:bill];
// }
[self configureCell:cell forRowAtIndexPath:indexPath]; [self configureCell:cell forRowAtIndexPath:indexPath];
return cell; return cell;
} }
- (void)configureCell:(UITableViewCell *)cell - (void)configureCell:(UITableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath forRowAtIndexPath:(NSIndexPath *)indexPath
{ {
//cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UIView *contentView = cell.contentView; UIView *contentView = cell.contentView;
GTORepairListCellContentView *view = [contentView viewWithClass:[GTORepairListCellContentView class]]; GTORepairListCellContentView *view = [contentView viewWithClass:[GTORepairListCellContentView class]];
if (!view) { if (!view) {
view = [[GTORepairListCellContentView alloc] initWithFrame:contentView.bounds]; view = [[GTORepairListCellContentView alloc] initWithFrame:contentView.bounds];
//view.m_bHiddenNumLabel = m_bIsInHome;
[view autoresizingWithStrechFullSize]; [view autoresizingWithStrechFullSize];
[contentView addSubview:view]; [contentView addSubview:view];
} }
......
...@@ -317,12 +317,14 @@ ...@@ -317,12 +317,14 @@
}else if(indexPath.row == 2){ }else if(indexPath.row == 2){
stateStr = GTO_LICENCE__STATE_SUBMITTED; stateStr = GTO_LICENCE__STATE_SUBMITTED;
}else if(indexPath.row == 3){ }else if(indexPath.row == 3){
stateStr = GTO_LICENCE__STATE_APPROVED; stateStr = GTO_LICENCE__STATE_ASKFORAPPROVE;
}else if(indexPath.row == 4){ }else if(indexPath.row == 4){
stateStr =GTO_LICENCE__STATE_REJECTED;
}else if(indexPath.row == 5){
stateStr = GTO_LICENCE__STATE_APPROVED; stateStr = GTO_LICENCE__STATE_APPROVED;
}else if(indexPath.row == 5){
stateStr =GTO_LICENCE__STATE_REJECTED;
}else if(indexPath.row == 6){ }else if(indexPath.row == 6){
stateStr = GTO_LICENCE__STATE_APPROVED;
}else if(indexPath.row == 7){
stateStr =GTO_LICENCE__STATE_FINISHED; stateStr =GTO_LICENCE__STATE_FINISHED;
}else { }else {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#import "GTOAnswer.h" #import "GTOAnswer.h"
#import "GTOQuestion.h" #import "GTOQuestion.h"
#define TopMargin 44 #define TopMargin 44
#define TableHeight 150 #define TableHeight 170
#define LeftMargin 20 #define LeftMargin 20
#define BtnWidth 60 #define BtnWidth 60
#define BtnHeight 24 #define BtnHeight 24
...@@ -282,7 +282,7 @@ static NSString *cellID = @"licenceListCell"; ...@@ -282,7 +282,7 @@ static NSString *cellID = @"licenceListCell";
_boltView.backgroundColor = XXFBgColor; _boltView.backgroundColor = XXFBgColor;
_boltView.delegate = self; _boltView.delegate = self;
//initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成) //initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
_boltView.dataArrState = [[NSMutableArray alloc]initWithObjects:@"全部",@"未提交",@"待审批",@"审批通过" ,@"审批拒绝",@"已过期",@"已结束",nil]; _boltView.dataArrState = [[NSMutableArray alloc]initWithObjects:@"全部",@"未提交",@"申请审批",@"待审批",@"审批通过" ,@"审批拒绝",@"已过期",@"已结束",nil];
_boltView.dataArrRisk = [[NSMutableArray alloc]initWithObjects:@"全部",GTO_LICENCE_RISK_HIGHT,GTO_LICENCE__RISK_MIDDLE,nil]; _boltView.dataArrRisk = [[NSMutableArray alloc]initWithObjects:@"全部",GTO_LICENCE_RISK_HIGHT,GTO_LICENCE__RISK_MIDDLE,nil];
[_maskView addSubview:_boltView]; [_maskView addSubview:_boltView];
[UIView animateWithDuration:0.25 animations:^{ [UIView animateWithDuration:0.25 animations:^{
...@@ -423,18 +423,7 @@ static NSString *cellID = @"licenceListCell"; ...@@ -423,18 +423,7 @@ static NSString *cellID = @"licenceListCell";
[tableView deselectRowAtIndexPath:indexPath animated:NO]; [tableView deselectRowAtIndexPath:indexPath animated:NO];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
// static NSString *cellID = @"SurveyID";
// PurchaseCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
// if (cell == nil) {
// cell = [[PurchaseCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
// tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
// }
// if (self.dataArr.count > 0) {
// PurchaseBill *bill = self.dataArr[indexPath.row];
// [cell setPurchaseBill:bill];
// }
[self configureCell:cell forRowAtIndexPath:indexPath]; [self configureCell:cell forRowAtIndexPath:indexPath];
return cell; return cell;
...@@ -442,10 +431,6 @@ static NSString *cellID = @"licenceListCell"; ...@@ -442,10 +431,6 @@ static NSString *cellID = @"licenceListCell";
- (void)configureCell:(UITableViewCell *)cell - (void)configureCell:(UITableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath forRowAtIndexPath:(NSIndexPath *)indexPath
{ {
//cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UIView *contentView = cell.contentView; UIView *contentView = cell.contentView;
GTOLicenceListCellContentView *view = [contentView viewWithClass:[GTOLicenceListCellContentView class]]; GTOLicenceListCellContentView *view = [contentView viewWithClass:[GTOLicenceListCellContentView class]];
...@@ -461,7 +446,9 @@ static NSString *cellID = @"licenceListCell"; ...@@ -461,7 +446,9 @@ static NSString *cellID = @"licenceListCell";
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight; //如果是审批拒绝状态,就显示拒绝理由,所以增加一个label的高度
GTOLicence *licence = _dataArr[indexPath.section];
return [licence.state isEqualToString:@"rejected"] ? TableHeight + 20: TableHeight;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return section == 0 ? 1 : 10; return section == 0 ? 1 : 10;
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
#import "GTORepair.h" #import "GTORepair.h"
@interface GTORepairDetailTopCellView () @interface GTORepairDetailTopCellView ()
@property (strong, nonatomic) IBTUILabel *m_billNumberLabel; @property (strong, nonatomic) IBTUILabel *m_billNumberLabel;//报修单号
@property (strong, nonatomic) IBTUILabel *m_projectLabel;//报修项目 @property (strong, nonatomic) IBTUILabel *m_projectLabel;//报修项目
@property (strong, nonatomic) IBTUILabel *m_stateLabel;//完成状态
@property (strong, nonatomic) IBTUILabel *m_stateValueLabel;//完成状态
@property (strong, nonatomic) IBTUILabel *m_storeNameLabel;//油站 @property (strong, nonatomic) IBTUILabel *m_storeNameLabel;//油站
@property (strong, nonatomic) IBTUILabel *m_repairDateLabel;//开始时间 @property (strong, nonatomic) IBTUILabel *m_repairDateLabel;//开始时间
@property (strong, nonatomic) IBTUILabel *m_engineerNameLabel; @property (strong, nonatomic) IBTUILabel *m_engineerNameLabel;
...@@ -35,6 +37,8 @@ ...@@ -35,6 +37,8 @@
UIFont *font = [UIFont systemFontOfSize:17]; UIFont *font = [UIFont systemFontOfSize:17];
self.m_billNumberLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_billNumberLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_projectLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_projectLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_stateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_stateValueLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_storeNameLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_storeNameLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_repairDateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_repairDateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_engineerNameLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_engineerNameLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
...@@ -45,6 +49,8 @@ ...@@ -45,6 +49,8 @@
[self addSubview:_m_billNumberLabel]; [self addSubview:_m_billNumberLabel];
[self addSubview:_m_projectLabel]; [self addSubview:_m_projectLabel];
[self addSubview:_m_stateLabel];
[self addSubview:_m_stateValueLabel];
[self addSubview:_m_storeNameLabel]; [self addSubview:_m_storeNameLabel];
[self addSubview:_m_repairDateLabel]; [self addSubview:_m_repairDateLabel];
[self addSubview:_m_engineerNameLabel]; [self addSubview:_m_engineerNameLabel];
...@@ -69,9 +75,18 @@ ...@@ -69,9 +75,18 @@
.size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING, .size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING,
.size.height = lblH, .size.height = lblH,
}; };
//增加报修状态
_m_stateLabel.frame = CGRectMake(leftX,
_m_projectLabel.bottom + GTO_VERTICAL_PADDING,
80,
lblH);
_m_stateValueLabel.frame = CGRectMake(_m_stateLabel.right,
_m_stateLabel.y,
100,
lblH);
_m_storeNameLabel.frame = (CGRect){ _m_storeNameLabel.frame = (CGRect){
.origin.x = leftX, .origin.x = leftX,
.origin.y = _m_projectLabel.bottom + GTO_VERTICAL_PADDING, .origin.y = _m_stateLabel.bottom + GTO_VERTICAL_PADDING,
.size.width = _m_billNumberLabel.width, .size.width = _m_billNumberLabel.width,
.size.height = lblH, .size.height = lblH,
}; };
...@@ -110,13 +125,16 @@ ...@@ -110,13 +125,16 @@
- (void)updateWithRepair: (GTORepair *)repair { - (void)updateWithRepair: (GTORepair *)repair {
self.m_billNumberLabel.text = [NSString stringWithFormat:@"报修单号%@ ",repair.billnumber]; self.m_billNumberLabel.text = [NSString stringWithFormat:@"报修单号: %@ ",repair.billnumber];
self.m_projectLabel.text = [NSString stringWithFormat:@"报修项目: %@",repair.title ]; self.m_projectLabel.text = [NSString stringWithFormat:@"报修项目: %@",repair.title ];
self.m_storeNameLabel.text = [NSString stringWithFormat:@"油站名称:%@ ",repair.store_name]; self.m_stateLabel.text = @"报修状态: ";
self.m_startDateLabel.text = [NSString stringWithFormat:@"新建时间:%@",repair.create_time ]; self.m_stateValueLabel.text = [GTOCommonTools repairStateChineseWithEnglish:repair.state];
self.m_engineerNameLabel.text = [NSString stringWithFormat:@"报修申请人:%@ ",repair.requestor]; self.m_stateValueLabel.textColor = [GTOCommonTools textColorWithState:repair.state];
self.m_repairDateLabel.text = [NSString stringWithFormat:@"报修日期:%@ ",repair.repairDate]; self.m_storeNameLabel.text = [NSString stringWithFormat:@"油站名称: %@ ",repair.store_name];
self.m_contentLabel.text = [NSString stringWithFormat:@"内容:%@ ",[GTOCommonTools nullChangedWithId:repair.content]]; self.m_startDateLabel.text = [NSString stringWithFormat:@"新建时间: %@",repair.create_time ];
self.m_engineerNameLabel.text = [NSString stringWithFormat:@"报修申请人: %@ ",repair.requestor];
self.m_repairDateLabel.text = [NSString stringWithFormat:@"报修时间: %@ ",[repair.repairDate substringToIndex:11]];
self.m_contentLabel.text = [NSString stringWithFormat:@"内容描述: %@ ",[GTOCommonTools nullChangedWithId:repair.content]];
} }
@end @end
...@@ -82,8 +82,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -82,8 +82,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
self.title = @"报修单详情"; self.title = @"报修单详情";
//[self initSubViews];
} }
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[self p_licences]; [self p_licences];
...@@ -144,11 +142,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -144,11 +142,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
NSInteger success = [data[@"success"] integerValue]; NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ; NSString *message = data[@"message"] ;
if (success == 1) { if (success == 1) {
// if (_currentPage == 0) {
// if (self.dataArr.count > 0) {
// [self.dataArr removeAllObjects];
// }
// }
NSArray *recodesArr = data[ @"data" ][ @"records" ]; NSArray *recodesArr = data[ @"data" ][ @"records" ];
if (!_d_muArrLicences) { if (!_d_muArrLicences) {
self.d_muArrLicences = [NSMutableArray array]; self.d_muArrLicences = [NSMutableArray array];
...@@ -162,16 +155,7 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -162,16 +155,7 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
[self.d_muArrLicences addObject:licence]; [self.d_muArrLicences addObject:licence];
} }
// NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
// NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
[self.c_tableView reloadData]; [self.c_tableView reloadData];
// [self endRefreshing];
// if (pageCount <= _currentPage) {
// [self.tableView.footer noticeNoMoreData];
// }
// if (_currentPage == 0 && self.dataArr.count > 0) {
// [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
// }
}else{ }else{
[IBTLoadingView showTips:message]; [IBTLoadingView showTips:message];
} }
...@@ -194,8 +178,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -194,8 +178,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
[self.view addSubview:_c_tableView]; [self.view addSubview:_c_tableView];
[_c_tableView reloadData]; [_c_tableView reloadData];
self.c_addPhotoV = [[GTORepairAddPhotoView alloc]initWithFrame:(CGRect){ self.c_addPhotoV = [[GTORepairAddPhotoView alloc]initWithFrame:(CGRect){
.origin.x = 0, .origin.x = 0,
.origin.y = _c_tableView.bottom + 5, .origin.y = _c_tableView.bottom + 5,
...@@ -226,18 +208,13 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -226,18 +208,13 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
for(NSDictionary *dict in _d_repair.attachmentUrls) { for(NSDictionary *dict in _d_repair.attachmentUrls) {
ICRPostAttachment *postAttachment = [ICRPostAttachment DBObject]; ICRPostAttachment *postAttachment = [ICRPostAttachment DBObject];
[postAttachment praseFromJsonDict:dict]; [postAttachment praseFromJsonDict:dict];
// NSString *str = [NSString stringWithFormat:@"%@%@",HTTP_LOCAL_BASE_URL ,postAttachment.fileUrl];
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// [self addAttachment:[self p_getImageFromURL:str]];
// });
self.d_isDownLoadImg = YES; self.d_isDownLoadImg = YES;
[self addAttachment:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",HTTP_LOCAL_BASE_URL ,postAttachment.fileUrl]]]; [self addAttachment:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",HTTP_LOCAL_BASE_URL ,postAttachment.fileUrl]]];
} }
} }
} else if ([_d_repair.state isEqualToString:GTO_REPAIR_STATE_SUBMITTED] || [_d_repair.state isEqualToString:GTO_REPAIR_STATE_PROCESSING]){ } else if ([_d_repair.state isEqualToString:GTO_REPAIR_STATE_SUBMITTED] ||
[_d_repair.state isEqualToString:GTO_REPAIR_STATE_PROCESSING]){
self.c_addPhotoV.hidden = YES; self.c_addPhotoV.hidden = YES;
bottomV.tag = kBottomViewOneApplicationTag; bottomV.tag = kBottomViewOneApplicationTag;
[bottomV.f_oneBtn setTitle:@"申请结束报修" forState:UIControlStateNormal]; [bottomV.f_oneBtn setTitle:@"申请结束报修" forState:UIControlStateNormal];
...@@ -253,6 +230,10 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -253,6 +230,10 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
self.c_bottomView = bottomV; self.c_bottomView = bottomV;
[self.view addSubview:_c_bottomView]; [self.view addSubview:_c_bottomView];
if ([_d_repair.state isEqualToString:GTO_REPAIR_STATE_SUBMITTED] ||
[_d_repair.state isEqualToString:GTO_REPAIR_STATE_PROCESSING]){
self.c_tableView.height = self.view.height - BottomViewHeight - 10;
}
} }
//加载本地图片 //加载本地图片
- (void)addLocalPhotos { - (void)addLocalPhotos {
...@@ -273,14 +254,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -273,14 +254,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
if (!_d_muArrPhotos.count) { if (!_d_muArrPhotos.count) {
self.d_muArrPhotos = [NSMutableArray arrayWithArray:fetchedObjects]; self.d_muArrPhotos = [NSMutableArray arrayWithArray:fetchedObjects];
for(ICRPostAttachment *postAttachment in fetchedObjects) { for(ICRPostAttachment *postAttachment in fetchedObjects) {
// BOOL isHave = [[NSFileManager defaultManager] fileExistsAtPath:postAttachment.filePath];
// if([[NSFileManager defaultManager] fileExistsAtPath:postAttachment.filePath]) {
// CLog(@"%@",postAttachment.filePath);
// UIImage *img = [[UIImage alloc]initWithContentsOfFile:postAttachment.filePath];
// [self addAttachment:img];
// }
if (postAttachment.content) { if (postAttachment.content) {
NSData *imageData = [NSData dataFromBase64String:postAttachment.content]; NSData *imageData = [NSData dataFromBase64String:postAttachment.content];
UIImage *image = [UIImage imageWithData:imageData]; UIImage *image = [UIImage imageWithData:imageData];
...@@ -312,11 +285,7 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -312,11 +285,7 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
NSInteger success = [data[@"success"] integerValue]; NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ; NSString *message = data[@"message"] ;
if (success == 1) { if (success == 1) {
// NSDictionary *dictRepair = data[@"data"];
// self.d_repair = [GTORepair DBObject];
// [_d_repair praseFromJsonDict:dictRepair];
// [self initSubViews];
// [_c_tableView reloadData];
} }
}; };
void(^fail)(id) = ^(id data) { void(^fail)(id) = ^(id data) {
...@@ -362,11 +331,14 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -362,11 +331,14 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
return section == 0 ? 0.1 : 44; return section == 0 ? 0.1 : 44;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return indexPath.section == 0 ? 200 : 90; if (indexPath.section == 0) {
return 210;
}else{
GTOLicence *licence = _d_muArrLicences[indexPath.row];
return [licence.state isEqualToString:@"rejected"] ? 110 + 20 : 110;
}
} }
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
// static NSString *headID = @"headID";
// UIView *view = [tableView dequeueReusableHeaderFooterViewWithIdentifier:headID];
if (section == 0) { if (section == 0) {
return nil; return nil;
} else { } else {
...@@ -382,7 +354,7 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -382,7 +354,7 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
contentView.backgroundColor = XXFBgColor; contentView.backgroundColor = XXFBgColor;
GXFButtonAndLineView *headLineV = [contentView viewWithClass:[GXFButtonAndLineView class]]; GXFButtonAndLineView *headLineV = [contentView viewWithClass:[GXFButtonAndLineView class]];
if (!headLineV) { if (!headLineV) {
headLineV = [[GXFButtonAndLineView alloc]initViewLineAndButtonWithFrame:CGRectMake(0, 0, self.view.width * 0.5, 44 ) isSeleted:YES buttonTitle: @"许可证" selectColor:GTO_RED_COLOR]; headLineV = [[GXFButtonAndLineView alloc]initViewLineAndButtonWithFrame:CGRectMake(0, 0, self.view.width * 0.5, 44 ) isSeleted:YES buttonTitle: @"许可证列表" selectColor:GTO_RED_COLOR];
headLineV.f_btn.userInteractionEnabled = NO; headLineV.f_btn.userInteractionEnabled = NO;
BOOL createPermission = [GTOCommonTools hasPermissionWithPermissionId:500303]; BOOL createPermission = [GTOCommonTools hasPermissionWithPermissionId:500303];
...@@ -405,12 +377,9 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -405,12 +377,9 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
UITableViewCell *cell = nil; UITableViewCell *cell = nil;
if (indexPath.section == 0) { if (indexPath.section == 0) {
cell = [tableView dequeueReusableCellWithIdentifier:cellIDTop forIndexPath:indexPath]; cell = [tableView dequeueReusableCellWithIdentifier:cellIDTop forIndexPath:indexPath];
} else { } else {
cell = [tableView dequeueReusableCellWithIdentifier:cellIDItem forIndexPath:indexPath]; cell = [tableView dequeueReusableCellWithIdentifier:cellIDItem forIndexPath:indexPath];
} }
[self configureCell:cell forRowAtIndexPath:indexPath]; [self configureCell:cell forRowAtIndexPath:indexPath];
return cell; return cell;
} }
...@@ -612,12 +581,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) { ...@@ -612,12 +581,6 @@ typedef NS_ENUM(NSUInteger, bottomViewTag) {
[_d_currentLicence saveToDBWithHandleData:NULL [_d_currentLicence saveToDBWithHandleData:NULL
complete:^{ complete:^{
[self fetchResult]; [self fetchResult];
// if ([_d_currentLicence.state isEqualToString:GTO_LICENCE_STATE_INITIAL]) {
// [self p_addAlerInfoLicenceView];
// } else {
// [self fetchResult];
// }
} }
fail:^(NSError *error) { fail:^(NSError *error) {
...@@ -838,17 +801,14 @@ didVideoPickedWithURL:(NSURL *)videoUrl { ...@@ -838,17 +801,14 @@ didVideoPickedWithURL:(NSURL *)videoUrl {
} }
//申请结束报修 //申请结束报修
- (void)httpApplicationRepair { - (void)httpApplicationRepair {
// if (_d_muArrLicences.count > 0) {
// for(GTOLicence *licence in _d_muArrLicences ) { for (GTOLicence *licence in _d_muArrLicences) {
// BOOL condition = [licence.state isEqualToString:GTO_LICENCE_STATE_INITIAL] if ([licence.state isEqualToString:@"submitted"] ||
// || [licence.state isEqualToString:GTO_LICENCE__STATE_SUBMITTED]; [licence.state isEqualToString:@"initial"] ||
// if (condition) { [licence.state isEqualToString:@"askforapprove"]) {
// [IBTLoadingView showProgressLabel:@"有未审批的许可证或者审批不通过的许可证"]; [IBTLoadingView hideHUDWithText:@"有未提交或待审批的许可证,请处理完成后重试"];
// return; }
// } }
// };
// }
void(^succ)(id) = ^(id data) { void(^succ)(id) = ^(id data) {
if ([data[@"success"] integerValue] == 1) { if ([data[@"success"] integerValue] == 1) {
[IBTLoadingView hideHUDForView:self.view]; [IBTLoadingView hideHUDForView:self.view];
......
...@@ -11,10 +11,13 @@ ...@@ -11,10 +11,13 @@
@interface GTORepairListCellContentView () @interface GTORepairListCellContentView ()
@property (strong, nonatomic) IBTUILabel *m_repairTitleLabel; @property (strong, nonatomic) IBTUILabel *m_repairTitleLabel;
@property (strong, nonatomic) IBTUILabel *m_billNumberLabel; @property (strong, nonatomic) IBTUILabel *m_billNumberLabel;
@property (nonatomic, strong) IBTUILabel *labelProposer;//报修申请人
@property (strong, nonatomic) IBTUILabel *m_storeNameLabel;//油站 @property (strong, nonatomic) IBTUILabel *m_storeNameLabel;//油站
@property (strong, nonatomic) IBTUILabel *m_stateLabel;//完成状态 @property (strong, nonatomic) IBTUILabel *m_stateLabel;//完成状态
@property (strong, nonatomic) IBTUILabel *m_stateValueLabel;//完成状态 @property (strong, nonatomic) IBTUILabel *m_stateValueLabel;//完成状态
@property (strong, nonatomic) IBTUILabel *m_repairDateLabel;//开始时间 @property (strong, nonatomic) IBTUILabel *m_repairDateLabel;//开始时间
@property (nonatomic, strong) UIImageView *imgRight;
@end @end
@implementation GTORepairListCellContentView @implementation GTORepairListCellContentView
...@@ -34,29 +37,28 @@ ...@@ -34,29 +37,28 @@
UIFont *font = [UIFont systemFontOfSize:17]; UIFont *font = [UIFont systemFontOfSize:17];
self.m_billNumberLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_billNumberLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.labelProposer = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_storeNameLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_storeNameLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_stateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_stateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_stateValueLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_stateValueLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_repairDateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft]; self.m_repairDateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.imgRight = [UIImageView new];
self.imgRight.image = [UIImage imageNamed:@"23"];
[self addSubview:_m_repairTitleLabel]; [self addSubview:_m_repairTitleLabel];
[self addSubview:_m_billNumberLabel]; [self addSubview:_m_billNumberLabel];
[self addSubview:self.labelProposer];
[self addSubview:_m_storeNameLabel]; [self addSubview:_m_storeNameLabel];
[self addSubview:_m_stateLabel]; // [self addSubview:_m_stateLabel];
[self addSubview:_m_stateValueLabel]; [self addSubview:_m_stateValueLabel];
[self addSubview:_m_repairDateLabel]; [self addSubview:_m_repairDateLabel];
[self addSubview:self.imgRight];
} }
- (void)layoutSubviews { - (void)layoutSubviews {
CGFloat lblH = 17; CGFloat lblH = 17;
_m_repairTitleLabel.frame = (CGRect){ _m_repairTitleLabel.frame = (CGRect){
.origin.x = GTO_LEFT_PADDING, .origin.x = GTO_LEFT_PADDING,
.origin.y = GTO_TOP_VERTICAL_PADDING, .origin.y = GTO_TOP_VERTICAL_PADDING,
.size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING, .size.width = SCREEN_SIZE.width - 100,
.size.height = lblH + 10, .size.height = lblH + 10,
}; };
_m_billNumberLabel.frame = (CGRect){ _m_billNumberLabel.frame = (CGRect){
...@@ -65,27 +67,26 @@ ...@@ -65,27 +67,26 @@
.size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING, .size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING,
.size.height = lblH, .size.height = lblH,
}; };
_labelProposer.frame = CGRectMake(_m_repairTitleLabel.x,
_m_billNumberLabel.bottom + GTO_VERTICAL_PADDING,
_m_billNumberLabel.width,
lblH);
_m_storeNameLabel.frame = (CGRect){ _m_storeNameLabel.frame = (CGRect){
.origin.x = _m_repairTitleLabel.x, .origin.x = _m_repairTitleLabel.x,
.origin.y = _m_billNumberLabel.bottom + GTO_VERTICAL_PADDING, .origin.y = _labelProposer.bottom + GTO_VERTICAL_PADDING,
.size.width = _m_billNumberLabel.width, .size.width = _labelProposer.width,
.size.height = lblH, .size.height = lblH,
}; };
_m_stateLabel.frame = (CGRect){
.origin.x =_m_repairTitleLabel.x,
.origin.y = _m_storeNameLabel.bottom + GTO_VERTICAL_PADDING,
.size.width = 80,
.size.height = lblH,
}; [_m_stateLabel sizeToFit];
_m_stateValueLabel.frame = (CGRect){ _m_stateValueLabel.frame = (CGRect){
.origin.x =_m_stateLabel.right, .origin.x = _m_repairTitleLabel.right,
.origin.y = _m_storeNameLabel.bottom + GTO_VERTICAL_PADDING, .origin.y = _m_repairTitleLabel.y,
.size.width = self.width - _m_stateLabel.right, .size.width = ScreenSize.width - _m_repairTitleLabel.right - 30,
.size.height = lblH, .size.height = lblH,
}; };
_imgRight.frame = CGRectMake(_m_stateValueLabel.right, _m_stateValueLabel.y, 10, _m_stateValueLabel.height);
_m_repairDateLabel.frame = (CGRect){ _m_repairDateLabel.frame = (CGRect){
.origin.x = _m_repairTitleLabel.x, .origin.x = _m_repairTitleLabel.x,
.origin.y = _m_stateLabel.bottom + GTO_VERTICAL_PADDING, .origin.y = _m_storeNameLabel.bottom + GTO_VERTICAL_PADDING,
.size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING, .size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING,
.size.height = lblH, .size.height = lblH,
}; };
...@@ -98,12 +99,15 @@ ...@@ -98,12 +99,15 @@
- (void)updateWithRepair: (GTORepair *)repair { - (void)updateWithRepair: (GTORepair *)repair {
self.m_repairTitleLabel.text = [NSString stringWithFormat:@"%@ ",repair.title]; self.m_repairTitleLabel.text = [NSString stringWithFormat:@"%@ ",repair.title];
self.m_billNumberLabel.text = [NSString stringWithFormat:@"维修单号:%@ ",repair.billnumber]; self.m_billNumberLabel.text = [NSString stringWithFormat:@"报修单号:%@ ",repair.billnumber];
self.labelProposer.text = [NSString stringWithFormat:@"报修申请人:%@",
repair.requestor];
self.m_storeNameLabel.text = [NSString stringWithFormat:@"油站名称:%@ ",repair.store_name]; self.m_storeNameLabel.text = [NSString stringWithFormat:@"油站名称:%@ ",repair.store_name];
self.m_stateLabel.text = [NSString stringWithFormat:@"报修状态: "]; self.m_stateLabel.text = [NSString stringWithFormat:@"报修状态: "];
self.m_stateValueLabel.text = [GTOCommonTools repairStateChineseWithEnglish:repair.state]; self.m_stateValueLabel.text = [GTOCommonTools repairStateChineseWithEnglish:repair.state];
self.m_stateValueLabel.textColor = [GTOCommonTools textColorWithState:repair.state]; self.m_stateValueLabel.textColor = [GTOCommonTools textColorWithRepairState:repair.state];
self.m_repairDateLabel.text = [NSString stringWithFormat:@"维修时间:%@",repair.repairDate ]; self.m_repairDateLabel.text = [NSString stringWithFormat:@"报修时间:%@",
[repair.repairDate substringToIndex:11]];
[self layoutSubviews]; [self layoutSubviews];
} }
@end @end
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
//记录更新时间 //记录更新时间
self.tableView.header.lastUpdatedTimeKey = TemplateNameUpdateDate; self.tableView.header.lastUpdatedTimeKey = TemplateNameUpdateDate;
self.title = @"选择模板"; self.title = @"选择许可证类型";
[self fetchDataList:@"" tableStr:GTO_PATROL_TEMPLATE]; [self fetchDataList:@"" tableStr:GTO_PATROL_TEMPLATE];
} }
- (void)getBaseDataFromServer{ - (void)getBaseDataFromServer{
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
+ (NSString *)pioneeringStateChineseWithEnglish: (NSString *)englishState; + (NSString *)pioneeringStateChineseWithEnglish: (NSString *)englishState;
//根据状态返回返回不同的文字颜色 //根据状态返回返回不同的文字颜色
+ (UIColor *)textColorWithState: (NSString *)state; + (UIColor *)textColorWithState: (NSString *)state;
//根据状态返回报修列表的文字颜色
+ (UIColor *)textColorWithRepairState: (NSString *)state;
//是否有某个功能的权限 //是否有某个功能的权限
+ (BOOL)hasPermissionWithPermissionId: (NSUInteger)permissionId; + (BOOL)hasPermissionWithPermissionId: (NSUInteger)permissionId;
......
...@@ -158,10 +158,35 @@ ...@@ -158,10 +158,35 @@
//根据状态返回返回不同的文字颜色 //根据状态返回返回不同的文字颜色
+ (UIColor *)textColorWithState: (NSString *)state { + (UIColor *)textColorWithState: (NSString *)state {
if ([state isEqualToString:@"initial"]) { //未提交
return GTO_RED_COLOR;
} else if ([state isEqualToString:@"submitted"]) { //申请审批(和待审批的英文单词互换)
return GTO_BLUE_SHALLOW_TINT_COLOR;
}else if ([state isEqualToString:@"approved"]) {
return GTO_GREEN_COLOR;
}else if ([state isEqualToString:@"rejected"]) {
return GTO_RED_COLOR;
}else if ([state isEqualToString:@"expired"]) {
return GTO_GRAY_SHALLOW_TINT_COLOR;
}else if ([state isEqualToString:@"finished"]) {
return GTO_GRAY_SHALLOW_TINT_COLOR;
}else if ([state isEqualToString:@"application"]) {
return GTO_GREEN_COLOR;
}else if ([state isEqualToString:@"processing"]) {
return GTO_BLUE_SHALLOW_TINT_COLOR;
}else if([state isEqualToString:@"askforapprove"]){ //待审批
return GTO_BLUE_SHALLOW_TINT_COLOR;
}else{
return nil;
}
}
+ (UIColor *)textColorWithRepairState: (NSString *)state
{
if ([state isEqualToString:@"initial"]) { if ([state isEqualToString:@"initial"]) {
return GTO_RED_COLOR; return GTO_RED_COLOR;
} else if ([state isEqualToString:@"submitted"]) { } else if ([state isEqualToString:@"submitted"]) {
return GTO_BLUE_SHALLOW_TINT_COLOR; return GTO_RED_COLOR;
}else if ([state isEqualToString:@"approved"]) { }else if ([state isEqualToString:@"approved"]) {
return GTO_GREEN_COLOR; return GTO_GREEN_COLOR;
}else if ([state isEqualToString:@"rejected"]) { }else if ([state isEqualToString:@"rejected"]) {
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.2.4</string> <string>1.2.6</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.2.4</string> <string>1.2.6</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
......
...@@ -91,18 +91,11 @@ ...@@ -91,18 +91,11 @@
//#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:8080/total-server/rest" //#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:8080/total-server/rest"
//开发环境 //开发环境
#define HTTP_LOCAL_BASE_URL @"http://39.196.195.30:8093" #define HTTP_LOCAL_BASE_URL @"http://139.196.195.30:8093"
#define HTTP_REST_API_BASE_URL @"http://139.196.195.30:8093/total-server/rest" #define HTTP_REST_API_BASE_URL @"http://139.196.195.30:8093/total-server/rest"
//豪杰/
//#define HTTP_REST_API_BASE_URL @"http://192.168.100.168:8080/total-server/rest"
//@"http://139.196.39.77:8080/total-web/"//
#define HTTP_WEATHER_URL @"http://apis.baidu.com/heweather/weather/free" #define HTTP_WEATHER_URL @"http://apis.baidu.com/heweather/weather/free"
//@"http://mobile.weather.com.cn/data/sk/"
//http://m.weather.com.cn/mweather/101020100.shtml
//http://www.weather.com.cn/data/sk/
//refreshUpdateDate //refreshUpdateDate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment