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

报表

parent e1b6be2f
This diff is collapsed.
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
NSString * path = [NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES) lastObject]; NSString * path = [NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES) lastObject];
CLog(@"%@",path); CLog(@"%@",path);
[self enterpriseUpdate];
// Required // Required
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1 #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) { if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
...@@ -70,6 +68,7 @@ ...@@ -70,6 +68,7 @@
[self setupBMKMapMgr]; [self setupBMKMapMgr];
_m_appViewControllerMgr = [ICRAppViewControllerManager getAppViewControllerManager]; _m_appViewControllerMgr = [ICRAppViewControllerManager getAppViewControllerManager];
#pragma 版本更新 #pragma 版本更新
[self enterpriseUpdate];
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
return YES; return YES;
} }
...@@ -135,14 +134,13 @@ ...@@ -135,14 +134,13 @@
NSLog(@"string:%@", [array2 objectAtIndex:i]); NSLog(@"string:%@", [array2 objectAtIndex:i]);
} }
BOOL isNeedUpdate=[self compareVersion]; BOOL isNeedUpdate=[self compareVersion];
// NSComparisonResult comResult = [self p_compareVersions: self.version betweenVersion2:self.severVersion];
if (isNeedUpdate) { if (isNeedUpdate) {
if (self.severForceUpdate) { if (self.severForceUpdate) {
//强制更新 //强制更新
// UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:nil otherButtonTitles: @"去下载", nil]; UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:nil otherButtonTitles: @"去下载", nil];
// alertV.tag = 1001; alertV.tag = 1001;
// [alertV show]; [alertV show];
}else }else
{ {
UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:@"下次再说"otherButtonTitles: @"去下载", nil];// UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:@"下次再说"otherButtonTitles: @"去下载", nil];//
...@@ -213,9 +211,12 @@ clickedButtonAtIndex:(NSInteger)buttonIndex { ...@@ -213,9 +211,12 @@ clickedButtonAtIndex:(NSInteger)buttonIndex {
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. //即将进入前台再次判断版本是否有需要更新
[self enterpriseUpdate];
[application setApplicationIconBadgeNumber:0]; [application setApplicationIconBadgeNumber:0];
[application cancelAllLocalNotifications]; [application cancelAllLocalNotifications];
} }
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
......
...@@ -416,6 +416,15 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) { ...@@ -416,6 +416,15 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//1.报表首页,数据罗盘
- (void)queryHomepageWith:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//2.报表首页组织明细(读)
- (void)queryOrgdataWith:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
@end @end
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "downSale.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "downSale.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "goSale.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "goSale.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#define ICR_IMAGE_BG_COLOR [UIColor colorWithW:242 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:7280/cruiser-server/rest"
//********现场正式环境********* //********现场正式环境*********
......
...@@ -15,10 +15,9 @@ ...@@ -15,10 +15,9 @@
#define KNOTIFICATION_ChoseTransportProduct @"KNOTIFICATION_ChoseTransportProduct"//选择发运单 #define KNOTIFICATION_ChoseTransportProduct @"KNOTIFICATION_ChoseTransportProduct"//选择发运单
#define KNOTIFICATION_ChoseTransferProduct @"KNOTIFICATION_ChoseTransferProduct"//选择转运单 #define KNOTIFICATION_ChoseTransferProduct @"KNOTIFICATION_ChoseTransferProduct"//选择转运单
#define KNOTIFICATION_EditReceiveProduct @"KNOTIFICATION_EditReceiveProduct" #define KNOTIFICATION_EditReceiveProduct @"KNOTIFICATION_EditReceiveProduct"
#define KNOTIFICATION_GetNextDetailData @"KNOTIFICATION_GetNextDetailData"
#define KNOTIFICATION_AddPurchaseProduct @"KNOTIFICATION_AddPurchaseProduct" #define KNOTIFICATION_AddPurchaseProduct @"KNOTIFICATION_AddPurchaseProduct"
#define KNOTIFICATION_AddTransportCost @"KNOTIFICATION_AddTransportCost" #define KNOTIFICATION_AddTransportCost @"KNOTIFICATION_AddTransportCost"
......
...@@ -47,4 +47,8 @@ ...@@ -47,4 +47,8 @@
+(UILabel *)labelWithTitle:(NSString *)title frame:(CGRect)frame textFont:(UIFont *)titleFont; +(UILabel *)labelWithTitle:(NSString *)title frame:(CGRect)frame textFont:(UIFont *)titleFont;
+ (UIButton *)buttonWithTitle:(NSString *)title Image:(UIImage *)image frame:(CGRect)frame fontSize:(float)fontSize fontColor:(UIColor *)color; + (UIButton *)buttonWithTitle:(NSString *)title Image:(UIImage *)image frame:(CGRect)frame fontSize:(float)fontSize fontColor:(UIColor *)color;
+ (UIButton *)buttonWithImage:(UIImage *)image frame:(CGRect)frame; + (UIButton *)buttonWithImage:(UIImage *)image frame:(CGRect)frame;
+ (NSString *)getWeekFromDate;
+ (NSInteger)getWeeks:(NSInteger)year;
@end @end
...@@ -291,7 +291,9 @@ ...@@ -291,7 +291,9 @@
button.titleLabel.font = [UIFont systemFontOfSize:fontSize]; button.titleLabel.font = [UIFont systemFontOfSize:fontSize];
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
if (image) {
[button setImage:image forState:UIControlStateNormal]; [button setImage:image forState:UIControlStateNormal];
}
[button setTitleColor:color forState:UIControlStateNormal]; [button setTitleColor:color forState:UIControlStateNormal];
return button; return button;
...@@ -308,4 +310,57 @@ ...@@ -308,4 +310,57 @@
return button; return button;
} }
+ (NSString *)getWeekFromDate{
NSString *yearWeek = @"";
NSCalendar *greCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *dateComponents = [greCalendar components:NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit | NSWeekCalendarUnit | NSWeekdayCalendarUnit | NSWeekOfMonthCalendarUnit | NSWeekOfYearCalendarUnit fromDate:[NSDate date]];
NSString *year = [IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy"];
if (dateComponents.weekOfYear == 1) {
yearWeek = [NSString stringWithFormat:@"%ld%ld", [year integerValue]+1
,(long)dateComponents.weekOfYear];
}else{
yearWeek = [NSString stringWithFormat:@"%ld%ld", (long)[year integerValue]
,(long)dateComponents.weekOfYear];
}
return yearWeek;
// NSDate *today = [NSDate date];
// NSCalendar *gregorian = [[NSCalendar alloc]
// initWithCalendarIdentifier:NSGregorianCalendar];
// NSDateComponents *weekdayComponents =
// [gregorian components:(NSDayCalendarUnit |
// NSWeekdayCalendarUnit) fromDate:today];
// weekdayComponents.day = 10; //一月的第10天
//
// NSDate *date = [gregorian dateFromComponents:weekdayComponents];
//
// NSInteger day = [weekdayComponents day];
// NSInteger weekday = [weekdayComponents weekday];
//
// NSUInteger firstDay = [gregorian ordinalityOfUnit:NSWeekdayCalendarUnit inUnit:kCFCalendarUnitWeek forDate:date]; //该月的第10天星期几
}
+ (NSInteger)getWeeks:(NSInteger)year{
NSInteger weeks = 0;
NSString *dateStr = [NSString stringWithFormat:@"%ld-12-31 00:00:00",(long)year];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit | NSWeekCalendarUnit | NSWeekdayCalendarUnit | NSWeekOfMonthCalendarUnit | NSWeekOfYearCalendarUnit ;
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:dateStr];
NSDateComponents *comps = [calendar components:unitFlags fromDate:date];
weeks = [comps weekOfYear];
if (weeks==1) {
return 52;
}else{
return 53;
}
}
@end @end
...@@ -89,6 +89,8 @@ ...@@ -89,6 +89,8 @@
#define HexColor(colorStr) [UIColor colorWithHexString:colorStr] #define HexColor(colorStr) [UIColor colorWithHexString:colorStr]
#define RGBA(R,G,B,A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A] #define RGBA(R,G,B,A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]
#define ScreenSize ([[UIScreen mainScreen] bounds].size) #define ScreenSize ([[UIScreen mainScreen] bounds].size)
#define WidthScale (ScreenSize.width/320)
#define HeightScale (ScreenSize.height-64)/(480-64)
#define IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) #define IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define FontSize(num) [UIFont systemFontOfSize:num] #define FontSize(num) [UIFont systemFontOfSize:num]
#define AppWindow [[UIApplication sharedApplication].delegate window] #define AppWindow [[UIApplication sharedApplication].delegate window]
...@@ -105,6 +107,7 @@ ...@@ -105,6 +107,7 @@
#define GXF_LEFTSIX_COLOR HexColor(@"666666") #define GXF_LEFTSIX_COLOR HexColor(@"666666")
#define GXF_PopView_COLOR RGBA(24,164,219,1) #define GXF_PopView_COLOR RGBA(24,164,219,1)
#define GXF_TWELVETEEN_SIZE FontSize(12)
#define GXF_THREETEENTH_SIZE FontSize(13) #define GXF_THREETEENTH_SIZE FontSize(13)
#define GXF_FOURTEENTH_SIZE FontSize(14) #define GXF_FOURTEENTH_SIZE FontSize(14)
#define GXF_FIFTEENTEN_SIZE FontSize(15) #define GXF_FIFTEENTEN_SIZE FontSize(15)
...@@ -225,7 +228,20 @@ ...@@ -225,7 +228,20 @@
#define SaleWeek @"周" #define SaleWeek @"周"
#define SaleMonth @"月" #define SaleMonth @"月"
#define SaleEnDay @"day"
#define SaleEnWeek @"week"
#define SaleEnMonth @"month"
//报表统一颜色
#define ReportColor RGBA(42, 135, 193, 1)
#define ReportContentColor RGBA(192, 0, 13, 1)
#define ReportTableHeaderColor RGBA(207, 207, 207, 1)
#define ReportTitleColor RGBA(52, 141, 194, 1)
#define ReportChainSignPlus @"plus"
#define ReportChainSignMinus @"minus"
#define ReportChainPlusImage @"goSale"
#define ReportChainMinusImage @"downSale"
#endif #endif
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#pragma mark - Private Method #pragma mark - Private Method
- (void)_init { - (void)_init {
if (!IBT_IOS7_OR_LATER) { if (!IBT_IOS7_OR_LATER) {
self.layer.borderColor = IBT_TINTCOLOR.CGColor; self.layer.borderColor = XXFBgColor.CGColor;
self.layer.borderWidth = 1.0f; self.layer.borderWidth = 1.0f;
self.layer.cornerRadius = 4.0f; self.layer.cornerRadius = 4.0f;
self.layer.masksToBounds = YES; self.layer.masksToBounds = YES;
......
...@@ -85,6 +85,7 @@ static NSString *MyTableViewCell = @"IBTTableViewCell"; ...@@ -85,6 +85,7 @@ static NSString *MyTableViewCell = @"IBTTableViewCell";
[IBTCommon localizableString:@"Read"], ]; [IBTCommon localizableString:@"Read"], ];
self.m_segContainer = [[IBTSegmentContainer alloc] initWithItems:arrSegments]; self.m_segContainer = [[IBTSegmentContainer alloc] initWithItems:arrSegments];
self.m_segmentControl = _m_segContainer.segmentControl; self.m_segmentControl = _m_segContainer.segmentControl;
self.m_segmentControl.tintColor = GXF_NAVIGAYION_COLOR;
_m_segmentControl.selectedSegmentIndex = 0; _m_segmentControl.selectedSegmentIndex = 0;
_m_segContainer.frame = (CGRect){ _m_segContainer.frame = (CGRect){
.origin.x = 0, .origin.x = 0,
......
...@@ -323,7 +323,7 @@ typedef enum : NSUInteger { ...@@ -323,7 +323,7 @@ typedef enum : NSUInteger {
return NO; return NO;
} }
for (PurchaseBillProduct *billProduct in _pvc.productArr) { for (PurchaseBillProduct *billProduct in _pvc.productArr) {
if ([billProduct.qty integerValue] <= 0 || [billProduct.baseQty integerValue] <= 0) { if ([billProduct.qty floatValue] <= 0 || [billProduct.baseQty floatValue] <= 0) {
ShowMessage(@"有数量等于0的商品明细,请编辑后保存"); ShowMessage(@"有数量等于0的商品明细,请编辑后保存");
return NO; return NO;
} }
......
...@@ -555,7 +555,7 @@ typedef enum : NSUInteger { ...@@ -555,7 +555,7 @@ typedef enum : NSUInteger {
return NO; return NO;
} }
for (NoticeProduct *billProduct in _shopeArr) { for (NoticeProduct *billProduct in _shopeArr) {
if ([billProduct.quantity integerValue] <= 0 || [billProduct.qpcQuantity integerValue] <= 0) { if ([billProduct.quantity floatValue] <= 0 || [billProduct.qpcQuantity floatValue] <= 0) {
ShowMessage(@"有数量等于0的商品明细,请编辑后保存"); ShowMessage(@"有数量等于0的商品明细,请编辑后保存");
return NO; return NO;
} }
...@@ -588,7 +588,7 @@ typedef enum : NSUInteger { ...@@ -588,7 +588,7 @@ typedef enum : NSUInteger {
- (void)cancelTimeView{ - (void)cancelTimeView{
[self clearDatePickView]; [self clearDatePickView];
} }
- (void)okTimeView:(NSString *)time{ - (void)okTimeView:(NSString *)time withType:(NSString *)type{
_finishDateLabel.textColor = GXF_CONTENT_COLOR; _finishDateLabel.textColor = GXF_CONTENT_COLOR;
if (time.length > 15) { if (time.length > 15) {
......
...@@ -272,7 +272,7 @@ typedef enum : NSUInteger { ...@@ -272,7 +272,7 @@ typedef enum : NSUInteger {
return NO; return NO;
} }
if ([packageQuantity.text integerValue] <= 0 || [foundationQuantity.text integerValue] <= 0 || [packageSpecification.text integerValue] <= 0) { if ([packageQuantity.text floatValue] <= 0 || [foundationQuantity.text floatValue] <= 0 || [packageSpecification.text floatValue] <= 0) {
ShowMessage(@"商品数量不能为0"); ShowMessage(@"商品数量不能为0");
return NO; return NO;
} }
......
...@@ -85,7 +85,7 @@ typedef enum : NSUInteger { ...@@ -85,7 +85,7 @@ typedef enum : NSUInteger {
TransferPdtDetail *billProbuct = [TransferPdtDetail new]; TransferPdtDetail *billProbuct = [TransferPdtDetail new];
[billProbuct setValuesForKeysWithDictionary:billDict]; [billProbuct setValuesForKeysWithDictionary:billDict];
[productArr addObject:billProbuct]; [productArr addObject:billProbuct];
if ([self.transfer.state isEqualToString:TRANSFER_STATE_RECEIVED]) { if ([self.transfer.state isEqualToString:TRANSFER_STATE_RECEIVED] || [billProbuct.rctBaseQty floatValue] > 0 || [billProbuct.rctQty floatValue] > 0) {
[self.defalutState addObject:@"YES"]; [self.defalutState addObject:@"YES"];
}else{ }else{
[self.defalutState addObject:@"NO"]; [self.defalutState addObject:@"NO"];
...@@ -430,10 +430,18 @@ typedef enum : NSUInteger { ...@@ -430,10 +430,18 @@ typedef enum : NSUInteger {
} }
- (BOOL)checkReceive{ - (BOOL)checkReceive{
for (NSString *isEdit in _pvc.defaultState) {
if ([isEdit isEqualToString:@"NO"]) {
ShowMessage(@"有商品行没有编辑过收货数量,请先编辑再收货");
return NO;
}
}
if (_pvc.productArr.count == 0) { if (_pvc.productArr.count == 0) {
ShowMessage(@"商品不能为空"); ShowMessage(@"商品不能为空");
return NO; return NO;
} }
return YES; return YES;
} }
......
//
// GrossRateViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/11/13.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "Compass.h"
@interface GrossRateViewController : ICRBaseViewController
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,assign)NSInteger count;
- (void)setValueInGrossRate:(Compass *)compass;
@end
//
// GrossRateViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/13.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "GrossRateViewController.h"
#import "ReportDetailViewController.h"
#import "CustomSegView.h"
#import "SMPageControl.h"
#import "PasengerCell.h"
#import "PassengerHeaderCell.h"
#import "RPassgerView.h"
#define LeftWidth 50
static NSString *grossRateViewHeaderController = @"grossRateViewHeaderController";
@interface GrossRateViewController ()<CustomSegViewDelegate,UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)SMPageControl *pageControl;
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)RPassgerView *rpassgerView;
@end
@implementation GrossRateViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self bulidLayout];
}
#pragma mark - 布局
- (void)bulidLayout{
self.view .backgroundColor = [UIColor whiteColor];
CGRect rect = CGRectMake(0, 0, ScreenSize.width, 145);
self.bgView = [[UIView alloc]initWithFrame:rect];
rect = CGRectMake(0, 0, ScreenSize.width, 130);
self.rpassgerView = [[RPassgerView alloc]initWithFrame:rect];
[self.bgView addSubview:self.rpassgerView];
self.pageControl = [[SMPageControl alloc]initWithFrame:CGRectMake(0, self.rpassgerView.bottom, self.view.width, 10)];
self.pageControl.numberOfPages = 4;
self.pageControl.currentPage = 3;
self.pageControl.pageIndicatorTintColor = XXFBgColor;
self.pageControl.currentPageIndicatorTintColor = ReportColor;
self.pageControl.indicatorMargin = 15.0f;
self.pageControl.indicatorDiameter = 10.0f;
[self.bgView addSubview:self.pageControl];
rect = CGRectMake(0, 0, self.view.width, self.view.height - 158);
self.tableView = [[UITableView alloc]initWithFrame:rect style:UITableViewStylePlain];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.tableView registerClass:[PassengerHeaderCell class] forHeaderFooterViewReuseIdentifier:grossRateViewHeaderController];
self.tableView.tableHeaderView = self.bgView;
[self.view addSubview:self.tableView];
}
- (void)setValueInGrossRate:(Compass *)compass{
[self.rpassgerView setGrossprofitWithCompass:compass];
}
#pragma mark - tableViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *passgerPriceCellIdentify = @"grossRateViewHeaderController";
PasengerCell *cell = [tableView dequeueReusableCellWithIdentifier:passgerPriceCellIdentify];
if(cell == nil) {
cell = [[PasengerCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:passgerPriceCellIdentify];
}
//没有选中风格
cell.selectionStyle = UITableViewCellSelectionStyleNone;
//取消分割线
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
OrgCompass *test = _dataArr[indexPath.row];
if (test.level == 0) {
cell.dqLabel.textColor = ReportTitleColor;
cell.dqLabel.font = GXF_FIFTEENTEN_SIZE;
cell.lineLabel.hidden = NO;
}else if(test.level == 1)
{
cell.dqLabel.textColor = [UIColor blackColor];
cell.dqLabel.font = GXF_FOURTEENTH_SIZE;
cell.lineLabel.hidden = NO;
}else {
cell.lineLabel.hidden = YES;
cell.dqLabel.textColor = [UIColor lightGrayColor];
cell.dqLabel.font = GXF_THREETEENTH_SIZE;
}
if(test != nil) {
[cell updateCellWithGross:test index:indexPath];
}
cell.detailBtn.tag = indexPath.row;
[cell.detailBtn addTarget:self action:@selector(detailClick:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
- (void)detailClick:(UIButton *)btn{
ReportDetailViewController *rvc = [ReportDetailViewController new];
rvc.title = @"陆金所";
[self PushViewController:rvc animated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [PasengerCell cellHeight];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[[NSNotificationCenter defaultCenter]postNotificationName:KNOTIFICATION_GetNextDetailData object:nil userInfo:@{@"indexPath":indexPath}];
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
PassengerHeaderCell *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:grossRateViewHeaderController];
if (headerView == nil) {
headerView = [[PassengerHeaderCell alloc] initWithReuseIdentifier:grossRateViewHeaderController];
}
[headerView buildLayout:@"毛利率"];
[headerView setTotalValue:[NSString stringWithFormat:@"共%ld家",(long)self.count]];
return headerView;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return [PassengerHeaderCell viewHeight];
}
@end
...@@ -7,7 +7,12 @@ ...@@ -7,7 +7,12 @@
// //
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
#import "Compass.h"
@interface PassengerViewController : ICRBaseViewController @interface PassengerViewController : ICRBaseViewController
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,assign)NSInteger count;
- (void)setValueInPassenger:(Compass *)compass;
@end @end
...@@ -7,7 +7,12 @@ ...@@ -7,7 +7,12 @@
// //
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
#import "Compass.h"
@interface PassgerPriceViewController : ICRBaseViewController @interface PassgerPriceViewController : ICRBaseViewController
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,assign)NSInteger count;
- (void)setValueInPassgerPrice:(Compass *)compass;
@end @end
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
@interface ReportDetailViewController : ICRBaseViewController @interface ReportDetailViewController : ICRBaseViewController
@property (nonatomic,strong)NSString *reportStyle;
@end @end
...@@ -8,8 +8,18 @@ ...@@ -8,8 +8,18 @@
#import "ReportDetailViewController.h" #import "ReportDetailViewController.h"
#import "CustomSegView.h" #import "CustomSegView.h"
@interface ReportDetailViewController ()<CustomSegViewDelegate> #import "RSaleView.h"
#import "FinishTimeView.h"
@interface ReportDetailViewController ()<CustomSegViewDelegate,FinishTimeViewDelegate>
@property (nonatomic,strong)CustomSegView *segView; @property (nonatomic,strong)CustomSegView *segView;
@property (nonatomic,strong)RSaleView *rsaleView;
@property (nonatomic,strong)UIWebView *webView;
@property (nonatomic,strong)FinishTimeView *startTimeView;
@property (nonatomic,strong)NSString *scopeType;
@property (nonatomic,strong)NSString *selectDay;
@property (nonatomic,strong)NSString *selectMonth;
@property (nonatomic,strong)NSString *selectWeek;
@end @end
...@@ -28,18 +38,120 @@ ...@@ -28,18 +38,120 @@
self.segView = [[CustomSegView alloc]initWithFrame:rect withArr:arr]; self.segView = [[CustomSegView alloc]initWithFrame:rect withArr:arr];
self.segView.delegate = self; self.segView.delegate = self;
[self.view addSubview:self.segView]; [self.view addSubview:self.segView];
rect = CGRectMake(0, self.segView.bottom, ScreenSize.width, 130);
self.rsaleView = [[RSaleView alloc]initWithFrame:rect];
[self.view addSubview:self.rsaleView];
rect = CGRectMake(0, self.rsaleView.bottom, ScreenSize.width, ScreenSize.height - self.rsaleView.bottom - 64);
self.webView = [[UIWebView alloc]initWithFrame:rect];
self.webView.scrollView.backgroundColor = [UIColor redColor];
[self.view addSubview:self.webView];
} }
#pragma mark -CustomSegViewDelegate #pragma mark -CustomSegViewDelegate
- (void)customSegOneClick:(NSString *)title{ - (void)customSegOneClick:(NSString *)title{
//日周年切换
NSString *dayType = @"";
if ([title isEqualToString:SaleDay]) {
dayType = @"day";
self.scopeType = [IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy-MM-dd"];
}else if ([title isEqualToString:SaleWeek]) {
dayType = @"week";
self.scopeType = [IBTCommon getWeekFromDate];
}else if ([title isEqualToString:SaleMonth]) {
dayType = @"month";
self.scopeType = [IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy-MM"];
}
CLog(@"-------%@",self.scopeType);
// self.dayType = dayType;
// [self getDataFromServer];
} }
- (void)customSegTwoClick:(NSString *)title{ - (void)customSegTwoClick:(NSString *)title{
//选择历史查看
if ([title isEqualToString:SaleDay]) {
[self startDatePickView:SaleEnDay];
}else if ([title isEqualToString:SaleWeek]) {
[self startDatePickView:SaleEnWeek];
}else if ([title isEqualToString:SaleMonth]) {
[self startDatePickView:SaleEnMonth];
}
}
- (void)startDatePickView:(NSString *)type{
if (!self.startTimeView) {
NSString *currentStr = @"";
if ([type isEqualToString:SaleEnDay]) {
if (self.selectDay) {
currentStr = self.selectDay;
}else{
currentStr = [IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy-MM-dd"];
}
}else if([type isEqualToString:SaleEnMonth]){
if (self.selectMonth) {
currentStr = self.selectMonth;
}else{
currentStr = [IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy-MM"];
}
}else{
if (self.selectWeek) {
currentStr = self.selectWeek;
}else{
currentStr = [IBTCommon getWeekFromDate];
}
}
self.startTimeView = [[FinishTimeView alloc] initWithFrame:CGRectMake(0, ScreenSize.height, ScreenSize.width, ScreenSize.height - 64) withDate:currentStr type:type];
self.startTimeView.delegate = self;
self.startTimeView.backgroundColor = RGBA(0, 0, 0 ,0.5);
[AppWindow addSubview:self.startTimeView];
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = self.startTimeView.frame;
startFrame.origin.y = 64;
self.startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
}];
}
}
- (void)cancelTimeView{
[self clearDatePickView];
} }
- (void)okTimeView:(NSString *)time withType:(NSString *)type{
CLog(@"--------%@",time);
// 关闭选择器
[self clearDatePickView];
if ([type isEqualToString:SaleEnDay]) {
self.selectDay = time;
}else if ([type isEqualToString:SaleEnWeek]) {
self.selectWeek = time;
}else if ([type isEqualToString:SaleEnMonth]) {
self.selectMonth = time;
}
self.scopeType = time;
#warning 需要修改的
//[self getDataFromServer];
}
#pragma mark - 取消
- (void)clearDatePickView{
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = self.startTimeView.frame;
startFrame.origin.y = ScreenSize.height;
self.startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
[self.startTimeView removeFromSuperview];
self.startTimeView = nil;
}];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
......
...@@ -7,7 +7,11 @@ ...@@ -7,7 +7,11 @@
// //
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
#import "Compass.h"
@interface SaleViewController : ICRBaseViewController @interface SaleViewController : ICRBaseViewController
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,assign)NSInteger count;
- (void)setValueInSale:(Compass *)compass;
@end @end
//
// SearchReportViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/11/17.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface SearchReportViewController : ICRBaseViewController
@end
//
// SearchReportViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/17.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "SearchReportViewController.h"
#import "RsearchCell.h"
#import "ReportDetailViewController.h"
@interface SearchReportViewController ()<UITextFieldDelegate,UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)UITextField *selectTextFiled;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@end
@implementation SearchReportViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"搜索组织";
self.view.backgroundColor = [UIColor whiteColor];
self.dataArr = [NSMutableArray array];
self.selectTextFiled = [[UITextField alloc] initWithFrame:CGRectMake(20,5,ScreenSize.width - 100, 30)];
self.selectTextFiled.textAlignment = NSTextAlignmentLeft;
self.selectTextFiled.background = [UIImage imageNamed:@"textFiled"];
self.selectTextFiled.delegate = self;
self.selectTextFiled.placeholder = @"输入门店或者区域、代码查询";
self.selectTextFiled.font = GXF_THREETEENTH_SIZE;
[self.view addSubview:self.selectTextFiled];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(self.selectTextFiled.right + 5,7, 60, 25);
[btn setTitle:@"开始查询" forState:UIControlStateNormal];
btn.titleLabel.font = FontSize(13);
btn.layer.cornerRadius = 5;
btn.layer.masksToBounds = YES;
btn.backgroundColor = ReportColor;
[btn addTarget:self action:@selector(checkWithBillNumber) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
CGRect rect = CGRectMake(0, 50, ScreenSize.width, ScreenSize.height - 163);
self.tableView = [[UITableView alloc]initWithFrame:rect style:UITableViewStylePlain];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.view addSubview:self.tableView];
}
#pragma mark - tableViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *cellID = @"SearchCell";
RsearchCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if(cell == nil) {
cell = [[RsearchCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
}
//没有选中风格
cell.selectionStyle = UITableViewCellSelectionStyleNone;
//取消分割线
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
ReportDetailViewController *rvc = [ReportDetailViewController new];
rvc.title = @"陆金所";
[self PushViewController:rvc animated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [RsearchCell cellHeight];
}
- (void)checkWithBillNumber{
}
- (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
//
// Compass.h
// XFFruit
//
// Created by 陈俊俊 on 15/11/18.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface Compass : IBTModel
@property (nonatomic,strong)NSString *dateScopeType;
// 统计时间类型 否 String 100 day(日),week(周),month(月)
@property (nonatomic,strong)NSString *dateScope;
// 统计时间 否 String 100 日:2015-10-10周:37,表示今年第几周月:2015-10
@property (nonatomic,strong)NSString *sales;
// 销售额 是 String 100
@property (nonatomic,strong)NSString *salesChainSign;
// 销售环比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *salesChainRate;
//销售环比变化率 是 Double  30,表示30%
@property (nonatomic,strong)NSString *salesYoYSign;
//销售同比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *salesYoYRate;
//销售同比变化率 是 Double
@property (nonatomic,strong)NSNumber *salesTargetRate;
//销售目标达成率 是 Double
@property (nonatomic,strong)NSString *dailysalesPerStore;
//单店日均销售 是 String 100
@property (nonatomic,strong)NSString *passengerdate;
//客流统计时间 是 String 100
@property (nonatomic,strong)NSString *passenger;
// 客流数 是 String 100
@property (nonatomic,strong)NSString *passengerChainSign;
// 客流数环比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *passengerChainRate;
//客流数环比变化率 是 Double
@property (nonatomic,strong)NSString *passengerYoYSign;
//客流数同比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *passengerYoYRate;
// 客流数同比变化率 是 Double
@property (nonatomic,strong)NSString *persalesdate;
//客单价统计时间 是 String 100
@property (nonatomic,strong)NSString *persales;
//客单价 是 String 100
@property (nonatomic,strong)NSString *persalesChainSign;
//客单价环比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *persalesChainRate;
//客单价环比增减率 是 Double
@property (nonatomic,strong)NSString *persalesYoYSign;
//客单价同比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *persalesYoYRate;
//客单价同比增减率 是 Double
@property (nonatomic,strong)NSString *grossprofitdate;
//毛利率统计时间 是 String 100
@property (nonatomic,strong)NSString *grossprofit;
//毛利率 是 String 100
@property (nonatomic,strong)NSString *grossprofitChainSign;
//毛利率环比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *grossprofitChainRate;
//毛利率环比增减率 是 Double
@property (nonatomic,strong)NSString *grossprofitYoYSign;
//毛利率同比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *grossprofitYoYRate;
//毛利率同比增减率 是 Double
@end
//
// Compass.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/18.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "Compass.h"
@implementation Compass
@end
//
// OrgCompass.h
// XFFruit
//
// Created by 陈俊俊 on 15/11/18.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface OrgCompass : IBTModel
@property (nonatomic,strong)NSString *orguuid;
//组织uuid 否 String 38
@property (nonatomic,strong)NSString *orgcode;
//组织code 否 String 100
@property (nonatomic,strong)NSString *orgname;
//组织name 否 String 100
@property (nonatomic,assign)BOOL isleaf;
//是否叶子节点 否 Boolean 是否是最底层组织,即门店
@property (nonatomic,strong)NSString *sales;
//销售额 是 String 100
@property (nonatomic,strong)NSString *salesChainSign;
//销售环比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *salesChainRate;
//销售环比变化率 是 Double  30,表示30%
@property (nonatomic,strong)NSNumber *salesTargetRate;
//销售目标达成率 是 Double
@property (nonatomic,strong)NSString *passenger;
//客流数 是 String 100
@property (nonatomic,strong)NSString *passengerChainSign;
//客流数环比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *passengerChainRate;
//客流数环比变化率 是 Double
@property (nonatomic,strong)NSString *persales;
//客单价 是 String 100
@property (nonatomic,strong)NSString *persalesChainSign;
//客单价环比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *persalesChainRate;
//客单价环比增减率 是 Double
@property (nonatomic,strong)NSString *grossprofit;
//毛利率 是 String 100
@property (nonatomic,strong)NSString *grossprofitChainSign;
//毛利率环比增减标志 是 String 30 枚举值为:plus(增),minus(减)
@property (nonatomic,strong)NSNumber *grossprofitChainRate;
//毛利率环比增减率 是 Double
@property (nonatomic,assign)NSInteger level;
//新增等级
@property (nonatomic,strong)NSString *parentuuid;
@property (nonatomic , assign) BOOL expand;//该节点是否处于展开状态
@end
//
// OrgCompass.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/18.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "OrgCompass.h"
@implementation OrgCompass
@end
//
// SaleTest.h
// XFFruit
//
// Created by 陈俊俊 on 15/11/14.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface SaleTest : IBTModel
@property (nonatomic,strong)NSString *name;
@property (nonatomic,strong)NSString *xseStr;
@property (nonatomic,strong)NSString *bszStr;
@property (nonatomic,strong)NSString *dclStr;
@property (nonatomic , assign) int parentId;//父节点的id,如果为-1表示该节点为根节点
@property (nonatomic , assign) int nodeId;//本节点的id
@property (nonatomic , assign) int depth;//该节点的深度
@property (nonatomic , assign) BOOL expand;//该节点是否处于展开状态
@end
//
// SaleTest.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/14.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "SaleTest.h"
@implementation SaleTest
@end
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
- (void)bulidLayout{ - (void)bulidLayout{
_bgView = [[UIView alloc]initWithFrame:self.bounds]; _bgView = [[UIView alloc]initWithFrame:self.bounds];
_bgView.layer.borderWidth = 1; _bgView.layer.borderWidth = 1;
_bgView.layer.borderColor = GXF_NAVIGAYION_COLOR.CGColor; _bgView.layer.borderColor = ReportColor.CGColor;
_bgView.layer.cornerRadius = 5; _bgView.layer.cornerRadius = 5;
_bgView.layer.masksToBounds = YES; _bgView.layer.masksToBounds = YES;
[self addSubview:_bgView]; [self addSubview:_bgView];
...@@ -44,19 +44,19 @@ ...@@ -44,19 +44,19 @@
IBTCustomButtom *segBtn = [IBTCustomButtom buttonWithType:UIButtonTypeCustom]; IBTCustomButtom *segBtn = [IBTCustomButtom buttonWithType:UIButtonTypeCustom];
segBtn.frame = CGRectMake(width*i, 0, width, _bgView.height); segBtn.frame = CGRectMake(width*i, 0, width, _bgView.height);
segBtn.titleLabel.font = GXF_FIFTEENTEN_SIZE; segBtn.titleLabel.font = GXF_FIFTEENTEN_SIZE;
[segBtn setTitleColor:GXF_NAVIGAYION_COLOR forState:UIControlStateNormal]; [segBtn setTitleColor:ReportColor forState:UIControlStateNormal];
segBtn.tag = BeginBtnTag + i; segBtn.tag = BeginBtnTag + i;
[segBtn setTitle:self.segArr[i] forState:UIControlStateNormal]; [segBtn setTitle:self.segArr[i] forState:UIControlStateNormal];
[segBtn addTarget:self action:@selector(segClick:) forControlEvents:UIControlEventTouchUpInside]; [segBtn addTarget:self action:@selector(segClick:) forControlEvents:UIControlEventTouchUpInside];
[_bgView addSubview:segBtn]; [_bgView addSubview:segBtn];
if (i == 0) { if (i == 0) {
segBtn.backgroundColor = GXF_NAVIGAYION_COLOR; segBtn.backgroundColor = ReportColor;
[segBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [segBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_currentBtnTag = i+ BeginBtnTag; _currentBtnTag = i+ BeginBtnTag;
} }
if (i < self.segArr.count - 1) { if (i < self.segArr.count - 1) {
[segBtn addRightBorderWithWidth:1 color:GXF_NAVIGAYION_COLOR]; [segBtn addRightBorderWithWidth:1 color:ReportColor];
} }
} }
} }
...@@ -66,9 +66,9 @@ ...@@ -66,9 +66,9 @@
IBTCustomButtom *beforeBtn = (IBTCustomButtom *)[_bgView viewWithTag:_currentBtnTag]; IBTCustomButtom *beforeBtn = (IBTCustomButtom *)[_bgView viewWithTag:_currentBtnTag];
if ([beforeBtn isKindOfClass:[UIButton class]] && beforeBtn) { if ([beforeBtn isKindOfClass:[UIButton class]] && beforeBtn) {
beforeBtn.backgroundColor = RGBA(1, 1, 1, 0); beforeBtn.backgroundColor = RGBA(1, 1, 1, 0);
[beforeBtn setTitleColor:GXF_NAVIGAYION_COLOR forState:UIControlStateNormal]; [beforeBtn setTitleColor:ReportColor forState:UIControlStateNormal];
} }
btn.backgroundColor = GXF_NAVIGAYION_COLOR; btn.backgroundColor = ReportColor;
[btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_currentBtnTag = btn.tag; _currentBtnTag = btn.tag;
if ([self.delegate respondsToSelector:@selector(customSegOneClick:)]) { if ([self.delegate respondsToSelector:@selector(customSegOneClick:)]) {
......
...@@ -7,11 +7,20 @@ ...@@ -7,11 +7,20 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "OrgCompass.h"
@interface PasengerCell : UITableViewCell @interface PasengerCell : UITableViewCell
@property (nonatomic, strong) UILabel *dqLabel;
@property (nonatomic, strong) UILabel *saleLabel;
@property (nonatomic, strong) UILabel *lastWeekLabel;
@property (nonatomic, strong) UILabel *lineLabel;
@property (nonatomic,strong)UIButton *detailBtn;
+ (CGFloat)cellHeight; + (CGFloat)cellHeight;
- (void)updateCellWith:(id)obj index:(NSIndexPath *)indexPath; - (void)updateCellWithPrice:(OrgCompass *)obj index:(NSIndexPath *)indexPath;
- (void)updateCellWithFlow:(OrgCompass *)obj index:(NSIndexPath *)indexPath;
- (void)updateCellWithGross:(OrgCompass *)obj index:(NSIndexPath *)indexPath;
@end @end
...@@ -8,17 +8,10 @@ ...@@ -8,17 +8,10 @@
#import "PasengerCell.h" #import "PasengerCell.h"
#define Sale_Cell_Height 50 #define Sale_Cell_Height 50
#define Left_Width 85 #define Left_Width 160
#define Left_margin 10 #define Left_margin 0
@interface PasengerCell () @interface PasengerCell ()
{
BOOL hasBuildLayout; // default, NO;
}
@property (nonatomic, strong) UILabel *dqLabel;
@property (nonatomic, strong) UILabel *saleLabel;
@property (nonatomic, strong) UILabel *lastWeekLabel;
@property (nonatomic, strong) UIFont *textFont; @property (nonatomic, strong) UIFont *textFont;
@property (nonatomic, strong) UIFont *titleFont; @property (nonatomic, strong) UIFont *titleFont;
...@@ -30,6 +23,13 @@ ...@@ -30,6 +23,13 @@
@implementation PasengerCell @implementation PasengerCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self buildLayout];
}
return self;
}
+ (CGFloat)cellHeight + (CGFloat)cellHeight
{ {
...@@ -40,15 +40,9 @@ ...@@ -40,15 +40,9 @@
- (void)buildLayout - (void)buildLayout
{ {
if(hasBuildLayout) {
return;
}
hasBuildLayout = YES;
if(self.textFont == nil) { if(self.textFont == nil) {
self.textFont = [UIFont systemFontOfSize:13]; self.textFont = [UIFont systemFontOfSize:15];
} }
if(self.titleFont == nil) { if(self.titleFont == nil) {
...@@ -65,10 +59,10 @@ ...@@ -65,10 +59,10 @@
CGRect rect = CGRectMake(Left_margin,0, Left_Width, Sale_Cell_Height); CGRect rect = CGRectMake(Left_margin,0, Left_Width, Sale_Cell_Height);
self.dqLabel = [IBTCommon labelWithTitle:@"0101第一片区" frame:rect textFont:self.textFont]; self.dqLabel = [IBTCommon labelWithTitle:@"0101第一片区" frame:rect textFont:self.textFont];
self.dqLabel.textColor = GXF_NAVIGAYION_COLOR; self.dqLabel.textColor = ReportTitleColor;
[self.contentView addSubview:self.dqLabel]; [self.contentView addSubview:self.dqLabel];
CGFloat width = (ScreenSize.width - self.dqLabel.width)/2; CGFloat width = (ScreenSize.width - self.dqLabel.right - 35)/2;
rect = CGRectMake(self.dqLabel.right , 0, width, Sale_Cell_Height); rect = CGRectMake(self.dqLabel.right , 0, width, Sale_Cell_Height);
self.saleLabel = [IBTCommon labelWithTitle:@"60.0" frame:rect textFont:self.textFont]; self.saleLabel = [IBTCommon labelWithTitle:@"60.0" frame:rect textFont:self.textFont];
...@@ -80,23 +74,71 @@ ...@@ -80,23 +74,71 @@
self.lastWeekLabel.textAlignment = NSTextAlignmentCenter; self.lastWeekLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.lastWeekLabel]; [self.contentView addSubview:self.lastWeekLabel];
UILabel *lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(10, Sale_Cell_Height - 1, ScreenSize.width - 10 * 2, 1))]; rect = CGRectMake(self.lastWeekLabel.right, 0, 35, Sale_Cell_Height);
lineLabel.backgroundColor = GXF_LINE_COLOR; self.detailBtn = [IBTCommon buttonWithTitle:@"详" Image:nil frame:rect fontSize:20 fontColor:ReportColor];
[self.contentView addSubview:lineLabel]; self.detailBtn.titleLabel.font = [UIFont boldSystemFontOfSize:15];
[self.contentView addSubview:self.detailBtn];
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0, Sale_Cell_Height - 1, ScreenSize.width, 1))];
self.lineLabel.backgroundColor = [UIColor lightGrayColor];
[self.contentView addSubview:self.lineLabel];
} }
#pragma mark - update view #pragma mark - update view
//客单价
- (void)updateCellWith:(id)policy index:(NSIndexPath *)indexPath - (void)updateCellWithPrice:(OrgCompass *)sale index:(NSIndexPath *)indexPath
{ {
self.indexPath = indexPath; self.indexPath = indexPath;
//组织name
[self buildLayout]; self.dqLabel.text = sale.orgname;
//客单价
self.saleLabel.text = sale.persales;
//客单价比变化率
if ([sale.persalesChainSign isEqualToString:ReportChainSignPlus]) {
self.lastWeekLabel.textColor = ReportContentColor;
}else{
self.lastWeekLabel.textColor = GXF_NAVIGAYION_COLOR;
}
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",sale.persalesChainRate];
self.lastWeekLabel.text = salesYoStr;
} }
//客流量
- (void)updateCellWithFlow:(OrgCompass *)sale index:(NSIndexPath *)indexPath
{
self.indexPath = indexPath;
//组织name
self.dqLabel.text = sale.orgname;
//客流量
self.saleLabel.text = sale.passenger;
//客流量比变化率
if ([sale.passengerChainSign isEqualToString:ReportChainSignPlus]) {
self.lastWeekLabel.textColor = ReportContentColor;
}else{
self.lastWeekLabel.textColor = GXF_NAVIGAYION_COLOR;
}
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",sale.passengerChainRate];
self.lastWeekLabel.text = salesYoStr;
}
//毛利率
- (void)updateCellWithGross:(OrgCompass *)sale index:(NSIndexPath *)indexPath{
self.indexPath = indexPath;
//组织name
self.dqLabel.text = sale.orgname;
//毛利率
self.saleLabel.text = sale.grossprofit;
//毛利率比变化率
if ([sale.grossprofitChainSign isEqualToString:ReportChainSignPlus]) {
self.lastWeekLabel.textColor = ReportContentColor;
}else{
self.lastWeekLabel.textColor = GXF_NAVIGAYION_COLOR;
}
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",sale.grossprofitChainRate];
self.lastWeekLabel.text = salesYoStr;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
......
...@@ -10,5 +10,6 @@ ...@@ -10,5 +10,6 @@
@interface PassengerHeaderCell : UITableViewHeaderFooterView @interface PassengerHeaderCell : UITableViewHeaderFooterView
+ (CGFloat)viewHeight; + (CGFloat)viewHeight;
- (void)buildLayout; - (void)buildLayout:(NSString *)titleStr;
- (void)setTotalValue:(NSString *)totalValue;
@end @end
...@@ -17,8 +17,11 @@ ...@@ -17,8 +17,11 @@
} }
@property (nonatomic, strong) UILabel *label; @property (nonatomic, strong) UILabel *label;
@property (nonatomic, strong) UILabel *searchLabel;
@property (nonatomic, strong) UIFont *textFont; @property (nonatomic, strong) UIFont *textFont;
@end @end
...@@ -30,43 +33,44 @@ ...@@ -30,43 +33,44 @@
return Sale_Header_Height; return Sale_Header_Height;
} }
- (void)buildLayout - (void)buildLayout:(NSString *)titleStr
{ {
if(hasBuildLayout) { if(hasBuildLayout) {
return; return;
} }
if(self.textFont == nil) { if(self.textFont == nil) {
self.textFont = [UIFont systemFontOfSize:15]; self.textFont = [UIFont systemFontOfSize:13];
} }
hasBuildLayout = YES; hasBuildLayout = YES;
self.contentView.backgroundColor = [UIColor lightGrayColor]; self.contentView.backgroundColor = ReportTableHeaderColor;
CGRect rect = CGRectMake(0, 0, 50, Sale_Header_Height); CGRect rect = CGRectMake(10, 0, 150, Sale_Header_Height);
UILabel *searLabel = [IBTCommon labelWithTitle:@"280家" frame:rect textFont:self.textFont]; UILabel *searLabel = [IBTCommon labelWithTitle:@"" frame:rect textFont:self.textFont];
searLabel.textAlignment = NSTextAlignmentCenter; searLabel.textColor = ReportTitleColor;
[self.contentView addSubview:searLabel]; [self.contentView addSubview:searLabel];
self.searchLabel = searLabel;
rect = CGRectMake(searLabel.right, 0,Sale_Header_Height - 5, Sale_Header_Height);
UIImageView *yearImage = [[UIImageView alloc]initWithFrame:rect];
yearImage.image = [UIImage imageNamed:@"search"];
[self.contentView addSubview:yearImage];
CGFloat width = (ScreenSize.width - searLabel.width - yearImage.width - 20)/2; CGFloat width = (ScreenSize.width - searLabel.right - 35)/2;
rect = CGRectMake(yearImage.right + 20 , 0, width, Sale_Header_Height); rect = CGRectMake(self.searchLabel.right, 0, width, Sale_Header_Height);
UILabel * ksjLabel = [IBTCommon labelWithTitle:@"客单价" frame:rect textFont:self.textFont]; UILabel * ksjLabel = [IBTCommon labelWithTitle:titleStr frame:rect textFont:self.textFont];
ksjLabel.textColor = ReportTitleColor;
ksjLabel.textAlignment = NSTextAlignmentCenter; ksjLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:ksjLabel]; [self.contentView addSubview:ksjLabel];
rect = CGRectMake(ksjLabel.right , 0, width, Sale_Header_Height); rect = CGRectMake(ksjLabel.right , 0, width, Sale_Header_Height);
UILabel * bszLabel = [IBTCommon labelWithTitle:@"比上周" frame:rect textFont:self.textFont]; UILabel * bszLabel = [IBTCommon labelWithTitle:@"比上周" frame:rect textFont:self.textFont];
bszLabel.textColor = ReportTitleColor;
bszLabel.textAlignment = NSTextAlignmentCenter; bszLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:bszLabel]; [self.contentView addSubview:bszLabel];
} }
- (void)setTotalValue:(NSString *)totalValue{
self.searchLabel.text = totalValue;
}
@end @end
//
// PassgerPriceCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/8.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "PassgerPriceCell.h"
#define Sale_Cell_Height 50
#define Left_Width 85
#define Left_margin 10
@interface PassgerPriceCell ()
{
BOOL hasBuildLayout; // default, NO;
}
@property (nonatomic, strong) UILabel *dqLabel;
@property (nonatomic, strong) UILabel *saleLabel;
@property (nonatomic, strong) UILabel *lastWeekLabel;
@property (nonatomic, strong) UIFont *textFont;
@property (nonatomic, strong) UIFont *titleFont;
@property (nonatomic, strong) NSIndexPath *indexPath;
@end
@implementation PassgerPriceCell
+ (CGFloat)cellHeight
{
return Sale_Cell_Height;
}
#pragma mark - build view
- (void)buildLayout
{
if(hasBuildLayout) {
return;
}
hasBuildLayout = YES;
if(self.textFont == nil) {
self.textFont = [UIFont systemFontOfSize:13];
}
if(self.titleFont == nil) {
self.titleFont = [UIFont systemFontOfSize:17];
}
//页面布局
[self createView];
}
//创建视图
- (void)createView
{
CGRect rect = CGRectMake(Left_margin,0, Left_Width, Sale_Cell_Height);
self.dqLabel = [IBTCommon labelWithTitle:@"0101第一片区" frame:rect textFont:self.textFont];
self.dqLabel.textColor = GXF_NAVIGAYION_COLOR;
[self.contentView addSubview:self.dqLabel];
CGFloat width = (ScreenSize.width - self.dqLabel.width)/2;
rect = CGRectMake(self.dqLabel.right , 0, width, Sale_Cell_Height);
self.saleLabel = [IBTCommon labelWithTitle:@"60.0" frame:rect textFont:self.textFont];
self.saleLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.saleLabel];
rect = CGRectMake(self.saleLabel.right, 0, width, Sale_Cell_Height);
self.lastWeekLabel = [IBTCommon labelWithTitle:@"14.20%" frame:rect textFont:self.textFont];
self.lastWeekLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.lastWeekLabel];
UILabel *lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(10, Sale_Cell_Height - 1, ScreenSize.width - 10 * 2, 1))];
lineLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:lineLabel];
}
#pragma mark - update view
- (void)updateCellWith:(id)policy index:(NSIndexPath *)indexPath
{
self.indexPath = indexPath;
[self buildLayout];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// PassgerPriceHeaderCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/8.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "PassgerPriceHeaderCell.h"
#define Sale_Header_Height 30
@interface PassgerPriceHeaderCell ()
{
BOOL hasBuildLayout; // default, NO;
}
@property (nonatomic, strong) UILabel *label;
@property (nonatomic, strong) UIFont *textFont;
@end
@implementation PassgerPriceHeaderCell
+ (CGFloat)viewHeight
{
return Sale_Header_Height;
}
- (void)buildLayout
{
if(hasBuildLayout) {
return;
}
if(self.textFont == nil) {
self.textFont = [UIFont systemFontOfSize:15];
}
hasBuildLayout = YES;
self.contentView.backgroundColor = [UIColor lightGrayColor];
CGRect rect = CGRectMake(0, 0, 50, Sale_Header_Height);
UILabel *searLabel = [IBTCommon labelWithTitle:@"280家" frame:rect textFont:self.textFont];
searLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:searLabel];
rect = CGRectMake(searLabel.right, 0,Sale_Header_Height - 5, Sale_Header_Height);
UIImageView *yearImage = [[UIImageView alloc]initWithFrame:rect];
yearImage.image = [UIImage imageNamed:@"search"];
[self.contentView addSubview:yearImage];
CGFloat width = (ScreenSize.width - searLabel.width - yearImage.width - 20)/2;
rect = CGRectMake(yearImage.right + 20 , 0, width, Sale_Header_Height);
UILabel * ksjLabel = [IBTCommon labelWithTitle:@"毛利率" frame:rect textFont:self.textFont];
ksjLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:ksjLabel];
rect = CGRectMake(ksjLabel.right , 0, width, Sale_Header_Height);
UILabel * bszLabel = [IBTCommon labelWithTitle:@"比上周" frame:rect textFont:self.textFont];
bszLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:bszLabel];
}
@end
//
// RPassgerView.h
// XFFruit
//
// Created by 陈俊俊 on 15/11/13.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Compass.h"
@interface RPassgerView : UIView
@property (nonatomic,strong)UIButton *centerLabel;
@property (nonatomic,strong)UILabel *dateLabel;
@property (nonatomic,strong)UIButton *lastWeekLabel;
@property (nonatomic,strong)UIButton *lastYearLabel;
//客流
- (void)setPassengerWithCompass:(Compass *)compass;
//客单价
- (void)setPersalesWithCompass:(Compass *)compass;
//毛利率
- (void)setGrossprofitWithCompass:(Compass *)compass;
@end
//
// RPassgerView.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/13.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "RPassgerView.h"
#define LeftWidth 50
#define ImageSize 20
#define ContentHeight 30
#define TopWidth 200
@interface RPassgerView ()
@end
@implementation RPassgerView
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout{
CGRect rect = CGRectMake((ScreenSize.width - TopWidth)/2,20, TopWidth, ContentHeight);
self.centerLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:ReportContentColor];
self.centerLabel.enabled = NO;
self.centerLabel.titleLabel.font = [UIFont boldSystemFontOfSize:30];
[self addSubview:self.centerLabel];
rect = CGRectMake(0, self.centerLabel.bottom,ScreenSize.width, 20);
self.dateLabel = [[UILabel alloc]initWithFrame:rect];
self.dateLabel.textColor = GXF_CONTENT_COLOR;
self.dateLabel.font = GXF_FOURTEENTH_SIZE;
self.dateLabel.textAlignment = NSTextAlignmentCenter;
self.dateLabel.text = @"";
[self addSubview:self.dateLabel];
CGFloat bottomWidth = (ScreenSize.width - 20*2)/2;
rect = CGRectMake(20, self.dateLabel.bottom,bottomWidth, ContentHeight);
self.lastWeekLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:ReportContentColor];
self.lastWeekLabel.enabled = NO;
[self addSubview:self.lastWeekLabel];
rect = CGRectMake(self.lastWeekLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *weekLabel = [[UILabel alloc]initWithFrame:rect];
weekLabel.textColor = [UIColor lightGrayColor];
weekLabel.text = @"比上周同期";
weekLabel.textAlignment = NSTextAlignmentCenter;
weekLabel.font = GXF_THREETEENTH_SIZE;
[self addSubview:weekLabel];
rect = CGRectMake(self.lastWeekLabel.right,self.dateLabel.bottom,bottomWidth, ContentHeight);
self.lastYearLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:GXF_NAVIGAYION_COLOR];
self.lastYearLabel.enabled = NO;
[self addSubview:self.lastYearLabel];
rect = CGRectMake(self.lastWeekLabel.right, self.lastYearLabel.bottom,bottomWidth,20);
UILabel *yearLabel = [[UILabel alloc]initWithFrame:rect];
yearLabel.textColor = [UIColor lightGrayColor];
yearLabel.textAlignment = NSTextAlignmentCenter;
yearLabel.text = @"比去年同期";
yearLabel.font = GXF_THREETEENTH_SIZE;
[self addSubview:yearLabel];
}
//客流
- (void)setPassengerWithCompass:(Compass *)compass{
//客流数
[self.centerLabel setImage:[UIImage imageNamed:@"goSale"] forState:UIControlStateDisabled];
[self.centerLabel setTitle:compass.passenger forState:UIControlStateNormal];
//客流统计时间
self.dateLabel.text = [NSString stringWithFormat:@"%@累计客流量",compass.passengerdate];
//客流数环比变化率
if ([compass.passengerChainSign isEqualToString:ReportChainSignPlus]) {
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateDisabled];
}else{
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainMinusImage] forState:UIControlStateDisabled];
}
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",compass.passengerChainRate];
[self.lastWeekLabel setTitle:salesYoStr forState:UIControlStateNormal];
//客流数同比变化率
if ([compass.passengerYoYSign isEqualToString:ReportChainSignPlus]) {
[self.lastYearLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateNormal];
}else{
[self.lastYearLabel setImage:[UIImage imageNamed:ReportChainMinusImage] forState:UIControlStateNormal];
}
NSString *passengerYoYRateStr = [NSString stringWithFormat:@"%@%%",compass.passengerYoYRate];
[self.lastYearLabel setTitle:passengerYoYRateStr forState:UIControlStateNormal];
}
//客单价
- (void)setPersalesWithCompass:(Compass *)compass{
//客单价
[self.centerLabel setImage:[UIImage imageNamed:@"goSale"] forState:UIControlStateDisabled];
[self.centerLabel setTitle:compass.persales forState:UIControlStateNormal];
//客单价统计时间
self.dateLabel.text = [NSString stringWithFormat:@"%@累计客流量",compass.persalesdate];
//客单价环比变化率
if ([compass.persalesChainSign isEqualToString:ReportChainSignPlus]) {
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateDisabled];
}else{
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainMinusImage] forState:UIControlStateDisabled];
}
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",compass.persalesChainRate];
[self.lastWeekLabel setTitle:salesYoStr forState:UIControlStateNormal];
//客单价同比变化率
if ([compass.persalesYoYSign isEqualToString:ReportChainSignPlus]) {
[self.lastYearLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateDisabled];
}else{
[self.lastYearLabel setImage:[UIImage imageNamed:ReportChainMinusImage] forState:UIControlStateDisabled];
}
NSString *passengerYoYRateStr = [NSString stringWithFormat:@"%@%%",compass.persalesYoYRate];
[self.lastYearLabel setTitle:passengerYoYRateStr forState:UIControlStateNormal];
}
//毛利率
- (void)setGrossprofitWithCompass:(Compass *)compass{
//毛利率
[self.centerLabel setImage:[UIImage imageNamed:@"goSale"] forState:UIControlStateDisabled];
[self.centerLabel setTitle:compass.persales forState:UIControlStateNormal];
//毛利率统计时间
self.dateLabel.text = [NSString stringWithFormat:@"%@累计客流量",compass.persalesdate];
//毛利率环比变化率
if ([compass.grossprofitChainSign isEqualToString:ReportChainSignPlus]) {
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateDisabled];
}else{
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainMinusImage] forState:UIControlStateDisabled];
}
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",compass.grossprofitChainRate];
[self.lastWeekLabel setTitle:salesYoStr forState:UIControlStateNormal];
//毛利率同比变化率
if ([compass.grossprofitYoYSign isEqualToString:ReportChainSignPlus]) {
[self.lastYearLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateDisabled];
}else{
[self.lastYearLabel setImage:[UIImage imageNamed:ReportChainMinusImage] forState:UIControlStateDisabled];
}
NSString *passengerYoYRateStr = [NSString stringWithFormat:@"%@%%",compass.grossprofitYoYRate];
[self.lastYearLabel setTitle:passengerYoYRateStr forState:UIControlStateNormal];
}
@end
// //
// PassgerPriceHeaderCell.h // RSaleView.h
// XFFruit // XFFruit
// //
// Created by 陈俊俊 on 15/11/8. // Created by 陈俊俊 on 15/11/13.
// Copyright © 2015年 Xummer. All rights reserved. // Copyright © 2015年 Xummer. All rights reserved.
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "Compass.h"
@interface PassgerPriceHeaderCell : UITableViewHeaderFooterView @interface RSaleView : UIView
+ (CGFloat)viewHeight; - (void)setValueInSaleView:(Compass *)compass;
- (void)buildLayout;
@end @end
//
// RSaleView.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/13.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "RSaleView.h"
#define LeftWidth 50
#define ImageSize 20
#define ContentHeight 30
@interface RSaleView ()
@property (nonatomic,strong)UILabel *centerLabel;
@property (nonatomic,strong)UILabel *dateLabel;
@property (nonatomic,strong)UIButton *lastWeekLabel;
@property (nonatomic,strong)UIButton *lastYearLabel;
@property (nonatomic,strong)UILabel *rateLabel;
@property (nonatomic,strong)UILabel *averageLabel;
@property (nonatomic,strong)UIImageView *lastWeekImage;
@property (nonatomic,strong)UIImageView *lastYearImage;
@end
@implementation RSaleView
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout{
CGRect rect = CGRectMake(0, 30, LeftWidth, 20);
rect = CGRectMake(LeftWidth, 20, ScreenSize.width - LeftWidth*2 , ContentHeight);
self.centerLabel = [[UILabel alloc]initWithFrame:rect];
self.centerLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.centerLabel];
rect = CGRectMake(0, self.centerLabel.bottom,self.width, 20);
self.dateLabel = [[UILabel alloc]initWithFrame:rect];
self.dateLabel.textColor = GXF_CONTENT_COLOR;
self.dateLabel.font = GXF_FOURTEENTH_SIZE;
self.dateLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.dateLabel];
CGFloat bottomWidth = (ScreenSize.width - 20)/4;
rect = CGRectMake(10, self.dateLabel.bottom + 5,bottomWidth, ContentHeight);
self.lastWeekLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:ReportContentColor];
[self addSubview:self.lastWeekLabel];
rect = CGRectMake(self.lastWeekLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *weekLabel = [[UILabel alloc]initWithFrame:rect];
weekLabel.textColor = [UIColor lightGrayColor];
weekLabel.text = @"比上周同期";
weekLabel.font = GXF_THREETEENTH_SIZE;
weekLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:weekLabel];
rect = CGRectMake(self.lastWeekLabel.right, self.lastWeekLabel.top,bottomWidth, ContentHeight);
self.lastYearLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:GXF_NAVIGAYION_COLOR];
[self addSubview:self.lastYearLabel];
rect = CGRectMake(self.lastYearLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *yearLabel = [[UILabel alloc]initWithFrame:rect];
yearLabel.textColor = [UIColor lightGrayColor];
yearLabel.text = @"比去年同期";
yearLabel.font = GXF_THREETEENTH_SIZE;
yearLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:yearLabel];
rect = CGRectMake(self.lastYearLabel.right,self.lastWeekLabel.top,bottomWidth, ContentHeight);
self.rateLabel = [[UILabel alloc]initWithFrame:rect];
self.rateLabel.textColor = ReportColor;
self.rateLabel.font = GXF_FIFTEENTEN_SIZE;
self.rateLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.rateLabel];
rect = CGRectMake(self.rateLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *raLabel = [[UILabel alloc]initWithFrame:rect];
raLabel.textColor = [UIColor lightGrayColor];
raLabel.text = @"销售达成率";
raLabel.font = GXF_THREETEENTH_SIZE;
raLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:raLabel];
rect = CGRectMake(self.rateLabel.right, self.lastWeekLabel.top,bottomWidth, ContentHeight);
self.averageLabel = [[UILabel alloc]initWithFrame:rect];
self.averageLabel.textColor = ReportColor;
self.averageLabel.font = GXF_FIFTEENTEN_SIZE;
self.averageLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.averageLabel];
rect = CGRectMake(self.averageLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *avLabel = [[UILabel alloc]initWithFrame:rect];
avLabel.textColor = [UIColor lightGrayColor];
avLabel.text = @"单店日均";
avLabel.font = GXF_THREETEENTH_SIZE;
avLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:avLabel];
}
- (void)setValueInSaleView:(Compass *)compass{
//统计时间
self.dateLabel.text = [NSString stringWithFormat:@"%@累计销售额",compass.dateScope];
//销售额
NSMutableAttributedString *attributeStr1 = [IBTCommon setTextViewBoldFontOfString:@"$ " paragraphStyle:8 fontSize:20 color:ReportColor];
[attributeStr1 appendAttributedString:[IBTCommon setTextViewBoldFontOfString:compass.sales paragraphStyle:8 fontSize:30 color:ReportContentColor]];
self.centerLabel.attributedText = attributeStr1;
//销售环比变化率
if ([compass.salesChainSign isEqualToString:ReportChainSignPlus]) {
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateNormal];
}else{
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainMinusImage] forState:UIControlStateNormal];
}
NSString *salesChainRateStr = [NSString stringWithFormat:@"%@%%",compass.salesChainRate];
[self.lastWeekLabel setTitle:salesChainRateStr forState:UIControlStateNormal];
//销售同比变化率
if ([compass.salesYoYSign isEqualToString:ReportChainSignPlus]) {
[self.lastYearLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateNormal];
}else{
[self.lastYearLabel setImage:[UIImage imageNamed:ReportChainMinusImage] forState:UIControlStateNormal];
}
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",compass.salesYoYRate];
[self.lastYearLabel setTitle:salesYoStr forState:UIControlStateNormal];
//销售目标达成率
NSString *salesTargetStr = [NSString stringWithFormat:@"%@%%",compass.salesTargetRate];
self.rateLabel.text = salesTargetStr;
//单店日均销售
NSString *dailysalesPerStr = [NSString stringWithFormat:@"%@%%",compass.dailysalesPerStore];
self.averageLabel.text = dailysalesPerStr;
}
@end
// //
// PassgerPriceCell.h // RsearchCell.h
// XFFruit // XFFruit
// //
// Created by 陈俊俊 on 15/11/8. // Created by 陈俊俊 on 15/11/17.
// Copyright © 2015年 Xummer. All rights reserved. // Copyright © 2015年 Xummer. All rights reserved.
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface PassgerPriceCell : UITableViewCell @interface RsearchCell : UITableViewCell
+ (CGFloat)cellHeight; + (CGFloat)cellHeight;
@property (nonatomic,strong)UILabel *titleLabel;
- (void)updateCellWith:(id)obj index:(NSIndexPath *)indexPath; @property (nonatomic,strong)UILabel *lineLabel;
@end @end
//
// RsearchCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/11/17.
// Copyright © 2015年 Xummer. All rights reserved.
//
#import "RsearchCell.h"
#define LeftMargin 10
@implementation RsearchCell
+ (CGFloat)cellHeight{
return 50;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin*2, 44))];
self.titleLabel.textAlignment= NSTextAlignmentLeft;
self.titleLabel.textColor = ReportColor;
self.titleLabel.text = @"2222";
self.titleLabel.font = GXF_FIFTEENTEN_SIZE;
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 44-1, ScreenSize.width - LeftMargin * 2, 1))];
self.lineLabel.backgroundColor = [UIColor blackColor];
self.lineLabel.font = GXF_FIFTEENTEN_SIZE;
[self.contentView addSubview:self.titleLabel];
[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
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@interface SaleHeaderView : UITableViewHeaderFooterView @interface SaleHeaderView : UITableViewHeaderFooterView
@property (nonatomic,strong)UIButton *searchBtn; @property (nonatomic,strong)UILabel *totalLabel;
+ (CGFloat)viewHeight; + (CGFloat)viewHeight;
- (void)buildLayout; - (void)buildLayout;
......
...@@ -36,37 +36,35 @@ ...@@ -36,37 +36,35 @@
} }
if(self.textFont == nil) { if(self.textFont == nil) {
self.textFont = [UIFont systemFontOfSize:15]; self.textFont = [UIFont systemFontOfSize:13];
} }
hasBuildLayout = YES; hasBuildLayout = YES;
self.contentView.backgroundColor = XXFBgColor; self.contentView.backgroundColor = ReportTableHeaderColor;
CGRect rect = CGRectMake(0, 0, 50, Sale_Header_Height); CGRect rect = CGRectMake(10, 0, 105, Sale_Header_Height);
UILabel *searLabel = [IBTCommon labelWithTitle:@"280家" frame:rect textFont:self.textFont]; UILabel *searLabel = [IBTCommon labelWithTitle:@"280家" frame:rect textFont:self.textFont];
searLabel.textAlignment = NSTextAlignmentCenter; searLabel.textColor = ReportTitleColor;
[self.contentView addSubview:searLabel]; [self.contentView addSubview:searLabel];
self.totalLabel = searLabel;
rect = CGRectMake(searLabel.right, 0,Sale_Header_Height - 5, Sale_Header_Height); CGFloat width = (ScreenSize.width - searLabel.right - 35)/3;
self.searchBtn = [IBTCommon buttonWithImage:[UIImage imageNamed:@"search"] frame:rect]; rect = CGRectMake(searLabel.right, 0, width + 10, Sale_Header_Height);
[self.contentView addSubview:self.searchBtn]; UILabel * xsBtn = [IBTCommon labelWithTitle:@"销售额" frame:rect textFont:self.textFont];
xsBtn.textColor = ReportTitleColor;
xsBtn.textAlignment = NSTextAlignmentCenter;
CGFloat width = (ScreenSize.width - searLabel.width - self.searchBtn.width - 20)/3;
rect = CGRectMake(self.searchBtn.right + 20 , 0, width, Sale_Header_Height);
UIButton * xsBtn = [IBTCommon buttonWithTitle:@"销售额" Image:[UIImage imageNamed:@"arrowdown"] frame:rect fontSize:15 fontColor:[UIColor blackColor]];
[self.contentView addSubview:xsBtn]; [self.contentView addSubview:xsBtn];
rect = CGRectMake(xsBtn.right , 0, width, Sale_Header_Height); rect = CGRectMake(xsBtn.right , 0, width, Sale_Header_Height);
UIButton * bszLabel = [IBTCommon buttonWithTitle:@"比上周" Image:[UIImage imageNamed:@"arrowdown"] frame:rect fontSize:15 fontColor:[UIColor blackColor]]; UILabel * bszLabel = [IBTCommon labelWithTitle:@"比上周" frame:rect textFont:self.textFont];
bszLabel.textColor = ReportTitleColor;
bszLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:bszLabel]; [self.contentView addSubview:bszLabel];
rect = CGRectMake(bszLabel.right , 0, width-10, Sale_Header_Height);
rect = CGRectMake(bszLabel.right , 0, width, Sale_Header_Height);
UILabel * sclLabel = [IBTCommon labelWithTitle:@"达成率" frame:rect textFont:self.textFont]; UILabel * sclLabel = [IBTCommon labelWithTitle:@"达成率" frame:rect textFont:self.textFont];
sclLabel.textColor = ReportTitleColor;
sclLabel.textAlignment = NSTextAlignmentCenter; sclLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:sclLabel]; [self.contentView addSubview:sclLabel];
......
...@@ -7,12 +7,20 @@ ...@@ -7,12 +7,20 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "OrgCompass.h"
@interface SaleViewCell : UITableViewCell @interface SaleViewCell : UITableViewCell
@property (nonatomic,strong)UIButton *detailBtn;
@property (nonatomic, strong) UILabel *dqLabel;
@property (nonatomic, strong) UILabel *saleLabel;
@property (nonatomic, strong) UILabel *lastWeekLabel;
@property (nonatomic, strong) UILabel *rateLabel;
@property (nonatomic, strong) UILabel *lineLabel;
+ (CGFloat)cellHeight; + (CGFloat)cellHeight;
- (void)updateCellWith:(id)obj index:(NSIndexPath *)indexPath; - (void)updateCellWith:(OrgCompass *)obj index:(NSIndexPath *)indexPath;
@end @end
...@@ -9,19 +9,13 @@ ...@@ -9,19 +9,13 @@
#import "SaleViewCell.h" #import "SaleViewCell.h"
#define Sale_Cell_Height 50 #define Sale_Cell_Height 50
#define Left_Width 85 #define Left_Width 115
#define Left_margin 10 #define Left_margin 0
@interface SaleViewCell () @interface SaleViewCell ()
{ {
BOOL hasBuildLayout; // default, NO; BOOL hasBuildLayout; // default, NO;
} }
@property (nonatomic, strong) UILabel *dqLabel;
@property (nonatomic, strong) UILabel *saleLabel;
@property (nonatomic, strong) UILabel *lastWeekLabel;
@property (nonatomic, strong) UILabel *rateLabel;
@property (nonatomic, strong) UIFont *textFont; @property (nonatomic, strong) UIFont *textFont;
@property (nonatomic, strong) UIFont *titleFont; @property (nonatomic, strong) UIFont *titleFont;
...@@ -50,7 +44,7 @@ ...@@ -50,7 +44,7 @@
if(self.textFont == nil) { if(self.textFont == nil) {
self.textFont = [UIFont systemFontOfSize:13]; self.textFont = [UIFont systemFontOfSize:15];
} }
if(self.titleFont == nil) { if(self.titleFont == nil) {
...@@ -67,12 +61,12 @@ ...@@ -67,12 +61,12 @@
CGRect rect = CGRectMake(Left_margin,0, Left_Width, Sale_Cell_Height); CGRect rect = CGRectMake(Left_margin,0, Left_Width, Sale_Cell_Height);
self.dqLabel = [IBTCommon labelWithTitle:@"0101第一片区" frame:rect textFont:self.textFont]; self.dqLabel = [IBTCommon labelWithTitle:@"0101第一片区" frame:rect textFont:self.textFont];
self.dqLabel.textColor = GXF_NAVIGAYION_COLOR; self.dqLabel.textColor = ReportTitleColor;
[self.contentView addSubview:self.dqLabel]; [self.contentView addSubview:self.dqLabel];
CGFloat width = (ScreenSize.width - self.dqLabel.width)/3; CGFloat width = (ScreenSize.width - self.dqLabel.right - 35)/3;
rect = CGRectMake(self.dqLabel.right , 0, width, Sale_Cell_Height); rect = CGRectMake(self.dqLabel.right , 0, width+10, Sale_Cell_Height);
self.saleLabel = [IBTCommon labelWithTitle:@"56,080" frame:rect textFont:self.textFont]; self.saleLabel = [IBTCommon labelWithTitle:@"56,080" frame:rect textFont:self.textFont];
self.saleLabel.textAlignment = NSTextAlignmentCenter; self.saleLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.saleLabel]; [self.contentView addSubview:self.saleLabel];
...@@ -82,26 +76,47 @@ ...@@ -82,26 +76,47 @@
self.lastWeekLabel.textAlignment = NSTextAlignmentCenter; self.lastWeekLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.lastWeekLabel]; [self.contentView addSubview:self.lastWeekLabel];
rect = CGRectMake(self.lastWeekLabel.right, 0, width, Sale_Cell_Height); rect = CGRectMake(self.lastWeekLabel.right, 0, width-10, Sale_Cell_Height);
self.rateLabel = [IBTCommon labelWithTitle:@"60%" frame:rect textFont:self.textFont]; self.rateLabel = [IBTCommon labelWithTitle:@"60%" frame:rect textFont:self.textFont];
self.rateLabel.textColor = ReportTitleColor;
self.rateLabel.textAlignment = NSTextAlignmentCenter; self.rateLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.rateLabel]; [self.contentView addSubview:self.rateLabel];
UILabel *lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(10, Sale_Cell_Height - 1, ScreenSize.width - 10 * 2, 1))]; rect = CGRectMake(self.rateLabel.right, 0, 35, Sale_Cell_Height);
lineLabel.backgroundColor = GXF_LINE_COLOR; self.detailBtn = [IBTCommon buttonWithTitle:@"详" Image:nil frame:rect fontSize:20 fontColor:ReportColor];
[self.contentView addSubview:lineLabel]; self.detailBtn.titleLabel.font = [UIFont boldSystemFontOfSize:15];
[self.contentView addSubview:self.detailBtn];
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0, Sale_Cell_Height - 1, ScreenSize.width, 1))];
self.lineLabel.backgroundColor = [UIColor lightGrayColor];
[self.contentView addSubview:self.lineLabel];
} }
#pragma mark - update view #pragma mark - update view
- (void)updateCellWith:(id)policy index:(NSIndexPath *)indexPath - (void)updateCellWith:(OrgCompass *)sale index:(NSIndexPath *)indexPath
{ {
self.indexPath = indexPath; self.indexPath = indexPath;
[self buildLayout]; [self buildLayout];
//组织name
self.dqLabel.text = sale.orgname;
//销售额
self.saleLabel.text = sale.sales;
//销售环比变化率
if ([sale.salesChainSign isEqualToString:ReportChainSignPlus]) {
self.lastWeekLabel.textColor = ReportContentColor;
}else{
self.lastWeekLabel.textColor = GXF_NAVIGAYION_COLOR;
}
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",sale.salesChainRate];
self.lastWeekLabel.text = salesYoStr;
//销售目标达成率
NSString *salesTargetRateStr = [NSString stringWithFormat:@"%@%%",sale.salesTargetRate];
self.rateLabel.text = salesTargetRateStr;
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
......
...@@ -10,11 +10,13 @@ ...@@ -10,11 +10,13 @@
@protocol FinishTimeViewDelegate <NSObject> @protocol FinishTimeViewDelegate <NSObject>
- (void)cancelTimeView; - (void)cancelTimeView;
- (void)okTimeView:(NSString *)time; - (void)okTimeView:(NSString *)time withType:(NSString *)type;
@end @end
@interface FinishTimeView : UIView<UIPickerViewDataSource,UIPickerViewDelegate> @interface FinishTimeView : UIView<UIPickerViewDataSource,UIPickerViewDelegate>
@property (nonatomic,weak)id<FinishTimeViewDelegate>delegate; @property (nonatomic,weak)id<FinishTimeViewDelegate>delegate;
- (instancetype)initWithFrame:(CGRect)frame withDate:(NSString *)dateStr; - (instancetype)initWithFrame:(CGRect)frame withDate:(NSString *)dateStr;
- (instancetype)initWithFrame:(CGRect)frame withDate:(NSString *)dateStr type:(NSString *)type;
@end @end
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
@"queryOrders":orderArr, @"queryOrders":orderArr,
@"userUuid":userUtil.userId, @"userUuid":userUtil.userId,
@"pageNumber":@(_currentPage), @"pageNumber":@(_currentPage),
// @"fetchParts":@"pdtDetails", @"fetchParts":@"pdtDetails",
@"pageSize":@(20)}; @"pageSize":@(20)};
[[ICRHTTPController sharedController] queryTransferWithData:dict success:succ failure:fail]; [[ICRHTTPController sharedController] queryTransferWithData:dict success:succ failure:fail];
} }
......
...@@ -262,7 +262,7 @@ typedef enum : NSUInteger { ...@@ -262,7 +262,7 @@ typedef enum : NSUInteger {
return NO; return NO;
} }
for (TransferPdtDetail *billProduct in _bottomView.productVC.transferProductArr) { for (TransferPdtDetail *billProduct in _bottomView.productVC.transferProductArr) {
if ([billProduct.qty integerValue] <= 0 || [billProduct.baseQty integerValue] <= 0) { if ([billProduct.qty floatValue] <= 0 || [billProduct.baseQty floatValue] <= 0) {
ShowMessage(@"有数量等于0的商品明细,请编辑后保存"); ShowMessage(@"有数量等于0的商品明细,请编辑后保存");
return NO; return NO;
} }
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
}else if ([str isEqualToString:@"选择发运单"]){ }else if ([str isEqualToString:@"选择发运单"]){
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransportProduct object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransportProduct object:nil];
}else if ([str isEqualToString:@"选择转运单"]){ }else if ([str isEqualToString:@"选择转运单"]){
// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransferProduct object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransferProduct object:nil];
} }
} }
- (void)clearFromSuper{ - (void)clearFromSuper{
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
- (void)cancelTimeView{ - (void)cancelTimeView{
[self clearDatePickView]; [self clearDatePickView];
} }
- (void)okTimeView:(NSString *)time{ - (void)okTimeView:(NSString *)time withType:(NSString *)type{
_arriveDateLabel.textColor = GXF_CONTENT_COLOR; _arriveDateLabel.textColor = GXF_CONTENT_COLOR;
if (time.length > 15) { if (time.length > 15) {
......
...@@ -156,8 +156,10 @@ ...@@ -156,8 +156,10 @@
sourceT = @"无"; sourceT = @"无";
}else if ([pdtDetail.sourcetype isEqualToString:@"purchase"]) { }else if ([pdtDetail.sourcetype isEqualToString:@"purchase"]) {
sourceT = @"采购单"; sourceT = @"采购单";
}if ([pdtDetail.sourcetype isEqualToString:@"transport"]) { }else if ([pdtDetail.sourcetype isEqualToString:@"transport"]) {
sourceT = @"发运单"; sourceT = @"发运单";
}else if ([pdtDetail.sourcetype isEqualToString:@"transfer"]) {
sourceT = @"转运单";
} }
self.showPurchaseLabel.text = [NSString stringWithFormat:@"来源类型:%@",sourceT]; self.showPurchaseLabel.text = [NSString stringWithFormat:@"来源类型:%@",sourceT];
self.showSourceNumberLabel.text = [NSString stringWithFormat:@"来源单号:%@",pdtDetail.sourcebillnumber.length > 0 ?pdtDetail.sourcebillnumber : @"无"]; self.showSourceNumberLabel.text = [NSString stringWithFormat:@"来源单号:%@",pdtDetail.sourcebillnumber.length > 0 ?pdtDetail.sourcebillnumber : @"无"];
......
...@@ -271,7 +271,7 @@ typedef enum : NSUInteger { ...@@ -271,7 +271,7 @@ typedef enum : NSUInteger {
} }
for (TransportPdtDetail *billProduct in _bottomView.productVC.transportProductArr) { for (TransportPdtDetail *billProduct in _bottomView.productVC.transportProductArr) {
if ([billProduct.qty integerValue] <= 0 || [billProduct.baseQty integerValue] <= 0) { if ([billProduct.qty floatValue] <= 0 || [billProduct.baseQty floatValue] <= 0) {
ShowMessage(@"有数量等于0的商品明细,请编辑后保存"); ShowMessage(@"有数量等于0的商品明细,请编辑后保存");
return NO; return NO;
} }
......
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
- (void)cancelTimeView{ - (void)cancelTimeView{
[self clearDatePickView]; [self clearDatePickView];
} }
- (void)okTimeView:(NSString *)time{ - (void)okTimeView:(NSString *)time withType:(NSString *)type{
_arriveDateLabel.textColor = GXF_CONTENT_COLOR; _arriveDateLabel.textColor = GXF_CONTENT_COLOR;
if (time.length > 15) { if (time.length > 15) {
......
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