Commit a8825459 authored by 陈俊俊's avatar 陈俊俊

采购单

parent 8956cf5d
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
@interface ProductViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate> @interface ProductViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate>
{ {
CGRect _tableFrame; CGRect _tableFrame;
NSInteger _currentRow; NSMutableArray *_selectRowArr;//记录当前选中的cell
BOOL isFirst;
} }
@end @end
...@@ -26,14 +25,18 @@ ...@@ -26,14 +25,18 @@
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = XXFBgColor; self.view.backgroundColor = XXFBgColor;
[super viewDidLoad]; [super viewDidLoad];
isFirst = YES; [self initData];
[self createView];
}
- (void)initData{
_selectRowArr = [[NSMutableArray alloc]init];
if (!self.productArr) { if (!self.productArr) {
self.productArr = [NSMutableArray array]; self.productArr = [NSMutableArray array];
} }
[self.productArr addObject:@"ffff"]; [self.productArr addObject:@"ffff"];
[self.productArr addObject:@"fffff"]; [self.productArr addObject:@"fffff"];
[self createView];
} }
- (void)setViewFrame:(CGRect)viewFrame{ - (void)setViewFrame:(CGRect)viewFrame{
_tableFrame = viewFrame; _tableFrame = viewFrame;
} }
...@@ -80,35 +83,35 @@ ...@@ -80,35 +83,35 @@
cell.editBtn.hidden = YES; cell.editBtn.hidden = YES;
} }
} }
if (indexPath.row != _currentRow) { if ([self isHaveIndexPath:indexPath]) {
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = TableHeight-1;
cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = 0;
cell.showView.frame = showfrmame;
cell.showView.hidden = YES;
cell.backgroundColor = [UIColor whiteColor];
}else if (indexPath.row == _currentRow && !isFirst)
{
cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"]; cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
CGRect Linefrmame = cell.lineLabel.frame; CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = 200-1; Linefrmame.origin.y = 200-1;
cell.lineLabel.frame = Linefrmame; cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame; CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = 150; showfrmame.size.height = 150;
cell.showView.frame = showfrmame; cell.showView.frame = showfrmame;
cell.showView.hidden = NO;
cell.backgroundColor = XXFBgColor; cell.backgroundColor = XXFBgColor;
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = TableHeight-1;
cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = 0;
cell.showView.frame = showfrmame;
cell.backgroundColor = [UIColor whiteColor];
} }
return cell; return cell;
} }
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in _selectRowArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
ProductCell *cell = (ProductCell *)[tableView cellForRowAtIndexPath:indexPath]; ProductCell *cell = (ProductCell *)[tableView cellForRowAtIndexPath:indexPath];
...@@ -119,29 +122,25 @@ ...@@ -119,29 +122,25 @@
Linefrmame.origin.y = 200-1; Linefrmame.origin.y = 200-1;
showfrmame.size.height = 150; showfrmame.size.height = 150;
cell.showView.hidden = NO; // cell.showView.hidden = NO;
isFirst = NO;
cell.backgroundColor = [UIColor whiteColor]; cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr addObject:indexPath];
}else{ }else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"]; cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
isFirst = YES;
Linefrmame.origin.y = TableHeight -1; Linefrmame.origin.y = TableHeight -1;
showfrmame.size.height = 0; showfrmame.size.height = 0;
cell.showView.hidden = YES; // cell.showView.hidden = YES;
cell.backgroundColor = [UIColor whiteColor]; cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr removeObject:indexPath];
} }
cell.lineLabel.frame = Linefrmame; cell.lineLabel.frame = Linefrmame;
cell.showView.frame = showfrmame; cell.showView.frame = showfrmame;
_currentRow = indexPath.row;
[self.tableView reloadData]; [self.tableView reloadData];
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row == _currentRow && !isFirst) { if ([self isHaveIndexPath:indexPath]) {
return 200; return 200;
} }
return TableHeight; return TableHeight;
......
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)]; self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
self.showView.hidden = YES; // self.showView.hidden = YES;
self.showView.clipsToBounds = YES;
self.showTitleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))]; self.showTitleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))];
self.showTitleLabel.textAlignment = NSTextAlignmentLeft; self.showTitleLabel.textAlignment = NSTextAlignmentLeft;
......
...@@ -354,7 +354,7 @@ typedef enum : NSUInteger { ...@@ -354,7 +354,7 @@ typedef enum : NSUInteger {
ChosePersonViewController *cvc = [ChosePersonViewController new]; ChosePersonViewController *cvc = [ChosePersonViewController new];
cvc.chosePerson = ^(NSArray *users){ cvc.chosePerson = ^(NSArray *users){
NSString *textStr = @""; NSString *textStr = @"";
if (self.users.count >0) { if (self.users.count > 0) {
[self.users removeAllObjects]; [self.users removeAllObjects];
} }
for (SurveyUser *user in users) { for (SurveyUser *user in users) {
...@@ -428,12 +428,6 @@ typedef enum : NSUInteger { ...@@ -428,12 +428,6 @@ typedef enum : NSUInteger {
_startTimeView = nil; _startTimeView = nil;
}]; }];
} }
#pragma mark delegate #pragma mark delegate
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{ - (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
[_noteTextView resignFirstResponder]; [_noteTextView resignFirstResponder];
......
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