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

采购单

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