Commit a44683ad authored by n22's avatar n22

采购

parent 534bb720
......@@ -355,6 +355,7 @@
C1FE50531AE024FA00C18080 /* UIAlertView+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE504D1AE024FA00C18080 /* UIAlertView+Blocks.m */; };
C1FE50561AE3587F00C18080 /* ICRAttachmentUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */; };
C1FE50571AE3587F00C18080 /* ICRAttachmentUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */; };
FE0C652C1B8EAB3400580183 /* AddProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE0C652B1B8EAB3400580183 /* AddProductViewController.m */; };
FE0C9B091B7C543D00335B39 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = FE0C9B081B7C543D00335B39 /* User.m */; };
FE17F6791B85847D0078CE96 /* QueryOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE17F6781B85847D0078CE96 /* QueryOrder.m */; };
FE17F6831B85CA5B0078CE96 /* NewPurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE17F67C1B85CA5B0078CE96 /* NewPurchaseNoticeViewController.m */; };
......@@ -785,6 +786,8 @@
C1FE504D1AE024FA00C18080 /* UIAlertView+Blocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+Blocks.m"; sourceTree = "<group>"; };
C1FE50541AE3587F00C18080 /* ICRAttachmentUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRAttachmentUnit.h; sourceTree = "<group>"; };
C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRAttachmentUnit.m; sourceTree = "<group>"; };
FE0C652A1B8EAB3400580183 /* AddProductViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddProductViewController.h; sourceTree = "<group>"; };
FE0C652B1B8EAB3400580183 /* AddProductViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddProductViewController.m; sourceTree = "<group>"; };
FE0C9B071B7C543D00335B39 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = User.h; path = ../Views/User.h; sourceTree = "<group>"; };
FE0C9B081B7C543D00335B39 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = User.m; path = ../Views/User.m; sourceTree = "<group>"; };
FE17F6771B85847D0078CE96 /* QueryOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QueryOrder.h; sourceTree = "<group>"; };
......@@ -1005,6 +1008,8 @@
FE4678A91B8D60F900B5EDA3 /* ChooseTypeViewController.m */,
FE4678AB1B8D636300B5EDA3 /* ChooseWarehouseViewController.h */,
FE4678AC1B8D636300B5EDA3 /* ChooseWarehouseViewController.m */,
FE0C652A1B8EAB3400580183 /* AddProductViewController.h */,
FE0C652B1B8EAB3400580183 /* AddProductViewController.m */,
);
path = Controllers;
sourceTree = "<group>";
......@@ -2131,6 +2136,7 @@
C15295CE1B24741400DF60D1 /* ASValuePopUpView.m in Sources */,
C159184D1AC062460013B391 /* IBTTableView.m in Sources */,
30D1859C1ADBB91000327997 /* ICRAnnouncement.m in Sources */,
FE0C652C1B8EAB3400580183 /* AddProductViewController.m in Sources */,
C142D2AE1AC3A155000109A7 /* NSString+TrimmingAdditions.m in Sources */,
C15918471AC062460013B391 /* IBTCommon.m in Sources */,
C1FE502D1ADD887400C18080 /* LBorderView.m in Sources */,
......
//
// AddProductViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "HPGrowingTextView.h"
@protocol AddProductViewDelegate <NSObject>
- (void)dissmiss;
- (void)pushViewController:(id)cvc;
@end
@interface AddProductViewController : ICRBaseViewController
@property (nonatomic,assign)CGRect viewFrame;
@property (nonatomic,strong)UILabel *productNameLabel;//商品
@property (nonatomic,strong)UILabel *productTypeLabel;//单位
@property (nonatomic,strong)UITextField *productStandFiled;//规格
@property (nonatomic,strong)UITextField *productCountFiled;//包装数量
@property (nonatomic,strong)UITextField *baseCountFiled;//基础数量
@property (nonatomic,strong)UITextField *basePriceFiled;//基础单价
@property (nonatomic,strong)UITextField *productPriceFiled;//包装单价
@property (nonatomic,strong)UITextField *totalPriceFiled;//总价格
@property (nonatomic,strong)HPGrowingTextView *remarkTextView;//备注
@property (nonatomic,weak)id<AddProductViewDelegate>delegate;
@end
......@@ -2,7 +2,7 @@
// ChooseTypeViewController.h
// XFFruit
//
// Created by n22 on 15/8/26.
// Created by 陈俊俊 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
......@@ -11,5 +11,5 @@ typedef void(^ChoseType)(NSString *type);
@interface ChooseTypeViewController : ICRBaseViewController
@property (nonatomic,copy)ChoseType choseType;
@property (nonatomic,copy)NSArray *dataArr;
@end
......@@ -2,7 +2,7 @@
// ChooseTypeViewController.m
// XFFruit
//
// Created by n22 on 15/8/26.
// Created by 陈俊俊 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
......@@ -16,7 +16,6 @@
NSIndexPath *_currentIndexPath;
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
@end
......@@ -24,15 +23,8 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self initData];
[self bulidLayout];
}
- (void)initData{
self.dataArr = [NSMutableArray array];
[self.dataArr addObject:@"普通"];
[self.dataArr addObject:@"紧急"];
}
- (void)bulidLayout
{
self.view.backgroundColor = HexColor(@"f8f8f8");
......
......@@ -2,7 +2,7 @@
// ChooseStoreViewController.h
// XFFruit
//
// Created by n22 on 15/8/26.
// Created by 陈俊俊 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
......
......@@ -2,7 +2,7 @@
// ChooseStoreViewController.m
// XFFruit
//
// Created by n22 on 15/8/26.
// Created by 陈俊俊 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
......
......@@ -9,7 +9,7 @@
#import "NewPurchaseViewController.h"
#import "TopPurchaseView.h"
#import "ProductViewController.h"
#import "AddProductViewController.h"
#define TopHeight 328
#define BottomHeight 300
#define SpaceHeight 20
......@@ -20,12 +20,13 @@ typedef enum : NSUInteger {
CommitTag,
} BtnTag;
@interface NewPurchaseViewController ()<TopPurchaseViewDelegate>
@interface NewPurchaseViewController ()<TopPurchaseViewDelegate,ProductViewDelegate>
{
UIScrollView *_scrollView;
TopPurchaseView *_purchaseView;
UIView *_bottomView;
ProductViewController *_pvc ;
AddProductViewController *_avc;
}
@end
......@@ -67,6 +68,7 @@ typedef enum : NSUInteger {
[_scrollView addSubview:_bottomView];
_pvc = [[ProductViewController alloc]init];
_pvc.delegate = self;
_pvc.viewFrame = _bottomView.bounds;
[_bottomView addSubview:_pvc.view];
......@@ -76,10 +78,24 @@ typedef enum : NSUInteger {
}
#pragma mark - TopPurchaseViewDelegate
- (void)pushNextViewController:(id)vc{
[self PushViewController:vc animated:YES];
}
#pragma mark - ProductViewDelegate
- (void)pushViewController:(id)cvc selfController:(id)avc{
_avc = avc;
[self PushViewController:cvc animated:YES];
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
if (_avc) {
[AppWindow addSubview:_avc.view];
}
}
#pragma mark - 协议方法
- (void)hiddenKeyBoard{
[self keyboardHidden];
......
......@@ -7,10 +7,15 @@
//
#import "ICRBaseViewController.h"
@protocol ProductViewDelegate <NSObject>
- (void)pushViewController:(id)cvc selfController:(id)avc;
@end
@interface ProductViewController : ICRBaseViewController
@property (nonatomic,strong)NSMutableArray *productArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,assign)CGRect viewFrame;
@property (nonatomic,assign)BOOL isHiddenEdit;
@property (nonatomic,weak)id<ProductViewDelegate>delegate;
@end
......@@ -10,12 +10,14 @@
#import "FooterCell.h"
#import "HeaderCell.h"
#import "ProductCell.h"
#import "AddProductViewController.h"
#define TableHeight 44
@interface ProductViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate>
@interface ProductViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate,AddProductViewDelegate>
{
CGRect _tableFrame;
NSMutableArray *_selectRowArr;//记录当前选中的cell
AddProductViewController *_avc;
}
@end
......@@ -60,10 +62,34 @@
self.tableView.tableFooterView = footCell;
}
}
#pragma mark - footerDelegate
- (void)addClick{
[self.productArr addObject:@"dddd"];
[self.tableView reloadData];
// [self.productArr addObject:@"dddd"];
// [self.tableView reloadData];
if (_avc == nil) {
_avc = [[AddProductViewController alloc]init];
_avc.delegate = self;
_avc.view.backgroundColor = RGBA(0, 0, 0, 0.5);
[AppWindow addSubview:_avc.view];
}
}
#pragma mark - addProductViewDelegate
- (void)dissmiss{
if (_avc) {
[_avc.view removeFromSuperview];
_avc = nil;
}
}
- (void)pushViewController:(id)cvc{
if (_avc) {
[_avc.view removeFromSuperview];
}
if ([self.delegate respondsToSelector:@selector(pushViewController:selfController:)]) {
[self.delegate pushViewController:cvc selfController:_avc];
}
}
#pragma mark - 协议方法
......@@ -102,6 +128,8 @@
cell.showView.frame = showfrmame;
cell.backgroundColor = [UIColor whiteColor];
}
cell.editBtn.tag = indexPath.row;
[cell.editBtn addTarget:self action:@selector(editClick:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
......@@ -122,14 +150,12 @@
Linefrmame.origin.y = 200-1;
showfrmame.size.height = 150;
// cell.showView.hidden = NO;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr addObject:indexPath];
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
Linefrmame.origin.y = TableHeight -1;
showfrmame.size.height = 0;
// cell.showView.hidden = YES;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr removeObject:indexPath];
}
......@@ -137,14 +163,20 @@
cell.showView.frame = showfrmame;
[self.tableView reloadData];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if ([self isHaveIndexPath:indexPath]) {
return 200;
}
return TableHeight;
}
- (void)editClick:(UIButton *)btn{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"" message:@"哈哈" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -36,7 +36,7 @@
- (void)bulidLayout
{
CGFloat headWidth = (ScreenSize.width - LeftWidth - RightWidth - SpaceMargin* (3 -1))/3;
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
......@@ -130,7 +130,7 @@
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - RightWidth, 0, RightWidth - LeftMargin, TableHeight);
self.editBtn.frame = CGRectMake(ScreenSize.width - LeftWidth, 0, LeftWidth , TableHeight);
self.editBtn.contentMode = UIViewContentModeScaleAspectFit;
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin * 2, 1))];;
......
......@@ -89,7 +89,7 @@
self.otherPriceFiled.placeholder = @"请输入其他费用";
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(textField.frame) + 5, 0, 20, TableHeight)];
label.text = @"元";
label.textColor = HexColor(@"bbbbbb");
label.textColor = HexColor(@"444444");
label.font = FontSize(TitleSize);
[cell.contentView addSubview:label];
......@@ -132,7 +132,7 @@
self.purchasePriceLabel = contentLabel;
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(contentLabel.frame)+ 5, 0, 20, TableHeight)];
label.text = @"元";
label.textColor = HexColor(@"bbbbbb");
label.textColor = HexColor(@"444444");
label.font = FontSize(TitleSize);
[cell.contentView addSubview:label];
......@@ -156,6 +156,7 @@
}else if(indexPath.row == 1){
ChooseTypeViewController *tvc = [[ChooseTypeViewController alloc]init];
tvc.title = @"类型";
tvc.dataArr = @[@"普通",@"紧急"];
tvc.choseType = ^(NSString *type){
self.purchaseTypeLabel.text = type;
self.purchaseTypeLabel.textColor = HexColor(@"444444");
......
......@@ -100,7 +100,6 @@ typedef enum : NSUInteger {
UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(saveBtn.frame.origin.x + saveBtn.frame.size.width + LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"提交" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:HexColor(@"f69100")];
[footView addSubview:commitBtn];
[self.view addSubview:footView];
_tableView.tableFooterView = footView;
[self.view addSubview:_tableView];
}
......
......@@ -31,7 +31,7 @@
}
- (void)bulidLayout{
CGFloat headWidth = (ScreenSize.width - LeftWidth - RightWidth - SpaceMargin* (self.arr.count -1))/self.arr.count;
CGFloat headWidth = (ScreenSize.width - LeftWidth - LeftWidth - SpaceMargin* (self.arr.count -1))/self.arr.count;
for (NSInteger i = 0; i < self.arr.count; i++) {
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(LeftWidth + (SpaceMargin + headWidth)*i, 0, headWidth, self.frame.size.height)];
label.font = FontSize(TitleSize);
......
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