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

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into DEV_20150805_001

Conflicts:
	XFFruit/Controllers/HTTPController/ICRHTTPController.m
	XFFruit/ViewControllers/Business/BusinessViewController.m
	XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m
	XFFruit/ViewControllers/Survey/controllers/ChooseProductViewController.m
parents b27addf1 e6b29715
This diff is collapsed.
......@@ -89,7 +89,7 @@
@(500101),@(500102),@(500103),
@(500201),
@(500301),@(500302),@(500303),//"采购通知",
@(500401),@(500402),@(500403),@(500406),//"采购单"
@(500401),@(500402),@(500403),@(500404),//"采购单"
@(500501),@(500502),@(500503),//"发运单"
@(500601),@(500602),@(500603),//"转运单"
@(500701),@(500702),@(500703),];//加工单
......@@ -97,7 +97,7 @@
@"新建行情调研",@"查看行情调研", @"查看行情调研",
@"填写行情反馈",
@"新建采购通知",@"查看采购通知", @"查看采购通知",
@"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单【供应商】",
@"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单",//【供应商】",
@"新建发运单",@"查看发运单", @"查看发运单",
@"新增加工单",@"查看加工单", @"查看加工单",
@"新建转运单", @"查看转运单", @"查看转运单"];
......
......@@ -253,6 +253,40 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
failure:(void (^)(id))fail;
//1·保存采购通知单
- (void)savePurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//2·获取采购通知单列表
- (void)getPurchaseNoticeListWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//3·采购通知单明细(读)
- (void)getPurchaseNoticeDetailedWithPurchaseUuid:(NSString *)purchaseUuid success:(void (^)(id))succ
failure:(void (^)(id))fail;
//4·保存并提交采购通知单
- (void)saveAndSubmitPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//5·提交采购通知单
- (void)ComitPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//6·接受采购通知单
- (void)acceptPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//7·结束采购通知单
- (void)finishPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//8·获取采购通知单跟进记录
- (void)getPurchaseNoticeRecodWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//添加采购单
- (void)savePurchaseWithData:(id)data
......
......@@ -86,6 +86,16 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
//加工单
XFFHttp_QueryProcess,
XFFHttp_GetProcess,
//采购通知单
XFFHttp_savePurchaseNotice,
XFFHttp_getPurchaseNoticeList,
XFFHttp_getPurchaseNoticeDetailed,
XFFHttp_saveAndSubmitPurchaseNotice,
XFFHttp_ComitPurchaseNotice,
XFFHttp_acceptPurchaseNotice,
XFFHttp_finishPurchaseNotice,
XFFHttp_getPurchaseNoticeRecod,
//采购单
XFFHttp_PurchaseSave,
......@@ -159,7 +169,17 @@ static NSString * const ICRHTTPInterface[] = {
//加工单
[XFFHttp_QueryProcess ] = @"process/query",
[XFFHttp_GetProcess ] = @"process/get",
//采购通知单
[XFFHttp_savePurchaseNotice] = @"purchase/notice/save",
[XFFHttp_getPurchaseNoticeList] = @"purchase/notice/query",
[XFFHttp_getPurchaseNoticeDetailed] = @"purchase/notice/get/",
[XFFHttp_saveAndSubmitPurchaseNotice] = @"purchase/notice/saveandsubmit",
[XFFHttp_ComitPurchaseNotice] = @"purchase/notice/submit/",
[XFFHttp_acceptPurchaseNotice] = @"purchase/notice/accept/",
[XFFHttp_finishPurchaseNotice] = @"purchase/notice/finish/",
[XFFHttp_getPurchaseNoticeRecod] = @"purchase/trace/get/",
//采购单
[XFFHttp_PurchaseSave] = @"purchase/bill/save",
......@@ -1646,8 +1666,8 @@ acceptTypeJson:YES
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetVendor ClassName:@"Vendor" Page_number:page_number page_size:page_size success:succ failure:fail];
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetVendor ClassName:@"Vendor" Page_number:page_number page_size:page_size success:succ failure:fail];
}
//仓库
-(void)getWarehouseWithPage_number:(NSUInteger)page_number
......@@ -1721,8 +1741,9 @@ acceptTypeJson:YES
fail( error );
}
};
// NSString *dateStr = [[NSDate date] httpParameterString];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", @"2015-05-06",@(page_number),@(page_size)];
#pragma 请求参数的下载时间应该有要求????
NSString *dateStr = @"2015-05-04";//[[NSDate date] httpParameterString];//urlAction
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if (isPost) {
......@@ -1978,5 +1999,80 @@ acceptTypeJson:YES
success:success
failure:failure];
}
//1·保存采购通知单
- (void)savePurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//2·获取采购通知单列表
- (void)getPurchaseNoticeListWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (succ) {
succ( responseObject );
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
NSDictionary *dict = data;
NSString *urlStr = [[self class] UrlForPluginHTTPAction:XFFHttp_getPurchaseNoticeList];
[self POST:urlStr
parameters:dict
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
//3·采购通知单明细(读)
- (void)getPurchaseNoticeDetailedWithPurchaseUuid:(NSString *)purchaseUuid success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//4·保存并提交采购通知单
- (void)saveAndSubmitPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//5·提交采购通知单
- (void)ComitPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//6·接受采购通知单
- (void)acceptPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//7·结束采购通知单
- (void)finishPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//8·获取采购通知单跟进记录
- (void)getPurchaseNoticeRecodWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
@end
......@@ -290,6 +290,7 @@
}
- (NSString *)httpParameterString {
NSString *str = [self stringWithFormatter:@"%Y-%m-%d %H:%M:%S"];
return [self stringWithFormatter:@"%Y-%m-%d %H:%M:%S"];
}
- (NSString *)coverStringFromString {
......
......@@ -49,11 +49,11 @@
//颜色
#define GXF_LABLE_TINT_COLOR HexColor(@"444444")
#define GXF_LABLE_BG_COLOR XXFBgColor
#define GXF_GREEN_COLOR HexColor(@"50bd62")
#define GXF_ORIGIN_COLOR HexColor(@"f69100")
#define GXF_GRAY_COLOR HexColor(@"444444")
#define GXF_GREEN_COLOR HexColor(@"50bd62")
#define GXF_ORIGIN_COLOR HexColor(@"f69100")
#define GXF_GRAY_COLOR HexColor(@"444444")
//字体大小
#define GXF_LABLE_FONT FontSize(15)
#define GXF_LABLE_FONT FontSize(15)
// 高度
......
......@@ -20,6 +20,7 @@
// Fuctions
- (NSDictionary *)dictForCommit;
- (NSMutableDictionary *)mutableDictDateToStringForCommit;//把属性为日期类型的转化为string
- (NSDictionary *)dictForLocalSave;
- (void)praseFromJsonDict:(NSDictionary *)dict;
- (void)praseFromLocalDict:(NSDictionary *)dict;
......
......@@ -418,6 +418,48 @@
return mDict;
}
- (NSMutableDictionary *)mutableDictDateToStringForCommit {
unsigned int count;
objc_property_t *properties = class_copyPropertyList([self class], &count);
if (count == 0) {
free(properties);
return nil;
}
NSMutableDictionary *mDict = [NSMutableDictionary dictionary];
NSDictionary *dictSpKeyDict = [[self class] specialKeysAndReplaceKeys];
NSArray *arrSpecialKeys = [dictSpKeyDict allKeys];
NSArray *arrCustomKeys = [[self class] customAcitonKeys];
NSArray *arrLocalKeys = [[self class] localKeys];
for (unsigned int i = 0; i < count; i++) {
objc_property_t property = properties[i];
NSString *key = [NSString stringWithUTF8String:property_getName(property)];
id value = [self valueForKey:key];
if ([value isKindOfClass:[NSDate class]]) {
value = [value httpParameterString];
}
if (value) {
if ([arrCustomKeys containsObject:key] ||
[arrLocalKeys containsObject:key]) {
continue;
} else if ([arrSpecialKeys containsObject:key]) {
[mDict addEntriesFromDictionary:@{dictSpKeyDict[key]: value}];
} else {
[mDict addEntriesFromDictionary:@{key: value}];
}
}
}
free(properties);
return mDict;
}
- (NSDictionary *)dictForLocalSave {
unsigned int count;
objc_property_t *properties = class_copyPropertyList([self class], &count);
......
......@@ -54,7 +54,7 @@ static NSString *cellID = @"cell";
self.navigationItem.rightBarButtonItem = rightBarBtn;
}
- (void)setupTableView {
self.f_tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height - 64) style:UITableViewStyleGrouped];
self.f_tableView.dataSource = self;
self.f_tableView.delegate = self;
//[self.f_tableView dequeueReusableCellWithIdentifier ]
......
......@@ -58,7 +58,7 @@
@end
@implementation ICRHomeViewController
static NSString *cellID = @"cell";
static NSString *firestCellID = @"firestCell";
static NSString *secondCellID = @"secondCell";
static NSString *collectionCellID = @"collectionCell";
//static CGFloat colletionCellHeight [UIScreen mainScreen].bounds.size.width / 3.0
......@@ -187,24 +187,30 @@ static NSString *collectionCellID = @"collectionCell";
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
UITableViewCell *cell; //= [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
if (indexPath.section == 0) {
cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = @"查看行情反馈-进行中";
cell = [tableView dequeueReusableCellWithIdentifier:firestCellID];
if (!cell) {
cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:firestCellID];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = @"查看行情反馈-进行中";
}
} else {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"secondCell"];
cell = [tableView dequeueReusableCellWithIdentifier:secondCellID];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:secondCellID];
} else {
while ([cell.contentView.subviews lastObject] != nil) {
[(UIView *)[cell.contentView.subviews lastObject]removeFromSuperview];
}
}
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame));
}
} else {
while ([cell.contentView.subviews lastObject] != nil) {
[(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
}
}
return cell;
}
......
......@@ -15,6 +15,7 @@
@property (nonatomic, copy) NSString *functionImgName; //
@property (nonatomic, copy) NSString *functionSmallImgName;
@property (nonatomic, assign) BOOL isSelected; //选中
@property (nonatomic, assign) BOOL hasPermission;
@property (nonatomic, assign) NSInteger functionItemTag;
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict;
......
......@@ -163,12 +163,14 @@
}
}
if (![[GXFFunctionDB sharedInstance]defaultdisplayFunctions]) {
//配置功能 不是默认配置
NSUserDefaults *f_default = [NSUserDefaults standardUserDefaults];
BOOL noDefault = [[f_default objectForKey:@"noDefault"] integerValue] > 0 ? YES : NO;
if (!noDefault) {
[[GXFFunctionDB sharedInstance]defaultdisplayFunctions];
}
};
void(^fail)(id) = ^(id data) {
......
......@@ -34,7 +34,7 @@
[IBTLoadingView showProgressLabel:@"正在加载..."];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSDictionary *queryOrderDict = @{@"direction":@"desc",@"field":@"billNumber"};
NSDictionary *queryOrderDict = @{@"direction":@"",@"field":@"billNumber"};
NSDictionary *dict = @{
@"billNumberLike":@"",
@"state":@"",
......
//
// PurchaseNoticeViewController.h
// XFFruit
//
// Created by mac on 15/9/5.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface PurchaseNoticeViewController : ICRBaseViewController
@end
......@@ -7,7 +7,10 @@
//
#import "ICRBaseViewController.h"
#import "PurchaseBill.h"
@interface SeePurchaseNoticeViewController : ICRBaseViewController
@property (nonatomic,strong)PurchaseBill *bill;
//模拟三个人员
@property (nonatomic,assign)NSInteger indexPerson;//0.1.2
@end
//
// SeePurchaseNoticeViewController.m
// XFFruit
//
// Created by mac on 15/8/16.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "SeePurchaseNoticeViewController.h"
@interface SeePurchaseNoticeViewController ()
@end
@implementation SeePurchaseNoticeViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (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
......@@ -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;
......
......@@ -11,6 +11,8 @@
#define LeftMargin 15
#define TableHeight 46
#define TableWidth 60
#define LeftWidth 40
#define RightWidth 30
@implementation PurchaseNoticeCell
......@@ -18,7 +20,6 @@
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.isSelected=NO;
[self bulidLayout];
}
......@@ -27,30 +28,35 @@
- (void)bulidLayout
{
CGFloat gipWidth = (ScreenSize.width-4*TableWidth-(LeftMargin+20)-RightWidth)/3;
self.HeardLabel=[[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin * 2, 1))];
self.HeardLabel.backgroundColor = HexColor(@"e5e5e5");
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;
self.SpLabel.textColor = HexColor(@"666666");
self.SpLabel.font = FontSize(TitleSize);
self.DjLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+80, 0, TableWidth,TableHeight ))];
self.DjLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20+self.SpLabel.size.width+gipWidth , 0, TableWidth,TableHeight ))];
self.DjLabel.textAlignment= NSTextAlignmentLeft;
self.DjLabel.textColor = HexColor(@"666666");
self.DjLabel.font = FontSize(TitleSize);
self.BzggLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+150, 0, TableWidth, TableHeight)];
self.BzggLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.DjLabel.frame.origin.x+self.DjLabel.size.width+gipWidth, 0, TableWidth, TableHeight)];
self.BzggLabel.textAlignment= NSTextAlignmentLeft;
self.BzggLabel.textColor = HexColor(@"666666");
self.BzggLabel.font = FontSize(TitleSize);
self.BzslLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+240, 0, TableWidth, TableHeight)];
self.BzslLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.BzggLabel.frame.origin.x+self.BzggLabel.size.width+gipWidth, 0, TableWidth, TableHeight)];
self.BzslLabel.textAlignment= NSTextAlignmentLeft;
self.BzslLabel.textColor = HexColor(@"666666");
self.BzslLabel.font = FontSize(TitleSize);
......@@ -67,14 +73,17 @@
NSArray*array1=[NSArray arrayWithObjects:@"包装数量",@"基础单价" ,@"总金额",nil];
for (int i=0; i<array.count; i++) {
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(TableWidth-10, i*(10+10), 100, 10)];
UILabel *lable=[[UILabel alloc]init];
// if (i==0) {
lable.frame=CGRectMake(LeftWidth, i*(10+10), 100, 10);
// }
lable.text=[array objectAtIndex:i];
lable.font=FontSize(TitleSize-2);
[lable setTextColor:HexColor(@"444444")];
[self.subSview addSubview:lable];
}
for (int i=0; i<array1.count; i++) {
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(TableWidth+150, i*(10+10), 100, 10)];
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(ScreenSize.width/2, i*(10+10), 60, 10)];
lable.text=[array objectAtIndex:i];
lable.font=FontSize(TitleSize-2);
[lable setTextColor:HexColor(@"444444")];
......@@ -83,10 +92,8 @@
self.subSview.hidden=YES;
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 setFrame:CGRectMake(ScreenSize.width-50, 0, 50, 50)];
[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 +101,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
......
//
// SelectCompanyViewController.h
// XFFruit
//
// Created by mac on 15/8/31.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "MaskCell.h"
typedef void(^ChosePackaging)(NSString *Packaging);
@interface SelectCompanyViewController : ICRBaseViewController
@property (nonatomic,copy)ChosePackaging chosePackaging;
@end
//
// SelectCompanyViewController.m
// XFFruit
//
// Created by mac on 15/8/31.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "SelectCompanyViewController.h"
#define TableHeight 45
@interface SelectCompanyViewController ()<UITableViewDataSource,UITableViewDelegate>
{
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
@end
@implementation SelectCompanyViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self initData];
[self initView];
// Do any additional setup after loading the view.
}
-(void)initData
{
self.dataArr=[NSMutableArray arrayWithObjects:@"筐",@"斤",nil];
self.title = @"选择包装单位";
}
-(void)initView
{
self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0,ScreenSize.width, ScreenSize.height) style:(UITableViewStylePlain)];
self.tableView.backgroundColor = [UIColor whiteColor];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.view addSubview:self.tableView];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:TableHeight];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textAlignment = UITextAlignmentCenter;
cell.textLabel.text=self.dataArr[indexPath.row];
cell.Commitbtn.hidden = YES;
}
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 40;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *ChosePackaging = self.dataArr[indexPath.row];
//block 回调
self.chosePackaging(ChosePackaging);
[self PopViewControllerAnimated:YES];
}
- (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
......@@ -12,6 +12,7 @@
#import "StartTimeView.h"
#import "ChosePersonViewController.h"
#import "ChooseProductViewController.h"
#import "SelectCompanyViewController.h"
#import "SurveyUser.h"
#import "Survey.h"
#import "Product.h"
......@@ -34,6 +35,7 @@ typedef enum : NSUInteger {
NSMutableArray *_dataArr;
UITextField *_titleField;
UILabel *_productLabel;
UILabel *_PackagingLable;
UILabel *_startDateLabel;
UILabel *_endDateLabel;
UILabel *_personLabel;
......@@ -58,7 +60,6 @@ typedef enum : NSUInteger {
[super viewDidLoad];
self.title = self.navTitle;
[self initData];
// [self createTableView];
[self setupSubviews];
// Do any additional setup after loading the view.
}
......@@ -260,7 +261,7 @@ typedef enum : NSUInteger {
}else if (indexPath.row==3)
{
contentLabel.text = @"选择包装单位";
_productLabel = contentLabel;
_PackagingLable = contentLabel;
[self preferDataInProductLabel];
}
......@@ -295,79 +296,9 @@ typedef enum : NSUInteger {
{
_titleField.placeholder = @"输入备注内容";
}
// if (self.survey) {
// _titleField.text = [IBTCommon checkString:self.survey.title];
// self.titleStr = [IBTCommon checkString:self.survey.title];
// }
}
// _titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
// _titleField.textAlignment = NSTextAlignmentRight;
// _titleField.textColor = HexColor(@"444444");
// _titleField.placeholder = @"输入调研标题";
// _titleField.font = FontSize(15);
// _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 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);
// _noteTextView.minNumberOfLines = 1;
// _noteTextView.maxNumberOfLines = 4;
// _noteTextView.font = FontSize(15);
// _noteTextView.textAlignment = NSTextAlignmentRight;
// _noteTextView.delegate = self;
// _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;
// }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 == 1) {
// contentLabel.text = @"选择商品";
// _productLabel = contentLabel;
// [self preferDataInProductLabel];
// }else if(indexPath.row == 2){
// contentLabel.text = @"选择日期";
// _startDateLabel = contentLabel;
// if (self.survey) {
// if (self.survey.beginDate.length > 9) {
// _startDateLabel.text = [[IBTCommon checkString:self.survey.beginDate]substringToIndex:10];
// }
// _startDateLabel.textColor = HexColor(@"444444");
// self.beginDateStr =[IBTCommon checkString:self.survey.beginDate];
//
// }
// }else if(indexPath.row == 3){
// contentLabel.text = @"选择日期";
// _endDateLabel = contentLabel;
// if (self.survey) {
// if (self.survey.endDate.length > 9) {
// _endDateLabel.text = [[IBTCommon checkString:self.survey.endDate]substringToIndex:10];
// }
// _endDateLabel.textColor = HexColor(@"444444");
// self.endDateStr = [IBTCommon checkString:self.survey.endDate];
// }
// }else if(indexPath.row == 4){
// contentLabel.text = @"选择调研人员";
// _personLabel = contentLabel;
// [self preferDataInPersonLabel];
// }
// }
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
......@@ -403,6 +334,10 @@ typedef enum : NSUInteger {
ChooseProductViewController *cvc = [ChooseProductViewController new];
cvc.choseBaseInfo = ^(NSArray *products){
Product *product = products[0];
if(indexPath.row == 0){
ChooseProductViewController *cvc = [ChooseProductViewController new];
cvc.choseProduct = ^(Product *product){
_productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code];
_productLabel.textColor = HexColor(@"444444");
self.productNameStr = product.name;
......@@ -411,6 +346,18 @@ typedef enum : NSUInteger {
};
cvc.isMoreChose = NO;
[self PushViewController:cvc animated:YES];
}else if (indexPath.row ==3)
{
SelectCompanyViewController *vc=[SelectCompanyViewController new];
vc.chosePackaging = ^(NSString *Packaging){
_PackagingLable.text = [NSString stringWithFormat:@"%@",Packaging];
_PackagingLable.textColor = HexColor(@"444444");
};
[self PushViewController:vc animated:YES];
}
}
......
......@@ -37,6 +37,55 @@
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getProductWithPage_number:0 page_size:100 success:succ failure:fail];
}
#pragma mark -成功
- (void)fetchProductList:(NSString *)titleStr{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = @"";
if (titleStr.length > 0) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@", [Product TableName],titleStr, @"uuid"];
}else{
sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Product TableName], @"uuid"];
}
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (![GXF_NSUSERFEFTAULTS objectForKey:ChooseProductUpdateDate]) {
[GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:ChooseProductUpdateDate];
[GXF_NSUSERFEFTAULTS synchronize];
[self getBaseDataFromServer];
}else{
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObject:self.tableView.header.lastUpdatedTime];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[self tableViewRefresh];
}
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:[Product class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
- (void)sureClick{
if(self.isMoreChose){
}else{
if (self.dataArr.count > 0) {
if (_currentIndexPath) {
Product *product = self.dataArr[_currentIndexPath.row];
//block 回调
self.choseProduct(product);
}
}
}
[self PopViewControllerAnimated:YES];
}
>>>>>>> e6b29715c43eb45494ed926219a5a1609fa46838
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
......
......@@ -50,7 +50,7 @@
"Survey7" = "新建发运单";
"Survey8" = "查看发运单";
"Survey9" = "新建加工单";
"EditorShopDetail" ="编辑商品明细";
"EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细";
// Store
......@@ -195,5 +195,21 @@
"AddSurvey" = "新建行情调研";
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
//Business
"Business" = "业务";
"Announcement" = "公告";
"AddSurvey" = "新建行情调研";
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
"Survey7" = "新建发运单";
"Survey8" = "查看发运单";
"Survey9" = "新建加工单";
"EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细";
......@@ -182,6 +182,24 @@
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
//Business
"Business" = "业务";
"Announcement" = "公告";
"AddSurvey" = "新建行情调研";
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
"Survey7" = "新建发运单";
"Survey8" = "查看发运单";
"Survey9" = "新建加工单";
"EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细";
......@@ -193,3 +211,4 @@
"VendorTitle" = "供应商";
"WarehouseTitle" = "加工工厂";
"ProductUnitTitle" = "商品单位";
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