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

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

parents 739d52c3 cad79801
......@@ -6,5 +6,6 @@ pod 'SSKeychain', '~> 1.2.3'
pod 'FMDB', '~> 2.5'
pod 'Base64nl', '~> 1.2'
pod 'Reveal-iOS-SDK', '~> 1.5.1'
pod 'BaiduMapAPI', '~> 2.8.0’
pod 'BaiduMapAPI', '~> 2.7.0'
pod 'MJRefresh', '~> 2.2.0'
pod 'IQKeyboardManager', '~> 3.2.3'
\ No newline at end of file
......@@ -20,20 +20,14 @@ PODS:
- AFNetworking/UIKit (2.5.4):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- BaiduMapAPI (2.8.0):
- BaiduMapAPI/All (= 2.8.0)
- BaiduMapAPI/All (2.8.0):
- BaiduMapAPI/Core
- BaiduMapAPI/Extend
- BaiduMapAPI/Core (2.8.0)
- BaiduMapAPI/Extend (2.8.0):
- BaiduMapAPI/Core
- BaiduMapAPI (2.7.0)
- Base64nl (1.2)
- FMDB (2.5):
- FMDB/standard (= 2.5)
- FMDB/common (2.5)
- FMDB/standard (2.5):
- FMDB/common
- IQKeyboardManager (3.2.4)
- MBProgressHUD (0.9.1)
- MJRefresh (2.2.0)
- Reveal-iOS-SDK (1.5.1)
......@@ -44,9 +38,10 @@ PODS:
DEPENDENCIES:
- AFNetworking (~> 2.5.4)
- BaiduMapAPI (~> 2.8.0)
- BaiduMapAPI (~> 2.7.0)
- Base64nl (~> 1.2)
- FMDB (~> 2.5)
- IQKeyboardManager (~> 3.2.3)
- MBProgressHUD (~> 0.9.1)
- MJRefresh (~> 2.2.0)
- Reveal-iOS-SDK (~> 1.5.1)
......@@ -55,13 +50,14 @@ DEPENDENCIES:
SPEC CHECKSUMS:
AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e
BaiduMapAPI: e066aa1e85f9fee77a1bc071afb67552852bb0fb
BaiduMapAPI: d6433624b0b4dd156f2d842f394a5011b02a6401
Base64nl: a497bdcd1c01ea793d36b399016195a8713c0e95
FMDB: 96e8f1bcc1329e269330f99770ad4285d9003e52
IQKeyboardManager: 555b1231fefafb21b19278d7cca72986a27b748b
MBProgressHUD: c47f2c166c126cf2ce36498d80f33e754d4e93ad
MJRefresh: 65a2bf14abb6feeaed8696aa1551f70e15ab0a08
Reveal-iOS-SDK: c9c55cad2729c85f6ced415f1b21857c9a2d8ef9
SDWebImage: 71b7cdc1d1721d6a82ed62889030225f2c249e29
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
COCOAPODS: 0.38.2
COCOAPODS: 0.37.1
This diff is collapsed.
......@@ -25,6 +25,7 @@
#import "Survey.h"
#import "Vendor.h"
#import "Warehouse.h"
#import "GXFProductUnit.h"
#define ICR_DB_ERROR_PARAMETER @"Parse Error: Bad Parameter(s)"
......@@ -96,7 +97,7 @@ static NSString *ICRDataBasePath = @"";
[_m_dbQueue inDatabase:^(FMDatabase *db) {
NSArray *tableNameArr =
@[ [Product class],[User class],[Survey class],[Vendor class],[Warehouse class]];
@[ [Product class],[User class],[Survey class],[Vendor class],[Warehouse class],[GXFProductUnit class]];
NSMutableArray *sqlBatch = [NSMutableArray array];
NSString *sql = nil;
......
......@@ -231,6 +231,29 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//1.7 商品单位
- (void)getProductunitWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//7.1 保存加工单(写)
- (void)saveProcessWithAuthenticode:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//7.2 获取加工单列表(读)
- (void)processQueryWithBillData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//7.3 加工单明细(读) [已实现]
- (void)getResultWithProcessUuid:(NSString *)processUuid
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//添加采购单
- (void)savePurchaseWithData:(id)data
success:(void (^)(id))succ
......@@ -250,6 +273,7 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail;
@end
......@@ -41,4 +41,28 @@
#import "NSData+EncodeAdditions.h"
#import "UIScrollView+Content.h"
//Avatar
//颜色
#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_LABLE_FONT FontSize(15)
// 高度
#define NavigationBarHeight 64
#define BottomViewHeight 60
#define GXF_TABLEVIEW_NOMALCELL_HEIGHT 44
#define KeyboardHeight 258
#define SEARCH_TOP_HEIGHT 50
#define SEARCH_TABLECELL_HEIGHT 50
#endif
......@@ -13,4 +13,15 @@
#define KNOTIFICATION_changeIsSelectedFunctions @"KNOTIFICATION_changeIsSelectedFunctions"
//Avatar
#define KNOTIFICATION_saveMaterial @"KNOTIFICATION_saveMaterial"
#define KNOTIFICATION_editMaterial @"KNOTIFICATION_editMaterial"
#define KNOTIFICATION_saveProduct @"KNOTIFICATION_saveProduct"
#define KNOTIFICATION_editProduct @"KNOTIFICATION_editProduct"
#define KNOTIFICATION_deleteProduct @"KNOTIFICATION_deleteProduct"
#endif
......@@ -36,6 +36,7 @@
+ (NSString *)stringFromDate:(NSDate*)aDate;
+ (NSString*)dictionaryToJson:(id)dic;
+ (NSString *)checkString:(NSString *)str;
+ (BOOL)checkStringIsNilOrSpance: (NSString *)str;
+ (NSMutableAttributedString *)setTextViewFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color;
+ (NSString *)trimmingCharacters:(NSString *)str;
+ (int)compareDate:(NSString*)oneDate withDate:(NSString*)twoDate;
......
......@@ -198,6 +198,13 @@
return (str)?str:@"";
}
+ (BOOL)checkStringIsNilOrSpance:(NSString *)str {
if (!str || [str isEqualToString:@"" ] || [str isEqual:[NSNull null]]) {
return YES;
} else {
return NO;
}
}
+ (NSMutableAttributedString *)setTextViewFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
paragraphStyle.lineSpacing = lineHeight;
......
......@@ -11,5 +11,4 @@
@interface IBTTableViewCell : UITableViewCell
- (void)setAccessoryType:(UITableViewCellAccessoryType)accessoryType;
@end
......@@ -10,4 +10,10 @@
@interface IBTUILabel : UILabel
- (instancetype)initWithFrame:(CGRect)frame
Text: (NSString *)text
textAligment: (NSTextAlignment)textAlignment
backgroundColor: (UIColor *)bgColor
textColor: (UIColor *)textColor
font: (UIFont *)font;
@end
......@@ -21,7 +21,29 @@
return self;
}
/*
- (instancetype)initWithFrame:(CGRect)frame
Text: (NSString *)text
textAligment: (NSTextAlignment)textAlignment
backgroundColor: (UIColor *)bgColor
textColor: (UIColor *)textColor
font: (UIFont *)font
{
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
// IBTUILabel *lbl = [[IBTUILabel alloc]initWithFrame:frame];
self.text = text;
self.textAlignment = textAlignment;
self.backgroundColor = bgColor;
self.textColor = textColor;
self.font = font;
return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
......
......@@ -132,7 +132,7 @@
[self PushViewController:svc animated:YES];
}
break;
case kFunctionSeeSurvey://查看行情
case kFunctionSeeSurvey://查看行情调研
{
SurveyViewController *svc = [[SurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey"];
......
//
// GXFPaging.h
// XFFruit
//
// Created by freecui on 15/9/2.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface GXFPaging : NSObject
@property (nonatomic, assign) NSInteger pageNumber; //页码
@property (nonatomic, assign) NSInteger pageSize;// 分页大小
@property (nonatomic, assign) NSInteger page;//当前分页
@property (nonatomic, assign) NSInteger pageCount;//总页数
@property (nonatomic, assign) NSInteger recordCount;//总记录数
- (instancetype)initWithPageNumber: (NSInteger)pageNumber
andPageSize: (NSInteger)pageSize;
@end
//
// GXFPaging.m
// XFFruit
//
// Created by freecui on 15/9/2.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFPaging.h"
@implementation GXFPaging
- (instancetype)initWithPageNumber:(NSInteger)pageNumber andPageSize:(NSInteger)pageSize {
self = [super init];
if (!self) {
return nil;
}
self.pageNumber = pageNumber;
self.pageSize = pageSize;
return self;
}
@end
//
// ProductUnit.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface GXFProductUnit : IBTModel
@property (nonatomic, copy) NSString *uuid;//唯一标识
@property (nonatomic, copy) NSString *name;//名称
@property (nonatomic, assign) BOOL enabled;//是否启用
@property (nonatomic, strong) NSDate *create_time; //创建时间
@property (nonatomic, copy) NSString *create_id;//创建人代码
@property (nonatomic, copy) NSString *crete_operName;//创建人名称
@property (nonatomic, strong) NSDate *lastModified_time;//最后修改时间
@property (nonatomic, copy) NSString *lastModified_id;//最后修改人代码
@property (nonatomic, copy) NSString *lastModified_operName;//最后修改人名称
@end
//
// ProductUnit.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFProductUnit.h"
@implementation GXFProductUnit
+ (NSDictionary *)specialKeysAndReplaceKeys {
return @{ @"sID" : [[self class] PrimaryKey], };
}
+ (NSString *)PrimaryKey {
return @"uuid";
}
@end
//
// GXFSearchVendorViewController.h
// XFFruit
// 供应商选择界面
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFBaseSearchViewController.h"
typedef void(^ChoseVendor)(NSArray *vendor);
@interface GXFSearchVendorViewController : UIViewController
@property (nonatomic,copy)ChoseVendor choseVendor;
- (instancetype)initWithTitle: (NSString *)title;
- (instancetype)initWithTitle: (NSString *)title
isMoreChoices: (BOOL)isMoreChoices;
@end
//
// GXFVendorViewController.h
// XFFruit
//
// Created by freecui on 15/9/2.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFVendorViewController : UIViewController
typedef void(^ChoseVendor)(NSArray *vendor);
@property (nonatomic,copy)ChoseVendor choseVendor;
- (instancetype)initWithTitle: (NSString *)title;
- (instancetype)initWithTitle: (NSString *)title
isMoreChoices: (BOOL)isMoreChoices;
@end
//
// GXFSearchVendorViewController.m
// XFFruit
// 供应商选择界面
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFVendorViewController.h"
#import "MaskCell.h"
#import "GXFSearchView.h"
#import "Vendor.h"
@interface GXFVendorViewController ()<UITableViewDataSource,UITableViewDelegate,GXFSearchViewDelegate>
{
// UITextField *_selectTextFiled;
NSIndexPath *_currentIndexPath;
}
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) GXFSearchView *c_searchView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,assign) BOOL d_isMoreChoices;//是否是多选
@end
@implementation GXFVendorViewController
- (instancetype)initWithTitle: (NSString *)title {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = NO;
return self;
}
- (instancetype) initWithTitle:(NSString *)title isMoreChoices:(BOOL)isMoreChoices {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = isMoreChoices;
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self initSubViews];
}
- (void)initData{
self.dataArr = [NSMutableArray array];
self.indexArr = [NSMutableArray array];
[self fetchVendorList];
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchVendorList];
}else{
[IBTLoadingView showTips:data];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
}
- (void)fetchVendorList{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Vendor TableName], @"uuid"];;
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[strongSelf.f_tableView reloadData];
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:[Vendor class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
- (void)initSubViews {
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClicked)];
self.navigationItem.rightBarButtonItem = rightItem;
self.c_searchView = [[GXFSearchView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, SEARCH_TABLECELL_HEIGHT)];
self.c_searchView.delegate = self;
[self.view addSubview:_c_searchView];
self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, SEARCH_TABLECELL_HEIGHT, self.view.width, self.view.height - SEARCH_TABLECELL_HEIGHT - NavigationBarHeight) style:UITableViewStylePlain];
self.f_tableView.delegate = self;
self.f_tableView.dataSource = self;
[self.view addSubview: _f_tableView];
}
- (void)sureClicked {
if (_d_isMoreChoices) {
NSMutableArray *arr = [[NSMutableArray alloc]init];
for (NSIndexPath *index in self.indexArr) {
Vendor *vendor = self.dataArr[index.row];
[arr addObject:vendor];
}
self.choseVendor(arr);
}else{
NSMutableArray *arr = [[NSMutableArray alloc]init];
if (self.dataArr.count > 0) {
Vendor *vendor = self.dataArr[_currentIndexPath.row];
[arr addObject:vendor];
self.choseVendor(arr);
}
}
[self PopViewControllerAnimated:YES];
}
- (void)searchViewClickedDelegateBtn {
if (_d_isMoreChoices) {
[self.indexArr removeAllObjects];
}else{
_currentIndexPath = nil;
}
self.c_searchView.f_textFiled.text = @"";
//_selectTextFiled.text = @"";
[self.f_tableView reloadData];
}
#pragma mark - UITableViewDataSource 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50;
}
- (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:self.view.width totalHeight:SEARCH_TABLECELL_HEIGHT];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (_d_isMoreChoices) {
if ([self hasIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
}
//cell的现实内容
if (self.dataArr.count > 0) {
Vendor *vendor = self.dataArr[indexPath.row];
NSString *proStr = [NSString stringWithFormat:@"%@[%@]",vendor.name,vendor.code];
[cell setTitleStr:proStr];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (_d_isMoreChoices == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
if (![self hasIndexPath:indexPath]) {
[self.indexArr addObject:indexPath];
}
NSString *personStr = @"";
for (NSIndexPath *index in self.indexArr) {
Vendor *vendor = self.dataArr[index.row];
if (personStr.length == 0) {
personStr = [personStr stringByAppendingFormat:@"%@",vendor.name];
}else{
personStr = [personStr stringByAppendingFormat:@"、%@",vendor.name];
}
}
self.c_searchView.f_textFiled.text = personStr;
// _selectTextFiled.text = personStr;
}else{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
_currentIndexPath = indexPath;
Vendor *vendor = self.dataArr[indexPath.row];
self.c_searchView.f_textFiled.text = vendor.name;
}
}
- (BOOL)hasIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in self.indexArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// GXFWarehouseViewController.h
// XFFruit
//
// Created by freecui on 15/9/2.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFWarehouseViewController : UIViewController
typedef void(^blockChooceWarehouse)(NSArray *warehouses);
@property (nonatomic,copy)blockChooceWarehouse chooceWarehouse;
- (instancetype)initWithTitle: (NSString *)title;
- (instancetype)initWithTitle: (NSString *)title
isMoreChoices: (BOOL)isMoreChoices;
@end
//
// GXFSearchVendorViewController.m
// XFFruit
// 供应商选择界面
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFWarehouseViewController.h"
#import "MaskCell.h"
#import "GXFSearchView.h"
#import "Warehouse.h"
@interface GXFWarehouseViewController ()<UITableViewDataSource,UITableViewDelegate,GXFSearchViewDelegate>
{
NSIndexPath *_currentIndexPath;
}
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) GXFSearchView *c_searchView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,assign) BOOL d_isMoreChoices;//是否是多选
@end
@implementation GXFWarehouseViewController
- (instancetype)initWithTitle: (NSString *)title {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = NO;
return self;
}
- (instancetype) initWithTitle:(NSString *)title isMoreChoices:(BOOL)isMoreChoices {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = isMoreChoices;
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self initSubViews];
}
- (void)initData{
self.dataArr = [NSMutableArray array];
self.indexArr = [NSMutableArray array];
[self fetchVendorList];
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchVendorList];
}else{
[IBTLoadingView showTips:data];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:100 success:succ failure:fail];
}
- (void)fetchVendorList{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Warehouse TableName], @"uuid"];;
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[strongSelf.f_tableView reloadData];
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:[Warehouse class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
- (void)initSubViews {
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClicked)];
self.navigationItem.rightBarButtonItem = rightItem;
self.c_searchView = [[GXFSearchView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, SEARCH_TABLECELL_HEIGHT)];
self.c_searchView.delegate = self;
[self.view addSubview:_c_searchView];
self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, SEARCH_TABLECELL_HEIGHT, self.view.width, self.view.height - SEARCH_TABLECELL_HEIGHT - NavigationBarHeight) style:UITableViewStylePlain];
self.f_tableView.delegate = self;
self.f_tableView.dataSource = self;
[self.view addSubview: _f_tableView];
}
- (void)sureClicked {
if (_d_isMoreChoices) {
NSMutableArray *arr = [[NSMutableArray alloc]init];
for (NSIndexPath *index in self.indexArr) {
Warehouse *warehouse = self.dataArr[index.row];
[arr addObject:warehouse];
}
self.chooceWarehouse(arr);
}else{
NSMutableArray *arr = [[NSMutableArray alloc]init];
if (self.dataArr.count > 0) {
Warehouse *warehouse = self.dataArr[_currentIndexPath.row];
[arr addObject:warehouse];
self.chooceWarehouse(arr);
}
}
[self PopViewControllerAnimated:YES];
}
- (void)searchViewClickedDelegateBtn {
if (_d_isMoreChoices) {
[self.indexArr removeAllObjects];
}else{
_currentIndexPath = nil;
}
self.c_searchView.f_textFiled.text = @"";
//_selectTextFiled.text = @"";
[self.f_tableView reloadData];
}
#pragma mark - UITableViewDataSource 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50;
}
- (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:self.view.width totalHeight:SEARCH_TABLECELL_HEIGHT];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (_d_isMoreChoices) {
if ([self hasIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
}
//cell的现实内容
if (self.dataArr.count > 0) {
Warehouse *warehouse = self.dataArr[indexPath.row];
NSString *proStr = [NSString stringWithFormat:@"%@[%@]",warehouse.name,warehouse.code];
[cell setTitleStr:proStr];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (_d_isMoreChoices == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
if (![self hasIndexPath:indexPath]) {
[self.indexArr addObject:indexPath];
}
NSString *personStr = @"";
for (NSIndexPath *index in self.indexArr) {
Warehouse *warehouse = self.dataArr[indexPath.row];
if (personStr.length == 0) {
personStr = [personStr stringByAppendingFormat:@"%@",warehouse.name];
}else{
personStr = [personStr stringByAppendingFormat:@"、%@",warehouse.name];
}
}
self.c_searchView.f_textFiled.text = personStr;
// _selectTextFiled.text = personStr;
}else{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
_currentIndexPath = indexPath;
Warehouse *warehouse = self.dataArr[indexPath.row];
self.c_searchView.f_textFiled.text = warehouse.name;
}
}
- (BOOL)hasIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in self.indexArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
......@@ -25,12 +25,14 @@
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
#import "GXFNewProcessViewController.h"
#import "GXFFunctionsViewController.h"
#import "GXFDisplayFunction.h"
#import "GXFFunction.h"
#import "GXFNoticeFunctionTableViewCell.h"
#import "GXFFunctionCollectionViewCell.h"
#import "GXFSeeProcessViewController.h"
......@@ -57,6 +59,7 @@
@implementation ICRHomeViewController
static NSString *cellID = @"cell";
static NSString *secondCellID = @"secondCell";
static NSString *collectionCellID = @"collectionCell";
//static CGFloat colletionCellHeight [UIScreen mainScreen].bounds.size.width / 3.0
#pragma mark - Life Cycle
......@@ -69,7 +72,7 @@ static NSString *collectionCellID = @"collectionCell";
}
- (void)viewWillAppear:(BOOL)animated {
}
- (void)setupSubviews {
......@@ -196,6 +199,11 @@ static NSString *collectionCellID = @"collectionCell";
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame));
}
} else {
while ([cell.contentView.subviews lastObject] != nil) {
[(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
}
}
return cell;
......@@ -261,6 +269,17 @@ static NSString *collectionCellID = @"collectionCell";
[self PushViewController:pvc animated:YES];
}
break;
case kFunctionNewProcessing:{
GXFNewProcessViewController *pvc = [[GXFNewProcessViewController alloc]init];
//pvc.title = @"采购单";
[self PushViewController:pvc animated:YES];
}
break;
case kFunctionSeeProcessing:{
GXFSeeProcessViewController *seeProcessVC= [[GXFSeeProcessViewController alloc]init];
[self PushViewController:seeProcessVC animated:YES];
}
break;
default:
return;
break;
......
//
// GXFProcessViewController.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface GXFNewProcessViewController : UIViewController
@end
//
// GXFSeeProcessViewController.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFSeeProcessViewController : UIViewController
@end
//
// GXFSeeProcessViewController.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFSeeProcessViewController.h"
@interface GXFSeeProcessViewController ()
@end
@implementation GXFSeeProcessViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated {
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
//[strongSelf fetchtSurveyList:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSDictionary *queryOrderDict = @{@"direction":@"desc",@"field":@"billNumber"};
NSDictionary *dict = @{
@"billNumberLike":@"",
@"state":@"",
@"titleLike":@"",
@"queryOrders":@[queryOrderDict],
@"pageNumber":@(0),
@"pageSize":@(20)};
[[ICRHTTPController sharedController] querySurveyWithBillData:dict success:succ failure:fail];
}
- (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
//
// GXFBaseSearchViewController.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIViewController.h"
#define TopMargin 50
#define TableCellHeight 50
@class GXFBaseSearchViewController;
@protocol GXFBaseSearchViewControllerDelegate <NSObject>
- (void)baseSearchViewControllernClickedNavigationRightButton;
- (void)baseSearchViewControllerClickedDelegateButton;
@end
@interface GXFBaseSearchViewController : IBTUIViewController
//@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) UITextField *f_textFiled;
@property (nonatomic, strong) id<GXFBaseSearchViewControllerDelegate>delegate;
- (instancetype)initWithSubViews;
@end
//
// GXFBaseSearchViewController.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define BACKGROUND_CLOLOR HexColor(@"f8f8f8");
#import "GXFBaseSearchViewController.h"
@interface GXFBaseSearchViewController ()
@end
@implementation GXFBaseSearchViewController
- (instancetype)initWithSubViews {
self = [super init];
if (!self) {
return nil;
}
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClick)];
self.navigationItem.rightBarButtonItem = rightItem;
self.f_textFiled = [[UITextField alloc]initWithFrame:CGRectMake(20, 5, self.view.width - 20 * 2, TopMargin - 10)];
self.f_textFiled.textAlignment = NSTextAlignmentLeft;
self.f_textFiled.background = [UIImage imageNamed:@"textFiled"];
self.f_textFiled.font = FontSize(15);
[self.view addSubview:_f_textFiled];
UIImageView *leftImgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 35, 40)];
leftImgV.image = [UIImage imageNamed:@"search"];
self.f_textFiled.leftView = leftImgV;
self.f_textFiled.leftViewMode = UITextFieldViewModeAlways;
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[rightBtn setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal];
rightBtn.frame = CGRectMake(0, 0, 35, 40);
[rightBtn addTarget:self action:@selector(deleteClicked) forControlEvents:UIControlEventTouchUpInside];
self.f_textFiled.rightView = rightBtn;
self.f_textFiled.rightViewMode = UITextFieldViewModeAlways;
self.view.backgroundColor = BACKGROUND_CLOLOR;
// self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, TopMargin, self.view.width, self.view.height - TopMargin - NavigationBarHeight) style:UITableViewStylePlain];
// [self.view addSubview:_f_tableView];
return self;
}
- (void)sureClick {
if ([_delegate respondsToSelector:@selector(baseSearchViewControllernClickedNavigationRightButton)]) {
[_delegate baseSearchViewControllernClickedNavigationRightButton];
}
}
- (void)deleteClicked {
if ([_delegate respondsToSelector:@selector(baseSearchViewControllerClickedDelegateButton)]) {
[_delegate baseSearchViewControllernClickedNavigationRightButton];
}
}
- (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
//
// GXFBottomView.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIView.h"
@class GXFBottomView;
@protocol GXFBottomViewDelegate <NSObject>
- (void)bottomViewleftButtonClicked: (UIButton *)leftBtn;
- (void)bottomViewRightButtonClicked: (UIButton *)rightBtn;
@end
@interface GXFBottomView : IBTUIView
typedef NS_ENUM(NSInteger, buttonTag){
leftTag = 1,
rightTag
};
@property (nonatomic, weak) id<GXFBottomViewDelegate>delegate;
@property (nonatomic, strong) UIButton *f_leftBtn;
@property (nonatomic, strong) UIButton *f_rightBtn;
- (instancetype)initWithFrame:(CGRect)frame
LeftBtnTitle: (NSString *)leftTitle
rightBtnTitle: (NSString *)rightTitle;
- (instancetype)initWithFrame:(CGRect)frame
leftButtonColor: (UIColor *)leftBtnColor
rightButtonColor: (UIColor *)rightBtnColor
LeftBtnTitle: (NSString *)leftTitle
rightBtnTitle: (NSString *)rightTitle;
@end
//
// GXFBottomView.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFBottomView.h"
#define LEFT_PADDING (15)
#define TOP_PADDING (8)
#define BUTTON_WIDTH (self.width - 3.0 * LEFT_PADDING ) / 2.0
#define BUTTON_HEIGHT (44)
#define LEFT_BUTTON_COLOR HexColor(@"50bd62")
#define RIGHT_BUTTON_COLOR HexColor(@"f69100")
@interface GXFBottomView ()
@end
@implementation GXFBottomView
- (instancetype)initWithFrame:(CGRect)frame LeftBtnTitle:(NSString *)leftTitle rightBtnTitle:(NSString *)rightTitle{
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
CGRect leftRect = CGRectMake(LEFT_PADDING, TOP_PADDING, BUTTON_WIDTH, BUTTON_HEIGHT);
UIButton *leftBtn = [IBTCustomButtom creatButtonWithFrame:leftRect target:self sel:@selector(leftBtnClicked) tag:leftTag image:nil title:leftTitle titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:LEFT_BUTTON_COLOR];
self.f_leftBtn = leftBtn;
[self addSubview:_f_leftBtn];
CGRect rightRect = CGRectMake(leftBtn.right + LEFT_PADDING, TOP_PADDING, BUTTON_WIDTH, BUTTON_HEIGHT);
UIButton *rightBtn = [IBTCustomButtom creatButtonWithFrame:rightRect target:self sel:@selector(rightBtnClicked) tag:rightTag image:nil title:rightTitle titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:RIGHT_BUTTON_COLOR];
self.f_rightBtn = rightBtn;
[self addSubview:_f_rightBtn];
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
leftButtonColor: (UIColor *)leftBtnColor
rightButtonColor: (UIColor *)rightBtnColor
LeftBtnTitle: (NSString *)leftTitle
rightBtnTitle: (NSString *)rightTitle {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
CGRect leftRect = CGRectMake(LEFT_PADDING, TOP_PADDING, BUTTON_WIDTH, BUTTON_HEIGHT);
UIButton *leftBtn = [IBTCustomButtom creatButtonWithFrame:leftRect target:self sel:@selector(leftBtnClicked) tag:leftTag image:nil title:leftTitle titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:leftBtnColor];
self.f_leftBtn = leftBtn;
[self addSubview:_f_leftBtn];
CGRect rightRect = CGRectMake(leftBtn.right + LEFT_PADDING, TOP_PADDING, BUTTON_WIDTH, BUTTON_HEIGHT);
UIButton *rightBtn = [IBTCustomButtom creatButtonWithFrame:rightRect target:self sel:@selector(rightBtnClicked) tag:rightTag image:nil title:rightTitle titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:rightBtnColor];
self.f_rightBtn = rightBtn;
[self addSubview:_f_rightBtn];
return self;
}
- (void)leftBtnClicked {
if ([_delegate respondsToSelector:@selector(bottomViewleftButtonClicked:)]) {
[_delegate bottomViewleftButtonClicked:_f_leftBtn];
}
}
- (void)rightBtnClicked {
if ([_delegate respondsToSelector:@selector(bottomViewRightButtonClicked:)]) {
[_delegate bottomViewRightButtonClicked:_f_rightBtn];
}
}
@end
//
// GXFButtonAndLineView.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFButtonAndLineView : UIView
@property (nonatomic, strong) UIButton *f_btn;
@property (nonatomic, strong) UIView *f_line;
- (instancetype)initViewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color;
- (instancetype)initViewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color
action:(SEL)action
forControlEvents:(UIControlEvents)controlEvents;
@end
//
// GXFButtonAndLineView.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFButtonAndLineView.h"
@implementation GXFButtonAndLineView
- (instancetype)initViewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, self.width, self.height - 1);
[btn setTitle:title forState:UIControlStateNormal];
CGSize labelSize = [btn.titleLabel.text sizeWithAttributes:@{NSFontAttributeName: btn.titleLabel.font}];
UIView *line = [[UIView alloc]initWithFrame:CGRectMake((self.width - labelSize.width ) * 0.5, btn.bottom, labelSize.width, 1)];
if (isSelected) {
[btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
line.backgroundColor = GXF_GREEN_COLOR;
} else {
[btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
line.backgroundColor = [UIColor whiteColor];
}
self.f_btn = btn;
self.f_line = line;
[self addSubview:line];
[self addSubview:btn];
return self;
}
- (instancetype)initViewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color
action:(SEL)action
forControlEvents:(UIControlEvents)controlEvents
{
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, self.width, self.height - 1);
[btn setTitle:title forState:UIControlStateNormal];
[btn addTarget:self action:action forControlEvents:controlEvents];
CGSize labelSize = [btn.titleLabel.text sizeWithAttributes:@{NSFontAttributeName: btn.titleLabel.font}];
UIView *line = [[UIView alloc]initWithFrame:CGRectMake((self.width - labelSize.width ) * 0.5, btn.bottom, labelSize.width, 1)];
if (isSelected) {
[btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
line.backgroundColor = GXF_GREEN_COLOR;
} else {
[btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
line.backgroundColor = [UIColor whiteColor];
}
self.f_btn = btn;
self.f_line = line;
[self addSubview:line];
[self addSubview:btn];
return self;
}
@end
//
// GXFPopNewMaterialView.h
// XFFruit
//
// Created by freecui on 15/9/3.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFPopNewMaterialViewController : UIViewController
@end
//
// GXFPopNewProductView.h
// XFFruit
//
// Created by freecui on 15/9/3.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@class GXFProcessProduct;
@interface GXFPopNewProductViewController : UIViewController
- (instancetype)initWithProcessProduct: (GXFProcessProduct *)processProduct
isEdit: (BOOL) isEdited;
@end
//
// GXFProcess.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFProcessBill : IBTModel
@property (nonatomic, copy) NSString *uuid;//唯一标识
@property (nonatomic, copy) NSString *version;//版本
@property (nonatomic, copy) NSString *billNumber;//加工单号
@property (nonatomic, copy) NSString *state;// initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
@property (nonatomic, copy) NSString *title;//标题
@property (nonatomic, strong) NSDate *beginDate;//开始日期
@property (nonatomic, strong) NSDate *endDate;//结束日期
@property (nonatomic,copy)NSString *vendor_uuid;//供应商uuid
@property (nonatomic,copy)NSString *vendor_code;//供应商代码
@property (nonatomic,copy)NSString *vendor_name;//供应商姓名
@property (nonatomic,copy)NSString *warehouse_uuid;//加工工厂uuid
@property (nonatomic,copy)NSString *warehouse_code;//加工工厂代码
@property (nonatomic,copy)NSString *warehouse_name;//加工工厂姓名
@property (nonatomic,copy)NSString *contact;//联系人
@property (nonatomic,copy)NSString *contactPhone;//联系人电话
@property (nonatomic,copy)NSNumber *total;//总金额
@property (nonatomic,copy)NSString *remark;//备注
@property (nonatomic, strong) NSDate *create_time;//创建时间
@property (nonatomic, copy) NSString *create_id;// 创建人代码
@property (nonatomic, copy) NSString *create_operName;//创建人名称
@property (nonatomic, strong) NSDate *lastModified_time;//最后修改时间
@property (nonatomic, copy) NSString *lastModified_id;//最后修改人代码
@property (nonatomic, copy) NSString *lastModified_operName;//最后修改人名称
//@property (nonatomic,copy)NSString *materials;原料明细
//@property (nonatomic,copy)NSString *procucts;商品明细
@end
//
// GXFProcess.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFProcessBill.h"
@implementation GXFProcessBill
@end
//
// GXFMaterial.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFProcessMaterial : IBTModel
@property (nonatomic, copy) NSString *uuid;//唯一标识
@property (nonatomic, copy) NSString *productUuid;//商品uuid
@property (nonatomic, copy) NSString *productCode;//商品代码
@property (nonatomic,copy) NSString *productName;//商品名称
@property (nonatomic,strong) NSDate *instockDate;//入库日期
@property (nonatomic,copy) NSString *place;//产地
@property (nonatomic,copy) NSString *quality;//品质信息
@property (nonatomic,strong) NSNumber *baseQty;//基础数量
@property (nonatomic,strong) NSNumber *basePrice;//基础单价
@property (nonatomic,strong) NSNumber *total;//金额
@property (nonatomic,copy) NSString *remark;//备注
@end
//
// GXFMaterial.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFProcessMaterial.h"
@implementation GXFProcessMaterial
@end
//
// GXFProcessMaterialTableViewCell.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GXFProcessMaterial.h"
@interface GXFProcessMaterialTableViewCell : UITableViewCell
@property (nonatomic,strong)UIImageView *smallImageView;
@property (nonatomic,strong)UIButton *editBtn;
@property (nonatomic,strong)UILabel *seqLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
processMaterial: (GXFProcessMaterial *)processMaterial;
@end
@interface GXFProcessMaterialTableViewCell (Configure)
- (void)updateWithProcessMaterial: (GXFProcessMaterial *)processMaterial;
@end
\ No newline at end of file
//
// GXFProcessMaterialTableViewCell.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#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
#import "GXFProcessMaterialTableViewCell.h"
@interface GXFProcessMaterialTableViewCell ()
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *baseQtyLabel;
@property (nonatomic,strong)UILabel *instockDateLabel;
@property (nonatomic,strong)UILabel *showTitleLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
@property (nonatomic,strong)UILabel *showDateLabel;
@property (nonatomic,strong)UILabel *basebaseQtyLabel;
@property (nonatomic,strong)UILabel *totalbaseQtyLabel;
@property (nonatomic,strong)UILabel *placeLabel;
@property (nonatomic,strong)UILabel *qualityLabel;
@property (nonatomic,strong)UILabel *remarkLabel;
@end
@implementation GXFProcessMaterialTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
processMaterial: (GXFProcessMaterial *)processMaterial {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayoutWithprocessMaterial: processMaterial];
}
return self;
}
- (void)bulidLayoutWithprocessMaterial: (GXFProcessMaterial *)processMaterial
{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
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 = processMaterial.productUuid;//@"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 = processMaterial.productName;//@"苹果桃子";
self.titleLabel.font = FontSize(ContentSize);
self.baseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.baseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.baseQtyLabel.textColor = HexColor(ContentColor);
self.baseQtyLabel.text = [NSString stringWithFormat:@"%@",processMaterial.baseQty];
self.baseQtyLabel.font = FontSize(ContentSize);
self.instockDateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.baseQtyLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.instockDateLabel.textAlignment = NSTextAlignmentLeft;
self.instockDateLabel.text = [NSString stringWithFormat:@"%@",processMaterial.instockDate
];
self.instockDateLabel.textColor = HexColor(ContentColor);
self.instockDateLabel.font = FontSize(ContentSize);
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
// self.showView.hidden = YES;
self.showView.clipsToBounds = 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 = [NSString stringWithFormat:@"原料:%@",processMaterial.productName];
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.basebaseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showBaseCountLabel.frame), CGRectGetMaxY(self.showTitleLabel.frame), ShowWidth, ShowHeight))];
self.basebaseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.basebaseQtyLabel.textColor = HexColor(ShowColor);
self.basebaseQtyLabel.text = @"基础单价:11元";
self.basebaseQtyLabel.font = FontSize(ShowSize);
self.totalbaseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.showDateLabel.frame), ShowWidth, ShowHeight))];
self.totalbaseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.totalbaseQtyLabel.textColor = HexColor(ShowColor);
self.totalbaseQtyLabel.text = @"总金额:1000";
self.totalbaseQtyLabel.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.totalbaseQtyLabel.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:@"edit"] 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.baseQtyLabel];
// [self.contentView addSubview:self.standardLabel];
[self.contentView addSubview:self.instockDateLabel];
[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.basebaseQtyLabel];
[self.showView addSubview:self.totalbaseQtyLabel];
[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
@implementation GXFProcessMaterialTableViewCell (Configure)
- (void)updateWithProcessMaterial:(GXFProcessMaterial *)processMaterial {
}
@end
//
// GXFProduct.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFProcessProduct : IBTModel
@property (nonatomic, copy) NSString *uuid;//唯一标识
@property (nonatomic, copy) NSString *productUuid;//商品uuid
@property (nonatomic, copy) NSString *productCode;//商品代码
@property (nonatomic,copy) NSString *productName;//商品名称
@property (nonatomic,strong) NSDate *outstockDate;//出库日期
@property (nonatomic,copy) NSString *unit;//包装单位
@property (nonatomic,strong) NSNumber *qpc;//包装规格
@property (nonatomic,copy) NSString *qpcStr;//包装规格描述
@property (nonatomic,strong) NSNumber *quantity;//包装数量
@property (nonatomic,strong) NSNumber *baseQty;//基础数量
@property (nonatomic,copy) NSString *remark;//备注
@end
//
// GXFProduct.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFProcessProduct.h"
@implementation GXFProcessProduct
@end
//
// GXFProcessProductTableViewCell.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GXFProcessProduct.h"
@interface GXFProcessProductTableViewCell : UITableViewCell
@property (nonatomic,strong)UIImageView *smallImageView;
@property (nonatomic,strong)UIButton *editBtn;
@property (nonatomic,strong)UILabel *seqLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
processProduct: (GXFProcessProduct *)processProduct;
@end
//
// GXFProcessProductTableViewCell.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#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
#import "GXFProcessProductTableViewCell.h"
@interface GXFProcessProductTableViewCell ()
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *baseQtyLabel;
@property (nonatomic,strong)UILabel *instockDateLabel;
@property (nonatomic,strong)UILabel *showTitleLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
@property (nonatomic,strong)UILabel *showDateLabel;
@property (nonatomic,strong)UILabel *basebaseQtyLabel;
@property (nonatomic,strong)UILabel *totalbaseQtyLabel;
@property (nonatomic,strong)UILabel *placeLabel;
@property (nonatomic,strong)UILabel *qualityLabel;
@property (nonatomic,strong)UILabel *remarkLabel;
@end
@implementation GXFProcessProductTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
processProduct: (GXFProcessProduct *)processProduct {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayoutWithprocessProduct: processProduct];
}
return self;
}
- (void)bulidLayoutWithprocessProduct: (GXFProcessProduct *)processProduct
{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
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 = processProduct.productUuid;//@"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 = processProduct.productName;//@"苹果桃子";
self.titleLabel.font = FontSize(ContentSize);
self.baseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.baseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.baseQtyLabel.textColor = HexColor(ContentColor);
self.baseQtyLabel.text = [NSString stringWithFormat:@"%@",processProduct.baseQty];
self.baseQtyLabel.font = FontSize(ContentSize);
self.instockDateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.baseQtyLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.instockDateLabel.textAlignment = NSTextAlignmentLeft;
self.instockDateLabel.text = [NSString stringWithFormat:@"%@",processProduct.outstockDate
];
self.instockDateLabel.textColor = HexColor(ContentColor);
self.instockDateLabel.font = FontSize(ContentSize);
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
// self.showView.hidden = YES;
self.showView.clipsToBounds = 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 = [NSString stringWithFormat:@"原料:%@",processProduct.productName];
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.basebaseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showBaseCountLabel.frame), CGRectGetMaxY(self.showTitleLabel.frame), ShowWidth, ShowHeight))];
self.basebaseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.basebaseQtyLabel.textColor = HexColor(ShowColor);
self.basebaseQtyLabel.text = @"基础单价:11元";
self.basebaseQtyLabel.font = FontSize(ShowSize);
self.totalbaseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.showDateLabel.frame), ShowWidth, ShowHeight))];
self.totalbaseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.totalbaseQtyLabel.textColor = HexColor(ShowColor);
self.totalbaseQtyLabel.text = @"总金额:1000";
self.totalbaseQtyLabel.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.totalbaseQtyLabel.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:@"edit"] 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.baseQtyLabel];
// [self.contentView addSubview:self.standardLabel];
[self.contentView addSubview:self.instockDateLabel];
[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.basebaseQtyLabel];
[self.showView addSubview:self.totalbaseQtyLabel];
[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
//
// GXFSearchView.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIView.h"
@class GXFSearchView ;
@protocol GXFSearchViewDelegate <NSObject>
- (void)searchViewClickedDelegateBtn;
@end
@interface GXFSearchView : IBTUIView
@property (nonatomic, strong) UITextField *f_textFiled;
@property (nonatomic, weak) id<GXFSearchViewDelegate>delegate;
@end
//
// GXFSearchView.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define TopMargin 50
#import "GXFSearchView.h"
@interface GXFSearchView ()<UITextFieldDelegate>
@end
@implementation GXFSearchView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
self.f_textFiled = [[UITextField alloc]initWithFrame:CGRectMake(20, 5, self.width - 20 * 2, TopMargin - 10)];
self.f_textFiled.textAlignment = NSTextAlignmentLeft;
self.f_textFiled.font = FontSize(15);
[self addSubview:_f_textFiled];
UIImageView *leftImgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 35, 40)];
leftImgV.image = [UIImage imageNamed:@"search"];
self.f_textFiled.background = [UIImage imageNamed:@"textFiled"];
self.f_textFiled.leftView = leftImgV;
self.f_textFiled.leftViewMode = UITextFieldViewModeAlways;
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[rightBtn setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal];
rightBtn.frame = CGRectMake(0, 0, 35, 40);
[rightBtn addTarget:self action:@selector(deleteClicked) forControlEvents:UIControlEventTouchUpInside];
self.f_textFiled.rightView = rightBtn;
self.f_textFiled.rightViewMode = UITextFieldViewModeAlways;
return self;
}
- (void)deleteClicked {
if ([_delegate respondsToSelector:@selector(searchViewClickedDelegateBtn)]) {
[_delegate searchViewClickedDelegateBtn];
}
}
@end
//
// GXFTableViewCell.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
static NSString *noLblCell = @"noLblCell";
static NSString *lblCell = @"lblCell";
static NSString *arrowCell = @"arrowCell";
static NSString *remarkCell = @"remarkCell";
static NSString *addHeaderCell = @"addHeaderCell";
static NSString *addDetailCell = @"addDetailCell";
//static NSString *actionFootCell = @"actionFootCell";
@interface GXFTableViewCell : UITableViewCell
@property (nonatomic, strong) UITextField *f_textField;
- (instancetype)initWithStyle: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
// textField: (UITextField *)textF
hasLable: (BOOL)hasLbl
backLableText: (NSString *)lblText; //带有placeholder和label
- (instancetype)initWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
// hasLable: (BOOL)hasLbl
backLableText: (NSString *)lblText;//@"lblCell" :无箭头cellstyle为默认 :带有placeholder和label ,,没箭头可编辑
- (instancetype)initWithStyle: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder //带有placeholder分两张情况 :1),有箭头 2)没箭头可编辑
isEdit: (BOOL)isEdit;
- (instancetype)initAccessorWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder; //@"arrowCell":带有placeholder :1),有箭头
- (instancetype)initEditNoAccessorWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder; // @"noLblCell" :带有placeholder :2)没箭头可编辑
- (instancetype)initWithStyle: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
contentArray: (NSArray *)array; // cell 一行中显示的内容
//- (instancetype)initwithBottom: ()
@end
#pragma cell 默认的宽度好像是320 ????
@interface GXFTableViewCell (Frame)
- (instancetype)initWithWidth: (CGFloat)width
Style: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
// textField: (UITextField *)textF
hasLable: (BOOL)hasLbl
backLableText: (NSString *)lblText; //带有placeholder和label
- (instancetype)initWithWidth: (CGFloat)width
Style: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder //带有placeholder分两张情况 :1),有箭头 2)没箭头可编辑
isEdit: (BOOL)isEdit;
//- (instancetype)initWithWidth: (CGFloat)width
// Style: (UITableViewCellStyle)style
// reuseIdentifier: (NSString *)reuseIdentifier
// contentArray: (NSArray *)array; // cell 一行中显示的内容
@end
//
// GXFTableViewCell.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFTableViewCell.h"
@interface GXFTableViewCell ()
@end
@implementation GXFTableViewCell
//带有placeholder和label
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
textFieldPlaceholder:(NSString *)placeholder
hasLable:(BOOL)hasLbl
backLableText:(NSString *)lblText {
self = [self initWithStyle:style reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder isEdit:YES];
UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(self.width - 25, 0, 25, self.height)];
lbl.textAlignment = NSTextAlignmentLeft;
lbl.text = lblText;
[self.contentView addSubview:lbl];
return self;
}
//@"lblCell" :无箭头cellstyle为默认 :带有placeholder和label ,,没箭头可编辑
- (instancetype)initWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
// hasLable: (BOOL)hasLbl
backLableText: (NSString *)lblText {
self = [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder hasLable:YES backLableText:lblText];
return self;
return self;
}
#pragma 共同调用原始的初始化方法待有textfield
//带有placeholder分两张情况 :1),有箭头 2)没箭头可编辑
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
isEdit:(BOOL)isEdit {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (!self) {
return nil;
}
UITextField *textF = [[UITextField alloc]initWithFrame:CGRectMake(self.width * 0.2, 0, self.width * 0.8 - 30, self.height)];
textF.textAlignment = NSTextAlignmentRight;
textF.placeholder = placeholder;
textF.enabled = isEdit;
self.f_textField = textF;
[self.contentView addSubview:_f_textField];
return self;
}
//@"arrowCell":带有placeholder :1),有箭头不可编辑
- (instancetype)initAccessorWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder {
self = [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder isEdit:NO];
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return self;
}
//// @"noLblCell" :带有placeholder :2)没箭头可编辑
- (instancetype)initEditNoAccessorWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder {
self = [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder isEdit:YES];
return self;
}
// cell 一行中显示的内容
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier contentArray:(NSArray *)array {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (!self) {
return nil;
}
[self p_setSubViews:array];
return self;
}
- (void)p_setSubViews: (NSArray *)array{
for (NSInteger i = 0; i < array.count; i++) {
CGFloat lblW = self.width * 1.0 / 3.0;
CGFloat lblX = lblW * i;
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(lblX,0,lblW,self.height)];
label.font = FontSize(15);
label.textAlignment = NSTextAlignmentCenter;
label.textColor = HexColor(@"bbbbbb");
label.text = array[i];
[self.contentView addSubview:label];
}
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
@implementation GXFTableViewCell (Frame)
//带有placeholder和label
- (instancetype)initWithWidth: (CGFloat)width
Style:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
textFieldPlaceholder:(NSString *)placeholder
hasLable:(BOOL)hasLbl
backLableText:(NSString *)lblText {
self = [self initWithWidth:width Style:style reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder isEdit:YES];
self.width = width;
UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(self.width - 25, 0, 25, self.height)];
lbl.textAlignment = NSTextAlignmentLeft;
lbl.text = lblText;
[self.contentView addSubview:lbl];
return self;
}
#pragma 共同调用原始的初始化方法待有textfield
//带有placeholder分两张情况 :1),有箭头 2)没箭头可编辑
- (instancetype)initWithWidth: (CGFloat)width
Style:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
isEdit:(BOOL)isEdit {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (!self) {
return nil;
}
self.width = width;
UITextField *textF = [[UITextField alloc]initWithFrame:CGRectMake(self.width * 0.2, 0, self.width * 0.8 - 30, self.height)];
textF.textAlignment = NSTextAlignmentRight;
textF.placeholder = placeholder;
textF.enabled = isEdit;
self.f_textField = textF;
[self.contentView addSubview:_f_textField];
return self;
}
//// cell 一行中显示的内容
//- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier contentArray:(NSArray *)array {
// self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
// if (!self) {
// return nil;
// }
// [self p_setSubViews:array];
// return self;
//}
@end
......@@ -113,13 +113,13 @@
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:TableHeight];
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:SEARCH_TABLECELL_HEIGHT];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (self.isMoreChose) {
if ([self isHaveIndexPath:indexPath]) {
if ([self hasIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
......@@ -157,7 +157,7 @@
if (self.isMoreChose == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
if (![self isHaveIndexPath:indexPath]) {
if (![self hasIndexPath:indexPath]) {
[self.indexArr addObject:indexPath];
}
......@@ -170,10 +170,21 @@
}
}
- (BOOL)hasIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in self.indexArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
#pragma mark - 按钮事件
- (void)boxValueChanged:(NSNotification *)fication{
NSString *tilkeStr = [IBTCommon trimmingCharacters:self.selectTextFiled.text];
[self fetchVendorList:tilkeStr];
}
- (void)tableViewRefresh{
_currentIndexPath = nil;
......
......@@ -180,4 +180,16 @@
"Survey" = "行情调研";
"AddSurvey" = "新建行情调研";
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
\ No newline at end of file
"Purchase" = "采购单";
//Avatar
//选择界面 的title
"ProductTitle" = "商品选择";
"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