Commit 4d6dcb24 authored by zhu's avatar zhu

no message

parent e6b29715
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
0414FF191B94959700C7B00E /* PurchaseNoticeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF121B94959700C7B00E /* PurchaseNoticeCell.m */; }; 0414FF191B94959700C7B00E /* PurchaseNoticeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF121B94959700C7B00E /* PurchaseNoticeCell.m */; };
0414FF1A1B94959700C7B00E /* SelectCompanyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF141B94959700C7B00E /* SelectCompanyViewController.m */; }; 0414FF1A1B94959700C7B00E /* SelectCompanyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF141B94959700C7B00E /* SelectCompanyViewController.m */; };
0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF161B94959700C7B00E /* ShopDetaileViewController.m */; }; 0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF161B94959700C7B00E /* ShopDetaileViewController.m */; };
04B4A3871B9CAAD700D88D68 /* ShopDetail.m in Sources */ = {isa = PBXBuildFile; fileRef = 04B4A3861B9CAAD700D88D68 /* ShopDetail.m */; };
04F6E70A1B9B08A500550849 /* PurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */; }; 04F6E70A1B9B08A500550849 /* PurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */; };
300DD94A1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; }; 300DD94A1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; };
300DD94B1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; }; 300DD94B1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; };
...@@ -439,6 +440,8 @@ ...@@ -439,6 +440,8 @@
0414FF141B94959700C7B00E /* SelectCompanyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectCompanyViewController.m; sourceTree = "<group>"; }; 0414FF141B94959700C7B00E /* SelectCompanyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectCompanyViewController.m; sourceTree = "<group>"; };
0414FF151B94959700C7B00E /* ShopDetaileViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopDetaileViewController.h; sourceTree = "<group>"; }; 0414FF151B94959700C7B00E /* ShopDetaileViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopDetaileViewController.h; sourceTree = "<group>"; };
0414FF161B94959700C7B00E /* ShopDetaileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopDetaileViewController.m; sourceTree = "<group>"; }; 0414FF161B94959700C7B00E /* ShopDetaileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopDetaileViewController.m; sourceTree = "<group>"; };
04B4A3851B9CAAD700D88D68 /* ShopDetail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopDetail.h; sourceTree = "<group>"; };
04B4A3861B9CAAD700D88D68 /* ShopDetail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopDetail.m; sourceTree = "<group>"; };
04F6E7081B9B08A500550849 /* PurchaseNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurchaseNoticeViewController.h; sourceTree = "<group>"; }; 04F6E7081B9B08A500550849 /* PurchaseNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurchaseNoticeViewController.h; sourceTree = "<group>"; };
04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseNoticeViewController.m; sourceTree = "<group>"; }; 04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseNoticeViewController.m; sourceTree = "<group>"; };
1B0B22845F5CD40B5CF655F2 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; }; 1B0B22845F5CD40B5CF655F2 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
...@@ -983,6 +986,8 @@ ...@@ -983,6 +986,8 @@
0414FF0F1B94959700C7B00E /* Models */ = { 0414FF0F1B94959700C7B00E /* Models */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04B4A3851B9CAAD700D88D68 /* ShopDetail.h */,
04B4A3861B9CAAD700D88D68 /* ShopDetail.m */,
); );
path = Models; path = Models;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2364,6 +2369,7 @@ ...@@ -2364,6 +2369,7 @@
C10C909B1AE56E8700B911CD /* JTOptionsEntity.m in Sources */, C10C909B1AE56E8700B911CD /* JTOptionsEntity.m in Sources */,
C11A34621B24485100079129 /* ICRStoreResult.m in Sources */, C11A34621B24485100079129 /* ICRStoreResult.m in Sources */,
35CF33841B954F35001211EF /* GXFTableViewCell.m in Sources */, 35CF33841B954F35001211EF /* GXFTableViewCell.m in Sources */,
04B4A3871B9CAAD700D88D68 /* ShopDetail.m in Sources */,
7217E9E91B72364300FE5C1D /* SurveyResult.m in Sources */, 7217E9E91B72364300FE5C1D /* SurveyResult.m in Sources */,
C10214DB1AD90A3F0024637E /* ICRFunctionBaseView.m in Sources */, C10214DB1AD90A3F0024637E /* ICRFunctionBaseView.m in Sources */,
35B448DF1B9B0A73001209E2 /* ProductBillCell.m in Sources */, 35B448DF1B9B0A73001209E2 /* ProductBillCell.m in Sources */,
...@@ -2371,11 +2377,8 @@ ...@@ -2371,11 +2377,8 @@
FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */, FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */,
30D7495F1ACE8F4400C63BA1 /* ICRConfigurationViewController.m in Sources */, 30D7495F1ACE8F4400C63BA1 /* ICRConfigurationViewController.m in Sources */,
FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */, FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */,
0414FF171B94959700C7B00E /* NewPurchaseNoticeViewController.m in Sources */, 0414FF171B94959700C7B00E /* NewPurchaseNoticeViewController.m in Sources */,
35CF33901B95AF1B001211EF /* GXFBaseSearchViewController.m in Sources */, 35CF33901B95AF1B001211EF /* GXFBaseSearchViewController.m in Sources */,
FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */, FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */,
C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */, C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */,
C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */, C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */,
...@@ -2385,11 +2388,8 @@ ...@@ -2385,11 +2388,8 @@
C142D2BE1AC3A155000109A7 /* UIView+FindUIViewController.m in Sources */, C142D2BE1AC3A155000109A7 /* UIView+FindUIViewController.m in Sources */,
35C3C0BF1AE95F1D0035AC8A /* UIImage+Rotate.m in Sources */, 35C3C0BF1AE95F1D0035AC8A /* UIImage+Rotate.m in Sources */,
7281A0C51B89BF1C0052B1AC /* ChooseVendorViewController.m in Sources */, 7281A0C51B89BF1C0052B1AC /* ChooseVendorViewController.m in Sources */,
04F6E70A1B9B08A500550849 /* PurchaseNoticeViewController.m in Sources */, 04F6E70A1B9B08A500550849 /* PurchaseNoticeViewController.m in Sources */,
35CF337E1B953FFF001211EF /* GXFProcessProduct.m in Sources */, 35CF337E1B953FFF001211EF /* GXFProcessProduct.m in Sources */,
C11A344D1B1BE27200079129 /* ICRPatrolAllStoreViewController.m in Sources */, C11A344D1B1BE27200079129 /* ICRPatrolAllStoreViewController.m in Sources */,
C10214DD1AD90A3F0024637E /* ICRFunctionEntity.m in Sources */, C10214DD1AD90A3F0024637E /* ICRFunctionEntity.m in Sources */,
FE4678AA1B8D60F900B5EDA3 /* ChooseTypeViewController.m in Sources */, FE4678AA1B8D60F900B5EDA3 /* ChooseTypeViewController.m in Sources */,
...@@ -2876,9 +2876,7 @@ ...@@ -2876,9 +2876,7 @@
"$(PROJECT_DIR)", "$(PROJECT_DIR)",
); );
PRODUCT_NAME = XFFruit; PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c"; PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**"; USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
}; };
name = Debug; name = Debug;
...@@ -2899,9 +2897,7 @@ ...@@ -2899,9 +2897,7 @@
"$(PROJECT_DIR)", "$(PROJECT_DIR)",
); );
PRODUCT_NAME = XFFruit; PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c"; PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**"; USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
}; };
name = Release; name = Release;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#import "Survey.h" #import "Survey.h"
#import "PurchaseNoticeCell.h" #import "PurchaseNoticeCell.h"
#import "ShopDetaileViewController.h" #import "ShopDetaileViewController.h"
#import "ShopDetail.h"
#define LeftMargin 15 #define LeftMargin 15
#define LeftWidth 40 #define LeftWidth 40
#define RightWidth 30 #define RightWidth 30
...@@ -40,6 +41,7 @@ typedef enum : NSUInteger { ...@@ -40,6 +41,7 @@ typedef enum : NSUInteger {
{ {
UITableView *_tableView; UITableView *_tableView;
NSMutableArray *_dataArr; NSMutableArray *_dataArr;
NSMutableArray *_shopeArr;
UITextField *_titleField; UITextField *_titleField;
UILabel *_productLabel; UILabel *_productLabel;
UILabel *_startDateLabel; UILabel *_startDateLabel;
...@@ -81,6 +83,7 @@ typedef enum : NSUInteger { ...@@ -81,6 +83,7 @@ typedef enum : NSUInteger {
{ {
selectCellAry=[[NSMutableArray alloc]initWithCapacity:1000]; selectCellAry=[[NSMutableArray alloc]initWithCapacity:1000];
_dataArr=[[NSMutableArray alloc]initWithObjects:@"标题:",@"采购员:",@"备注:", nil]; _dataArr=[[NSMutableArray alloc]initWithObjects:@"标题:",@"采购员:",@"备注:", nil];
_shopeArr=[[NSMutableArray alloc]initWithObjects: nil];
self.view.backgroundColor = XXFBgColor; self.view.backgroundColor = XXFBgColor;
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, LeftMargin,ScreenSize.width, ScreenSize.height/3-LeftMargin)) style:(UITableViewStylePlain)]; _tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, LeftMargin,ScreenSize.width, ScreenSize.height/3-LeftMargin)) style:(UITableViewStylePlain)];
...@@ -100,6 +103,7 @@ typedef enum : NSUInteger { ...@@ -100,6 +103,7 @@ typedef enum : NSUInteger {
UIView *footView2=[[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TableHeight)]; UIView *footView2=[[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TableHeight)];
footView2.backgroundColor=[UIColor clearColor]; footView2.backgroundColor=[UIColor clearColor];
NSArray *ary=[NSArray arrayWithObjects:@"商品",@"价格",@"包装规格",@"包装数量", nil]; NSArray *ary=[NSArray arrayWithObjects:@"商品",@"价格",@"包装规格",@"包装数量", nil];
// NSArray *ary=[NSArray arrayWithObjects: nil];
CGFloat gipWidth = (ScreenSize.width-(((RightWidth+70)+(LeftWidth+35))+(35+70)))/3; CGFloat gipWidth = (ScreenSize.width-(((RightWidth+70)+(LeftWidth+35))+(35+70)))/3;
for (int i=0; i< ary.count;i++ ) { for (int i=0; i< ary.count;i++ ) {
...@@ -177,7 +181,7 @@ typedef enum : NSUInteger { ...@@ -177,7 +181,7 @@ typedef enum : NSUInteger {
return _dataArr.count; return _dataArr.count;
}else if ([tableView isEqual:mingXiTableView]) }else if ([tableView isEqual:mingXiTableView])
{ {
return _dataArr.count; return _shopeArr.count;
} }
return 1; return 1;
} }
...@@ -207,9 +211,11 @@ typedef enum : NSUInteger { ...@@ -207,9 +211,11 @@ typedef enum : NSUInteger {
Cell = [[PurchaseNoticeCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellID]; Cell = [[PurchaseNoticeCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone; tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
Cell.selectionStyle = UITableViewCellSelectionStyleNone; Cell.selectionStyle = UITableViewCellSelectionStyleNone;
// Cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;向左箭头 // Cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;向左箭头
[self showShopDetail:Cell indexPath:indexPath];
} }
if (Cell.isSelected==YES) { if (Cell.isSelected==YES) {
Cell.arrowView.image = [UIImage imageNamed:@"arrowdown"]; Cell.arrowView.image = [UIImage imageNamed:@"arrowdown"];
Cell.backgroundColor=XXFBgColor; Cell.backgroundColor=XXFBgColor;
...@@ -372,9 +378,31 @@ typedef enum : NSUInteger { ...@@ -372,9 +378,31 @@ typedef enum : NSUInteger {
-(void)addShopeDetailed -(void)addShopeDetailed
{ {
ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init]; ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init];
// 回调
svc.choseShopDetail = ^(ShopDetail *shopDetail){
[_shopeArr addObject:shopDetail];
[mingXiTableView reloadData];
};
svc.title = [IBTCommon localizableString:@"AddShopDetail"]; svc.title = [IBTCommon localizableString:@"AddShopDetail"];
[self PushViewController:svc animated:YES]; [self PushViewController:svc animated:YES];
}
-(void)showShopDetail:(PurchaseNoticeCell*)Cell indexPath:(NSIndexPath *)indexPath
{
ShopDetail *shopDetail=[_shopeArr objectAtIndex:indexPath.row];
Cell.SpLabel.text=shopDetail.merchandise;//商品
Cell.DjLabel.text=shopDetail.packageUnitPrice;//包装单价
Cell.BzggLabel.text=shopDetail.packageSpecification;//包装规格
Cell.BzslLabel.text=shopDetail.packageQuantity;//包装数量
Cell.packageSpecification.text=shopDetail.packageSpecification;//包装规格
Cell.foundationQuantity.text=shopDetail.foundationQuantity;//基础数量
Cell.packageUnitPrice.text=shopDetail.packageUnitPrice;//包装单价
Cell.remark.text=shopDetail.remark;//备注
Cell.packageQuantity.text=shopDetail.packageQuantity;//包装数量
Cell.foundationUnitPrice.text=shopDetail.foundationUnitPrice;//基础单价
Cell.totalMoney.text=shopDetail.totalMoney;//总金额
} }
//编辑 //编辑
- (void)didtoucher - (void)didtoucher
......
//
// ShopDetail.h
// XFFruit
//
// Created by mac on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface ShopDetail : IBTModel
@property (nonatomic,strong)NSString *merchandise;//商品
@property (nonatomic,strong)NSString *packageSpecification;//包装规格
@property (nonatomic,strong)NSString *packageQuantity;//包装数量
@property (nonatomic,strong)NSString *packageUnit;//包装单位
@property (nonatomic,strong)NSString *foundationQuantity;//基础数量
@property (nonatomic,strong)NSString *foundationUnitPrice;//基础单价
@property (nonatomic,strong)NSString *packageUnitPrice;//包装单价
@property (nonatomic,strong)NSString *totalMoney;//总金额
@property (nonatomic,strong)NSString *remark;//备注
@end
//
// ShopDetail.m
// XFFruit
//
// Created by mac on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ShopDetail.h"
@implementation ShopDetail
+ (NSDictionary *)specialKeysAndReplaceKeys {
return @{ @"pID" : [[self class] PrimaryKey], };
}
+ (NSString *)PrimaryKey {
return @"uuid";
}
@end
...@@ -19,6 +19,21 @@ ...@@ -19,6 +19,21 @@
@property (nonatomic,strong)UIView *subSview; @property (nonatomic,strong)UIView *subSview;
@property (nonatomic, assign) BOOL isSelected; @property (nonatomic, assign) BOOL isSelected;
@property (nonatomic,strong)UIButton *button; @property (nonatomic,strong)UIButton *button;
@property (nonatomic,strong)UILabel *packageSpecification;//包装规格
@property (nonatomic,strong)UILabel *packageQuantity;//包装数量
@property (nonatomic,strong)UILabel *packageUnit;//包装单位
@property (nonatomic,strong)UILabel *foundationQuantity;//基础数量
@property (nonatomic,strong)UILabel *foundationUnitPrice;//基础单价
@property (nonatomic,strong)UILabel *packageUnitPrice;//包装单价
@property (nonatomic,strong)UILabel *totalMoney;//总金额
@property (nonatomic,strong)UILabel *remark;//备注
@property (nonatomic,strong)NSArray *shopDetailAry1;
@property (nonatomic,strong)NSArray *shopDetailAry2;
- (void)setTitleStr:(NSString *)str; - (void)setTitleStr:(NSString *)str;
......
...@@ -21,11 +21,24 @@ ...@@ -21,11 +21,24 @@
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) { if (self) {
self.isSelected=NO; self.isSelected=NO;
[self initdata];
[self bulidLayout]; [self bulidLayout];
} }
return self; return self;
} }
-(void)initdata
{
self.packageSpecification=[[UILabel alloc]init];//包装规格
self.packageQuantity=[[UILabel alloc]init];;//包装数量
self.packageUnit=[[UILabel alloc]init]; ;//包装单位
self.foundationQuantity=[[UILabel alloc]init];;//基础数量
self.foundationUnitPrice=[[UILabel alloc]init];;//基础单价
self.packageUnitPrice=[[UILabel alloc]init];;//包装单价
self.totalMoney=[[UILabel alloc]init];;//总金额
self.remark=[[UILabel alloc]init];;//备注
self.shopDetailAry1=[NSArray arrayWithObjects: self.packageSpecification, self.foundationQuantity ,self.packageUnitPrice,self.remark,nil];
self.shopDetailAry2=[NSArray arrayWithObjects: self.packageQuantity, self.foundationUnitPrice ,self.totalMoney,nil];
}
- (void)bulidLayout - (void)bulidLayout
{ {
CGFloat gipWidth = (ScreenSize.width-4*TableWidth-(LeftMargin+20)-RightWidth)/3; CGFloat gipWidth = (ScreenSize.width-4*TableWidth-(LeftMargin+20)-RightWidth)/3;
...@@ -61,33 +74,54 @@ ...@@ -61,33 +74,54 @@
self.BzslLabel.textColor = HexColor(@"666666"); self.BzslLabel.textColor = HexColor(@"666666");
self.BzslLabel.font = FontSize(TitleSize); self.BzslLabel.font = FontSize(TitleSize);
self.SpLabel.text=@"1 西瓜"; // self.SpLabel.text=@"1 西瓜";
self.DjLabel.text=@"0.8"; // self.DjLabel.text=@"0.8";
self.BzggLabel.text=@"1*12"; // self.BzggLabel.text=@"1*12";
self.BzslLabel.text=@"100框"; // self.BzslLabel.text=@"100框";
self.subSview=[[UIView alloc]initWithFrame:CGRectMake(0, 50, ScreenSize.width, TableHeight*3)]; self.subSview=[[UIView alloc]initWithFrame:CGRectMake(0, 50, ScreenSize.width, TableHeight*3)];
NSArray*array=[NSArray arrayWithObjects:@"包装规格",@"基础数量" ,@"包装单价",@"备注",nil]; NSArray*array=[NSArray arrayWithObjects:@"包装规格:",@"基础数量:" ,@"包装单价:",@"备注:",nil];
NSArray*array1=[NSArray arrayWithObjects:@"包装数量",@"基础单价" ,@"总金额",nil]; NSArray*array1=[NSArray arrayWithObjects:@"包装数量:",@"基础单价:" ,@"总金额:",nil];
for (int i=0; i<array.count; i++) { for (int i=0; i<array.count; i++) {
UILabel *lable=[[UILabel alloc]init]; UILabel *lable=[[UILabel alloc]init];
// if (i==0) { // if (i==0) {
lable.frame=CGRectMake(LeftWidth, i*(10+10), 100, 10); lable.frame=CGRectMake(LeftWidth, i*(10+10), (ScreenSize.width-2*LeftMargin)/4, 10);
// } // }
lable.text=[array objectAtIndex:i]; lable.text=[array objectAtIndex:i];
lable.font=FontSize(TitleSize-2); lable.font=FontSize(TitleSize-2);
[lable setTextColor:HexColor(@"444444")]; [lable setTextColor:HexColor(@"444444")];
[self.subSview addSubview:lable]; [self.subSview addSubview:lable];
UILabel*shopeLable= [self.shopDetailAry1 objectAtIndex:i];
if (i==3) {
shopeLable.frame=CGRectMake(lable.frame.origin.x+lable.frame.size.width-LeftMargin, lable.frame.origin.y,(ScreenSize.width-2*LeftMargin)/4*3, 10);
}else{
shopeLable.frame=CGRectMake(lable.frame.origin.x+lable.frame.size.width-LeftMargin, lable.frame.origin.y,(ScreenSize.width-2*LeftMargin)/4, 10);
}
shopeLable.font=FontSize(TitleSize-2);
[shopeLable setTextColor:HexColor(@"444444")];
// shopeLable.backgroundColor=[UIColor redColor];
[self.subSview addSubview:shopeLable];
} }
for (int i=0; i<array1.count; i++) { for (int i=0; i<array1.count; i++) {
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(ScreenSize.width/2, i*(10+10), 60, 10)]; UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(ScreenSize.width/2, i*(10+10), (ScreenSize.width-2*LeftMargin)/4, 10)];
lable.text=[array objectAtIndex:i];
lable.text=[array1 objectAtIndex:i];
lable.font=FontSize(TitleSize-2); lable.font=FontSize(TitleSize-2);
[lable setTextColor:HexColor(@"444444")]; [lable setTextColor:HexColor(@"444444")];
[self.subSview addSubview:lable]; [self.subSview addSubview:lable];
UILabel*shopeLable= [self.shopDetailAry2 objectAtIndex:i];
shopeLable.frame=CGRectMake(lable.frame.origin.x-LeftMargin+lable.frame.size.width, lable.frame.origin.y,(ScreenSize.width-2*LeftMargin)/4, 10);
shopeLable.font=FontSize(TitleSize-2);
[shopeLable setTextColor:HexColor(@"444444")];
// shopeLable.backgroundColor=[UIColor redColor];
[self.subSview addSubview:shopeLable];
} }
self.subSview.hidden=YES; self.subSview.hidden=YES;
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
#import "Survey.h" #import "Survey.h"
#import "ShopDetail.h"
typedef void(^ChoseShopDetail)(ShopDetail *shopDetail);
@interface ShopDetaileViewController : ICRBaseViewController @interface ShopDetaileViewController : ICRBaseViewController
@property (nonatomic,strong)Survey *survey; @property (nonatomic,strong)Survey *survey;
@property (nonatomic,strong)ShopDetail *shopDetail;
@property (nonatomic,strong)ChoseShopDetail choseShopDetail;
@property (nonatomic,strong)NSString *navTitle; @property (nonatomic,strong)NSString *navTitle;
@end @end
...@@ -43,6 +43,16 @@ typedef enum : NSUInteger { ...@@ -43,6 +43,16 @@ typedef enum : NSUInteger {
UIDatePicker *_timePicker; UIDatePicker *_timePicker;
BOOL _isClickStart; BOOL _isClickStart;
StartTimeView *_startTimeView; StartTimeView *_startTimeView;
UITextField *merchandise; //商品
UITextField *packageSpecification;//包装规格
UITextField *packageQuantity; //包装数量
UITextField *packageUnit; //包装单位
UITextField *foundationQuantity; //基础数量
UITextField *foundationUnitPrice; //基础单价
UITextField *packageUnitPrice; //包装单价
UITextField *totalMoney; //总金额
UITextField *remark; //备注
} }
@property (nonatomic,strong)NSString *titleStr; @property (nonatomic,strong)NSString *titleStr;
@property (nonatomic,strong)NSString *productCodeStr; @property (nonatomic,strong)NSString *productCodeStr;
...@@ -64,6 +74,9 @@ typedef enum : NSUInteger { ...@@ -64,6 +74,9 @@ typedef enum : NSUInteger {
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)initData{ - (void)initData{
merchandise=[[UITextField alloc]init];
packageUnit=[[UITextField alloc]init];
merchandise.text=packageUnit.text=NULL;
_dataArr = [NSMutableArray array]; _dataArr = [NSMutableArray array];
self.users = [NSMutableArray array]; self.users = [NSMutableArray array];
[_dataArr addObject:@"商品"]; [_dataArr addObject:@"商品"];
...@@ -72,7 +85,7 @@ typedef enum : NSUInteger { ...@@ -72,7 +85,7 @@ typedef enum : NSUInteger {
[_dataArr addObject:@"包装单位"]; [_dataArr addObject:@"包装单位"];
[_dataArr addObject:@"基础数量"]; [_dataArr addObject:@"基础数量"];
[_dataArr addObject:@"基础单价"]; [_dataArr addObject:@"基础单价"];
[_dataArr addObject:@"包装单"]; [_dataArr addObject:@"包装单"];
[_dataArr addObject:@"总金额"]; [_dataArr addObject:@"总金额"];
[_dataArr addObject:@"备注"]; [_dataArr addObject:@"备注"];
} }
...@@ -89,10 +102,10 @@ typedef enum : NSUInteger { ...@@ -89,10 +102,10 @@ typedef enum : NSUInteger {
UIView *footView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 50)]; UIView *footView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 50)];
UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"保存" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_SAVE_COLOR]; UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"删除" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_SAVE_COLOR];
[footView addSubview:saveBtn]; [footView addSubview:saveBtn];
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:GXF_COMMIT_COLOR]; 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:GXF_COMMIT_COLOR];
[footView addSubview:commitBtn]; [footView addSubview:commitBtn];
// [self.view addSubview:footView]; // [self.view addSubview:footView];
...@@ -116,24 +129,63 @@ typedef enum : NSUInteger { ...@@ -116,24 +129,63 @@ typedef enum : NSUInteger {
break; break;
case CommitTag: case CommitTag:
{ {
// if ([self checkSurvey]) { if ([self informationComplete]) {
ShopDetail *shopDetail=self.shopDetail;
self.choseShopDetail(shopDetail);//回调
[self PopViewControllerAnimated:YES];
// [self saveSurvey:@"submitted" message:@"正在提交..."]; // [self saveSurvey:@"submitted" message:@"正在提交..."];
// } }
} }
break; break;
default: default:
break; break;
} }
} }
- (BOOL)checkSurvey{ - (BOOL)informationComplete{
self.titleStr = _titleField.text; self.shopDetail=[[ShopDetail alloc]init];
self.remarkStr = _noteTextView.text; self.shopDetail.merchandise=merchandise.text;
if (self.titleStr.length == 0 || self.productUuidStr.length == 0 || self.productNameStr.length == 0|| self.productCodeStr.length == 0 || self.users.count <=0 || self.beginDateStr.length == 0 || self.endDateStr.length == 0) { self.shopDetail.packageSpecification=packageSpecification.text;
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"信息不完整" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; self.shopDetail.packageQuantity=packageQuantity.text;
[alert show]; self.shopDetail.packageUnit=packageUnit.text;
self.shopDetail.foundationQuantity=foundationQuantity.text;
self.shopDetail.foundationUnitPrice=foundationUnitPrice.text;
self.shopDetail.packageUnitPrice=packageUnitPrice.text;
self.shopDetail.totalMoney=totalMoney.text;
self.shopDetail.remark=remark.text;
if (merchandise.text.length == 0 ) {
ShowMessage(@"商品不能为空");
return NO; return NO;
} }
return YES; if (packageSpecification.text.length == 0 ) {
ShowMessage(@"包装规格不能为空");
return NO;
}
if (packageQuantity.text.length == 0 ) {
ShowMessage(@"包装数量不能为空");
return NO;
}
if (packageUnit.text.length == 0) {
ShowMessage(@"包装单位不能为空");
return NO;
}
if (foundationQuantity.text.length == 0) {
ShowMessage(@"基础数量不能为空");
return NO;
}
if (foundationUnitPrice.text.length == 0) {
ShowMessage(@"基础单价不能为空");
return NO;
}if (packageUnitPrice.text.length == 0) {
ShowMessage(@"总金额不能为空");
return NO;
}
if (remark.text.length == 0) {
ShowMessage(@"备注不能为空");
return NO;
}
return YES;
} }
...@@ -255,13 +307,13 @@ typedef enum : NSUInteger { ...@@ -255,13 +307,13 @@ typedef enum : NSUInteger {
contentLabel.font = FontSize(TitleSize); contentLabel.font = FontSize(TitleSize);
[cell.contentView addSubview:contentLabel]; [cell.contentView addSubview:contentLabel];
if (indexPath.row==0) { if (indexPath.row==0) {
contentLabel.text = @"选择商品";
_productLabel = contentLabel; _productLabel = contentLabel;
contentLabel.text = @"选择商品";
[self preferDataInProductLabel]; [self preferDataInProductLabel];
}else if (indexPath.row==3) }else if (indexPath.row==3)
{ {
contentLabel.text = @"选择包装单位";
_PackagingLable = contentLabel; _PackagingLable = contentLabel;
contentLabel.text = @"选择包装单位";
[self preferDataInProductLabel]; [self preferDataInProductLabel];
} }
...@@ -276,24 +328,31 @@ typedef enum : NSUInteger { ...@@ -276,24 +328,31 @@ typedef enum : NSUInteger {
_titleField.delegate = self; _titleField.delegate = self;
[cell.contentView addSubview:_titleField]; [cell.contentView addSubview:_titleField];
if (indexPath.row==1) { if (indexPath.row==1) {
_titleField.placeholder = @"输入包装规格"; packageSpecification=_titleField;//包装规格
_titleField.placeholder = @"输入包装规格";
}else if (indexPath.row==2) }else if (indexPath.row==2)
{ {
_titleField.placeholder = @"输入包装数量"; packageQuantity=_titleField; //包装数量
_titleField.placeholder = @"输入包装数量";
}else if (indexPath.row==4) }else if (indexPath.row==4)
{ {
_titleField.placeholder = @"输入基础数量"; foundationQuantity=_titleField; //基础数量
_titleField.placeholder = @"输入基础数量";
}else if (indexPath.row==5) }else if (indexPath.row==5)
{ {
foundationUnitPrice=_titleField; //基础单价
_titleField.placeholder = @"输入基础单价"; _titleField.placeholder = @"输入基础单价";
}else if (indexPath.row==6) }else if (indexPath.row==6)
{ {
packageUnitPrice=_titleField; //包装单价
_titleField.placeholder = @"输入包装单价"; _titleField.placeholder = @"输入包装单价";
}else if (indexPath.row==7) }else if (indexPath.row==7)
{ {
totalMoney=_titleField; //总金额
_titleField.placeholder = @"输入总金额"; _titleField.placeholder = @"输入总金额";
}else if (indexPath.row==8) }else if (indexPath.row==8)
{ {
remark=_titleField; //备注
_titleField.placeholder = @"输入备注内容"; _titleField.placeholder = @"输入备注内容";
} }
...@@ -308,6 +367,7 @@ typedef enum : NSUInteger { ...@@ -308,6 +367,7 @@ typedef enum : NSUInteger {
cvc.choseProduct = ^(Product *product){ cvc.choseProduct = ^(Product *product){
_productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code]; _productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code];
merchandise.text=[NSString stringWithFormat:@"%@[%@]",product.name,product.code];
_productLabel.textColor = HexColor(@"444444"); _productLabel.textColor = HexColor(@"444444");
self.productNameStr = product.name; self.productNameStr = product.name;
self.productUuidStr = product.uuid; self.productUuidStr = product.uuid;
...@@ -321,12 +381,14 @@ typedef enum : NSUInteger { ...@@ -321,12 +381,14 @@ typedef enum : NSUInteger {
vc.chosePackaging = ^(NSString *Packaging){ vc.chosePackaging = ^(NSString *Packaging){
_PackagingLable.text = [NSString stringWithFormat:@"%@",Packaging]; _PackagingLable.text = [NSString stringWithFormat:@"%@",Packaging];
packageUnit.text=[NSString stringWithFormat:@"%@",Packaging];
_PackagingLable.textColor = HexColor(@"444444"); _PackagingLable.textColor = HexColor(@"444444");
}; };
[self PushViewController:vc animated:YES]; [self PushViewController:vc animated:YES];
} }
} }
......
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