Commit 4346f77e authored by 管鹏飞's avatar 管鹏飞

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

Conflicts:
	XFFruit.xcodeproj/project.pbxproj
	XFFruit/Info.plist
	XFFruit/Macro/ICRAppMacro.h
parents 25942065 1de7a49b
......@@ -64,4 +64,4 @@ SPEC CHECKSUMS:
SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
COCOAPODS: 0.39.0
COCOAPODS: 0.38.2
......@@ -2568,7 +2568,6 @@
C1F696001AB870B400F9F5DD /* Frameworks */,
C1F696011AB870B400F9F5DD /* Resources */,
1454647E6246AB3D8AAE6FF2 /* Copy Pods Resources */,
CE6AE18C05B31A4FEE20BD67 /* Embed Pods Frameworks */,
);
buildRules = (
);
......@@ -2708,21 +2707,6 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
CE6AE18C05B31A4FEE20BD67 /* Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
......@@ -3295,7 +3279,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit;
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "3a32e5a9-395f-425a-b1b0-c221be8d15d8";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Debug;
......@@ -3320,7 +3304,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit;
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "3a32e5a9-395f-425a-b1b0-c221be8d15d8";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Release;
......
......@@ -12,4 +12,5 @@
@property (strong, nonatomic) UIWindow *window;
@property (readonly, assign, nonatomic) ICRAppViewControllerManager *m_appViewControllerMgr;
-(void)comperVersion;
@end
......@@ -17,6 +17,9 @@
@property (strong, nonatomic) BMKMapManager *mapManager;
@property (strong, nonatomic) NSString *version;//本地版本号
@property (strong, nonatomic) NSString *severVersion;//服务器版本号
@property (strong, nonatomic) NSString *intVersion;//本地版本号
@property (strong, nonatomic) NSString *intSeverVersion;//服务器版本号
@property (strong, nonatomic) NSString *severUrl;//Ipa下载地址
@property (assign, nonatomic) BOOL severForceUpdate;//强制更新
......@@ -119,14 +122,27 @@
-(void)comperVersion
{
if (self.version && self.severVersion) {
NSComparisonResult comResult = [self p_compareVersions: self.version betweenVersion2:self.severVersion];
self.intVersion=@"";
self.intSeverVersion=@"";
NSArray *array1 = [self.version componentsSeparatedByString:@"."];
NSArray *array2 = [self.severVersion componentsSeparatedByString:@"."];
for (int i = 0; i < [array1 count]; i++) {
self.intVersion=[self.intVersion stringByAppendingFormat:@"%@",[array1 objectAtIndex:i]];
NSLog(@"string:%@", [array1 objectAtIndex:i]);
}
for (int i = 0; i < [array2 count]; i++) {
self.intSeverVersion=[self.intSeverVersion stringByAppendingFormat:@"%@",[array2 objectAtIndex:i]];
NSLog(@"string:%@", [array2 objectAtIndex:i]);
}
BOOL isNeedUpdate=[self compareVersion];
// NSComparisonResult comResult = [self p_compareVersions: self.version betweenVersion2:self.severVersion];
if (comResult == NSOrderedAscending) {
if (isNeedUpdate) {
if (self.severForceUpdate) {
//强制更新
UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:nil otherButtonTitles: @"去下载", nil];
alertV.tag = 1001;
[alertV show];
// UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:nil otherButtonTitles: @"去下载", nil];
// alertV.tag = 1001;
// [alertV show];
}else
{
UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:@"下次再说"otherButtonTitles: @"去下载", nil];//
......@@ -136,7 +152,17 @@
}
}
}
-(BOOL)compareVersion
{
float version=[self.intVersion floatValue];
float severVersion=[self.intSeverVersion floatValue];
if (severVersion >version) {
return YES;
}else
{
return NO;
}
}
- (void) alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex {
if (alertView.tag==1001) {
......
......@@ -177,7 +177,7 @@ static NSString *ICRDataBasePath = @"";
}
CLog(@"%@", sql);
[db executeUpdate:sql withArgumentsInArray:arrIDs];
// [db executeUpdate:sql withArgumentsInArray:arrIDs];
}
@autoreleasepool {
......
......@@ -217,29 +217,34 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
//1.下载商品信息
- (void)getProductWithPage_number:(NSUInteger)page_number
- (void)getProductWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//2.下载用户信息
- (void)getUserWithPage_number:(NSUInteger)page_number
- (void)getUserWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//3.供应商
- (void)getVendorWithPage_number:(NSUInteger)page_number
- (void)getVendorWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//4.仓库
- (void)getWarehouseWithPage_number:(NSUInteger)page_number
- (void)getWarehouseWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//5.科目账款
- (void)getAccounttitleWithPage_number:(NSUInteger)page_number
- (void)getAccounttitleWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
......@@ -314,7 +319,8 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ
failure:(void (^)(id))fail;
- (void)getProductUnitWithPage_number:(NSUInteger)page_number
- (void)getProductUnitWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
......
......@@ -1518,7 +1518,8 @@ acceptTypeJson:YES
}
//商品
-(void)getProductWithPage_number:(NSUInteger)page_number
-(void)getProductWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
......@@ -1555,7 +1556,7 @@ acceptTypeJson:YES
}
};
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetProduct] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", @"2015-05-04",@(page_number),@(page_size)];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetProduct] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", startDate,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:NULL
......@@ -1566,7 +1567,8 @@ acceptTypeJson:YES
}
- (void)getUserWithPage_number:(NSUInteger)page_number
- (void)getUserWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
......@@ -1601,8 +1603,7 @@ acceptTypeJson:YES
fail( error );
}
};
NSString *dateStr = @"2015-01-01";
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetUser] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", dateStr,@(page_number),@(page_size)];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetUser] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", startDate,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:NULL
......@@ -1753,33 +1754,85 @@ acceptTypeJson:YES
}
//供应商
-(void)getVendorWithPage_number:(NSUInteger)page_number
-(void)getVendorWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
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_downloadWithStartDate:stateDate ICRHTTPAction:XFFHttp_GetVendor ClassName:@"Vendor" Page_number:page_number page_size:page_size success:succ failure:fail];
}
//仓库
-(void)getWarehouseWithPage_number:(NSUInteger)page_number
-(void)getWarehouseWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetWarehouse ClassName:@"Warehouse" Page_number:page_number page_size:page_size success:succ failure:fail];
[self p_downloadWithStartDate:stateDate ICRHTTPAction:XFFHttp_GetWarehouse ClassName:@"Warehouse" Page_number:page_number page_size:page_size success:succ failure:fail];
}
//科目
- (void)getAccounttitleWithPage_number:(NSUInteger)page_number
- (void)getAccounttitleWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetAccounttitle ClassName:GXF_BASECLASS_ACCOUNTTITLE Page_number:page_number page_size:page_size success:succ failure:fail];
[self p_downloadWithStartDate:startDate ICRHTTPAction:XFFHttp_GetAccounttitle ClassName:GXF_BASECLASS_ACCOUNTTITLE Page_number:page_number page_size:page_size success:succ failure:fail];
}
- (void)p_downloadWithStartDate:(NSString *)startDate
ICRHTTPAction: (NSUInteger)urlAction
ClassName: (NSString *)class_Name
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail {
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (IsDictObject(responseObject)) {
void (^complete)(void) = ^(void){
if (succ) {
[IBTCommon runOnMainThreadWithoutDeadlocking:^{
succ( responseObject );
}];
}
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
objectClass:NSClassFromString( class_Name ) ///
deleteLocal:YES
handleData:NULL
complete:complete
fail:fail];
}
else {
if (fail) {
fail( nil );
}
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", startDate,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
parameters:NULL
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
- (void)getProductunitWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
......@@ -2633,7 +2686,8 @@ acceptTypeJson:YES
}
- (void)getProductUnitWithPage_number:(NSUInteger)page_number
- (void)getProductUnitWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
......@@ -2668,8 +2722,7 @@ acceptTypeJson:YES
fail( error );
}
};
NSString *dateStr = @"2015-05-01";
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetProductunit] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", dateStr,@(page_number),@(page_size)];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetProductunit] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", startDate,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:NULL
......
......@@ -27,6 +27,8 @@ typedef void(^ChoseBaseInfo)(NSArray *baseInfos);
@property (nonatomic,copy)ChoseBaseInfo choseBaseInfo;
@property (nonatomic,assign)BOOL isFirst;
@property (nonatomic,strong)NSString *selectStr;
@property (nonatomic,assign)NSInteger currentPage;
@property (nonatomic,strong)NSString *startDate;
- (void)endRefreshing;
- (void)getBaseDataFromServer;
......
......@@ -72,10 +72,50 @@
return ;
}
self.isRefresh = YES;
[self getBaseDataFromServer];
self.currentPage = 0;
[self getLastModifiedTime];
}];
}
- (void)getLastModifiedTime{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = [NSString stringWithFormat:@"select * from %@ order by lastModify_time desc limit 1",self.tableStr];
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (fetchedObjects.count > 0) {
NSString *startDate = @"";
if ([self.tableStr isEqualToString:GXF_BASECLASS_PRODUCT]) {
Product *product = fetchedObjects[0];
startDate = product.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_USER]) {
User *user = fetchedObjects[0];
startDate = user.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_PRODUCTUNIT]) {
GXFProductUnit *productUnit = fetchedObjects[0];
startDate = productUnit.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_VENDOR]) {
Vendor *vendor= fetchedObjects[0];
startDate = vendor.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_WAREHOUSE]) {
Warehouse *warehouse= fetchedObjects[0];
startDate = warehouse.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_ACCOUNTTITLE]) {
Accounttitle *accounttitle= fetchedObjects[0];
startDate = accounttitle.lastModify_time;
}
[strongSelf getBaseDataFromServerWithStartDate:startDate];
}
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:NSClassFromString(self.tableStr)
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
......@@ -142,8 +182,7 @@
}
#pragma mark - 按钮事件
- (void)boxValueChanged:(NSNotification *)fication{
// NSString *tilkeStr = [IBTCommon trimmingCharacters:self.selectTextFiled.text];
// [self fetchDataList:tilkeStr];
}
- (void)tableViewRefresh:(NSString *)titltstr{
self.currentIndexPath = nil;
......@@ -209,7 +248,8 @@
self.isFirst = NO;
[GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:self.tableView.header.lastUpdatedTimeKey];
[GXF_NSUSERFEFTAULTS synchronize];
[self getBaseDataFromServer];
NSString *befortDate = @"2014-01-01";
[self getBaseDataFromServerWithStartDate:befortDate];
}else{
[strongSelf.dataArr removeAllObjects];
if (!self.tableView.header.lastUpdatedTime) {
......@@ -253,6 +293,9 @@
-(void)getBaseDataFromServer
{
}
-(void)getBaseDataFromServerWithStartDate:(NSString *)startDate
{
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -17,7 +17,11 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<<<<<<< HEAD
<string>1.0.1</string>
=======
<string>1.0</string>
>>>>>>> 1de7a49b4d56cfdf4ff3774d83fe3795c134012e
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
......
......@@ -22,14 +22,15 @@
#define ICR_TABBAR_TINT_COLOR [UIColor colorWithR:36 g:38 b:53 a:1]
#define ICR_IMAGE_BG_COLOR [UIColor colorWithW:242 a:1]
//阿里云内部测试环境
//#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/cruiser-server/rest"
//********阿里云内部测试环境********
#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/cruiser-server/rest"
//现场测试环境
//********现场测试环境********
//#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7280/cruiser-server/rest"
/*********现场正式环境**********/
#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7380/cruiser-server/rest"
//********现场正式环境*********
// #define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7380/cruiser-server/rest"
// HTTP
......@@ -45,7 +46,12 @@
#import "ICRDataBaseController.h"
#import "NSData+EncodeAdditions.h"
#import "UIScrollView+Content.h"
#import "Product.h"
#import "User.h"
#import "GXFProductUnit.h"
#import "Vendor.h"
#import "Warehouse.h"
#import "Accounttitle.h"
......
......@@ -17,25 +17,52 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_ACCOUNTTITLE;
self.title = @"费用类型";
self.tableView.header.lastUpdatedTimeKey = ChooseAccountTitleUpdateDate;
[self fetchDataList:@"" tableStr:GXF_BASECLASS_ACCOUNTTITLE];
}
- (void)getBaseDataFromServer{
- (void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_ACCOUNTTITLE];
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getAccounttitleWithPage_number:0 page_size:1000 success:succ failure:fail];
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
}
[[ICRHTTPController sharedController] getAccounttitleWithStartDate:startDate
Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_ACCOUNTTITLE];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
......
......@@ -16,26 +16,56 @@
@implementation ChooseProductUnitViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_PRODUCTUNIT;
//记录更新时间
self.tableView.header.lastUpdatedTimeKey = ChooseProductUnitUpdateDate;
self.title = @"选择包装单位";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT];
}
- (void)getBaseDataFromServer{
- (void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT];
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getProductUnitWithPage_number:0 page_size:1000 success:succ failure:fail];
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
}
[[ICRHTTPController sharedController] getProductUnitWithStartDate:startDate
Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
......
......@@ -10,33 +10,61 @@
#define TopMargin 50
#define TableHeight 50
@interface ChooseProductViewController ()
{
}
@end
@implementation ChooseProductViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_PRODUCT;
//记录更新时间
self.tableView.header.lastUpdatedTimeKey = ChooseProductUpdateDate;
self.title = @"选择商品";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCT];
}
- (void)getBaseDataFromServer{
-(void)getBaseDataFromServerWithStartDate:(NSString *)startDate
{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCT];
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getProductWithPage_number:0 page_size:1000 success:succ failure:fail];
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
}
[[ICRHTTPController sharedController] getProductWithStartDate:startDate Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCT];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
......
......@@ -20,31 +20,55 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_VENDOR;
//记录更新时间
self.tableView.header.lastUpdatedTimeKey = ChooseVendorUpdateDate;
self.title = @"选择供应商";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_VENDOR];
}
- (void)getBaseDataFromServer{
- (void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_VENDOR];
}else{
[IBTLoadingView showTips:data];
}
__strong __typeof(weakSelf)strongSelf = weakSelf;
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:1000 success:succ failure:fail];
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
}
[[ICRHTTPController sharedController] getVendorWithStartDate:startDate
Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_VENDOR];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
#pragma mark - 协议方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
......
......@@ -17,33 +17,51 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_WAREHOUSE;
//记录更新时间
self.tableView.header.lastUpdatedTimeKey = ChooseWarehouseUpdateDate;
self.title = @"选择仓库";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_WAREHOUSE];
}
- (void)getBaseDataFromServer{
-(void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[IBTLoadingView showTips:data];
[self endRefreshing];
};
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
}
[[ICRHTTPController sharedController] getWarehouseWithStartDate:startDate Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_WAREHOUSE];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_WAREHOUSE];
}else{
[IBTLoadingView showTips:data];
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
};
void(^fail)(id) = ^(id data) {
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:1000 success:succ failure:fail];
}
}
#pragma mark - 协议方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
......
......@@ -20,27 +20,53 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_USER;
self.tableView.header.lastUpdatedTimeKey = ChoosePersonUpdateDate;
self.title = @"选择人员";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_USER];
}
- (void)getBaseDataFromServer{
- (void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_USER];
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getUserWithPage_number:0 page_size:1000 success:succ failure:fail];
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
}
[[ICRHTTPController sharedController] getUserWithStartDate:startDate
Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_USER];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
#pragma mark -成功
- (void)sureClick{
if (self.isMoreChose) {
......
......@@ -12,11 +12,14 @@
@property (nonatomic, copy) NSString *uuid;//唯一标识
@property (nonatomic, copy) NSString *name;//名称
@property (nonatomic, assign) BOOL enabled;//是否启用
@property (nonatomic, strong) NSDate *create_time; //创建时间
@property (nonatomic, strong) NSString *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;//最后修改人名称
@property (nonatomic, copy) NSString *create_operName;//创建人名称
@property (nonatomic, strong) NSString *lastModify_time;//最后修改时间
@property (nonatomic, copy) NSString *lastModify_id;//最后修改人代码
@property (nonatomic, copy) NSString *lastModify_operName;//最后修改人名称
@property (nonatomic, assign) NSInteger priority;//新增字段优先级
@end
......@@ -86,13 +86,13 @@
NSInteger pageSize = 100;
//判断选择
if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductTitle"]]) {
[[ICRHTTPController sharedController] getProductWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getProductWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"VendorTitle"]]) {
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getVendorWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"WarehouseTitle"]]) {
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getWarehouseWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductUnitTitle"]]) {
[[ICRHTTPController sharedController]getProductunitWithPage_number:pageNumber page_size:pageSize success:succ failure:fail];
......
......@@ -78,7 +78,7 @@
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getVendorWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
}
......
......@@ -78,7 +78,7 @@
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getWarehouseWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
}
......
......@@ -12,6 +12,7 @@
#import "GXFFunctionDB.h"
#import "GXFFunctionDBHelper.h"
#import "APService.h"
#import "ICRAppDelegate.h"
#define LOGIN_CONTAINER_LEFT_MARGIN (20)
#define LOGIN_CONTAINER_HEIGHT (450)
......@@ -100,17 +101,21 @@
// self.m_containerView.m_passwordTextF.text = @"aaa";
//@"http://218.244.151.129:7580/cruiser-server/rest"
// self.m_containerView.m_cCodeTextF.text = @"211534962";
// self.m_containerView.m_userNameTextF.text = @"admin";
// self.m_containerView.m_passwordTextF.text = @"thoradmin";
self.m_containerView.m_cCodeTextF.text = @"211534962";
self.m_containerView.m_userNameTextF.text = @"admin";
self.m_containerView.m_passwordTextF.text = @"thoradmin";
//@"http://122.224.171.126:7280/cruiser-server/rest"
self.m_containerView.m_cCodeTextF.text = @"923";
self.m_containerView.m_userNameTextF.text = @"admin";
self.m_containerView.m_passwordTextF.text = @"thoradmin";
//@"http://122.224.171.126:7280/cruiser-server/rest"
// self.m_containerView.m_cCodeTextF.text = @"923";
// self.m_containerView.m_userNameTextF.text = @"admin";
// self.m_containerView.m_passwordTextF.text = @"thoradmin";
//现场正式环境登陆
// self.m_containerView.m_cCodeTextF.text = @"211534968";
// self.m_containerView.m_userNameTextF.text = @"admin";
// self.m_containerView.m_passwordTextF.text = @"thoradmin";
[self.m_containerView checkLoginEnable];
#else
......@@ -127,7 +132,9 @@
}
- (void)onLoginTapped:(__unused id)sender {
//
//
ICRAppDelegate *appDelegate = (ICRAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate comperVersion];
NSString *nsRegisterCode = self.m_containerView.m_cCodeTextF.text;
NSString *nsUserName = self.m_containerView.m_userNameTextF.text;
NSString *nsPassword = [self.m_containerView.m_passwordTextF.text uppercaseMD5String];
......
......@@ -161,7 +161,7 @@ typedef enum : NSUInteger {
for (PurchaseBillProduct *billProduct in purchaseProduct) {
totalPrice += [billProduct.total floatValue];
}
_purchaseView.purchasePriceLabel.text = [NSString stringWithFormat:@"%.2f",totalPrice + otherPrice];
_purchaseView.purchasePriceLabel.text = [NSString stringWithFormat:@"%.4f",totalPrice + otherPrice];
_purchaseView.chargePurchase = [NSNumber numberWithFloat:otherPrice];
_purchaseView.total = [NSNumber numberWithFloat:totalPrice+otherPrice];
}
......
......@@ -13,6 +13,12 @@
@property (nonatomic,strong)NSString *code;//代码
@property (nonatomic,strong)NSString *name;//名称
@property (nonatomic,assign)BOOL enabled;//状态
@property (nonatomic,strong)NSString *create_id;
@property (nonatomic,strong)NSString *create_operName;
@property (nonatomic,strong)NSString *create_time;
@property (nonatomic,strong)NSString *lastModify_id;
@property (nonatomic,strong)NSString *lastModify_operName;
@property (nonatomic,strong)NSString *lastModify_time;
@end
......@@ -13,4 +13,10 @@
@property (nonatomic,strong)NSString *code;//代码
@property (nonatomic,strong)NSString *name;//名称
@property (nonatomic,assign)BOOL enabled;//状态
@property (nonatomic,strong)NSString *create_id;
@property (nonatomic,strong)NSString *create_operName;
@property (nonatomic,strong)NSString *create_time;
@property (nonatomic,strong)NSString *lastModify_id;
@property (nonatomic,strong)NSString *lastModify_operName;
@property (nonatomic,strong)NSString *lastModify_time;
@end
......@@ -47,18 +47,15 @@
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.textColor = GXF_CONTENT_COLOR;
self.titleLabel.text = @"苹果桃子";
self.titleLabel.font = GXF_SIXTEENTEH_SIZE;
self.priceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.priceLabel.textAlignment = NSTextAlignmentCenter;
self.priceLabel.textColor = GXF_CONTENT_COLOR;
self.priceLabel.text = @"80";
self.priceLabel.font = GXF_SIXTEENTEH_SIZE;
self.countLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.priceLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.countLabel.textAlignment = NSTextAlignmentCenter;
self.countLabel.text = @"200";
self.countLabel.textColor = GXF_CONTENT_COLOR;
self.countLabel.font = GXF_SIXTEENTEH_SIZE;
......@@ -79,43 +76,36 @@
self.showStandLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.seqLabel.frame), CGRectGetMaxY(self.showNameLabel.frame), ShowWidth, ShowHeight))];
self.showStandLabel.textAlignment = NSTextAlignmentLeft;
self.showStandLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showStandLabel.text = @"包装规格:1*12斤";
self.showStandLabel.font = GXF_THREETEENTH_SIZE;
self.showCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showStandLabel.frame), CGRectGetMaxY(self.showNameLabel.frame), ShowWidth, ShowHeight))];
self.showCountLabel.textAlignment = NSTextAlignmentLeft;
self.showCountLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showCountLabel.text = @"包装数量:10000";
self.showCountLabel.font = GXF_THREETEENTH_SIZE;
self.showBaseCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showStandLabel.frame), CGRectGetMaxY(self.showStandLabel.frame), ShowWidth, ShowHeight))];
self.showBaseCountLabel.textAlignment = NSTextAlignmentLeft;
self.showBaseCountLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showBaseCountLabel.text = @"基础数量:300";
self.showBaseCountLabel.font = GXF_THREETEENTH_SIZE;
self.showPriceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showCountLabel.frame), CGRectGetMaxY(self.showStandLabel.frame), ShowWidth, ShowHeight))];
self.showPriceLabel.textAlignment = NSTextAlignmentLeft;
self.showPriceLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showPriceLabel.text = @"包装单价:11元";
self.showPriceLabel.font = GXF_THREETEENTH_SIZE;
self.showBasePriceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showStandLabel.frame), CGRectGetMaxY(self.showBaseCountLabel.frame), ShowWidth, ShowHeight))];
self.showBasePriceLabel.textAlignment = NSTextAlignmentLeft;
self.showBasePriceLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showBasePriceLabel.text = @"基础单价:1000";
self.showBasePriceLabel.font = GXF_THREETEENTH_SIZE;
self.showTotalLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showCountLabel.frame), CGRectGetMaxY(self.showBaseCountLabel.frame), ShowWidth, ShowHeight))];
self.showTotalLabel.textAlignment = NSTextAlignmentLeft;
self.showTotalLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showTotalLabel.text = @"总金额:100";
self.showTotalLabel.font = GXF_THREETEENTH_SIZE;
self.showNoteLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showStandLabel.frame), CGRectGetMaxY(self.showBasePriceLabel.frame), ShowWidth, ShowHeight))];
self.showNoteLabel.textAlignment = NSTextAlignmentLeft;
self.showNoteLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showNoteLabel.text = @"备注:1000";
self.showNoteLabel.font = GXF_THREETEENTH_SIZE;
......
......@@ -133,7 +133,7 @@
}else if(indexPath.row == 5){
contentLabel.text = @"0";
contentLabel.frame = CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-30, TableHeight);
contentLabel.textColor = [UIColor redColor];
contentLabel.textColor = GXF_NAVIGAYION_COLOR;
self.purchasePriceLabel = contentLabel;
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(contentLabel.frame)+ 5, 0, 20, TableHeight)];
label.text = @"元";
......
......@@ -69,6 +69,7 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)UILabel *FootLabel;
@property (nonatomic,strong)UIButton *addDetailedButton;
@property (nonatomic,strong)NSMutableArray *selectUsers;
@property (nonatomic,strong)NSMutableArray *users;
@property (nonatomic,strong)NSString *purchaseNoticeUuid;
......@@ -123,13 +124,28 @@ typedef enum : NSUInteger {
_titleField.text = self.purchaseNotice.title;
self.titleStr = self.purchaseNotice.title;
}
if (self.purchaseNotice.purchaserName.length > 0) {
_personLabel.text = self.purchaseNotice.purchaserName;
if (self.purchaseNotice.purchasers.count > 0) {
NSString *personStr = @"";
for (NSDictionary * userDict in self.purchaseNotice.purchasers) {
SurveyUser *surveyUser = [[SurveyUser alloc]init];
[surveyUser setValuesForKeysWithDictionary:userDict];
[self.selectUsers addObject:surveyUser.userUuid];
if (personStr.length == 0) {
personStr = [personStr stringByAppendingFormat:@"%@",surveyUser.userName];
}else{
personStr = [personStr stringByAppendingFormat:@"、%@",surveyUser.userName];
}
}
_personLabel.text = personStr;
_personLabel.textColor = GXF_CONTENT_COLOR;
self.purchaseUuidStr = self.purchaseNotice.purchaserUuid;
self.purchaseCodeStr = self.purchaseNotice.purchaserCode;
self.purchaseNameStr = self.purchaseNotice.purchaserName;
[self.selectUsers addObject:self.purchaseNotice.purchaserUuid];
}
if (self.users) {
if (self.users.count > 0) {
[self.users removeAllObjects];
}
[self.users addObjectsFromArray:self.purchaseNotice.purchasers];
}
if (self.purchaseNotice.finishDate) {
if (self.purchaseNotice.finishDate.length > 15) {
......@@ -159,6 +175,7 @@ typedef enum : NSUInteger {
{
selectCellAry=[[NSMutableArray alloc]initWithCapacity:1000];
self.selectUsers = [NSMutableArray array];
self.users = [NSMutableArray array];
_dataArr=[[NSMutableArray alloc]initWithObjects:@"标题:",@"采购员:",@"要求采购完成时间:",@"备注:", nil];
_shopeArr=[[NSMutableArray alloc]init];
......@@ -337,20 +354,28 @@ typedef enum : NSUInteger {
cvc.selectArr = self.selectUsers;
}
cvc.choseBaseInfo = ^(NSArray *users){
if (users.count > 0) {
if(users.count > 0){
NSString *textStr = @"";
if (self.users.count > 0) {
[self.users removeAllObjects];
}
if (self.selectUsers.count > 0) {
[self.selectUsers removeAllObjects];
}
SurveyUser *user = users[0];
_personLabel.text = user.userName;
for (SurveyUser *user in users) {
if (textStr.length == 0) {
textStr = [textStr stringByAppendingFormat:@"%@",user.userName];
}else {
textStr = [textStr stringByAppendingFormat:@"、%@",user.userName];
}
[self.selectUsers addObject:user.userUuid];
[self.users addObject:[user dictForCommit]];
}
_personLabel.text = textStr;
_personLabel.textColor = GXF_CONTENT_COLOR;
self.purchaseNameStr = user.userName;
self.purchaseCodeStr = user.userCode;
self.purchaseUuidStr = user.userUuid;
[self.selectUsers addObject:user.userUuid];
}
};
cvc.isMoreChose = NO;
cvc.isMoreChose = YES;
[self PushViewController:cvc animated:YES];
}else if(indexPath.row == 2){
[self startDatePickView];
......@@ -521,7 +546,7 @@ typedef enum : NSUInteger {
ShowMessage(@"采购通知单标题不能为空");
return NO;
}
if (_personLabel.text.length == 0 ) {
if (self.users.count <=0) {
ShowMessage(@"采购员不能为空");
return NO;
}
......@@ -642,14 +667,13 @@ typedef enum : NSUInteger {
@"version":versionObject,
@"title":[IBTCommon checkString:self.titleStr],
@"state":[IBTCommon checkString:state],
@"purchaserUuid":[IBTCommon checkString:self.purchaseUuidStr],
@"purchaserCode":[IBTCommon checkString:self.purchaseCodeStr],
@"purchaserName":[IBTCommon checkString:self.purchaseNameStr],
@"purchasers":self.users,
@"finishDate":[IBTCommon checkString:self.finishDateStr],
@"remark":[IBTCommon checkString:self.remarkStr],
@"products":billProducts};
[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] savePurchaseNoticeWithData:dict success:succ failure:fail];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1) {
......
......@@ -15,6 +15,7 @@
#import "MJRefresh.h"
#import "PurchaseNoticeListCell.h"
#import "PurchaseNotice.h"
#import "SurveyUser.h"
#define TopMargin 44
#define TableHeight 120
#define LeftMargin 20
......@@ -128,6 +129,13 @@ typedef enum : NSUInteger {
for (NSDictionary *purchaseBillDict in recodesArr) {
PurchaseNotice *purchaseBill = [[PurchaseNotice alloc]init];
[purchaseBill setValuesForKeysWithDictionary:purchaseBillDict];
NSMutableArray *users = [NSMutableArray array];
for (NSDictionary *userDict in purchaseBill.purchasers) {
SurveyUser *user = [SurveyUser new];
[user setValuesForKeysWithDictionary:userDict];
[users addObject:user];
}
purchaseBill.purchasers = users;
[self.dataArr addObject:purchaseBill];
}
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
......
......@@ -11,7 +11,7 @@
#import "NoticeProduct.h"
#import "NoticeDetailCell.h"
#import "SurveyCell.h"
#import "SurveyUser.h"
#import "HPGrowingTextView.h"
#import "NoticeProductViewController.h"
#import "FollowUpRecordViewController.h"
......@@ -92,6 +92,13 @@ typedef enum : NSUInteger {
[productArr addObject:billProbuct];
}
purchaseNotice.products = productArr;
NSMutableArray *users = [NSMutableArray array];
for (NSDictionary *userDict in purchaseNotice.purchasers) {
SurveyUser *user = [SurveyUser new];
[user setValuesForKeysWithDictionary:userDict];
[users addObject:user];
}
purchaseNotice.purchasers = users;
self.purchaseNotice = purchaseNotice;
[strongSelf fetchtNoticeDetail];
}else{
......@@ -123,7 +130,15 @@ typedef enum : NSUInteger {
self.createOperNameLabel.text = [NSString stringWithFormat:@"%@%@",[IBTCommon checkString:self.purchaseNotice.create_operName],self.purchaseNotice.create_time.length > 10 ? [self.purchaseNotice.create_time substringToIndex:10] : self.purchaseNotice.create_time];
self.titleLabel.text = [IBTCommon checkString:self.purchaseNotice.title];
self.userLabel.text = [IBTCommon checkString:self.purchaseNotice.purchaserName];
NSString *textStr = @"";
for (SurveyUser *user in self.purchaseNotice.purchasers) {
if (textStr.length == 0) {
textStr = [textStr stringByAppendingFormat:@"%@",user.userName];
}else {
textStr = [textStr stringByAppendingFormat:@"、%@",user.userName];
}
}
self.userLabel.text = [IBTCommon checkString:textStr];
self.countLabel.text = [NSString stringWithFormat:@"%@",[self calutionTotalCount]];
self.finishLabel.text = [NSString stringWithFormat:@"%@",self.purchaseNotice.finishDate?[[IBTCommon checkString:self.purchaseNotice.finishDate] substringToIndex:10]:@"无"];
self.noteLabel.text = [IBTCommon checkString:self.purchaseNotice.remark];
......
......@@ -23,6 +23,7 @@
@property (nonatomic,strong)NSString *purchaserUuid;//采购员ID
@property (nonatomic,strong)NSString *purchaserCode;//采购员代码
@property (nonatomic,strong)NSString *purchaserName;//采购员名称
@property (nonatomic,strong)NSArray *purchasers;
@property (nonatomic,strong)NSString *finishDate;//新增要求采购完成时间
@property (nonatomic,strong)NSString *remark;//备注
@property (nonatomic,strong)NSArray *products;//商品
......
......@@ -7,7 +7,7 @@
//
#import "PurchaseNoticeListCell.h"
#import "SurveyUser.h"
#define TitleSize 16
#define LeftMargin 90
#define TopMargin 10
......@@ -69,7 +69,15 @@
- (void)setPurchaseNotice:(PurchaseNotice *)purchaseNotice{
self.billNumberLabel.text = [NSString stringWithFormat:@"单号:%@",purchaseNotice.billnumber];
self.titleLabel.text = [NSString stringWithFormat:@"标题:%@",purchaseNotice.title];
self.userLabel.text = [NSString stringWithFormat:@"采购员:%@",purchaseNotice.purchaserName] ;
NSString *textStr = @"";
for (SurveyUser *user in purchaseNotice.purchasers) {
if (textStr.length == 0) {
textStr = [textStr stringByAppendingFormat:@"%@",user.userName];
}else {
textStr = [textStr stringByAppendingFormat:@"、%@",user.userName];
}
}
self.userLabel.text = [NSString stringWithFormat:@"采购员:%@",textStr] ;
self.createOperNameLabel.text = [NSString stringWithFormat:@"创建人:%@",purchaseNotice.create_operName] ;
self.createTimeLabel.text =[NSString stringWithFormat:@"创建时间:%@",purchaseNotice.create_time];
NSString *stateStr = @"";
......
......@@ -102,7 +102,6 @@ typedef enum : NSUInteger {
- (void)setviewsData
{
if (self.shopDetail!=nil) {
//商品
_productLabel.text = [NSString stringWithFormat:@"%@[%@]",self.shopDetail.merchandise,self.shopDetail.product_code];
[self.selectProducts addObject:_shopDetail.product_uuid];
......@@ -134,7 +133,7 @@ typedef enum : NSUInteger {
}
//总金额
if ([self.shopDetail.totalMoney floatValue] <= 0) {
totalMoney.text=@"0.00";
totalMoney.text=@"0.0000";
}else{
totalMoney.text=self.shopDetail.totalMoney;
}
......@@ -367,7 +366,7 @@ typedef enum : NSUInteger {
_baseCountLabel = label;
[textField setEnabled:NO];
textField.placeholder = @"基础数量";
textField.textColor = [UIColor redColor];
textField.textColor = GXF_NAVIGAYION_COLOR;
foundationQuantity=textField; //基础数量
}else if (indexPath.row==5)
......@@ -380,15 +379,14 @@ typedef enum : NSUInteger {
{
label.text = @"元";
[textField addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventAllEditingEvents];
textField.placeholder = @"包装单价";
textField.placeholder = @"输入包装单价";
packageUnitPrice=textField; //包装单价
}else if (indexPath.row==7)
{
label.text = @"元";
[textField addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventAllEditingEvents];
textField.placeholder = @"总金额";
textField.textColor = [UIColor redColor];
textField.placeholder = @"输入总金额";
totalMoney=textField; //总金额
}
}
......@@ -481,10 +479,10 @@ typedef enum : NSUInteger {
if (foundationUnitPrice.text.length > 0) {
if (foundationQuantity.text.length > 0) {
float totalPrice = [foundationUnitPrice.text floatValue] * [foundationQuantity.text floatValue];
totalMoney.text = [NSString stringWithFormat:@"%.2f",totalPrice];
totalMoney.text = [NSString stringWithFormat:@"%.4f",totalPrice];
if (packageQuantity.text.length > 0 && [packageQuantity.text integerValue] > 0) {
float packagePrice = totalPrice / [packageQuantity.text floatValue];
packageUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
packageUnitPrice.text = [NSString stringWithFormat:@"%.4f",packagePrice];
}
}
}
......@@ -494,10 +492,10 @@ typedef enum : NSUInteger {
if (packageUnitPrice.text.length > 0) {
if (packageQuantity.text.length > 0) {
float totalPrice = [packageUnitPrice.text floatValue] * [packageQuantity.text floatValue];
totalMoney.text = [NSString stringWithFormat:@"%.2f",totalPrice];
totalMoney.text = [NSString stringWithFormat:@"%.4f",totalPrice];
if (foundationQuantity.text.length > 0 && [foundationQuantity.text integerValue] > 0) {
float packagePrice = totalPrice / [foundationQuantity.text floatValue];
foundationUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
foundationUnitPrice.text = [NSString stringWithFormat:@"%.4f",packagePrice];
}
}
}
......@@ -507,11 +505,11 @@ typedef enum : NSUInteger {
if (totalMoney.text.length > 0) {
if (packageQuantity.text.length > 0 && [packageQuantity.text floatValue] > 0) {
float packagePrice = [totalMoney.text floatValue] / [packageQuantity.text floatValue];
packageUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
packageUnitPrice.text = [NSString stringWithFormat:@"%.4f",packagePrice];
}
if (foundationQuantity.text.length > 0 && [foundationQuantity.text floatValue] > 0) {
float packagePrice = [totalMoney.text floatValue] / [foundationQuantity.text floatValue];
foundationUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
foundationUnitPrice.text = [NSString stringWithFormat:@"%.4f",packagePrice];
}
}
}
......
......@@ -206,7 +206,6 @@
textField.delegate = self;
[textField addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventAllEditingEvents];
[cell.contentView addSubview:textField];
textField.textColor = [UIColor redColor];
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(textField.frame)+ 5, 0, 20, TableRowHeight)];
label.textColor = GXF_CONTENT_COLOR;
......@@ -295,7 +294,7 @@
baseCount = total / [self.noticeProduct.price floatValue];
}
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%.2f元",total];
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%.4f元",total];
_shBaseQuantityField.text = [NSString stringWithFormat:@"%.0f",baseCount];
}
}else if (textField == _shBaseQuantityField) {
......@@ -306,7 +305,7 @@
baseCount = total / [self.noticeProduct.packprice floatValue];
}
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%.2f元",total];
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%.4f元",total];
_shPackField.text = [NSString stringWithFormat:@"%.0f",baseCount];
}
}
......
......@@ -11,10 +11,10 @@
@interface User : IBTModel
@property (nonatomic,strong)NSString *uuid;//唯一标识
@property (nonatomic,strong)NSString *version;//版本号
@property (nonatomic,strong)NSDate *create_time;//创建时间
@property (nonatomic,strong)NSString *create_time;//创建时间
@property (nonatomic,strong)NSString *create_id;//创建人代码
@property (nonatomic,strong)NSString *create_operName;//创建人名称
@property (nonatomic,strong)NSDate *lastModify_time;//最后修改时间
@property (nonatomic,strong)NSString *lastModify_time;//最后修改时间
@property (nonatomic,strong)NSString *lastModify_id;//最后修改人代码
@property (nonatomic,strong)NSString *lastModify_operName;//最后修改人名称
@property (nonatomic,strong)NSArray *company;//所属公司
......
......@@ -356,6 +356,9 @@ typedef enum : NSUInteger {
_personLabel.textColor = GXF_CONTENT_COLOR;
}
if (self.users) {
// if (self.users.count > 0) {
// [self.users removeAllObjects];
// }
[self.users addObjectsFromArray:self.survey.users];
}
}
......
......@@ -21,10 +21,10 @@
@property (nonatomic,strong)NSString *isNew;//是否新品
@property (nonatomic,strong)NSString *categoryUuid;//所属商品类别
@property (nonatomic,strong)NSString *image;//图片相对路径
@property (nonatomic,strong)NSDate *create_time;//创建时间
@property (nonatomic,strong)NSString *create_time;//创建时间
@property (nonatomic,strong)NSString *create_id;//创建人代码
@property (nonatomic,strong)NSString *create_operName;//创建人名称
@property (nonatomic,strong)NSDate *lastModify_time;//最后修改时间
@property (nonatomic,strong)NSString *lastModify_time;//最后修改时间
@property (nonatomic,strong)NSString *lastModify_id;//最后修改人代码
@property (nonatomic,strong)NSString *lastModify_operName;//最后修改人名称
@property (nonatomic,assign)NSInteger enabled;//是否启用
......
......@@ -216,7 +216,7 @@ typedef enum : NSUInteger {
}else{
[textField setEnabled:NO];
textField.text = @"0";
textField.textColor = [UIColor redColor];
textField.textColor = GXF_NAVIGAYION_COLOR;
_leftmoneyField = textField;
}
}
......@@ -236,7 +236,7 @@ typedef enum : NSUInteger {
}
- (void)textChange:(UITextField *)textField{
if (_actualmoneyField.text.length > 0 && _paidmoneyField.text.length > 0 ) {
_leftmoneyField.text = [NSString stringWithFormat:@"%.2f",[_actualmoneyField.text floatValue] - [_paidmoneyField.text floatValue]];
_leftmoneyField.text = [NSString stringWithFormat:@"%.4f",[_actualmoneyField.text floatValue] - [_paidmoneyField.text floatValue]];
}
}
......
......@@ -12,4 +12,10 @@
@property (nonatomic, strong) NSString *uuid;//唯一标识
@property (nonatomic, strong) NSString *name;//名称
@property (nonatomic, assign) BOOL enabled;//是否启用
@property (nonatomic,strong)NSString *create_id;
@property (nonatomic,strong)NSString *create_operName;
@property (nonatomic,strong)NSString *create_time;
@property (nonatomic,strong)NSString *lastModify_id;
@property (nonatomic,strong)NSString *lastModify_operName;
@property (nonatomic,strong)NSString *lastModify_time;
@end
......@@ -9,5 +9,11 @@
#import "Accounttitle.h"
@implementation Accounttitle
+ (NSDictionary *)specialKeysAndReplaceKeys {
return @{ @"aID" : [[self class] PrimaryKey], };
}
+ (NSString *)PrimaryKey {
return @"uuid";
}
@end
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