Commit 3a950dbc authored by Sandy's avatar Sandy

修改状态颜色

parent 3a540349
...@@ -155,7 +155,6 @@ static NSString *PatrolPlanCellIdentifier = @"PatrolPlanCell"; ...@@ -155,7 +155,6 @@ static NSString *PatrolPlanCellIdentifier = @"PatrolPlanCell";
/** 联网获取属数据 */ /** 联网获取属数据 */
- (void)getHttpDataWithDate:(NSString *)date DateType:(NSString *)dateType { - (void)getHttpDataWithDate:(NSString *)date DateType:(NSString *)dateType {
//[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];
...@@ -435,10 +434,6 @@ static NSString *PatrolPlanCellIdentifier = @"PatrolPlanCell"; ...@@ -435,10 +434,6 @@ static NSString *PatrolPlanCellIdentifier = @"PatrolPlanCell";
- (void)configureCell:(UITableViewCell *)cell - (void)configureCell:(UITableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath { forRowAtIndexPath:(NSIndexPath *)indexPath {
// cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
// id data = _m_arrAllData[indexPath.section];//_m_arrData[ indexPath.row
// ];
UIView *contentView = cell.contentView; UIView *contentView = cell.contentView;
......
...@@ -34,6 +34,7 @@ typedef NS_ENUM(NSUInteger, GTOPatrolPlanStatus) { ...@@ -34,6 +34,7 @@ typedef NS_ENUM(NSUInteger, GTOPatrolPlanStatus) {
@property (copy, nonatomic) NSString *category; // 巡店类别 @property (copy, nonatomic) NSString *category; // 巡店类别
@property (assign, nonatomic) BOOL recordLocation; //是否记录调整位置 @property (assign, nonatomic) BOOL recordLocation; //是否记录调整位置
@property (assign, nonatomic) GTOPatrolPlanStatus state; // 状态 应该是后台的状态吧????? @property (assign, nonatomic) GTOPatrolPlanStatus state; // 状态 应该是后台的状态吧?????
@property (strong, nonatomic) UIColor *stateColor;
@property (copy, nonatomic) NSString *remark; //说明 @property (copy, nonatomic) NSString *remark; //说明
@property (copy, nonatomic) NSArray *questions; //问题列表 @property (copy, nonatomic) NSArray *questions; //问题列表
@property (copy, nonatomic) NSArray *inspectors; //巡店员列表 @property (copy, nonatomic) NSArray *inspectors; //巡店员列表
......
...@@ -18,6 +18,34 @@ ...@@ -18,6 +18,34 @@
+ (NSString *)PrimaryKey { + (NSString *)PrimaryKey {
return @"uuid"; return @"uuid";
} }
- (UIColor *)stateColor {
if (!_stateColor) {
switch (self.state) {
case kPatrolPlanStatusCreated: {
_stateColor = GTO_RED_COLOR;
break;
}
case kPatrolPlanStatusCommited: {
_stateColor = [UIColor redColor];
break;
}
case kPatrolPlanStatusProcessing: {
_stateColor = GTO_BLUE_TINT_COLOR;
break;
}
case kPatrolPlanStatusFinished: {
_stateColor = [UIColor blackColor];
break;
}
case kPatrolPlanStatusCanceld: {
_stateColor = GTO_GRAY_TINT_COLOR;
break;
}
}
}
return _stateColor;
}
#pragma mark - setter #pragma mark - setter
//- (void)setQuestions:(NSArray *)questions { //- (void)setQuestions:(NSArray *)questions {
......
...@@ -120,25 +120,23 @@ ...@@ -120,25 +120,23 @@
_d_processLength = patrolPlan.processLength; _d_processLength = patrolPlan.processLength;
self.m_planNameLabel.text = [NSString stringWithFormat:@"%@",patrolPlan.name]; self.m_planNameLabel.text = [NSString stringWithFormat:@"%@",patrolPlan.name];
self.m_planTimeLabel.text = [NSString stringWithFormat:@"计划时间: %@ ~ %@",patrolPlan.beginDate ,patrolPlan.endDate ];//[NSString stringWithFormat:@"最后修改时间:%@ ",patrolPlan.lastModify_time];// NSString *begin = [patrolPlan.beginDate substringToIndex:11];
NSString *end = [patrolPlan.endDate substringToIndex:11];
self.m_planTimeLabel.text = [NSString stringWithFormat:@"计划时间: %@ ~ %@",begin ,end];//[NSString stringWithFormat:@"最后修改时间:%@ ",patrolPlan.lastModify_time];//
self.m_processLabel.text = [NSString stringWithFormat:@"巡检总进度: "]; self.m_processLabel.text = [NSString stringWithFormat:@"巡检总进度: "];
self.m_planStateLabel.text = @"状态: "; self.m_planStateLabel.text = @"状态: ";
NSString *stateStr = [NSString stringWithFormat:@"%ld",patrolPlan.state]; NSString *stateStr = [NSString stringWithFormat:@"%ld",patrolPlan.state];
self.m_planStateValueLabel.text = [GTOCommonTools patrolStateChineseWithEnglish:stateStr]; self.m_planStateValueLabel.text = [GTOCommonTools patrolStateChineseWithEnglish:stateStr];
if (patrolPlan.state == kPatrolPlanStatusProcessing) { self.m_planStateValueLabel.textColor = patrolPlan.stateColor;
self.m_planStateValueLabel.textColor = GTO_RED_COLOR;
} else {
self.m_planStateValueLabel.textColor = GTO_GRAY_TINT_COLOR;
}
self.d_processLength = patrolPlan.processLength;//finishStores * 1.0 / totalStores; self.d_processLength = patrolPlan.processLength;//finishStores * 1.0 / totalStores;
int percent = patrolPlan.processLength * 100; int percent = patrolPlan.processLength * 100;
self.m_processValueLabel.text = [NSString stringWithFormat:@"%d%%",percent];
self.m_processValueLabel.textColor = patrolPlan.stateColor;
if (patrolPlan.finishedStoreNumber == patrolPlan.totalStoreNumber) { if (patrolPlan.finishedStoreNumber == patrolPlan.totalStoreNumber) {
self.m_processValueLabel.text = [NSString stringWithFormat:@"%d%%",percent];
self.m_processValueLabel.textColor = GTO_GRAY_TINT_COLOR;
self.m_processFractionLabel.textColor = GTO_GRAY_TINT_COLOR; self.m_processFractionLabel.textColor = GTO_GRAY_TINT_COLOR;
} else { } else {
self.m_processValueLabel.text = [NSString stringWithFormat:@"%d%%",percent];
self.m_processValueLabel.textColor = GTO_BLUE_TINT_COLOR;
self.m_processFractionLabel.textColor = GTO_BLUE_TINT_COLOR; self.m_processFractionLabel.textColor = GTO_BLUE_TINT_COLOR;
} }
......
...@@ -122,23 +122,22 @@ static NSString *headerProblemItemID = @"headerItem"; ...@@ -122,23 +122,22 @@ static NSString *headerProblemItemID = @"headerItem";
__strong __typeof(weakSelf) strongSelf = weakSelf; __strong __typeof(weakSelf) strongSelf = weakSelf;
NSMutableArray *muArrDisplayRs = [NSMutableArray array]; NSMutableArray *muArrDisplayRs = [NSMutableArray array];
for (int count = 0; count < _d_licence.arrDisplayResults.count; count++) { for (int count = 0; count < strongSelf.d_licence.arrDisplayResults.count; count++) {
GTODisplayResult *displayR = [GTODisplayResult DBObject]; GTODisplayResult *displayR = [GTODisplayResult DBObject];
[displayR praseFromJsonDict:_d_licence.arrDisplayResults[count]]; [displayR praseFromJsonDict:strongSelf.d_licence.arrDisplayResults[count]];
NSMutableArray *muArrAnswers = [NSMutableArray array]; NSMutableArray *muArrAnswers = [NSMutableArray array];
for (GTOAnswer *answer in fetchedObjects) { for (GTOAnswer *answer in fetchedObjects) {
if ([answer.category isEqualToString:displayR.category]) if ([answer.category isEqualToString:displayR.category])
// displayR.answerNumber++;
[muArrAnswers addObject:[answer dictForCommit]]; [muArrAnswers addObject:[answer dictForCommit]];
} }
displayR.arrAnswers = muArrAnswers; displayR.arrAnswers = muArrAnswers;
[muArrDisplayRs addObject:[displayR dictForCommit]]; [muArrDisplayRs addObject:[displayR dictForCommit]];
} }
_d_licence.arrDisplayResults = muArrDisplayRs; strongSelf.d_licence.arrDisplayResults = muArrDisplayRs;
[_d_licence saveToDBWithHandleData:nil [strongSelf.d_licence saveToDBWithHandleData:nil
complete:^{ complete:^{
[_c_tableView reloadData]; [strongSelf.c_tableView reloadData];
} }
fail:nil]; fail:nil];
......
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