Commit 48d5df9b authored by 陈俊俊's avatar 陈俊俊

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into DEV_20150805_001

Conflicts:
	XFFruit/ViewControllers/Survey/controllers/ChooseProductViewController.m
parents 8e437981 ffbc2672
...@@ -113,4 +113,23 @@ ...@@ -113,4 +113,23 @@
#define SurveyUpdateDate @"surveyUpdateDate" #define SurveyUpdateDate @"surveyUpdateDate"
#define ChooseProductUpdateDate @"chooseProductUpdateDate" #define ChooseProductUpdateDate @"chooseProductUpdateDate"
//行情调研状态
//initial(未提交),submitted(已提交),insurvey(调研中),finished(已完成)
#define SURVEY_STATE_INITIAL @"initial"
#define SURVEY_STATE_SUBMITTED @"submitted"
#define SURVEY_STATE_INSURVEY @"insurvey"
#define SURVEY_STATE_FINISHED @"finished"
//采购单状态
#define PURCHASE_STATE_INITIAL @"initial"
#define PURCHASE_STATE_SUBMITTED @"submitted"
#define PURCHASE_STATE_REJECTED @"rejected"
#define PURCHASE_STATE_APPROVED @"approved"
#define PURCHASE_STATE_SHIPPING @"shipping"
#define PURCHASE_STATE_FINISHED @"finished"
#endif #endif
...@@ -193,22 +193,22 @@ typedef enum : NSUInteger { ...@@ -193,22 +193,22 @@ typedef enum : NSUInteger {
- (void)fetchtPurchaseDetail{ - (void)fetchtPurchaseDetail{
self.billNumberLabel.text = [IBTCommon checkString:self.bill.billNumber]; self.billNumberLabel.text = [IBTCommon checkString:self.bill.billNumber];
if ([self.bill.state isEqualToString:@"initial"]) { if ([self.bill.state isEqualToString:PURCHASE_STATE_INITIAL]) {
self.stateLabel.textColor = [UIColor redColor]; self.stateLabel.textColor = [UIColor redColor];
self.stateLabel.text = @"未提交"; self.stateLabel.text = @"未提交";
}else if ([self.bill.state isEqualToString:@"submitted"]) { }else if ([self.bill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {
self.stateLabel.textColor = [UIColor greenColor]; self.stateLabel.textColor = [UIColor greenColor];
self.stateLabel.text = @"已提交"; self.stateLabel.text = @"已提交";
}else if ([self.bill.state isEqualToString:@"rejected"]) { }else if ([self.bill.state isEqualToString:PURCHASE_STATE_REJECTED]) {
self.stateLabel.textColor = [UIColor grayColor]; self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已拒绝"; self.stateLabel.text = @"已拒绝";
}else if ([self.bill.state isEqualToString:@"approved"]) { }else if ([self.bill.state isEqualToString:PURCHASE_STATE_APPROVED]) {
self.stateLabel.textColor = [UIColor grayColor]; self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已审批"; self.stateLabel.text = @"已审批";
}else if ([self.bill.state isEqualToString:@"shipping"]) { }else if ([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
self.stateLabel.textColor = [UIColor grayColor]; self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"发运中"; self.stateLabel.text = @"发运中";
}else if ([self.bill.state isEqualToString:@"finished"]) { }else if ([self.bill.state isEqualToString:PURCHASE_STATE_FINISHED]) {
self.stateLabel.textColor = [UIColor blackColor]; self.stateLabel.textColor = [UIColor blackColor];
self.stateLabel.text = @"已完成"; self.stateLabel.text = @"已完成";
} }
...@@ -216,7 +216,7 @@ typedef enum : NSUInteger { ...@@ -216,7 +216,7 @@ typedef enum : NSUInteger {
self.createOperNameLabel.text = [IBTCommon checkString:self.bill.create_operName]; self.createOperNameLabel.text = [IBTCommon checkString:self.bill.create_operName];
self.checkNameLabel.text = [IBTCommon checkString:self.bill.vendor_name]; self.checkNameLabel.text = [IBTCommon checkString:self.bill.vendor_name];
self.vendorNameLabel.text = [IBTCommon checkString:self.bill.vendor_name]; self.vendorNameLabel.text = [IBTCommon checkString:self.bill.vendor_name];
self.totalPriceLabel.text = [IBTCommon checkString:self.bill.total]; self.totalPriceLabel.text = [IBTCommon checkString:[self.bill.total stringValue]];
self.noteLabel.text = [IBTCommon checkString:self.bill.remark]; self.noteLabel.text = [IBTCommon checkString:self.bill.remark];
self.lastModifyNameLabel.text = @"最后修改人"; self.lastModifyNameLabel.text = @"最后修改人";
self.typeLabel.text = @"类型"; self.typeLabel.text = @"类型";
......
...@@ -47,17 +47,17 @@ ...@@ -47,17 +47,17 @@
} }
- (void)preferData{ - (void)preferData{
//initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成) //initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
if ([self.state isEqualToString:@"initial"]) { if ([self.state isEqualToString:PURCHASE_STATE_INITIAL]) {
_currentIndexPath = [NSIndexPath indexPathForRow:0 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];
}else if ([self.state isEqualToString:@"submitted"]) { }else if ([self.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:1 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:1 inSection:0];
}else if ([self.state isEqualToString:@"rejected"]) { }else if ([self.state isEqualToString:PURCHASE_STATE_REJECTED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:2 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:2 inSection:0];
}else if ([self.state isEqualToString:@"approved"]) { }else if ([self.state isEqualToString:PURCHASE_STATE_APPROVED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:3 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:3 inSection:0];
}else if ([self.state isEqualToString:@"shipping"]) { }else if ([self.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
_currentIndexPath = [NSIndexPath indexPathForRow:4 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:4 inSection:0];
}else if ([self.state isEqualToString:@"finished"]) { }else if ([self.state isEqualToString:PURCHASE_STATE_FINISHED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:5 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:5 inSection:0];
} }
_billView.hidden = YES; _billView.hidden = YES;
...@@ -236,17 +236,17 @@ ...@@ -236,17 +236,17 @@
NSString *stateStr = @""; NSString *stateStr = @"";
if (indexPath.row == 0) { if (indexPath.row == 0) {
stateStr = @"initial"; stateStr = PURCHASE_STATE_INITIAL;
}else if(indexPath.row == 1){ }else if(indexPath.row == 1){
stateStr = @"submitted"; stateStr = PURCHASE_STATE_SUBMITTED;
}else if(indexPath.row == 2){ }else if(indexPath.row == 2){
stateStr = @"rejected"; stateStr = PURCHASE_STATE_REJECTED;
}else if(indexPath.row == 3){ }else if(indexPath.row == 3){
stateStr = @"approved"; stateStr = PURCHASE_STATE_APPROVED;
}else if(indexPath.row == 4){ }else if(indexPath.row == 4){
stateStr = @"shipping"; stateStr = PURCHASE_STATE_SHIPPING;
}else if(indexPath.row == 5){ }else if(indexPath.row == 5){
stateStr = @"finished"; stateStr = PURCHASE_STATE_FINISHED;
} }
[self.delegate getBoltValueSelectRow:stateStr]; [self.delegate getBoltValueSelectRow:stateStr];
} }
......
...@@ -69,25 +69,25 @@ ...@@ -69,25 +69,25 @@
self.createOperNameLabel.text = [NSString stringWithFormat:@"创建人:%@",purchaseBill.create_operName] ; self.createOperNameLabel.text = [NSString stringWithFormat:@"创建人:%@",purchaseBill.create_operName] ;
self.createTimeLabel.text =[NSString stringWithFormat:@"创建时间:%@",purchaseBill.create_time]; self.createTimeLabel.text =[NSString stringWithFormat:@"创建时间:%@",purchaseBill.create_time];
NSString *stateStr = @""; NSString *stateStr = @"";
if ([purchaseBill.state isEqualToString:@"initial"]) { if ([purchaseBill.state isEqualToString:PURCHASE_STATE_INITIAL]) {
stateStr = @"未提交"; stateStr = @"未提交";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:@"submitted"]) { }else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {
stateStr = @"已提交"; stateStr = @"已提交";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:@"rejected"]) { }else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_REJECTED]) {
stateStr = @"已拒绝"; stateStr = @"已拒绝";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:@"approved"]) { }else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_APPROVED]) {
stateStr = @"已审批"; stateStr = @"已审批";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:@"shipping"]) { }else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
stateStr = @"发运中"; stateStr = @"发运中";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:@"finished"]) { }else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_FINISHED]) {
stateStr = @"已完成"; stateStr = @"已完成";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
} }
......
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
//initial(未提交),submitted(已提交),insurvey(调研中) //initial(未提交),submitted(已提交),insurvey(调研中)
if ([self.state isEqualToString:@"none"]) { if ([self.state isEqualToString:@"none"]) {
_currentIndexPath = [NSIndexPath indexPathForRow:0 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];
}else if ([self.state isEqualToString:@"initial"]) { }else if ([self.state isEqualToString:SURVEY_STATE_INITIAL]) {
_currentIndexPath = [NSIndexPath indexPathForRow:1 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:1 inSection:0];
}else if ([self.state isEqualToString:@"submitted"]) { }else if ([self.state isEqualToString:SURVEY_STATE_SUBMITTED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:2 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:2 inSection:0];
}else if ([self.state isEqualToString:@"insurvey"]) { }else if ([self.state isEqualToString:SURVEY_STATE_INSURVEY]) {
_currentIndexPath = [NSIndexPath indexPathForRow:3 inSection:0]; _currentIndexPath = [NSIndexPath indexPathForRow:3 inSection:0];
} }
_titleView.hidden = YES; _titleView.hidden = YES;
......
...@@ -72,17 +72,17 @@ ...@@ -72,17 +72,17 @@
self.begindateLabel.text = [NSString stringWithFormat:@"开始时间:%@",[survey.beginDate substringToIndex:10]]; self.begindateLabel.text = [NSString stringWithFormat:@"开始时间:%@",[survey.beginDate substringToIndex:10]];
self.enddateLabel.text = [NSString stringWithFormat:@"结束时间:%@",[survey.endDate substringToIndex:10]]; self.enddateLabel.text = [NSString stringWithFormat:@"结束时间:%@",[survey.endDate substringToIndex:10]];
NSString *stateStr = @""; NSString *stateStr = @"";
if ([survey.state isEqualToString:@"initial"]) { if ([survey.state isEqualToString:SURVEY_STATE_INITIAL]) {
stateStr = @"未提交"; stateStr = @"未提交";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled];
}else if ([survey.state isEqualToString:@"submitted"]) { }else if ([survey.state isEqualToString:SURVEY_STATE_SUBMITTED]) {
stateStr = @"已提交"; stateStr = @"已提交";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([survey.state isEqualToString:@"insurvey"]) { }else if ([survey.state isEqualToString:SURVEY_STATE_INSURVEY]) {
stateStr = @"调研中"; stateStr = @"调研中";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([survey.state isEqualToString:@"finished"]) { }else if ([survey.state isEqualToString:SURVEY_STATE_FINISHED]) {
stateStr = @"已完成"; stateStr = @"已完成";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
} }
......
...@@ -90,9 +90,16 @@ ...@@ -90,9 +90,16 @@
__weak typeof(self)weakSelf = self; __weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) { ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf; __strong __typeof(weakSelf)strongSelf = weakSelf;
if (!fetchedObjects) {
[[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:self.tableView.header.lastUpdatedTimeKey];
[[NSUserDefaults standardUserDefaults] synchronize];
[self getData];
}else{
[strongSelf.dataArr removeAllObjects]; [strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObject:self.tableView.header.lastUpdatedTime];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects]; [strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[strongSelf tableViewRefresh]; [self deletePerson];
}
}; };
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController]; ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
...@@ -189,16 +196,25 @@ ...@@ -189,16 +196,25 @@
} }
} }
if (self.dataArr.count > 0) { if (self.dataArr.count > 0) {
if (indexPath.row == 0) {
NSString *dateStr = [self.dataArr[indexPath.row] httpParameterString];
cell.titleLabel.textColor = GXF_CONTENT_COLOR;
[cell setTitleStr:[NSString stringWithFormat:@"上次更新时间:%@",dateStr]];
}else{
Product *product = self.dataArr[indexPath.row]; Product *product = self.dataArr[indexPath.row];
cell.titleLabel.textColor = GXF_LEFTSIX_COLOR;
NSString *proStr = [NSString stringWithFormat:@"%@[%@]",product.name,product.code]; NSString *proStr = [NSString stringWithFormat:@"%@[%@]",product.name,product.code];
[cell setTitleStr:proStr]; [cell setTitleStr:proStr];
}
} }
return cell; return cell;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 0) {
return;
}
if (self.isMoreChose == YES) { if (self.isMoreChose == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath]; MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO; cell.Commitbtn.hidden = NO;
......
...@@ -103,16 +103,16 @@ typedef enum : NSUInteger { ...@@ -103,16 +103,16 @@ typedef enum : NSUInteger {
- (void)fetchtSurveyDetail{ - (void)fetchtSurveyDetail{
self.billNumberLabel.text = [IBTCommon checkString:self.survey.billNumber]; self.billNumberLabel.text = [IBTCommon checkString:self.survey.billNumber];
if ([self.survey.state isEqualToString:@"initial"]) { if ([self.survey.state isEqualToString:SURVEY_STATE_INITIAL]) {
self.stateLabel.textColor = [UIColor redColor]; self.stateLabel.textColor = [UIColor redColor];
self.stateLabel.text = @"未提交"; self.stateLabel.text = @"未提交";
}else if ([self.survey.state isEqualToString:@"submitted"]) { }else if ([self.survey.state isEqualToString:SURVEY_STATE_SUBMITTED]) {
self.stateLabel.textColor = [UIColor greenColor]; self.stateLabel.textColor = [UIColor greenColor];
self.stateLabel.text = @"已提交"; self.stateLabel.text = @"已提交";
}else if ([self.survey.state isEqualToString:@"insurvey"]) { }else if ([self.survey.state isEqualToString:SURVEY_STATE_INSURVEY]) {
self.stateLabel.textColor = [UIColor grayColor]; self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"调研中"; self.stateLabel.text = @"调研中";
}else if ([self.survey.state isEqualToString:@"finished"]) { }else if ([self.survey.state isEqualToString:SURVEY_STATE_FINISHED]) {
self.stateLabel.textColor = [UIColor blackColor]; self.stateLabel.textColor = [UIColor blackColor];
self.stateLabel.text = @"已完成"; self.stateLabel.text = @"已完成";
} }
......
...@@ -421,13 +421,13 @@ typedef enum : NSUInteger { ...@@ -421,13 +421,13 @@ typedef enum : NSUInteger {
if (self.dataArr.count > 0) { if (self.dataArr.count > 0) {
survey = self.dataArr[indexPath.row]; survey = self.dataArr[indexPath.row];
} }
if ([survey.state isEqualToString:@"initial"]) { if ([survey.state isEqualToString:SURVEY_STATE_INITIAL]) {
NewSurveyViewController *nvc = [[NewSurveyViewController alloc]init]; NewSurveyViewController *nvc = [[NewSurveyViewController alloc]init];
nvc.survey = survey; nvc.survey = survey;
nvc.navTitle = @"修改行情调研单"; nvc.navTitle = @"修改行情调研单";
[self PushViewController:nvc animated:YES]; [self PushViewController:nvc animated:YES];
}else if([survey.state isEqualToString:@"submitted"] || [survey.state isEqualToString:@"insurvey"]|| [survey.state isEqualToString:@"finished"]){ }else if([survey.state isEqualToString:SURVEY_STATE_SUBMITTED] || [survey.state isEqualToString:SURVEY_STATE_INSURVEY]|| [survey.state isEqualToString:SURVEY_STATE_FINISHED]){
SurveyDetailViewController *svc = [SurveyDetailViewController new]; SurveyDetailViewController *svc = [SurveyDetailViewController new];
svc.survey = survey; svc.survey = survey;
svc.surveyUuid = survey.uuid; svc.surveyUuid = survey.uuid;
......
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