Commit 3f78b465 authored by n22's avatar n22

采购单

parent 30820a28
platform :ios, 8.1
platform :ios, '8.1'
pod 'AFNetworking', '~> 2.5.4'
pod 'SDWebImage', '~> 3.7.2
pod 'SDWebImage', '~> 3.7.2'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'SSKeychain', '~> 1.2.3'
pod 'FMDB', '~> 2.5
pod 'FMDB', '~> 2.5'
pod 'Base64nl', '~> 1.2'
pod 'Reveal-iOS-SDK', '~> 1.5.1'
pod 'BaiduMapAPI', '~> 2.8.0
pod 'BaiduMapAPI', '~> 2.8.0'
......@@ -357,6 +357,10 @@
FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2FCC8A1B74A9EE00BBC6FB /* SurveyResultCell.m */; };
FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE4F17241B72FAAB00924DED /* ChosePersonViewController.m */; };
FE7155D91B7B328400595B0A /* Product.m in Sources */ = {isa = PBXBuildFile; fileRef = FE7155D81B7B328400595B0A /* Product.m */; };
FE9163C71B86F643007D6ECF /* NewPurchaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9163C61B86F643007D6ECF /* NewPurchaseViewController.m */; };
FE9163CA1B86F87E007D6ECF /* TopPurchaseView.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9163C91B86F87E007D6ECF /* TopPurchaseView.m */; };
FE9163CD1B8701E6007D6ECF /* ProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9163CC1B8701E6007D6ECF /* ProductViewController.m */; };
FE9163D01B87041C007D6ECF /* ProductCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9163CF1B87041C007D6ECF /* ProductCell.m */; };
FEA2F2FD1B8423B900D64735 /* BottomSheetView.m in Sources */ = {isa = PBXBuildFile; fileRef = FEA2F2FC1B8423B900D64735 /* BottomSheetView.m */; };
FEA2F3001B842A1C00D64735 /* MaterialVIewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FEA2F2FF1B842A1C00D64735 /* MaterialVIewController.m */; };
FEA2F3031B8453C700D64735 /* GoodsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FEA2F3021B8453C700D64735 /* GoodsViewController.m */; };
......@@ -775,6 +779,14 @@
FE4F17241B72FAAB00924DED /* ChosePersonViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChosePersonViewController.m; sourceTree = "<group>"; };
FE7155D71B7B328400595B0A /* Product.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Product.h; sourceTree = "<group>"; };
FE7155D81B7B328400595B0A /* Product.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Product.m; sourceTree = "<group>"; };
FE9163C51B86F643007D6ECF /* NewPurchaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewPurchaseViewController.h; sourceTree = "<group>"; };
FE9163C61B86F643007D6ECF /* NewPurchaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewPurchaseViewController.m; sourceTree = "<group>"; };
FE9163C81B86F87E007D6ECF /* TopPurchaseView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopPurchaseView.h; sourceTree = "<group>"; };
FE9163C91B86F87E007D6ECF /* TopPurchaseView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopPurchaseView.m; sourceTree = "<group>"; };
FE9163CB1B8701E6007D6ECF /* ProductViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductViewController.h; sourceTree = "<group>"; };
FE9163CC1B8701E6007D6ECF /* ProductViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductViewController.m; sourceTree = "<group>"; };
FE9163CE1B87041C007D6ECF /* ProductCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductCell.h; sourceTree = "<group>"; };
FE9163CF1B87041C007D6ECF /* ProductCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductCell.m; sourceTree = "<group>"; };
FEA2F2FB1B8423B900D64735 /* BottomSheetView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BottomSheetView.h; sourceTree = "<group>"; };
FEA2F2FC1B8423B900D64735 /* BottomSheetView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BottomSheetView.m; sourceTree = "<group>"; };
FEA2F2FE1B842A1C00D64735 /* MaterialVIewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MaterialVIewController.h; sourceTree = "<group>"; };
......@@ -1628,6 +1640,7 @@
C1C6FEED1AB88A3400D4C41A /* ViewControllers */ = {
isa = PBXGroup;
children = (
FE9163C11B86F46C007D6ECF /* Purchase */,
FE17F67A1B85CA5B0078CE96 /* PurchaseNotice */,
72C803431B7B6F0200990363 /* WorkSheet */,
7217E9C01B72364300FE5C1D /* Survey */,
......@@ -1849,6 +1862,48 @@
path = PurchaseNotice;
sourceTree = "<group>";
};
FE9163C11B86F46C007D6ECF /* Purchase */ = {
isa = PBXGroup;
children = (
FE9163C21B86F4A5007D6ECF /* Controllers */,
FE9163C31B86F4A5007D6ECF /* Models */,
FE9163C41B86F4A5007D6ECF /* Views */,
);
path = Purchase;
sourceTree = "<group>";
};
FE9163C21B86F4A5007D6ECF /* Controllers */ = {
isa = PBXGroup;
children = (
FE9163C51B86F643007D6ECF /* NewPurchaseViewController.h */,
FE9163C61B86F643007D6ECF /* NewPurchaseViewController.m */,
FE9163CB1B8701E6007D6ECF /* ProductViewController.h */,
FE9163CC1B8701E6007D6ECF /* ProductViewController.m */,
);
name = Controllers;
path = ../Survey/controllers/Controllers;
sourceTree = "<group>";
};
FE9163C31B86F4A5007D6ECF /* Models */ = {
isa = PBXGroup;
children = (
);
name = Models;
path = ../Survey/controllers/Models;
sourceTree = "<group>";
};
FE9163C41B86F4A5007D6ECF /* Views */ = {
isa = PBXGroup;
children = (
FE9163C81B86F87E007D6ECF /* TopPurchaseView.h */,
FE9163C91B86F87E007D6ECF /* TopPurchaseView.m */,
FE9163CE1B87041C007D6ECF /* ProductCell.h */,
FE9163CF1B87041C007D6ECF /* ProductCell.m */,
);
name = Views;
path = ../Survey/controllers/Views;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -2018,6 +2073,7 @@
7217E9EC1B72364300FE5C1D /* HPTextViewInternal.m in Sources */,
C159184B1AC062460013B391 /* IBTTabBarController.m in Sources */,
C142D2BE1AC3A155000109A7 /* UIView+FindUIViewController.m in Sources */,
FE9163CD1B8701E6007D6ECF /* ProductViewController.m in Sources */,
35C3C0BF1AE95F1D0035AC8A /* UIImage+Rotate.m in Sources */,
C11A344D1B1BE27200079129 /* ICRPatrolAllStoreViewController.m in Sources */,
C10214DD1AD90A3F0024637E /* ICRFunctionEntity.m in Sources */,
......@@ -2094,6 +2150,7 @@
C1E9F5731B2E411900BF1356 /* IBTFileManager.m in Sources */,
C15295B71B24450A00DF60D1 /* ICRQAViewController.m in Sources */,
30D7FE5D1AD4F941003D92EE /* ICRAboutViewController.m in Sources */,
FE9163C71B86F643007D6ECF /* NewPurchaseViewController.m in Sources */,
C10214DF1AD90A3F0024637E /* ICRFunctionItemControl.m in Sources */,
C15918431AC062460013B391 /* IBTTableViewUserInfo.m in Sources */,
30D702461ADE3862008DC0BF /* ICRAnnouncementDetailHeadView.m in Sources */,
......@@ -2152,12 +2209,14 @@
C18AEA8C1AC9855400A1DB7B /* IBTLoadingView.m in Sources */,
C10C90A11AE5751D00B911CD /* ICRPost.m in Sources */,
7217E9F21B72364300FE5C1D /* StartTimeView.m in Sources */,
FE9163CA1B86F87E007D6ECF /* TopPurchaseView.m in Sources */,
C1FE50351AE020D400C18080 /* IBTAudioController.m in Sources */,
FEA2F3061B8453DE00D64735 /* CostViewController.m in Sources */,
C14BE3061ADB84350049F1AA /* IBTTextFieldCell.m in Sources */,
30F7F5711ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */,
C15918451AC062460013B391 /* IBTBadgeView.m in Sources */,
C15295C31B2451AC00DF60D1 /* ICRQReseachViewController.m in Sources */,
FE9163D01B87041C007D6ECF /* ProductCell.m in Sources */,
C15918531AC062460013B391 /* IBTUINavigationController.m in Sources */,
C11A346F1B247BDB00079129 /* ICRAnswerDetail.m in Sources */,
C1ADF7411ACE6EFD007258A8 /* UIViewController+LogicController.m in Sources */,
......
......@@ -1327,7 +1327,7 @@ acceptTypeJson:YES
NSDictionary *dict = data;
NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveySave] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userId,userUtil.displayName];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveySave] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:dict
......@@ -1559,7 +1559,7 @@ acceptTypeJson:YES
};
NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveyFinish] stringByAppendingFormat:@"/%@?version=%@&time=%@&operId=%@&operName=%@",uuid,version,currentTime,userUtil.userId,userUtil.displayName];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveyFinish] stringByAppendingFormat:@"/%@?version=%@&time=%@&operId=%@&operName=%@",uuid,version,currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:nil
......@@ -1592,9 +1592,9 @@ acceptTypeJson:YES
fail( error );
}
};
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetResults] stringByAppendingFormat:@"/%@",uuid];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetResults] stringByAppendingFormat:@"/%@",@"5a7417014f27d2e1014f2b3be580003f"];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
[self GET:encodeUrlStr
parameters:nil
needToken:NO
acceptTypeJson:YES
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "arrowdown.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "arrowdown@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "arrowright.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "arrowright@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -36,6 +36,6 @@
+ (NSString *)stringFromDate:(NSDate*)aDate;
+ (NSString*)dictionaryToJson:(id)dic;
+ (NSString *)checkString:(NSString *)str;
+ (NSMutableAttributedString *)setTextViewFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color;
@end
......@@ -198,7 +198,13 @@
return (str)?str:@"";
}
+ (NSMutableAttributedString *)setTextViewFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
paragraphStyle.lineSpacing = lineHeight;
NSDictionary *attributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:size],NSForegroundColorAttributeName :color, NSParagraphStyleAttributeName:paragraphStyle};
NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc] initWithString:string attributes:attributes];
return attributeStr;
}
@end
......@@ -25,6 +25,7 @@
#import "NewSurveyViewController.h"
#import "SurveyViewController.h"
#import "AddWorkSheetViewController.h"
#import "NewPurchaseViewController.h"
@interface ICRHomeViewController ()
<
......@@ -143,11 +144,13 @@
break;
case kFunctionMyShop:
{
ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
sVC.title = [IBTCommon localizableString:@"MyStore"];
sVC.m_delegate = self;
[self PushViewController:sVC animated:YES];
// ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
// sVC.title = [IBTCommon localizableString:@"MyStore"];
// sVC.m_delegate = self;
// [self PushViewController:sVC animated:YES];
// AddWorkSheetViewController *sVC = [[AddWorkSheetViewController alloc] init];
NewPurchaseViewController *sVC = [[NewPurchaseViewController alloc] init];
[self PushViewController:sVC animated:YES];
}
break;
......
......@@ -11,6 +11,7 @@
@interface SurveyResultCell : UITableViewCell
@property (nonatomic,strong)UIButton *imageBtn;
@property (nonatomic,strong)UILabel *dateLabel;
@property (nonatomic,strong)UILabel *userNameLabel;
@property (nonatomic,strong)UILabel *placeLabel;
@property (nonatomic,strong)UILabel *priceLabel;
......
......@@ -32,10 +32,13 @@
self.imageBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.imageBtn.frame = CGRectMake(TopMargin *2 , TopMargin, LeftWidth, TableHeight - TopMargin*2);
self.userNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.imageBtn.frame) + TopMargin, TopMargin, ScreenSize.width - TopMargin*2 - LeftWidth, TitleHeight * 2))];
self.userNameLabel.numberOfLines = 0;
self.userNameLabel.textColor = HexColor(ContentColor);
self.userNameLabel.font = FontSize(ContentSize);
self.dateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.imageBtn.frame) + TopMargin, TopMargin, ScreenSize.width - TopMargin*2 - LeftWidth, TitleHeight))];
self.dateLabel.textColor = HexColor(ContentColor);
self.dateLabel.font = FontSize(ContentSize);
self.userNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.dateLabel.frame), CGRectGetMaxY(self.dateLabel.frame), CGRectGetWidth(self.dateLabel.frame), 30))];
self.userNameLabel.textColor = HexColor(TitleColor);
self.userNameLabel.font = FontSize(TitleSize);
self.placeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.userNameLabel.frame), CGRectGetMaxY(self.userNameLabel.frame), CGRectGetWidth(self.userNameLabel.frame), TitleHeight))];
self.placeLabel.textColor = HexColor(ContentColor);
......@@ -58,6 +61,7 @@
self.lineLabel.backgroundColor = HexColor(@"e5e5e5");
[self.contentView addSubview:self.imageBtn];
[self.contentView addSubview:self.dateLabel];
[self.contentView addSubview:self.userNameLabel];
[self.contentView addSubview:self.placeLabel];
[self.contentView addSubview:self.priceLabel];
......@@ -68,11 +72,14 @@
}
- (void)setSurveyResult:(SurveyResult *)surveyResult{
//
[self.imageBtn setBackgroundImage:[UIImage imageNamed:@"no_image_default"] forState:UIControlStateNormal];
self.userNameLabel.text = [NSString stringWithFormat:@"反馈人:%@[%@]",surveyResult.userName,surveyResult.feedbackTime];
self.dateLabel.text = [NSString stringWithFormat:@"%@",surveyResult.feedbackTime];
self.userNameLabel.text = [NSString stringWithFormat:@"反馈人:%@",surveyResult.userName];
self.placeLabel.text = [NSString stringWithFormat:@"产地:%@",surveyResult.place];
self.priceLabel.text = [NSString stringWithFormat:@"价格:%@",surveyResult.price];
NSMutableAttributedString *attributeStr1 = [IBTCommon setTextViewFontOfString:@"价格:" paragraphStyle:0 fontSize:ContentSize color:HexColor(ContentColor)];
NSString *str = [NSString stringWithFormat:@"%@",surveyResult.price];
[attributeStr1 appendAttributedString:[IBTCommon setTextViewFontOfString:str paragraphStyle:0 fontSize:ContentSize color:[UIColor redColor]]];
self.priceLabel.attributedText = attributeStr1;
self.capacityLabel.text = [NSString stringWithFormat:@"市场容量:%@",surveyResult.capacity];
self.qualityLabel.text = [NSString stringWithFormat:@"质量情况:%@",surveyResult.quality];
}
......
//
// NewPurchaseViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/8/21.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface NewPurchaseViewController : ICRBaseViewController
@end
//
// NewPurchaseViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/8/21.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "NewPurchaseViewController.h"
#import "TopPurchaseView.h"
#import "ProductViewController.h"
#define TopHeight 284
#define BottomHeight 300
#define SpaceHeight 20
#define BottomViewHeight 60
typedef enum : NSUInteger {
SaveTag = 8000,
CommitTag,
} BtnTag;
@interface NewPurchaseViewController ()<TopPurchaseViewDelegate>
{
UIScrollView *_scrollView;
TopPurchaseView *_purchaseView;
UIView *_bottomView;
}
@end
@implementation NewPurchaseViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"新建采购单";
//布局
[self bulidLayout];
}
#pragma mark - 布局
- (void)bulidLayout
{
self.view.backgroundColor = XXFBgColor;
_scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0,0, ScreenSize.width, ScreenSize.height- 64 - BottomViewHeight )];
_scrollView.showsHorizontalScrollIndicator = NO;
_scrollView.showsVerticalScrollIndicator = NO;
_scrollView.contentSize = CGSizeMake(ScreenSize.width, TopHeight+ BottomHeight + SpaceHeight*2);
[self.view addSubview:_scrollView];
UIView *footView = [[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")];
[footView 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")];
[footView addSubview:commitBtn];
[self.view addSubview:footView];
_purchaseView = [[TopPurchaseView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TopHeight)];
_purchaseView.delegate = self;
[_scrollView addSubview:_purchaseView];
_bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + 20, ScreenSize.width,BottomHeight)];
_bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView];
ProductViewController *pvc = [[ProductViewController alloc]init];
pvc.viewFrame = _bottomView.bounds;
[_bottomView addSubview:pvc.view];
}
- (void)btnClick:(UIButton *)btn{
}
#pragma mark - 协议方法
- (void)hiddenKeyBoard{
[self keyboardHidden];
}
- (void)keyboardHidden{
[_purchaseView.purchasePriceFiled resignFirstResponder];
[_purchaseView.remarkTextView resignFirstResponder];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// ProductViewController.h
// XFFruit
//
// Created by n22 on 15/8/21.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface ProductViewController : ICRBaseViewController
@property (nonatomic,strong)NSMutableArray *productArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,assign)CGRect viewFrame;
@end
//
// ProductViewController.m
// XFFruit
//
// Created by n22 on 15/8/21.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ProductViewController.h"
#import "FooterCell.h"
#import "HeaderCell.h"
#import "ProductCell.h"
#define TableHeight 44
@interface ProductViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate>
{
CGRect _tableFrame;
NSInteger _currentRow;
BOOL isFirst;
}
@end
@implementation ProductViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = XXFBgColor;
[super viewDidLoad];
isFirst = YES;
_productArr = [NSMutableArray array];
[_productArr addObject:@"ffff"];
[_productArr addObject:@"fffff"];
[self createView];
}
- (void)setViewFrame:(CGRect)viewFrame{
_tableFrame = viewFrame;
}
- (void)createView{
self.tableView = [[UITableView alloc]initWithFrame:_tableFrame style:(UITableViewStylePlain)];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.view addSubview:self.tableView];
NSArray *arr = @[@"商品",@"单价",@"包装规格"];
HeaderCell *headCell = [[HeaderCell alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 38) withArr:arr];
[self.view addSubview:headCell];
self.tableView.tableHeaderView = headCell;
FooterCell *footCell = [[FooterCell alloc]initWithFrame:CGRectMake(0, 0, _tableFrame.size.width, 50) withTitle:@"+点击添加商品明细"];
[self.view addSubview:footCell];
footCell.delegate = self;
self.tableView.tableFooterView = footCell;
}
- (void)addClick{
[self.productArr addObject:@"dddd"];
[self.tableView reloadData];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.productArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaterialCell";
ProductCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[ProductCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
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)
{
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;
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ProductCell *cell = (ProductCell *)[tableView cellForRowAtIndexPath:indexPath];
CGRect Linefrmame = cell.lineLabel.frame;
CGRect showfrmame = cell.showView.frame;
if (Linefrmame.origin.y == TableHeight - 1) {
cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
Linefrmame.origin.y = 200-1;
showfrmame.size.height = 150;
cell.showView.hidden = NO;
isFirst = NO;
cell.backgroundColor = [UIColor whiteColor];
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
isFirst = YES;
Linefrmame.origin.y = TableHeight -1;
showfrmame.size.height = 0;
cell.showView.hidden = YES;
cell.backgroundColor = [UIColor whiteColor];
}
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) {
return 200;
}
return TableHeight;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -10,6 +10,7 @@
#import "SurveyResult.h"
#import "SurveyResultCell.h"
#import "ResultView.h"
#define TableHeight 150
#define BeginTag 6000
@interface ResultDetailViewController ()<UITableViewDataSource,UITableViewDelegate,ResultViewDelegate>
......@@ -32,11 +33,11 @@
- (void)initData{
_dataArr = [NSMutableArray array];
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
NSLog(@"%@",data);
// [strongSelf fetchtSurveyList:data];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchtSurveyResultList:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
......@@ -59,6 +60,31 @@
}
}
- (void)fetchtSurveyResultList:(id)data{
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ;
if (success == 1) {
if (_dataArr.count > 0) {
[_dataArr removeAllObjects];
}
NSArray *dataArr = data[ @"data" ];
for (NSDictionary *surveyDict in dataArr) {
NSDictionary *resultDict = surveyDict[@"result"];
SurveyResult *surveyResult = [[SurveyResult alloc]init];
[surveyResult setValuesForKeysWithDictionary:resultDict];
[_dataArr addObject:surveyResult];
}
[_tableView reloadData];
}else{
[IBTLoadingView showTips:message];
}
}else{
[IBTLoadingView showTips:@" 无记录 "];
}
}
- (void)createTableView{
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, 0,ScreenSize.width, ScreenSize.height - 64)) style:(UITableViewStylePlain)];
_tableView.backgroundColor = [UIColor whiteColor];
......
//
// ProductCell.h
// XFFruit
//
// Created by n22 on 15/8/21.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ProductCell : UITableViewCell
@property (nonatomic,strong)UIImageView *smallImageView;
@property (nonatomic,strong)UIButton *editBtn;
@property (nonatomic,strong)UILabel *seqLabel;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *priceLabel;
@property (nonatomic,strong)UILabel *standardLabel;
@property (nonatomic,strong)UILabel *countLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
@property (nonatomic,strong)UILabel *showTitleLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
@property (nonatomic,strong)UILabel *showDateLabel;
@property (nonatomic,strong)UILabel *basePriceLabel;
@property (nonatomic,strong)UILabel *totalPriceLabel;
@property (nonatomic,strong)UILabel *placeLabel;
@property (nonatomic,strong)UILabel *qualityLabel;
@property (nonatomic,strong)UILabel *remarkLabel;
@end
//
// ProductCell.m
// XFFruit
//
// Created by n22 on 15/8/21.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ProductCell.h"
#define LeftMargin 13
#define TableHeight 44
#define SmallSize 10
#define SmallWidth 20
#define ContentColor @"444444"
#define ContentSize 16
#define SpaceMargin 1
#define LeftWidth 45
#define RightWidth 30
#define ShowColor @"bbbbbb"
#define ShowSize 13
#define ShowWidth 150
#define ShowHeight 20
@implementation ProductCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
CGFloat headWidth = (ScreenSize.width - LeftWidth - RightWidth - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
self.smallImageView.contentMode = UIViewContentModeScaleAspectFit;
self.seqLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.smallImageView.frame), 0, SmallWidth, TableHeight))];
self.seqLabel.textColor = HexColor(ContentColor);
self.seqLabel.text = @"13";
self.seqLabel.font = FontSize(ContentSize);
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.textColor = HexColor(ContentColor);
self.titleLabel.text = @"苹果桃子";
self.titleLabel.font = FontSize(ContentSize);
self.priceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.priceLabel.textAlignment = NSTextAlignmentLeft;
self.priceLabel.textColor = HexColor(ContentColor);
self.priceLabel.text = @"80";
self.priceLabel.font = FontSize(ContentSize);
self.standardLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.priceLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.standardLabel.textAlignment = NSTextAlignmentLeft;
self.standardLabel.text = @"20*20";
self.standardLabel.textColor = HexColor(ContentColor);
self.standardLabel.font = FontSize(ContentSize);
// self.countLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.standardLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
// self.countLabel.textAlignment = NSTextAlignmentLeft;
// self.countLabel.text = @"200";
// self.countLabel.textColor = HexColor(ContentColor);
// self.countLabel.font = FontSize(ContentSize);
//
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
self.showView.hidden = YES;
self.showTitleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))];
self.showTitleLabel.textAlignment = NSTextAlignmentLeft;
self.showTitleLabel.textColor = HexColor(ShowColor);
self.showTitleLabel.text = @"原料:苹果桃子";
self.showTitleLabel.font = FontSize(ShowSize);
self.showBaseCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showTitleLabel.frame), 0, ShowWidth, ShowHeight))];
self.showBaseCountLabel.textAlignment = NSTextAlignmentLeft;
self.showBaseCountLabel.textColor = HexColor(ShowColor);
self.showBaseCountLabel.text = @"基础数量:10000";
self.showBaseCountLabel.font = FontSize(ShowSize);
self.showDateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.showTitleLabel.frame), ShowWidth, ShowHeight))];
self.showDateLabel.textAlignment = NSTextAlignmentLeft;
self.showDateLabel.textColor = HexColor(ShowColor);
self.showDateLabel.text = @"入库时间:2015-02-04";
self.showDateLabel.font = FontSize(ShowSize);
self.basePriceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showBaseCountLabel.frame), CGRectGetMaxY(self.showTitleLabel.frame), ShowWidth, ShowHeight))];
self.basePriceLabel.textAlignment = NSTextAlignmentLeft;
self.basePriceLabel.textColor = HexColor(ShowColor);
self.basePriceLabel.text = @"基础单价:11元";
self.basePriceLabel.font = FontSize(ShowSize);
self.totalPriceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.showDateLabel.frame), ShowWidth, ShowHeight))];
self.totalPriceLabel.textAlignment = NSTextAlignmentLeft;
self.totalPriceLabel.textColor = HexColor(ShowColor);
self.totalPriceLabel.text = @"总金额:1000";
self.totalPriceLabel.font = FontSize(ShowSize);
self.placeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showBaseCountLabel.frame), CGRectGetMaxY(self.showDateLabel.frame), ShowWidth, ShowHeight))];
self.placeLabel.textAlignment = NSTextAlignmentLeft;
self.placeLabel.textColor = HexColor(ShowColor);
self.placeLabel.text = @"产地:河南省";
self.placeLabel.font = FontSize(ShowSize);
self.qualityLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.totalPriceLabel.frame), ShowWidth, ShowHeight))];
self.qualityLabel.textAlignment = NSTextAlignmentLeft;
self.qualityLabel.textColor = HexColor(ShowColor);
self.qualityLabel.text = @"质量:1000";
self.qualityLabel.font = FontSize(ShowSize);
self.remarkLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.qualityLabel.frame), ShowWidth, ShowHeight))];
self.remarkLabel.textAlignment = NSTextAlignmentLeft;
self.remarkLabel.textColor = HexColor(ShowColor);
self.remarkLabel.text = @"描述:河南省";
self.remarkLabel.font = FontSize(ShowSize);
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal];
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))];;
self.lineLabel.backgroundColor = HexColor(@"e5e5e5");
[self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.seqLabel];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.priceLabel];
[self.contentView addSubview:self.standardLabel];
// [self.contentView addSubview:self.countLabel];
[self.contentView addSubview:self.editBtn];
[self.contentView addSubview:self.showView];
[self.showView addSubview:self.showTitleLabel];
[self.showView addSubview:self.showBaseCountLabel];
[self.showView addSubview:self.showDateLabel];
[self.showView addSubview:self.basePriceLabel];
[self.showView addSubview:self.totalPriceLabel];
[self.showView addSubview:self.placeLabel];
[self.showView addSubview:self.qualityLabel];
[self.showView addSubview:self.remarkLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// TopPurchaseView.h
// XFFruit
//
// Created by n22 on 15/8/21.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HPGrowingTextView.h"
@protocol TopPurchaseViewDelegate <NSObject>
- (void)hiddenKeyBoard;
@end
@interface TopPurchaseView : UIView
@property (nonatomic,strong)UILabel *purchaseNoticeLabel;//采购通知单号
@property (nonatomic,strong)UILabel *purchaseTypeLabel;//类型
@property (nonatomic,strong)UILabel *purchaseSupplierLabel;//供应商
@property (nonatomic,strong)UILabel *purchaseStoreLabel;//收货仓库
@property (nonatomic,strong)UITextField *purchasePriceFiled;//总金额
@property (nonatomic,strong)HPGrowingTextView *remarkTextView;//备注
@property (nonatomic,weak)id <TopPurchaseViewDelegate>delegate;
@end
//
// TopPurchaseView.m
// XFFruit
//
// Created by n22 on 15/8/21.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TopPurchaseView.h"
#import "SurveyCell.h"
#define LeftMargin 15
#define TopMargin 20
#define LeftWidth 80
#define TableHeight 44
#define SpaceHeight 10
#define TitleSize 16
@interface TopPurchaseView ()<UITableViewDataSource,UITableViewDelegate,HPGrowingTextViewDelegate,UITextFieldDelegate>
{
UITableView *_tableView;
NSMutableArray *_dataArr;
}
@end
@implementation TopPurchaseView
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
//界面
[self bulidLayout];
}
return self;
}
#pragma mark - 布局
- (void)bulidLayout
{
self.backgroundColor = XXFBgColor;
_dataArr = [NSMutableArray array];
NSArray *arr = @[@"采购通知:",@"类型:",@"供应商:",@"收货仓库:",@"总金额:",@"备注:"];
[_dataArr addObjectsFromArray:arr];
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,self.frame.size.width, self.frame.size.height - TopMargin)) style:(UITableViewStylePlain)];
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.bounces = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
[self addSubview:_tableView];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return _dataArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"cellID";
SurveyCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[SurveyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (indexPath.row !=4 && indexPath.row != 5) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
[self createViewInCell:cell indexPath:indexPath];
}
[cell setTitleStr:_dataArr[indexPath.row]];
return cell;
}
- (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 4 ) {
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
textField.textAlignment = NSTextAlignmentRight;
textField.textColor = HexColor(@"444444");
textField.font = FontSize(15);
textField.returnKeyType = UIReturnKeyDone;
textField.delegate = self;
[cell.contentView addSubview:textField];
self.purchasePriceFiled = textField;
self.purchasePriceFiled.placeholder = @"请输总金额";
}else if (indexPath.row == _dataArr.count -1){
self.remarkTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
self.remarkTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
self.remarkTextView.minNumberOfLines = 1;
self.remarkTextView.maxNumberOfLines = 2;
self.remarkTextView.font = FontSize(15);
self.remarkTextView.textAlignment = NSTextAlignmentRight;
self.remarkTextView.delegate = self;
self.remarkTextView.returnKeyType = UIReturnKeyDone;
self.remarkTextView.placeholder = @"输入备注内容";
[cell.contentView addSubview:self.remarkTextView];
}else{
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight))];
contentLabel.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = HexColor(@"bbbbbb");
contentLabel.font = FontSize(TitleSize);
[cell.contentView addSubview:contentLabel];
if (indexPath.row == 0) {
contentLabel.text = @"选择采购通知";
self.purchaseNoticeLabel = contentLabel;
}else if(indexPath.row == 1){
contentLabel.text = @"选择类型";
self.purchaseTypeLabel = contentLabel;
}else if(indexPath.row == 2){
contentLabel.text = @"选择供应商";
self.purchaseSupplierLabel = contentLabel;
}else if(indexPath.row == 3){
contentLabel.text = @"选择收货仓库";
self.purchaseStoreLabel = contentLabel;
}
}
}
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
[self.remarkTextView resignFirstResponder];
return YES;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
[self.delegate hiddenKeyBoard];
return YES;
}
@end
......@@ -33,6 +33,7 @@ typedef enum : NSUInteger {
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"加工单";
//布局
[self bulidLayout];
}
......
......@@ -10,8 +10,8 @@
//#define HeadWidth 70
#define TitleSize 15
#define LeftMargin 13
#define LeftWidth 50
#define LeftWidth 45
#define RightWidth 30
#define SpaceMargin 1
@interface HeaderCell ()
@property (nonatomic,strong)NSArray *arr;
......@@ -31,11 +31,11 @@
}
- (void)bulidLayout{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (self.arr.count -1))/self.arr.count;
CGFloat headWidth = (ScreenSize.width - LeftWidth - RightWidth - 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);
label.textAlignment = NSTextAlignmentCenter;
label.textAlignment = NSTextAlignmentLeft;
label.textColor = HexColor(@"bbbbbb");
label.text = self.arr[i];
[self addSubview:label];
......
......@@ -9,11 +9,13 @@
#import "MaterialCell.h"
#define LeftMargin 13
#define TableHeight 44
#define SmallSize 20
#define SmallSize 15
#define SmallWidth 20
#define ContentColor @"444444"
#define ContentSize 16
#define SpaceMargin 1
#define LeftWidth 50
#define LeftWidth 45
#define RightWidth 30
#define ShowColor @"bbbbbb"
......@@ -34,30 +36,30 @@
- (void)bulidLayout
{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
CGFloat headWidth = (ScreenSize.width - LeftWidth - RightWidth - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"delete"];
self.seqLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.smallImageView.frame), 0, SmallSize, TableHeight))];
self.seqLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.smallImageView.frame), 0, SmallWidth, TableHeight))];
self.seqLabel.textColor = HexColor(ContentColor);
self.seqLabel.text = @"13";
self.seqLabel.font = FontSize(ContentSize);
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.textColor = HexColor(ContentColor);
self.titleLabel.text = @"苹果桃子";
self.titleLabel.font = FontSize(ContentSize);
self.baseCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.baseCountLabel.textAlignment = NSTextAlignmentCenter;
self.baseCountLabel.textAlignment = NSTextAlignmentLeft;
self.baseCountLabel.textColor = HexColor(ContentColor);
self.baseCountLabel.text = @"30000";
self.baseCountLabel.font = FontSize(ContentSize);
self.dateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.baseCountLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.dateLabel.textAlignment = NSTextAlignmentCenter;
self.dateLabel.textAlignment = NSTextAlignmentLeft;
self.dateLabel.text = @"2015-04-05";
self.dateLabel.textColor = HexColor(ContentColor);
self.dateLabel.font = FontSize(ContentSize);
......@@ -113,16 +115,12 @@
self.remarkLabel.text = @"描述:河南省";
self.remarkLabel.font = FontSize(ShowSize);
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - LeftWidth, 0, LeftWidth, TableHeight);
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin * 2, 1))];;
self.lineLabel.backgroundColor = HexColor(@"e5e5e5");
[self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.seqLabel];
[self.contentView addSubview:self.titleLabel];
......@@ -140,8 +138,6 @@
[self.showView addSubview:self.qualityLabel];
[self.showView addSubview:self.remarkLabel];
[self.contentView addSubview:self.lineLabel];
}
......
......@@ -21,7 +21,7 @@
@property (nonatomic,strong)NSString *supplier;//供应商
@property (nonatomic,strong)UITextField *peopleTextFiled;//联系人
@property (nonatomic,strong)UITextField *phoneTextFiled;//电话
@property (nonatomic,strong)NSString *factory;//标题
@property (nonatomic,strong)NSString *factory;//加工工厂
@property (nonatomic,strong)HPGrowingTextView *remarkTextView;//标题
@property (nonatomic,strong)UIButton *factoryBtn;
@property (nonatomic,strong)UIButton *supplierBtn;
......
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