Commit 50948233 authored by zhu's avatar zhu

no message

parent 27f380e1
This diff is collapsed.
......@@ -16,10 +16,6 @@
#import "Survey.h"
#import "PurchaseNoticeCell.h"
#import "ShopDetaileViewController.h"
#define LeftMargin 15
#define BtnHeight 44
#define TableHeight 46
......@@ -30,6 +26,12 @@
#define KeyboardHeight 258
#define DateViewHeight 300
#define FootOfsetHeight 140
#define BottomViewHeight 60
typedef enum : NSUInteger {
SaveTag = 8000,
CommitTag,
} BtnTag;
@interface NewPurchaseNoticeViewController()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,HPGrowingTextViewDelegate>
{
UITableView *_tableView;
......@@ -41,6 +43,7 @@
UILabel *_personLabel;
HPGrowingTextView *_noteTextView;
NSIndexPath *selectedCellIndexPath;
NSMutableArray *selectCellAry;
BOOL _isClickStart;
......@@ -76,6 +79,7 @@
}
-(void)setupSubviews
{
selectCellAry=[[NSMutableArray alloc]initWithCapacity:1000];
_dataArr=[[NSMutableArray alloc]initWithObjects:@"标题:",@"采购员:",@"备注:", nil];
self.view.backgroundColor = XXFBgColor;
......@@ -115,6 +119,15 @@
self.HeardLabel.font = FontSize(TitleSize);
//HexColor(@"e5e5e5")
UIView *footView4 = [[UIView alloc]initWithFrame:CGRectMake(0, ScreenSize.height - BottomViewHeight - 64, ScreenSize.width, BottomViewHeight)];
UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(15, 8, (ScreenSize.width - 15*3)/2, 44) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"保存" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:HexColor(@"50bd62")];
[footView4 addSubview:saveBtn];
UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetMaxX(saveBtn.frame) + 15, 8, (ScreenSize.width - 15*3)/2, 44) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"提交" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:HexColor(@"f69100")];
[footView4 addSubview:commitBtn];
[self.view addSubview:footView4];
[footView3 addSubview:self.addDetailedButton];
[footView3 addSubview:self.HeardLabel];
[footView3 addSubview:self.FootLabel];
......@@ -125,6 +138,7 @@
mingXiTableView.tableHeaderView=footView2;
[self.view addSubview:_tableView];
[self.view addSubview:mingXiTableView];
[self.view addSubview:footView4];
}
......@@ -177,17 +191,18 @@
// Cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;向左箭头
}
if(selectedCellIndexPath != nil&[selectedCellIndexPath compare:indexPath] == NSOrderedSame){
Cell.backgroundColor=XXFBgColor;
Cell.subSview.hidden=NO;
}else
{
Cell.subSview.hidden=YES;
Cell.backgroundColor=[UIColor whiteColor];
}
if (Cell.isSelected==YES) {
Cell.arrowView.image = [UIImage imageNamed:@"arrowdown"];
Cell.backgroundColor=XXFBgColor;
Cell.subSview.hidden=NO;
}else
{
Cell.arrowView.image = [UIImage imageNamed:@"arrowright"];
Cell.backgroundColor=[UIColor whiteColor];
Cell.subSview.hidden=YES;
}
[Cell.button addTarget:self action:@selector(didtoucher) forControlEvents:UIControlEventTouchUpInside];
// [cell setTitleStr:_dataArr[indexPath.row]];
return Cell;
}
......@@ -204,15 +219,14 @@
}else if ([tableView isEqual:mingXiTableView])
{
if(selectedCellIndexPath != nil&[selectedCellIndexPath compare:indexPath] == NSOrderedSame){
return TableHeight*3;
}
return TableHeight;
if ([self comperIndexpath:indexPath]) {
return TableHeight*3;
}else
{
return TableHeight;
}
}
return TableHeight;
}
......@@ -252,11 +266,16 @@
}else if ([tableView isEqual:mingXiTableView])
{
PurchaseNoticeCell *Cell=(PurchaseNoticeCell*)[mingXiTableView cellForRowAtIndexPath:indexPath ];
Cell.isSelected=YES;
if (Cell.isSelected==NO) {
Cell.isSelected=YES;
[selectCellAry addObject:indexPath];
}else{
Cell.isSelected=NO;
[selectCellAry removeObject:indexPath];
}
selectedCellIndexPath = indexPath;
// [Cell setTitleStr:@"selected"];
// [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
[mingXiTableView reloadData];
}
......@@ -273,11 +292,7 @@
_titleField.returnKeyType = UIReturnKeyDone;
_titleField.delegate = self;
[cell.contentView addSubview:_titleField];
// if (self.survey) {
// _titleField.text = [IBTCommon checkString:self.survey.title];
// self.titleStr = [IBTCommon checkString:self.survey.title];
// }
// }else
}else if (indexPath.row == _dataArr.count -1){
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
_noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
......@@ -289,10 +304,6 @@
_noteTextView.returnKeyType = UIReturnKeyDone;
_noteTextView.placeholder = @"输入备注内容";
[cell.contentView addSubview:_noteTextView];
// if (self.survey) {
// _noteTextView.text = [IBTCommon checkString:self.survey.remark];
// self.remarkStr = [IBTCommon checkString:self.survey.remark];
// }
CGRect lineFrame = cell.lineLabel.frame;
lineFrame.origin.y = TableHeight*2-1;
cell.lineLabel.frame = lineFrame;
......@@ -309,7 +320,15 @@
}
}
}
-(BOOL)comperIndexpath:(NSIndexPath *)indexPath
{
for (NSIndexPath *path in selectCellAry) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)preferDataInPersonLabel{
if (self.survey) {
if (self.survey.users.count > 0) {
......@@ -373,6 +392,26 @@
[_noteTextView resignFirstResponder];
[self setTableFrame:LeftMargin];
}
- (void)btnClick:(UIButton *)btn{
switch (btn.tag) {
case SaveTag:
{
// if ([self checkSurvey]) {
// [self saveSurvey:@"initial" message:@"正在保存..."];
// }
}
break;
case CommitTag:
{
// if ([self checkSurvey]) {
// [self saveSurvey:@"submitted" message:@"正在提交..."];
// }
}
break;
default:
break;
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
......
......@@ -11,6 +11,7 @@
@interface PurchaseNoticeCell : UITableViewCell
@property (nonatomic,strong)UILabel *HeardLabel;
@property (nonatomic,strong)UILabel *FootLabel;
@property (nonatomic,strong)UIImageView *arrowView;
@property (nonatomic,strong)UILabel *SpLabel;
@property (nonatomic,strong)UILabel *DjLabel;
@property (nonatomic,strong)UILabel *BzggLabel;
......
......@@ -32,8 +32,12 @@
self.HeardLabel.font = FontSize(TitleSize);
self.FootLabel=[[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, self.size.height-1, ScreenSize.width - LeftMargin * 2, 1))];
self.HeardLabel.backgroundColor = HexColor(@"e5e5e5");
self.HeardLabel.font = FontSize(TitleSize);
self.FootLabel.backgroundColor = HexColor(@"e5e5e5");
self.FootLabel.font = FontSize(TitleSize);
self.arrowView=[[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - 10)/2 , 10, 10)];
self.arrowView.image = [UIImage imageNamed:@"arrowright"];
self.arrowView.contentMode = UIViewContentModeScaleAspectFit;
self.SpLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20, 0, TableWidth, TableHeight))];
self.SpLabel.textAlignment= NSTextAlignmentLeft;
......@@ -84,9 +88,7 @@
self.button=[UIButton buttonWithType:UIButtonTypeCustom];
[self.button setFrame:CGRectMake(310, 0, 50, 50)];
[self.button setImage:[UIImage imageNamed:@"AttachHide"] forState:UIControlStateNormal];
// [self.button setTitle:@"编辑" forState:UIControlStateNormal];
// [self.button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[self.button setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
[self.contentView addSubview:self.button];
[self.contentView addSubview:self.subSview];
[self.contentView addSubview:self.SpLabel];
......@@ -94,6 +96,7 @@
[self.contentView addSubview:self.BzslLabel];
[self.contentView addSubview:self.BzggLabel];
[self.contentView addSubview:self.HeardLabel];
[self.contentView addSubview:self.arrowView];
// [self.contentView addSubview:self.FootLabel];
}
- (void)setTitleStr:(NSString *)str
......
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