// // SalesDataAnalysisVC.m // IBOSS-HJ // // Created by 关宏厚 on 2020/12/30. // Copyright © 2020 elongtian. All rights reserved. // #import "SalesDataAnalysisVC.h" @interface SalesDataAnalysisVC () { UIScrollView *scroll; UIView *content; UIView *salesStatusContent; CAShapeLayer *btnSalesStatusCustomMaskLayer; CAShapeLayer *btnSalesStatusRecentlyThirtyDaysMaskLayer; NSInteger topMargin; UIView *vDate; UIView *collectionContent; UIView *salesAmountContent; UIView *orderStatusContent; UIView *repairStatusContent; UIView *shoppingGuideFilingContent; UIView *deliveryStatusContent; UIView *installStatusContent; UIView *salesAchievementContent; UIView *nextThreeDaysNeedDeliveyCountView; UIView *orderAmountContent; UILabel *lblSalesAmount; UILabel *lblCollectionAmount; UILabel *lblSalesAddCustomer; UILabel *lblOrderCustomerCount; UILabel *lblUnsubscribeCustomerCount; UILabel *lblOrderAmount; UILabel *lblUnsubscribeAmount; UIView *vCollectionStatusDate; UILabel *lblSalesCustomerCount; UILabel *lblSalesAchievementPercent; CAShapeLayer *btnSalesStatusChannelMaskLayer; CAShapeLayer *btnSalesStatusDepartmentMaskLayer; CAShapeLayer *btnCollectionStatusChannelMaskLayer; CAShapeLayer *btnCollectionStatusDepartmentMaskLayer; CAShapeLayer *btnCollectionStatusCustomMaskLayer; CAShapeLayer *btnCollectionStatusRecentlyThirtyDaysMaskLayer; UIView *collectionAmountContent; CAShapeLayer *btnOrderStatusCustomMaskLayer; CAShapeLayer *btnOrderStatusRecentlyThirtyDaysMaskLayer; CAShapeLayer *btnOrderStatusChannelMaskLayer; CAShapeLayer *btnOrderStatusDepartmentMaskLayer; CAShapeLayer *btnSalesAchievementCustomMaskLayer; CAShapeLayer *btnSalesAchievementCurrentMonthMaskLayer; UIView *vOrderStatusDate; UILabel *lblSalesAchievementPlanAmount; UILabel *lblSalesAchievementSalesAmount; CAShapeLayer *btnSalesAchievementDepartmentMaskLayer; CAShapeLayer *btnSalesAchievementStaffMaskLayer; UILabel *lblFilingCustomerCount; UILabel *lblTransactionCustomerCount; UILabel *lblTransactionPercent; UILabel *lblDeliveryPercent; UILabel *lblInstallPercent; UILabel *lblRepairPercent; UILabel *lblNeedDeliveryCustomerCount; UILabel *lblDeliveredCustomerCount; UILabel *lblNeedInstallCustomerCount; UILabel *lblInstalledCustomerCount; UILabel *lblNeedRepairCustomerCount; UILabel *lblRepairedCustomerCount; UILabel *lblNextDayNeedDeliveryCount; UILabel *lblNextTwoDaysNeedDeliveryCount; UILabel *lblNextThreeDaysNeedDeliveryCount; UILabel *lblNextDayNeedInstallCount; UILabel *lblNextTwoDaysNeedInstallCount; UILabel *lblNextThreeDaysNeedInstallCount; UILabel *lblNextDayNeedRepairCount; UILabel *lblNextTwoDaysNeedRepairCount; UILabel *lblNextThreeDaysNeedRepairCount; NSMutableArray *salesStatusXArray; NSMutableArray *salesStatusYArray; NSMutableArray *collectionStatusXArray; NSMutableArray *collectionStatusYArray; NSMutableArray *orderStatusXArray; NSMutableArray *orderStatusYArray; NSMutableArray *salesAchievementXArray; NSMutableArray *salesAchievementYArray; NSMutableArray *salesAchievementTitleArray; NSMutableArray *shoppingGuideXArray; NSMutableArray *shoppingGuideYArray; NSMutableArray *shoppingGuideTitleArray; CGFloat height; NSString *typeId; NSString *salesAchievementTypeId; NSString *cashStatusTypeId; NSString *orderStatusTypeId; UIView *nextDayNeedDeliveyCountView; UIView *nextDayNeedInstallCountView; UIView *nextDayNeedRepairCountView; CustomBorderView *salesStatusBorderV; CustomBorderView *collectionStatusBorderV; CustomBorderView *orderStatusBorderV; CustomBorderView *shoppingGuidePieBorderV; CustomBorderView *shoppingGuideChartBorderV; CustomBorderView *deliveryStatusBorderV; CustomBorderView *installStatusBorderV; CustomBorderView *repairStatusBorderV; CustomBorderView *salesAchievementBorderV; CustomBorderView *salesAchievementPieBorderV; int borderWidth; } @end @implementation SalesDataAnalysisVC #pragma mark - 公共函数 - (void)viewDidLoad { [super viewDidLoad]; topMargin=15; typeId=@"1"; height=0; borderWidth=1; cashStatusTypeId=@"1"; orderStatusTypeId=@"1"; salesAchievementTypeId=@"0"; salesStatusXArray=[[NSMutableArray alloc]init]; salesStatusYArray=[[NSMutableArray alloc]init]; collectionStatusXArray=[[NSMutableArray alloc]init]; collectionStatusYArray=[[NSMutableArray alloc]init]; NSArray *initDateArray= [DateFormat getMonthFirstLastDay]; _shoppingGuideStartDate=[initDateArray objectAtIndex:0]; _shoppingGuideEndDate=[DateFormat getCurrentDate]; _deliveryStatusStartDate=[initDateArray objectAtIndex:0]; _deliveryStatusEndDate=[DateFormat getCurrentDate]; _installStatusStartDate=[initDateArray objectAtIndex:0]; _installStatusEndDate=[DateFormat getCurrentDate]; _repairStatusStartDate=[initDateArray objectAtIndex:0]; _repairStatusEndDate=[DateFormat getCurrentDate]; orderStatusXArray=[[NSMutableArray alloc]init]; orderStatusYArray=[[NSMutableArray alloc]init]; salesAchievementXArray=[[NSMutableArray alloc]init]; // [salesAchievementXArray addObject:@"总经办"]; // [salesAchievementXArray addObject:@"工程部"]; // [salesAchievementXArray addObject:@"采购中心"]; salesAchievementYArray=[[NSMutableArray alloc]init]; // NSMutableDictionary *dic=[[NSMutableDictionary alloc]init]; // [dic setObject:@"40000" forKey:@"planAmount"]; // [dic setObject:@"38000" forKey:@"saleAmount"]; // [salesAchievementYArray addObject:dic]; // NSMutableDictionary *dic1=[[NSMutableDictionary alloc]init]; // [dic1 setObject:@"30000" forKey:@"planAmount"]; // [dic1 setObject:@"20000" forKey:@"saleAmount"]; // [salesAchievementYArray addObject:dic1]; // // NSMutableDictionary *dic2=[[NSMutableDictionary alloc]init]; // [dic2 setObject:@"35000" forKey:@"planAmount"]; // [dic2 setObject:@"23000" forKey:@"saleAmount"]; // [salesAchievementYArray addObject:dic2]; salesAchievementTitleArray=[[NSMutableArray alloc]init]; [salesAchievementTitleArray addObject:@"任务额"]; [salesAchievementTitleArray addObject:@"销售额"]; shoppingGuideXArray=[[NSMutableArray alloc]init]; shoppingGuideTitleArray=[[NSMutableArray alloc]init]; [shoppingGuideTitleArray addObject:@"成交客户数"]; [shoppingGuideTitleArray addObject:@"报备客户数"]; shoppingGuideYArray=[[NSMutableArray alloc]init]; [self loadNavStyle]; [self initUI]; [self startLoading]; _salesStatusStartDate=[DateFormat getCurrentDate]; _salesStatusEndDate=[DateFormat getCurrentDate]; _collectionStatusStartDate=[DateFormat getCurrentDate]; _collectionStatusEndDate=[DateFormat getCurrentDate]; // _orderStatusStartDate=[DateFormat getCurrentDate]; _orderStatusStartDate=[DateFormat getCurrentDate]; _orderStatusEndDate=[DateFormat getCurrentDate]; cashStatusTypeId=@"1"; _salesAchievementMonth=[DateFormat getCurrentNoSeparateMonth]; [self asyncConcurrent]; } #pragma mark - 私有函数 /** 切换销售利润按钮颜色 */ -(void)changeSalesStatusButtonColor { btnSalesStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; _btnSalesStatusToday.layer.borderColor=[UIColor lightGrayColor].CGColor; _btnSalesStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor; _btnSalesStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor; btnSalesStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnSalesStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnSalesStatusToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnSalesStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnSalesStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnSalesStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } -(void)changeOrderStatusButtonColor { btnOrderStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnOrderStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnOrderStatusToday.layer.borderColor=[UIColor lightGrayColor].CGColor; [_btnOrderStatusToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnOrderStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor; [_btnOrderStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnOrderStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor; [_btnOrderStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btnOrderStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnOrderStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } -(void)changeCashStatusButtonColor { btnCollectionStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnCollectionStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnCollectionStatusToday.layer.borderColor=[UIColor lightGrayColor].CGColor; [_btnCollectionStatusToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnCollectionStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor; [_btnCollectionStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnCollectionStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor; [_btnCollectionStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btnCollectionStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnCollectionStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } -(void)clearSalesStatusData { lblSalesAmount.text=@"0.00"; lblSalesAddCustomer.text=@"0"; lblSalesCustomerCount.text=@"0"; } -(void)clearCollectionStatusData { lblCollectionAmount.text=@"0.00"; } -(void)clearOrderStatusData { lblOrderCustomerCount.text=@"0"; lblUnsubscribeCustomerCount.text=@"0"; lblOrderAmount.text=@"0.00"; lblUnsubscribeAmount.text=@"0.00"; } -(void)clearSalesAchievementData { lblSalesAchievementPercent.text=@"完成率0.00%"; lblSalesAchievementSalesAmount.text=@"0.00"; lblSalesAchievementPlanAmount.text=@"0.00"; } -(void)clearShoppingGuideFilingData { lblFilingCustomerCount.text=@"0"; lblTransactionCustomerCount.text=@"0"; lblTransactionPercent.text=@"成交率0.00%"; } -(void)clearDeliveryData { lblDeliveredCustomerCount.text=@"0"; lblNeedDeliveryCustomerCount.text=@"0"; lblNextDayNeedDeliveryCount.text=@"0"; lblNextTwoDaysNeedDeliveryCount.text=@"0"; lblNextThreeDaysNeedDeliveryCount.text=@"0"; lblDeliveryPercent.text=@"完成率0.00%"; } -(void)clearInstallData { lblNeedInstallCustomerCount.text=@"0"; lblInstalledCustomerCount.text=@"0"; lblNextDayNeedInstallCount.text=@"0"; lblNextTwoDaysNeedInstallCount.text=@"0"; lblNextThreeDaysNeedInstallCount.text=@"0"; lblInstallPercent.text=@"完成率0.00%"; } -(void)clearRepairData { lblNeedRepairCustomerCount.text=@"0"; lblRepairedCustomerCount.text=@"0"; lblNextDayNeedRepairCount.text=@"0"; lblNextTwoDaysNeedRepairCount.text=@"0"; lblNextThreeDaysNeedRepairCount.text=@"0"; } /** 导航按钮样式 */ -(void)loadNavStyle { self.navigationItem.title=@"销售数据分析"; //返回 UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setBackgroundImage:[UIImage imageNamed:@"icon_back"] forState:UIControlStateNormal]; [button addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside]; button.frame = CGRectMake(0, 0, 15, 18); UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button]; self.navigationItem.leftBarButtonItem = menuButton; } /** 获取y轴最大值 */ -(double)getYAxisMaximumValue:(NSMutableArray*) yValueArray { double maximumValue=[[yValueArray objectAtIndex:0]doubleValue]; for(int i=1;imaximumValue) { maximumValue=yValue; } } return maximumValue; } /** 获取y轴最小值 */ -(double)getYAxisMinimumValue:(NSMutableArray*) yValueArray { double minimumValue=[[yValueArray objectAtIndex:0]doubleValue]; for(int i=1;i_tempSalesStatusStartDate=date; } andCompletionBlock:^(void){ self->_salesStatusStartDate = _tempSalesStatusStartDate; [weakself.btnSalesStatusStartDate setTitle:self->_salesStatusStartDate forState:UIControlStateNormal]; [self startLoading]; [self->salesStatusXArray removeAllObjects]; [self->salesStatusYArray removeAllObjects]; [self clearSalesStatusData]; [self loadSalesStatusData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } /** 选择销售状态结束日期 */ - (void)btnSelectEndDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ self->_tempSalesStatusEndDate=date; } andCompletionBlock:^(void){ self->_salesStatusEndDate = _tempSalesStatusEndDate; [weakself.btnSalesStatusEndDate setTitle:_salesStatusEndDate forState:UIControlStateNormal]; [self->salesStatusXArray removeAllObjects]; [self->salesStatusYArray removeAllObjects]; [self clearSalesStatusData]; [self startLoading]; [self loadSalesStatusData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)selectCollectionStatusCustomDateData { vCollectionStatusDate.hidden=NO; vCollectionStatusDate.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin, Screen_Width, 25); if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ // salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(vCollectionStatusDate.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10); collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } NSArray *dateInitArray=[DateFormat getMonthFirstLastDay]; _collectionStatusStartDate=[dateInitArray objectAtIndex:0]; _collectionStatusEndDate=[DateFormat getCurrentDate]; [_btnCollectionStatusStartDate setTitle:_collectionStatusStartDate forState:UIControlStateNormal]; [_btnCollectionStatusEndDate setTitle:_collectionStatusEndDate forState:UIControlStateNormal]; [self changeCashStatusButtonColor]; btnCollectionStatusCustomMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnCollectionStatusCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; [collectionStatusXArray removeAllObjects]; [collectionStatusYArray removeAllObjects]; NSArray *initMonthArray= [DateFormat getMonthFirstLastDay]; _collectionStatusStartDate=[initMonthArray objectAtIndex:0]; _collectionStatusEndDate=[DateFormat getCurrentDate]; [self clearCollectionStatusData]; [self startLoading]; [self loadCashData]; } -(void)selectCustomDateData { vDate.hidden=NO; vDate.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin, Screen_Width, 25); salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(vDate.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, CGRectGetMaxY(salesStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } NSArray *monthInitArray= [DateFormat getMonthFirstLastDay]; _salesStatusStartDate=[monthInitArray objectAtIndex:0]; _salesStatusEndDate=[DateFormat getCurrentDate]; [_btnSalesStatusStartDate setTitle:_salesStatusStartDate forState:UIControlStateNormal]; [_btnSalesStatusEndDate setTitle:_salesStatusEndDate forState:UIControlStateNormal]; [self changeSalesStatusButtonColor]; btnSalesStatusCustomMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnSalesStatusCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; [salesStatusXArray removeAllObjects]; [salesStatusYArray removeAllObjects]; [self clearSalesStatusData]; [self startLoading]; [self loadSalesStatusData]; } -(void)selectSevenDaysData { vDate.hidden=YES; [self changeSalesStatusButtonColor]; _btnSalesStatusRecentlySevenDays.layer.borderColor=[UIColor redColor].CGColor; [_btnSalesStatusRecentlySevenDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _salesStatusStartDate=[DateFormat getDateBefore:7]; _salesStatusEndDate=[DateFormat getCurrentDate]; salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [salesStatusXArray removeAllObjects]; [salesStatusYArray removeAllObjects]; [self clearSalesStatusData]; [self startLoading]; [self loadSalesStatusData]; } -(void)selectThirtyDaysData { vDate.hidden=YES; [self changeSalesStatusButtonColor]; _btnSalesStatusRecentlyThirtyDays.layer.borderColor=[UIColor redColor].CGColor; [_btnSalesStatusRecentlyThirtyDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _salesStatusStartDate=[DateFormat getDateBefore:30]; _salesStatusEndDate=[DateFormat getCurrentDate]; salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } // // collectionContent.frame=CGRectMake(10, CGRectGetMaxY(salesStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); // // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); // // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); // // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); // [salesStatusXArray removeAllObjects]; [salesStatusYArray removeAllObjects]; [self clearSalesStatusData]; [self startLoading]; [self loadSalesStatusData]; } -(void)selectTodayDateData { vDate.hidden=YES; [salesStatusXArray removeAllObjects]; [salesStatusYArray removeAllObjects]; [self changeSalesStatusButtonColor]; _btnSalesStatusToday.layer.borderColor=[UIColor redColor].CGColor; [_btnSalesStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _salesStatusStartDate=[DateFormat getCurrentDate]; _salesStatusEndDate=[DateFormat getCurrentDate]; salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } // collectionContent.frame=CGRectMake(10, CGRectGetMaxY(salesStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); // // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); // // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); // // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); [self clearSalesStatusData]; [self startLoading]; [self loadSalesStatusData]; } -(void)selectYesterdayDateData { vDate.hidden=YES; [salesStatusXArray removeAllObjects]; [salesStatusYArray removeAllObjects]; [self changeSalesStatusButtonColor]; _btnSalesStatusYesterday.layer.borderColor=[UIColor redColor].CGColor; [_btnSalesStatusYesterday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _salesStatusStartDate=[DateFormat getDateBefore:1]; _salesStatusEndDate=[DateFormat getDateBefore:1]; salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [self clearSalesStatusData]; [self startLoading]; [self loadSalesStatusData]; } -(void)selectCollectionStatusYesterdayDateData { [self changeCashStatusButtonColor]; vCollectionStatusDate.hidden=YES; [collectionStatusXArray removeAllObjects]; [collectionStatusYArray removeAllObjects]; _btnCollectionStatusYesterday.layer.borderColor=[UIColor redColor].CGColor; [_btnCollectionStatusYesterday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _collectionStatusStartDate=[DateFormat getDateBefore:1]; _collectionStatusEndDate=[DateFormat getDateBefore:1]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ // salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10); collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); height=CGRectGetMaxY(collectionContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); // // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); // // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); [self clearCollectionStatusData]; [self startLoading]; [self loadCashData]; } -(void)selectOrderStatusCustomDateData { if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } vOrderStatusDate.hidden=NO; vOrderStatusDate.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin, Screen_Width, 25); orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(vOrderStatusDate.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10); orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [orderStatusXArray removeAllObjects]; [orderStatusYArray removeAllObjects]; NSArray *dateInitArray= [DateFormat getMonthFirstLastDay]; _orderStatusStartDate=[dateInitArray objectAtIndex:0]; _orderStatusEndDate=[DateFormat getCurrentDate]; [_btnOrderStatusStartDate setTitle:_orderStatusStartDate forState:UIControlStateNormal]; [_btnOrderStatusEndDate setTitle:_orderStatusEndDate forState:UIControlStateNormal]; [self clearOrderStatusData]; [self startLoading]; [self loadOrderStatusData]; [self changeOrderStatusButtonColor]; btnOrderStatusCustomMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnOrderStatusCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } -(void)selectOrderStatusYesterdayDateData { [self changeOrderStatusButtonColor]; vOrderStatusDate.hidden=YES; _btnOrderStatusYesterday.layer.borderColor=[UIColor redColor].CGColor; [_btnOrderStatusYesterday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10); orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [orderStatusXArray removeAllObjects]; [orderStatusYArray removeAllObjects]; _orderStatusStartDate=[DateFormat getDateBefore:1]; _orderStatusEndDate=[DateFormat getDateBefore:1]; [self clearOrderStatusData]; [self startLoading]; [self loadOrderStatusData]; } -(void)selectOrderStatusTodayDateData { [self changeOrderStatusButtonColor]; vOrderStatusDate.hidden=YES; [orderStatusXArray removeAllObjects]; [orderStatusYArray removeAllObjects]; _btnOrderStatusToday.layer.borderColor=[UIColor redColor].CGColor; [_btnOrderStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _orderStatusStartDate=[DateFormat getCurrentDate]; _orderStatusEndDate=[DateFormat getCurrentDate]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10); orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); // // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); [self clearOrderStatusData]; [self startLoading]; [self loadOrderStatusData]; } -(void)selectOrderStatusSevenDaysData { [self changeOrderStatusButtonColor]; vOrderStatusDate.hidden=YES; [orderStatusXArray removeAllObjects]; [orderStatusYArray removeAllObjects]; _btnOrderStatusRecentlySevenDays.layer.borderColor=[UIColor redColor].CGColor; [_btnOrderStatusRecentlySevenDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _orderStatusStartDate=[DateFormat getDateBefore:7]; _orderStatusEndDate=[DateFormat getCurrentDate]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10); orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [self clearOrderStatusData]; [self startLoading]; [self loadOrderStatusData]; } -(void)selectOrderStatusThirtyDaysData { [self changeOrderStatusButtonColor]; vOrderStatusDate.hidden=YES; [orderStatusXArray removeAllObjects]; [orderStatusYArray removeAllObjects]; btnOrderStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnOrderStatusRecentlyThirtyDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _orderStatusStartDate=[DateFormat getDateBefore:30]; _orderStatusEndDate=[DateFormat getCurrentDate]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); } orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10); orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [self clearOrderStatusData]; [self startLoading]; [self loadOrderStatusData]; } -(void)selectCollectionStatusTodayDateData { [self changeCashStatusButtonColor]; vCollectionStatusDate.hidden=YES; _btnCollectionStatusToday.layer.borderColor=[UIColor redColor].CGColor; [_btnCollectionStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ // salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10); collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [collectionStatusXArray removeAllObjects]; [collectionStatusYArray removeAllObjects]; _collectionStatusStartDate=[DateFormat getCurrentDate]; _collectionStatusEndDate=[DateFormat getCurrentDate]; [self clearCollectionStatusData]; [self startLoading]; [self loadCashData]; } -(void)selectCollectionStatusSevenDaysData { vCollectionStatusDate.hidden=YES; [collectionStatusXArray removeAllObjects]; [collectionStatusYArray removeAllObjects]; [self changeCashStatusButtonColor]; _btnCollectionStatusRecentlySevenDays.layer.borderColor=[UIColor redColor].CGColor; [_btnCollectionStatusRecentlySevenDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _collectionStatusStartDate=[DateFormat getDateBefore:7]; _collectionStatusEndDate=[DateFormat getCurrentDate]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ // salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10); collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [self clearCollectionStatusData]; [self startLoading]; [self loadCashData]; } -(void)selectCollectionStatusThirtyDaysData { vCollectionStatusDate.hidden=YES; [collectionStatusXArray removeAllObjects]; [collectionStatusYArray removeAllObjects]; [self changeCashStatusButtonColor]; btnCollectionStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnCollectionStatusRecentlyThirtyDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _collectionStatusStartDate=[DateFormat getDateBefore:30]; _collectionStatusEndDate=[DateFormat getCurrentDate]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ // salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); } collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10); collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); height=CGRectGetMaxY(collectionContent.frame); if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound) { shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound) { deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound) { installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound) { repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); height=CGRectGetMaxY(repairStatusContent.frame); } [self clearCollectionStatusData]; [self startLoading]; [self loadCashData]; } -(void)initUI { int rowHeight=50; content=[UIView new]; content.frame=CGRectMake(0, 0,Screen_Width,0); scroll=[[UIScrollView alloc]init]; scroll.frame=CGRectMake(0,0, Screen_Width, Screen_Height); [self.view addSubview:scroll]; [scroll addSubview:content]; if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ salesStatusContent=[UIView new]; salesStatusContent.frame=CGRectMake(10, 10,Screen_Width,0); salesStatusContent.backgroundColor=[UIColor whiteColor]; [content addSubview:salesStatusContent]; UIView *salesStatusTitleView = [[UIView alloc]init]; salesStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45); UIView *salesStatusImgView=[UIImageView new]; salesStatusImgView.frame=CGRectMake(10, 10,10 , 25); [salesStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]]; [salesStatusTitleView addSubview:salesStatusImgView]; UILabel *titleSalesStatus = [[UILabel alloc]init]; titleSalesStatus.frame = CGRectMake(CGRectGetMaxX(salesStatusImgView.frame)+10, 10, 100, 25); titleSalesStatus.text = @"销售情况"; titleSalesStatus.textColor = [UIColor blackColor]; titleSalesStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [salesStatusTitleView addSubview:titleSalesStatus]; [salesStatusContent addSubview:salesStatusTitleView]; UIView *separator=[UIView new]; separator.frame=CGRectMake(0,salesStatusTitleView.frame.size.height-1, salesStatusTitleView.frame.size.width-20, 0.5); [separator setBackgroundColor:[UIColor lightGrayColor]]; [salesStatusTitleView addSubview:separator ]; _btnSalesStatusCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-175-10,CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)]; [_btnSalesStatusCustom setTitle:@"自定义" forState:UIControlStateNormal]; [_btnSalesStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnSalesStatusCustom.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnSalesStatusCustom addTarget:self action:@selector(selectCustomDateData) forControlEvents:UIControlEventTouchUpInside]; UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_btnSalesStatusCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer = [CAShapeLayer layer]; maskLayer.frame = _btnSalesStatusCustom.bounds; maskLayer.path = maskPath.CGPath; _btnSalesStatusCustom.layer.mask = maskLayer; [salesStatusContent addSubview:_btnSalesStatusCustom]; btnSalesStatusCustomMaskLayer = [CAShapeLayer layer]; btnSalesStatusCustomMaskLayer.frame = _btnSalesStatusCustom.bounds; btnSalesStatusCustomMaskLayer.path = maskPath.CGPath; btnSalesStatusCustomMaskLayer.fillColor=[UIColor clearColor].CGColor; btnSalesStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnSalesStatusCustomMaskLayer.lineWidth=1; [_btnSalesStatusCustom.layer addSublayer:btnSalesStatusCustomMaskLayer]; _btnSalesStatusYesterday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusCustom.frame),CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)]; [_btnSalesStatusYesterday setTitle:[DateFormat getDateBefore:1] forState:UIControlStateNormal]; _btnSalesStatusYesterday.layer.cornerRadius=0; _btnSalesStatusYesterday.layer.borderWidth=1; [_btnSalesStatusYesterday addTarget:self action:@selector(selectYesterdayDateData) forControlEvents:UIControlEventTouchUpInside]; [_btnSalesStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnSalesStatusYesterday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnSalesStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor; _btnSalesStatusYesterday.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [salesStatusContent addSubview:_btnSalesStatusYesterday]; _btnSalesStatusToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusYesterday.frame),CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)]; [_btnSalesStatusToday setTitle: [DateFormat getCurrentDate]forState:UIControlStateNormal]; _btnSalesStatusToday.layer.cornerRadius=0; _btnSalesStatusToday.layer.borderWidth=1; _btnSalesStatusToday.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnSalesStatusToday addTarget:self action:@selector(selectTodayDateData) forControlEvents:UIControlEventTouchUpInside]; [_btnSalesStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; [_btnSalesStatusToday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnSalesStatusToday.layer.borderColor=[UIColor redColor].CGColor; [salesStatusContent addSubview:_btnSalesStatusToday]; _btnSalesStatusRecentlySevenDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusToday.frame),CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)]; [_btnSalesStatusRecentlySevenDays setTitle:@"近7天" forState:UIControlStateNormal]; _btnSalesStatusRecentlySevenDays.titleLabel.font = [UIFont systemFontOfSize: 10.0]; _btnSalesStatusRecentlySevenDays.layer.cornerRadius=0; _btnSalesStatusRecentlySevenDays.layer.borderWidth=1; [_btnSalesStatusRecentlySevenDays addTarget:self action:@selector(selectSevenDaysData) forControlEvents:UIControlEventTouchUpInside]; [_btnSalesStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnSalesStatusRecentlySevenDays.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnSalesStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor; [salesStatusContent addSubview:_btnSalesStatusRecentlySevenDays]; _btnSalesStatusRecentlyThirtyDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusRecentlySevenDays.frame),CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)]; [_btnSalesStatusRecentlyThirtyDays setTitle:@"近30天" forState:UIControlStateNormal]; _btnSalesStatusRecentlyThirtyDays.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnSalesStatusRecentlyThirtyDays addTarget:self action:@selector(selectThirtyDaysData) forControlEvents:UIControlEventTouchUpInside]; [_btnSalesStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; UIBezierPath *maskPath2 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesStatusRecentlyThirtyDays.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer2 = [CAShapeLayer layer]; maskLayer2.frame = _btnSalesStatusRecentlyThirtyDays.bounds; maskLayer2.path = maskPath2.CGPath; _btnSalesStatusRecentlyThirtyDays.layer.mask = maskLayer2; [salesStatusContent addSubview:_btnSalesStatusRecentlyThirtyDays]; btnSalesStatusRecentlyThirtyDaysMaskLayer = [CAShapeLayer layer]; btnSalesStatusRecentlyThirtyDaysMaskLayer.frame = _btnSalesStatusRecentlyThirtyDays.bounds; btnSalesStatusRecentlyThirtyDaysMaskLayer.path = maskPath2.CGPath; btnSalesStatusRecentlyThirtyDaysMaskLayer.fillColor=[UIColor clearColor].CGColor; btnSalesStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnSalesStatusRecentlyThirtyDaysMaskLayer.lineWidth=1; [_btnSalesStatusRecentlyThirtyDays.layer addSublayer:btnSalesStatusRecentlyThirtyDaysMaskLayer]; vDate =[UIView new]; vDate.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin, Screen_Width, 0); [salesStatusContent addSubview:vDate]; vDate.hidden=YES; _btnSalesStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnSalesStatusStartDate setTitle:_salesStatusStartDate forState:UIControlStateNormal]; [_btnSalesStatusStartDate setBackgroundColor:[UIColor whiteColor]]; [_btnSalesStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnSalesStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:14]; [_btnSalesStatusStartDate addTarget:self action:@selector(btnSelectStartDate) forControlEvents:UIControlEventTouchUpInside]; _btnSalesStatusStartDate.frame = CGRectMake(Screen_Width/2-110 ,0 , 100, 25); [vDate addSubview:_btnSalesStatusStartDate]; UILabel *separatorLbl=[UILabel new]; separatorLbl.frame=CGRectMake(CGRectGetMaxX(_btnSalesStatusStartDate.frame), 0, 20, 25); separatorLbl.text=@"--"; separatorLbl.textColor = [UIColor blackColor]; separatorLbl.font = [UIFont systemFontOfSize: 14]; [vDate addSubview:separatorLbl]; _btnSalesStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnSalesStatusEndDate setTitle:_salesStatusEndDate forState:UIControlStateNormal]; [_btnSalesStatusEndDate setBackgroundColor:[UIColor whiteColor]]; [_btnSalesStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnSalesStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:14]; [_btnSalesStatusEndDate addTarget:self action:@selector(btnSelectEndDate) forControlEvents:UIControlEventTouchUpInside]; _btnSalesStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorLbl.frame) ,0 , 100, 25); [vDate addSubview:_btnSalesStatusEndDate]; salesAmountContent =[[UIView alloc]init]; salesAmountContent.frame = CGRectMake(0,CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin, Screen_Width, 0); [salesStatusContent addSubview:salesAmountContent]; UIView *salesAmountView= [[UIView alloc]init]; salesAmountView.frame = CGRectMake(0,0, Screen_Width, 25); UILabel *lblTitleSalesAmount = [[UILabel alloc]init]; lblTitleSalesAmount.frame = CGRectMake(Screen_Width/2-110, 0, 110, 25); lblTitleSalesAmount.text = @"销售金额:"; lblTitleSalesAmount.textColor = [UIColor redColor]; lblTitleSalesAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [salesAmountView addSubview:lblTitleSalesAmount]; lblSalesAmount = [[UILabel alloc]init]; lblSalesAmount.frame = CGRectMake(CGRectGetMaxX(lblTitleSalesAmount.frame), 0, 150, 25); lblSalesAmount.textColor = [UIColor redColor]; lblSalesAmount.text=@"0.00"; lblSalesAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [salesAmountView addSubview:lblSalesAmount]; [salesAmountContent addSubview:salesAmountView]; UIView *salesAddCustomerView = [[UIView alloc]init]; salesAddCustomerView.frame = CGRectMake(0,CGRectGetMaxY(salesAmountView.frame)+topMargin,Screen_Width/2, rowHeight); lblSalesAddCustomer= [[UILabel alloc]init]; lblSalesAddCustomer.frame = CGRectMake(0, 0,salesAddCustomerView.frame.size.width, 25); lblSalesAddCustomer.textAlignment=UITextAlignmentCenter; lblSalesAddCustomer.textColor = [UIColor blackColor]; lblSalesAddCustomer.text=@"0"; lblSalesAddCustomer.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [salesAddCustomerView addSubview:lblSalesAddCustomer]; UILabel *lblTitleSalesAddCustomer = [[UILabel alloc]init]; lblTitleSalesAddCustomer.frame = CGRectMake(0,CGRectGetMaxY(lblSalesAddCustomer.frame),salesAddCustomerView.frame.size.width, 25); lblTitleSalesAddCustomer.text = @"销售新增客户"; lblTitleSalesAddCustomer.textColor = [UIColor blackColor]; lblTitleSalesAddCustomer.textAlignment=UITextAlignmentCenter; lblTitleSalesAddCustomer.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [salesAddCustomerView addSubview:lblTitleSalesAddCustomer]; [salesAmountContent addSubview:salesAddCustomerView]; UIView *middleSeparator=[UIView new]; middleSeparator.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(salesAmountView.frame)+topMargin, 0.5, 45); middleSeparator.backgroundColor=[UIColor lightGrayColor]; [salesAmountContent addSubview:middleSeparator]; UIView *salesCustomerCountView = [[UIView alloc]init]; salesCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(salesAmountView.frame)+topMargin, Screen_Width/2, rowHeight); lblSalesCustomerCount = [[UILabel alloc]init]; lblSalesCustomerCount.frame = CGRectMake(0, 0, salesCustomerCountView.frame.size.width, 25); lblSalesCustomerCount.textAlignment=UITextAlignmentCenter; lblSalesCustomerCount.text=@"0"; lblSalesCustomerCount.textColor = [UIColor blackColor]; lblSalesCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [salesCustomerCountView addSubview:lblSalesCustomerCount]; UILabel *lblSalesCustomerCountTitle = [[UILabel alloc]init]; lblSalesCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblSalesCustomerCount.frame), salesCustomerCountView.frame.size.width, 25); lblSalesCustomerCountTitle.text = @"销售客户数"; lblSalesCustomerCountTitle.textAlignment=UITextAlignmentCenter; lblSalesCustomerCountTitle.textColor = [UIColor blackColor]; lblSalesCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [salesCustomerCountView addSubview:lblSalesCustomerCountTitle]; [salesAmountContent addSubview:salesCustomerCountView]; _btnSalesStatusDepartment = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(salesAddCustomerView.frame)+topMargin, 70, 35)]; [_btnSalesStatusDepartment setTitle:@"部门" forState:UIControlStateNormal]; [_btnSalesStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _btnSalesStatusDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0]; [_btnSalesStatusDepartment addTarget:self action:@selector(goSalesStatus:) forControlEvents:UIControlEventTouchUpInside]; _btnSalesStatusDepartment.tag=1001; UIBezierPath *maskPath7 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesStatusDepartment.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer8 = [CAShapeLayer layer]; maskLayer8.frame = _btnSalesStatusDepartment.bounds; maskLayer8.path = maskPath7.CGPath; _btnSalesStatusDepartment.layer.mask = maskLayer8; [salesAmountContent addSubview:_btnSalesStatusDepartment]; btnSalesStatusDepartmentMaskLayer = [CAShapeLayer layer]; btnSalesStatusDepartmentMaskLayer.frame = _btnSalesStatusDepartment.bounds; btnSalesStatusDepartmentMaskLayer.path = maskPath7.CGPath; btnSalesStatusDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor; btnSalesStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor; btnSalesStatusDepartmentMaskLayer.lineWidth=1; [_btnSalesStatusDepartment.layer addSublayer:btnSalesStatusDepartmentMaskLayer]; _btnSalesStatusChannel = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusDepartment.frame),CGRectGetMaxY(salesAddCustomerView.frame)+topMargin, 70, 35)]; [_btnSalesStatusChannel setTitle:@"渠道" forState:UIControlStateNormal]; [_btnSalesStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnSalesStatusChannel.tag=1000; [_btnSalesStatusChannel addTarget:self action:@selector(goSalesStatus:) forControlEvents:UIControlEventTouchUpInside]; _btnSalesStatusChannel.titleLabel.font = [UIFont systemFontOfSize: 12.0]; UIBezierPath *maskPath5 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesStatusChannel.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer5 = [CAShapeLayer layer]; maskLayer5.frame = _btnSalesStatusChannel.bounds; maskLayer5.path = maskPath5.CGPath; _btnSalesStatusChannel.layer.mask = maskLayer5; [salesAmountContent addSubview:_btnSalesStatusChannel]; btnSalesStatusChannelMaskLayer = [CAShapeLayer layer]; btnSalesStatusChannelMaskLayer.frame = _btnSalesStatusChannel.bounds; btnSalesStatusChannelMaskLayer.path = maskPath5.CGPath; btnSalesStatusChannelMaskLayer.fillColor=[UIColor clearColor].CGColor; btnSalesStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnSalesStatusChannelMaskLayer.lineWidth=1; [_btnSalesStatusChannel.layer addSublayer:btnSalesStatusChannelMaskLayer]; salesStatusBorderV=[CustomBorderView new]; salesStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnSalesStatusDepartment.frame)+topMargin,Screen_Width-30, 350); [salesStatusBorderV setBackgroundColor:[UIColor whiteColor]]; [salesStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [salesAmountContent addSubview:salesStatusBorderV]; _salesStatusChartView=[[BarChartView alloc]init]; _salesStatusChartView.frame=CGRectMake(0,0,salesStatusBorderV.frame.size.width, 350); [salesStatusBorderV addSubview:_salesStatusChartView]; salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10); salesStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10); height=CGRectGetMaxY(salesStatusContent.frame); salesStatusContent.layer.cornerRadius=CornerRadius; } if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ //收款状态 collectionContent=[UIView new]; collectionContent.backgroundColor=[UIColor whiteColor]; collectionContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0); [content addSubview:collectionContent]; UIView *collectionStatusTitleView = [[UIView alloc]init]; collectionStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45); UIView *collectionStatusImgView=[UIImageView new]; collectionStatusImgView.frame=CGRectMake(10, 10,10 , 25); [collectionStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]]; [collectionStatusTitleView addSubview:collectionStatusImgView]; UILabel *titleCollectionStatus = [[UILabel alloc]init]; titleCollectionStatus.frame = CGRectMake(CGRectGetMaxX(collectionStatusImgView.frame)+10, 10, 100, 25); titleCollectionStatus.text = @"收款情况"; titleCollectionStatus.textColor = [UIColor blackColor]; titleCollectionStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [collectionStatusTitleView addSubview:titleCollectionStatus]; [collectionContent addSubview:collectionStatusTitleView]; UIView *separator1=[UIView new]; separator1.frame=CGRectMake(0,collectionStatusTitleView.frame.size.height-1, collectionStatusTitleView.frame.size.width-20, 0.5); [separator1 setBackgroundColor:[UIColor lightGrayColor]]; [collectionStatusTitleView addSubview:separator1 ]; _btnCollectionStatusCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-175-10,CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)]; [_btnCollectionStatusCustom setTitle:@"自定义" forState:UIControlStateNormal]; [_btnCollectionStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnCollectionStatusCustom.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnCollectionStatusCustom addTarget:self action:@selector(selectCollectionStatusCustomDateData) forControlEvents:UIControlEventTouchUpInside]; UIBezierPath *maskPath1 = [UIBezierPath bezierPathWithRoundedRect:_btnCollectionStatusCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer1 = [CAShapeLayer layer]; maskLayer1.frame = _btnCollectionStatusCustom.bounds; maskLayer1.path = maskPath1.CGPath; _btnCollectionStatusCustom.layer.mask = maskLayer1; [collectionContent addSubview:_btnCollectionStatusCustom]; btnCollectionStatusCustomMaskLayer = [CAShapeLayer layer]; btnCollectionStatusCustomMaskLayer.frame = _btnSalesStatusCustom.bounds; btnCollectionStatusCustomMaskLayer.path = maskPath1.CGPath; btnCollectionStatusCustomMaskLayer.fillColor=[UIColor clearColor].CGColor; btnCollectionStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnCollectionStatusCustomMaskLayer.lineWidth=1; [_btnCollectionStatusCustom.layer addSublayer:btnCollectionStatusCustomMaskLayer]; _btnCollectionStatusYesterday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusCustom.frame),CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)]; [_btnCollectionStatusYesterday setTitle:[DateFormat getDateBefore:1] forState:UIControlStateNormal]; _btnCollectionStatusYesterday.layer.cornerRadius=0; _btnCollectionStatusYesterday.layer.borderWidth=1; [_btnCollectionStatusYesterday addTarget:self action:@selector(selectCollectionStatusYesterdayDateData) forControlEvents:UIControlEventTouchUpInside]; [_btnCollectionStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnCollectionStatusYesterday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnCollectionStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor; _btnCollectionStatusYesterday.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [collectionContent addSubview:_btnCollectionStatusYesterday]; _btnCollectionStatusToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusYesterday.frame),CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)]; [_btnCollectionStatusToday setTitle: [DateFormat getCurrentDate]forState:UIControlStateNormal]; _btnCollectionStatusToday.layer.cornerRadius=0; _btnCollectionStatusToday.layer.borderWidth=1; _btnCollectionStatusToday.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnCollectionStatusToday addTarget:self action:@selector(selectCollectionStatusTodayDateData) forControlEvents:UIControlEventTouchUpInside]; [_btnCollectionStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; [_btnCollectionStatusToday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnCollectionStatusToday.layer.borderColor=[UIColor redColor].CGColor; [collectionContent addSubview:_btnCollectionStatusToday]; _btnCollectionStatusRecentlySevenDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusToday.frame),CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)]; [_btnCollectionStatusRecentlySevenDays setTitle:@"近7天" forState:UIControlStateNormal]; _btnCollectionStatusRecentlySevenDays.titleLabel.font = [UIFont systemFontOfSize: 10.0]; _btnCollectionStatusRecentlySevenDays.layer.cornerRadius=0; _btnCollectionStatusRecentlySevenDays.layer.borderWidth=1; [_btnCollectionStatusRecentlySevenDays addTarget:self action:@selector(selectCollectionStatusSevenDaysData) forControlEvents:UIControlEventTouchUpInside]; [_btnCollectionStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnCollectionStatusRecentlySevenDays.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnCollectionStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor; [collectionContent addSubview:_btnCollectionStatusRecentlySevenDays]; _btnCollectionStatusRecentlyThirtyDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusRecentlySevenDays.frame),CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)]; [_btnCollectionStatusRecentlyThirtyDays setTitle:@"近30天" forState:UIControlStateNormal]; _btnCollectionStatusRecentlyThirtyDays.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnCollectionStatusRecentlyThirtyDays addTarget:self action:@selector(selectCollectionStatusThirtyDaysData) forControlEvents:UIControlEventTouchUpInside]; [_btnCollectionStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; UIBezierPath *maskPath4 = [UIBezierPath bezierPathWithRoundedRect:_btnCollectionStatusRecentlyThirtyDays.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer4 = [CAShapeLayer layer]; maskLayer4.frame = _btnCollectionStatusRecentlyThirtyDays.bounds; maskLayer4.path = maskPath4.CGPath; _btnCollectionStatusRecentlyThirtyDays.layer.mask = maskLayer4; [collectionContent addSubview:_btnCollectionStatusRecentlyThirtyDays]; btnCollectionStatusRecentlyThirtyDaysMaskLayer = [CAShapeLayer layer]; btnCollectionStatusRecentlyThirtyDaysMaskLayer.frame = _btnCollectionStatusRecentlyThirtyDays.bounds; btnCollectionStatusRecentlyThirtyDaysMaskLayer.path = maskPath4.CGPath; btnCollectionStatusRecentlyThirtyDaysMaskLayer.fillColor=[UIColor clearColor].CGColor; btnCollectionStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnCollectionStatusRecentlyThirtyDaysMaskLayer.lineWidth=1; [_btnCollectionStatusRecentlyThirtyDays.layer addSublayer:btnCollectionStatusRecentlyThirtyDaysMaskLayer]; vCollectionStatusDate =[UIView new]; vCollectionStatusDate.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin, Screen_Width, 0); [collectionContent addSubview:vCollectionStatusDate]; vCollectionStatusDate.hidden=YES; _btnCollectionStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnCollectionStatusStartDate setTitle:_collectionStatusStartDate forState:UIControlStateNormal]; [_btnCollectionStatusStartDate setBackgroundColor:[UIColor whiteColor]]; [_btnCollectionStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnCollectionStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:14]; [_btnCollectionStatusStartDate addTarget:self action:@selector(btnSelectCollectionStatusStartDate) forControlEvents:UIControlEventTouchUpInside]; _btnCollectionStatusStartDate.frame = CGRectMake(Screen_Width/2-110 ,0 , 100, 25); [vCollectionStatusDate addSubview:_btnCollectionStatusStartDate]; UILabel *separatorCollectionStatusLbl=[UILabel new]; separatorCollectionStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnCollectionStatusStartDate.frame), 0, 20, 25); separatorCollectionStatusLbl.text=@"--"; separatorCollectionStatusLbl.textColor = [UIColor blackColor]; separatorCollectionStatusLbl.font = [UIFont systemFontOfSize: 14]; [vCollectionStatusDate addSubview:separatorCollectionStatusLbl]; _btnCollectionStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnCollectionStatusEndDate setTitle:_collectionStatusEndDate forState:UIControlStateNormal]; [_btnCollectionStatusEndDate setBackgroundColor:[UIColor whiteColor]]; [_btnCollectionStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnCollectionStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:14]; [_btnCollectionStatusEndDate addTarget:self action:@selector(btnSelectCollectionStatusEndDate) forControlEvents:UIControlEventTouchUpInside]; _btnCollectionStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorCollectionStatusLbl.frame) ,0 , 100, 25); [vCollectionStatusDate addSubview:_btnCollectionStatusEndDate]; collectionAmountContent =[[UIView alloc]init]; collectionAmountContent.frame = CGRectMake(0,CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin, Screen_Width, 0); [collectionContent addSubview:collectionAmountContent]; UIView *collectionAmountView= [[UIView alloc]init]; collectionAmountView.frame = CGRectMake(0,0, Screen_Width, 25); UILabel *lblTitleCollectionAmount = [[UILabel alloc]init]; lblTitleCollectionAmount.frame = CGRectMake(Screen_Width/2-110, 0, 110, 25); lblTitleCollectionAmount.text = @"收款金额:"; lblTitleCollectionAmount.textColor = [UIColor redColor]; lblTitleCollectionAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [collectionAmountView addSubview:lblTitleCollectionAmount]; lblCollectionAmount = [[UILabel alloc]init]; lblCollectionAmount.frame = CGRectMake(CGRectGetMaxX(lblTitleCollectionAmount.frame), 0, 150, 25); lblCollectionAmount.textColor = [UIColor redColor]; lblCollectionAmount.text=@"0.00"; lblCollectionAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [collectionAmountView addSubview:lblCollectionAmount]; [collectionAmountContent addSubview:collectionAmountView]; _btnCollectionStatusDepartment = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(collectionAmountView.frame)+topMargin, 70, 35)]; [_btnCollectionStatusDepartment setTitle:@"部门" forState:UIControlStateNormal]; [_btnCollectionStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _btnCollectionStatusDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0]; [_btnCollectionStatusDepartment addTarget:self action:@selector(goCollectionStatus:) forControlEvents:UIControlEventTouchUpInside]; _btnCollectionStatusDepartment.tag=1003; UIBezierPath *maskPath8 = [UIBezierPath bezierPathWithRoundedRect:_btnCollectionStatusDepartment.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer9 = [CAShapeLayer layer]; maskLayer9.frame = _btnCollectionStatusDepartment.bounds; maskLayer9.path = maskPath8.CGPath; _btnCollectionStatusDepartment.layer.mask = maskLayer9; [collectionAmountContent addSubview:_btnCollectionStatusDepartment]; btnCollectionStatusDepartmentMaskLayer = [CAShapeLayer layer]; btnCollectionStatusDepartmentMaskLayer.frame = _btnSalesStatusDepartment.bounds; btnCollectionStatusDepartmentMaskLayer.path = maskPath8.CGPath; btnCollectionStatusDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor; btnCollectionStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor; btnCollectionStatusDepartmentMaskLayer.lineWidth=1; [_btnCollectionStatusDepartment.layer addSublayer:btnCollectionStatusDepartmentMaskLayer]; _btnCollectionStatusChannel = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusDepartment.frame),CGRectGetMaxY(collectionAmountView.frame)+topMargin, 70, 35)]; [_btnCollectionStatusChannel setTitle:@"渠道" forState:UIControlStateNormal]; [_btnCollectionStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnCollectionStatusChannel.tag=1004; [_btnCollectionStatusChannel addTarget:self action:@selector(goCollectionStatus:) forControlEvents:UIControlEventTouchUpInside]; _btnCollectionStatusChannel.titleLabel.font = [UIFont systemFontOfSize: 12.0]; UIBezierPath *maskPath11 = [UIBezierPath bezierPathWithRoundedRect:_btnCollectionStatusChannel.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer11 = [CAShapeLayer layer]; maskLayer11.frame = _btnCollectionStatusChannel.bounds; maskLayer11.path = maskPath11.CGPath; _btnCollectionStatusChannel.layer.mask = maskLayer11; [collectionAmountContent addSubview:_btnCollectionStatusChannel]; btnCollectionStatusChannelMaskLayer = [CAShapeLayer layer]; btnCollectionStatusChannelMaskLayer.frame = _btnCollectionStatusChannel.bounds; btnCollectionStatusChannelMaskLayer.path = maskPath11.CGPath; btnCollectionStatusChannelMaskLayer.fillColor=[UIColor clearColor].CGColor; btnCollectionStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnCollectionStatusChannelMaskLayer.lineWidth=1; [_btnCollectionStatusChannel.layer addSublayer:btnCollectionStatusChannelMaskLayer]; collectionStatusBorderV=[CustomBorderView new]; collectionStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnCollectionStatusDepartment.frame)+topMargin,Screen_Width-30, 350); [collectionStatusBorderV setBackgroundColor:[UIColor whiteColor]]; [collectionStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [collectionAmountContent addSubview:collectionStatusBorderV]; _collectionStatusChartView=[[BarChartView alloc]init]; _collectionStatusChartView.frame=CGRectMake(0, 0,collectionStatusBorderV.frame.size.width, 350); [collectionStatusBorderV addSubview:_collectionStatusChartView]; collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10); collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10); collectionContent.layer.cornerRadius=CornerRadius; height=CGRectGetMaxY(collectionContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ //订单情况 orderStatusContent=[UIView new]; orderStatusContent.backgroundColor=[UIColor whiteColor]; orderStatusContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0); [content addSubview:orderStatusContent]; UIView *orderStatusTitleView = [[UIView alloc]init]; orderStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45); UIView *orderStatusImgView=[UIImageView new]; orderStatusImgView.frame=CGRectMake(10, 10,10 , 25); [orderStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]]; [orderStatusTitleView addSubview:orderStatusImgView]; UILabel *titleOrderStatus = [[UILabel alloc]init]; titleOrderStatus.frame = CGRectMake(CGRectGetMaxX(orderStatusImgView.frame)+10, 10, 100, 25); titleOrderStatus.text = @"订单情况"; titleOrderStatus.textColor = [UIColor blackColor]; titleOrderStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [orderStatusTitleView addSubview:titleOrderStatus]; [orderStatusContent addSubview:orderStatusTitleView]; UIView *separator2=[UIView new]; separator2.frame=CGRectMake(0,orderStatusTitleView.frame.size.height-1, orderStatusTitleView.frame.size.width-20, 0.5); [separator2 setBackgroundColor:[UIColor lightGrayColor]]; [orderStatusTitleView addSubview:separator2 ]; _btnOrderStatusCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-175-10,CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)]; [_btnOrderStatusCustom setTitle:@"自定义" forState:UIControlStateNormal]; [_btnOrderStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnOrderStatusCustom.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnOrderStatusCustom addTarget:self action:@selector(selectOrderStatusCustomDateData) forControlEvents:UIControlEventTouchUpInside]; UIBezierPath *maskPath13 = [UIBezierPath bezierPathWithRoundedRect:_btnOrderStatusCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer13 = [CAShapeLayer layer]; maskLayer13.frame = _btnOrderStatusCustom.bounds; maskLayer13.path = maskPath13.CGPath; _btnOrderStatusCustom.layer.mask = maskLayer13; [orderStatusContent addSubview:_btnOrderStatusCustom]; btnOrderStatusCustomMaskLayer = [CAShapeLayer layer]; btnOrderStatusCustomMaskLayer.frame = _btnOrderStatusCustom.bounds; btnOrderStatusCustomMaskLayer.path = maskPath13.CGPath; btnOrderStatusCustomMaskLayer.fillColor=[UIColor clearColor].CGColor; btnOrderStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnOrderStatusCustomMaskLayer.lineWidth=1; [_btnOrderStatusCustom.layer addSublayer:btnOrderStatusCustomMaskLayer]; _btnOrderStatusYesterday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusCustom.frame),CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)]; [_btnOrderStatusYesterday setTitle:[DateFormat getDateBefore:1] forState:UIControlStateNormal]; _btnOrderStatusYesterday.layer.cornerRadius=0; _btnOrderStatusYesterday.layer.borderWidth=1; [_btnOrderStatusYesterday addTarget:self action:@selector(selectOrderStatusYesterdayDateData) forControlEvents:UIControlEventTouchUpInside]; [_btnOrderStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnOrderStatusYesterday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnOrderStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor; _btnOrderStatusYesterday.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [orderStatusContent addSubview:_btnOrderStatusYesterday]; _btnOrderStatusToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusYesterday.frame),CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)]; [_btnOrderStatusToday setTitle: [DateFormat getCurrentDate]forState:UIControlStateNormal]; _btnOrderStatusToday.layer.cornerRadius=0; _btnOrderStatusToday.layer.borderWidth=1; _btnOrderStatusToday.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnOrderStatusToday addTarget:self action:@selector(selectOrderStatusTodayDateData) forControlEvents:UIControlEventTouchUpInside]; [_btnOrderStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; [_btnOrderStatusToday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnOrderStatusToday.layer.borderColor=[UIColor redColor].CGColor; [orderStatusContent addSubview:_btnOrderStatusToday]; _btnOrderStatusRecentlySevenDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusToday.frame),CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)]; [_btnOrderStatusRecentlySevenDays setTitle:@"近7天" forState:UIControlStateNormal]; _btnOrderStatusRecentlySevenDays.titleLabel.font = [UIFont systemFontOfSize: 10.0]; _btnOrderStatusRecentlySevenDays.layer.cornerRadius=0; _btnOrderStatusRecentlySevenDays.layer.borderWidth=1; [_btnOrderStatusRecentlySevenDays addTarget:self action:@selector(selectOrderStatusSevenDaysData) forControlEvents:UIControlEventTouchUpInside]; [_btnOrderStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [_btnOrderStatusRecentlySevenDays.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡 _btnOrderStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor; [orderStatusContent addSubview:_btnOrderStatusRecentlySevenDays]; _btnOrderStatusRecentlyThirtyDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusRecentlySevenDays.frame),CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)]; [_btnOrderStatusRecentlyThirtyDays setTitle:@"近30天" forState:UIControlStateNormal]; _btnOrderStatusRecentlyThirtyDays.titleLabel.font = [UIFont systemFontOfSize: 10.0]; [_btnOrderStatusRecentlyThirtyDays addTarget:self action:@selector(selectOrderStatusThirtyDaysData) forControlEvents:UIControlEventTouchUpInside]; [_btnOrderStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; UIBezierPath *maskPath15 = [UIBezierPath bezierPathWithRoundedRect:_btnOrderStatusRecentlyThirtyDays.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer15 = [CAShapeLayer layer]; maskLayer15.frame = _btnOrderStatusRecentlyThirtyDays.bounds; maskLayer15.path = maskPath15.CGPath; _btnOrderStatusRecentlyThirtyDays.layer.mask = maskLayer15; [orderStatusContent addSubview:_btnOrderStatusRecentlyThirtyDays]; btnOrderStatusRecentlyThirtyDaysMaskLayer = [CAShapeLayer layer]; btnOrderStatusRecentlyThirtyDaysMaskLayer.frame = _btnOrderStatusRecentlyThirtyDays.bounds; btnOrderStatusRecentlyThirtyDaysMaskLayer.path = maskPath15.CGPath; btnOrderStatusRecentlyThirtyDaysMaskLayer.fillColor=[UIColor clearColor].CGColor; btnOrderStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnOrderStatusRecentlyThirtyDaysMaskLayer.lineWidth=1; [_btnOrderStatusRecentlyThirtyDays.layer addSublayer:btnOrderStatusRecentlyThirtyDaysMaskLayer]; vOrderStatusDate =[UIView new]; vOrderStatusDate.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin, Screen_Width, 0); [orderStatusContent addSubview:vOrderStatusDate]; vOrderStatusDate.hidden=YES; _btnOrderStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnOrderStatusStartDate setTitle:_orderStatusStartDate forState:UIControlStateNormal]; [_btnOrderStatusStartDate setBackgroundColor:[UIColor whiteColor]]; [_btnOrderStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnOrderStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:14]; [_btnOrderStatusStartDate addTarget:self action:@selector(btnSelectOrderStatusStartDate) forControlEvents:UIControlEventTouchUpInside]; _btnOrderStatusStartDate.frame = CGRectMake(Screen_Width/2-110 ,0 , 100, 25); [vOrderStatusDate addSubview:_btnOrderStatusStartDate]; UILabel *separatorOrderStatusLbl=[UILabel new]; separatorOrderStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnOrderStatusStartDate.frame), 0, 20, 25); separatorOrderStatusLbl.text=@"--"; separatorOrderStatusLbl.textColor = [UIColor blackColor]; separatorOrderStatusLbl.font = [UIFont systemFontOfSize: 14]; [vOrderStatusDate addSubview:separatorOrderStatusLbl]; _btnOrderStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnOrderStatusEndDate setTitle:_orderStatusEndDate forState:UIControlStateNormal]; [_btnOrderStatusEndDate setBackgroundColor:[UIColor whiteColor]]; [_btnOrderStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnOrderStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:14]; [_btnOrderStatusEndDate addTarget:self action:@selector(btnSelectOrderStatusEndDate) forControlEvents:UIControlEventTouchUpInside]; _btnOrderStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorOrderStatusLbl.frame) ,0 , 100, 25); [vOrderStatusDate addSubview:_btnOrderStatusEndDate]; orderAmountContent =[[UIView alloc]init]; orderAmountContent.frame = CGRectMake(0,CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin, Screen_Width, 0); [orderStatusContent addSubview:orderAmountContent]; UIView *orderCustomerCountView = [[UIView alloc]init]; orderCustomerCountView.frame = CGRectMake(0,topMargin,Screen_Width/2, rowHeight); lblOrderCustomerCount= [[UILabel alloc]init]; lblOrderCustomerCount.frame = CGRectMake(0, 0,orderCustomerCountView.frame.size.width, 25); lblOrderCustomerCount.textAlignment=UITextAlignmentCenter; lblOrderCustomerCount.textColor = [UIColor blackColor]; lblOrderCustomerCount.text=@"0"; lblOrderCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [orderCustomerCountView addSubview:lblOrderCustomerCount]; UILabel *lblTitleOrderCustomerCount = [[UILabel alloc]init]; lblTitleOrderCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblOrderCustomerCount.frame),orderCustomerCountView.frame.size.width, 25); lblTitleOrderCustomerCount.text = @"开单户数"; lblTitleOrderCustomerCount.textColor = [UIColor blackColor]; lblTitleOrderCustomerCount.textAlignment=UITextAlignmentCenter; lblTitleOrderCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [orderCustomerCountView addSubview:lblTitleOrderCustomerCount]; [orderAmountContent addSubview:orderCustomerCountView]; UIView *unsubscribeCustomerCountView = [[UIView alloc]init]; unsubscribeCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(orderCustomerCountView.frame)+topMargin,Screen_Width/2, rowHeight); lblUnsubscribeCustomerCount= [[UILabel alloc]init]; lblUnsubscribeCustomerCount.frame = CGRectMake(0, 0,unsubscribeCustomerCountView.frame.size.width, 25); lblUnsubscribeCustomerCount.textAlignment=UITextAlignmentCenter; lblUnsubscribeCustomerCount.textColor = [UIColor blackColor]; lblUnsubscribeCustomerCount.text=@"0"; lblUnsubscribeCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [unsubscribeCustomerCountView addSubview:lblUnsubscribeCustomerCount]; UILabel *lblTitleUnsubscribeCustomerCount = [[UILabel alloc]init]; lblTitleUnsubscribeCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblUnsubscribeCustomerCount.frame),unsubscribeCustomerCountView.frame.size.width, 25); lblTitleUnsubscribeCustomerCount.text = @"退订户数"; lblTitleUnsubscribeCustomerCount.textColor = [UIColor blackColor]; lblTitleUnsubscribeCustomerCount.textAlignment=UITextAlignmentCenter; lblTitleUnsubscribeCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [unsubscribeCustomerCountView addSubview:lblTitleUnsubscribeCustomerCount]; [orderAmountContent addSubview:unsubscribeCustomerCountView]; UIView *middleSeparator1=[UIView new]; middleSeparator1.frame=CGRectMake(Screen_Width/2,topMargin, 0.5, 45); middleSeparator1.backgroundColor=[UIColor lightGrayColor]; [orderAmountContent addSubview:middleSeparator1]; UIView *orderAmountView = [[UIView alloc]init]; orderAmountView.frame = CGRectMake(Screen_Width/2,topMargin, Screen_Width/2, rowHeight); lblOrderAmount = [[UILabel alloc]init]; lblOrderAmount.frame = CGRectMake(0, 0, orderAmountView.frame.size.width, 25); lblOrderAmount.textAlignment=UITextAlignmentCenter; lblOrderAmount.text=@"0.00"; lblOrderAmount.textColor = [UIColor blackColor]; lblOrderAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [orderAmountView addSubview:lblOrderAmount]; UILabel *lblOrderAmountTitle = [[UILabel alloc]init]; lblOrderAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblOrderAmount.frame), orderAmountView.frame.size.width, 25); lblOrderAmountTitle.text = @"开单金额"; lblOrderAmountTitle.textAlignment=UITextAlignmentCenter; lblOrderAmountTitle.textColor = [UIColor blackColor]; lblOrderAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [orderAmountView addSubview:lblOrderAmountTitle]; [orderAmountContent addSubview:orderAmountView]; UIView *unsubscribeAmountView = [[UIView alloc]init]; unsubscribeAmountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(orderAmountView.frame)+topMargin, Screen_Width/2, rowHeight); lblUnsubscribeAmount = [[UILabel alloc]init]; lblUnsubscribeAmount.frame = CGRectMake(0, 0, unsubscribeAmountView.frame.size.width, 25); lblUnsubscribeAmount.textAlignment=UITextAlignmentCenter; lblUnsubscribeAmount.text=@"0.00"; lblUnsubscribeAmount.textColor = [UIColor blackColor]; lblUnsubscribeAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [unsubscribeAmountView addSubview:lblUnsubscribeAmount]; UILabel *lblUnsubscribeAmountTitle= [[UILabel alloc]init]; lblUnsubscribeAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblUnsubscribeAmount.frame), unsubscribeAmountView.frame.size.width, 25); lblUnsubscribeAmountTitle.text = @"退订金额"; lblUnsubscribeAmountTitle.textAlignment=UITextAlignmentCenter; lblUnsubscribeAmountTitle.textColor = [UIColor blackColor]; lblUnsubscribeAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [unsubscribeAmountView addSubview:lblUnsubscribeAmountTitle]; [orderAmountContent addSubview:unsubscribeAmountView]; _btnOrderStatusDepartment = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(unsubscribeCustomerCountView.frame)+topMargin, 70, 35)]; [_btnOrderStatusDepartment setTitle:@"部门" forState:UIControlStateNormal]; [_btnOrderStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _btnOrderStatusDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0]; [_btnOrderStatusDepartment addTarget:self action:@selector(goOrderStatus:) forControlEvents:UIControlEventTouchUpInside]; _btnOrderStatusDepartment.tag=1005; UIBezierPath *maskPath16 = [UIBezierPath bezierPathWithRoundedRect:_btnOrderStatusDepartment.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer16 = [CAShapeLayer layer]; maskLayer16.frame = _btnOrderStatusDepartment.bounds; maskLayer16.path = maskPath16.CGPath; _btnOrderStatusDepartment.layer.mask = maskLayer16; [orderAmountContent addSubview:_btnOrderStatusDepartment]; btnOrderStatusDepartmentMaskLayer = [CAShapeLayer layer]; btnOrderStatusDepartmentMaskLayer.frame = _btnOrderStatusDepartment.bounds; btnOrderStatusDepartmentMaskLayer.path = maskPath16.CGPath; btnOrderStatusDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor; btnOrderStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor; btnOrderStatusDepartmentMaskLayer.lineWidth=1; [_btnOrderStatusDepartment.layer addSublayer:btnOrderStatusDepartmentMaskLayer]; _btnOrderStatusChannel = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusDepartment.frame),CGRectGetMaxY(unsubscribeCustomerCountView.frame)+topMargin, 70, 35)]; [_btnOrderStatusChannel setTitle:@"渠道" forState:UIControlStateNormal]; [_btnOrderStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnOrderStatusChannel.tag=1006; [_btnOrderStatusChannel addTarget:self action:@selector(goOrderStatus:) forControlEvents:UIControlEventTouchUpInside]; _btnOrderStatusChannel.titleLabel.font = [UIFont systemFontOfSize: 12.0]; UIBezierPath *maskPath19 = [UIBezierPath bezierPathWithRoundedRect:_btnOrderStatusChannel.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer19 = [CAShapeLayer layer]; maskLayer19.frame = _btnOrderStatusChannel.bounds; maskLayer19.path = maskPath19.CGPath; _btnOrderStatusChannel.layer.mask = maskLayer19; [orderAmountContent addSubview:_btnOrderStatusChannel]; btnOrderStatusChannelMaskLayer = [CAShapeLayer layer]; btnOrderStatusChannelMaskLayer.frame = _btnOrderStatusChannel.bounds; btnOrderStatusChannelMaskLayer.path = maskPath19.CGPath; btnOrderStatusChannelMaskLayer.fillColor=[UIColor clearColor].CGColor; btnOrderStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnOrderStatusChannelMaskLayer.lineWidth=1; [_btnOrderStatusChannel.layer addSublayer:btnOrderStatusChannelMaskLayer]; orderStatusBorderV=[CustomBorderView new]; orderStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnOrderStatusDepartment.frame)+topMargin,Screen_Width-30, 350); [orderStatusBorderV setBackgroundColor:[UIColor whiteColor]]; [orderStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [orderAmountContent addSubview:orderStatusBorderV]; _orderStatusChartView=[[BarChartView alloc]init]; _orderStatusChartView.frame=CGRectMake(0,0,orderStatusBorderV.frame.size.width, 350); [orderStatusBorderV addSubview:_orderStatusChartView]; orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10); orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10); orderStatusContent.layer.cornerRadius=CornerRadius; height=CGRectGetMaxY(orderStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ salesAchievementContent=[UIView new]; salesAchievementContent.backgroundColor=[UIColor whiteColor]; salesAchievementContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0); [content addSubview:salesAchievementContent]; UIView *salesAchievementTitleView = [[UIView alloc]init]; salesAchievementTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45); UIView *salesAchievementImgView=[UIImageView new]; salesAchievementImgView.frame=CGRectMake(10, 10,10 , 25); [salesAchievementImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]]; [salesAchievementTitleView addSubview:salesAchievementImgView]; UILabel *titleSalesAchievement = [[UILabel alloc]init]; titleSalesAchievement.frame = CGRectMake(CGRectGetMaxX(salesAchievementImgView.frame)+10, 10, 100, 25); titleSalesAchievement.text = @"销售业绩"; titleSalesAchievement.textColor = [UIColor blackColor]; titleSalesAchievement.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [salesAchievementTitleView addSubview:titleSalesAchievement]; [salesAchievementContent addSubview:salesAchievementTitleView]; UIView *separator3=[UIView new]; separator3.frame=CGRectMake(0,salesAchievementTitleView.frame.size.height-1, salesAchievementTitleView.frame.size.width-20, 0.5); [separator3 setBackgroundColor:[UIColor lightGrayColor]]; [salesAchievementTitleView addSubview:separator3 ]; _btnSalesAchievementCustom= [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-90,CGRectGetMaxY(salesAchievementTitleView.frame)+topMargin, 70, 35)]; [_btnSalesAchievementCustom setTitle:@"自定义" forState:UIControlStateNormal]; [_btnSalesAchievementCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnSalesAchievementCustom.titleLabel.font = [UIFont systemFontOfSize: 12.0]; [_btnSalesAchievementCustom addTarget:self action:@selector(selectSalesAchievementCustomDate) forControlEvents:UIControlEventTouchUpInside]; UIBezierPath *maskPath20 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesAchievementCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer20 = [CAShapeLayer layer]; maskLayer20.frame = _btnSalesAchievementCustom.bounds; maskLayer20.path = maskPath20.CGPath; _btnSalesAchievementCustom.layer.mask = maskLayer20; btnSalesAchievementCustomMaskLayer= [CAShapeLayer layer]; btnSalesAchievementCustomMaskLayer.frame = _btnSalesAchievementCustom.bounds; btnSalesAchievementCustomMaskLayer.path = maskPath20.CGPath; btnSalesAchievementCustomMaskLayer.fillColor=[UIColor clearColor].CGColor; btnSalesAchievementCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnSalesAchievementCustomMaskLayer.lineWidth=1; [_btnSalesAchievementCustom.layer addSublayer:btnSalesAchievementCustomMaskLayer]; [salesAchievementContent addSubview:_btnSalesAchievementCustom]; _btnSalesAchievemmentToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesAchievementCustom.frame),CGRectGetMaxY(salesAchievementTitleView.frame)+topMargin, 70, 35)]; _btnSalesAchievemmentToday.titleLabel.font = [UIFont systemFontOfSize: 12.0]; [_btnSalesAchievemmentToday setTitle:[DateFormat getCurrentMonth] forState:UIControlStateNormal]; [_btnSalesAchievemmentToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; [_btnSalesAchievemmentToday addTarget:self action:@selector(getSalesAchievementCurrentMonth) forControlEvents:UIControlEventTouchUpInside]; UIBezierPath *maskPath22 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesAchievemmentToday.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer22 = [CAShapeLayer layer]; maskLayer22.frame = _btnSalesAchievemmentToday.bounds; maskLayer22.path = maskPath22.CGPath; _btnSalesAchievemmentToday.layer.mask = maskLayer22; btnSalesAchievementCurrentMonthMaskLayer= [CAShapeLayer layer]; btnSalesAchievementCurrentMonthMaskLayer.frame = _btnSalesAchievemmentToday.bounds; btnSalesAchievementCurrentMonthMaskLayer.path = maskPath22.CGPath; btnSalesAchievementCurrentMonthMaskLayer.fillColor=[UIColor clearColor].CGColor; btnSalesAchievementCurrentMonthMaskLayer.strokeColor=[UIColor redColor].CGColor; btnSalesAchievementCurrentMonthMaskLayer.lineWidth=1; [_btnSalesAchievemmentToday.layer addSublayer:btnSalesAchievementCurrentMonthMaskLayer]; [salesAchievementContent addSubview:_btnSalesAchievemmentToday]; salesAchievementPieBorderV=[CustomBorderView new]; salesAchievementPieBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnSalesAchievementCustom.frame)+topMargin,Screen_Width-30, 200); [salesAchievementPieBorderV setBackgroundColor:[UIColor whiteColor]]; [salesAchievementPieBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [salesAchievementContent addSubview:salesAchievementPieBorderV]; _salesAchievementChart = [[MyView alloc]initWithFrame:CGRectMake(0,0, salesAchievementPieBorderV.frame.size.width,200)]; [salesAchievementPieBorderV addSubview:_salesAchievementChart]; UIView *percentView = [[UIView alloc]init]; percentView.frame = CGRectMake(0,CGRectGetMaxY(salesAchievementPieBorderV.frame)-30, Screen_Width, 25); lblSalesAchievementPercent= [[UILabel alloc]init]; lblSalesAchievementPercent.frame = CGRectMake(0, 0, percentView.frame.size.width, 25); lblSalesAchievementPercent.textColor = [UIColor blackColor]; lblSalesAchievementPercent.text=@"完成率0.00%"; lblSalesAchievementPercent.font = [UIFont systemFontOfSize:22]; lblSalesAchievementPercent.textAlignment=NSTextAlignmentCenter; [percentView addSubview:lblSalesAchievementPercent]; [salesAchievementContent addSubview:percentView]; UIView *planAmountView = [[UIView alloc]init]; planAmountView.frame = CGRectMake(0,CGRectGetMaxY(percentView.frame)+topMargin, Screen_Width/2, rowHeight); lblSalesAchievementPlanAmount = [[UILabel alloc]init]; lblSalesAchievementPlanAmount.frame = CGRectMake(0, 0, planAmountView.frame.size.width, 25); lblSalesAchievementPlanAmount.textColor = [UIColor blackColor]; lblSalesAchievementPlanAmount.text=@"0.00"; lblSalesAchievementPlanAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; lblSalesAchievementPlanAmount.textAlignment=NSTextAlignmentCenter; [planAmountView addSubview:lblSalesAchievementPlanAmount]; UILabel *lblTitleSalesAchievementPlanAmount = [[UILabel alloc]init]; lblTitleSalesAchievementPlanAmount.frame = CGRectMake(0,CGRectGetMaxY(lblSalesAchievementPlanAmount.frame),planAmountView.frame.size.width, 25); lblTitleSalesAchievementPlanAmount.text = @"任务额"; lblTitleSalesAchievementPlanAmount.textColor = [UIColor blackColor]; lblTitleSalesAchievementPlanAmount.textAlignment=NSTextAlignmentCenter; lblTitleSalesAchievementPlanAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [planAmountView addSubview:lblTitleSalesAchievementPlanAmount]; [salesAchievementContent addSubview:planAmountView]; UIView *middleSeparator7=[UIView new]; middleSeparator7.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(percentView.frame)+topMargin,0.5, 45); middleSeparator7.backgroundColor=[UIColor lightGrayColor]; [salesAchievementContent addSubview:middleSeparator7]; UIView *achievementSalesAmountView = [[UIView alloc]init]; achievementSalesAmountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(percentView.frame)+topMargin,Screen_Width/2,rowHeight); lblSalesAchievementSalesAmount = [[UILabel alloc]init]; lblSalesAchievementSalesAmount.frame = CGRectMake(0, 0,achievementSalesAmountView.frame.size.width, 25); lblSalesAchievementSalesAmount.text=@"0.00"; lblSalesAchievementSalesAmount.textColor = [UIColor blackColor]; lblSalesAchievementSalesAmount.textAlignment=NSTextAlignmentCenter; lblSalesAchievementSalesAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [achievementSalesAmountView addSubview:lblSalesAchievementSalesAmount]; UILabel *lblAchievementSalesAmountTitle= [[UILabel alloc]init]; lblAchievementSalesAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblSalesAchievementSalesAmount.frame), achievementSalesAmountView.frame.size.width, 25); lblAchievementSalesAmountTitle.text = @"销售金额"; lblAchievementSalesAmountTitle.textAlignment=NSTextAlignmentCenter; lblAchievementSalesAmountTitle.textColor = [UIColor blackColor]; lblAchievementSalesAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [achievementSalesAmountView addSubview:lblAchievementSalesAmountTitle]; [salesAchievementContent addSubview:achievementSalesAmountView]; _btnSalesAchievementDepartment = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(planAmountView.frame)+topMargin, 70, 35)]; [_btnSalesAchievementDepartment setTitle:@"部门" forState:UIControlStateNormal]; [_btnSalesAchievementDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; _btnSalesAchievementDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0]; [_btnSalesAchievementDepartment addTarget:self action:@selector(goSalesAchievement:) forControlEvents:UIControlEventTouchUpInside]; _btnSalesAchievementDepartment.tag=1007; UIBezierPath *maskPath23 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesAchievementDepartment.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer24 = [CAShapeLayer layer]; maskLayer24.frame = _btnSalesAchievementDepartment.bounds; maskLayer24.path = maskPath23.CGPath; _btnSalesAchievementDepartment.layer.mask = maskLayer24; [salesAchievementContent addSubview:_btnSalesAchievementDepartment]; btnSalesAchievementDepartmentMaskLayer = [CAShapeLayer layer]; btnSalesAchievementDepartmentMaskLayer.frame = _btnSalesAchievementDepartment.bounds; btnSalesAchievementDepartmentMaskLayer.path = maskPath23.CGPath; btnSalesAchievementDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor; btnSalesAchievementDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor; btnSalesAchievementDepartmentMaskLayer.lineWidth=1; [_btnSalesAchievementDepartment.layer addSublayer:btnSalesAchievementDepartmentMaskLayer]; _btnSalesAchievementStaff = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesAchievementDepartment.frame),CGRectGetMaxY(planAmountView.frame)+topMargin, 70, 35)]; [_btnSalesAchievementStaff setTitle:@"业务员" forState:UIControlStateNormal]; [_btnSalesAchievementStaff setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnSalesAchievementStaff.tag=1008; [_btnSalesAchievementStaff addTarget:self action:@selector(goSalesAchievement:) forControlEvents:UIControlEventTouchUpInside]; _btnSalesAchievementStaff.titleLabel.font = [UIFont systemFontOfSize: 12.0]; UIBezierPath *maskPath26 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesAchievementStaff.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)]; CAShapeLayer *maskLayer26 = [CAShapeLayer layer]; maskLayer26.frame = _btnSalesAchievementStaff.bounds; maskLayer26.path = maskPath26.CGPath; _btnSalesAchievementStaff.layer.mask = maskLayer26; [salesAchievementContent addSubview:_btnSalesAchievementStaff]; btnSalesAchievementStaffMaskLayer = [CAShapeLayer layer]; btnSalesAchievementStaffMaskLayer.frame = _btnSalesAchievementStaff.bounds; btnSalesAchievementStaffMaskLayer.path = maskPath26.CGPath; btnSalesAchievementStaffMaskLayer.fillColor=[UIColor clearColor].CGColor; btnSalesAchievementStaffMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; btnSalesAchievementStaffMaskLayer.lineWidth=1; [_btnSalesAchievementStaff.layer addSublayer:btnSalesAchievementStaffMaskLayer]; salesAchievementBorderV=[CustomBorderView new]; salesAchievementBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnSalesAchievementDepartment.frame)+topMargin,Screen_Width-30, 350); [salesAchievementBorderV setBackgroundColor:[UIColor whiteColor]]; [salesAchievementBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [salesAchievementContent addSubview:salesAchievementBorderV]; _salesAchievementChartView=[[BarChartView alloc]init]; _salesAchievementChartView.frame=CGRectMake(0,0,salesAchievementBorderV.frame.size.width, 350); [salesAchievementBorderV addSubview:_salesAchievementChartView]; salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10); salesAchievementContent.layer.cornerRadius=CornerRadius; [content addSubview:salesAchievementContent]; height=CGRectGetMaxY(salesAchievementContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound){ shoppingGuideFilingContent=[UIView new]; shoppingGuideFilingContent.backgroundColor=[UIColor whiteColor]; shoppingGuideFilingContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0); [content addSubview:shoppingGuideFilingContent]; UIView *shoppingGuideFilingTitleView = [[UIView alloc]init]; shoppingGuideFilingTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45); UIView *shoppingGuideFilingImgView=[UIImageView new]; shoppingGuideFilingImgView.frame=CGRectMake(10, 10,10 , 25); [shoppingGuideFilingImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]]; [shoppingGuideFilingTitleView addSubview:shoppingGuideFilingImgView]; UILabel *titleShoppingGuideFiling = [[UILabel alloc]init]; titleShoppingGuideFiling.frame = CGRectMake(CGRectGetMaxX(shoppingGuideFilingImgView.frame)+10, 10, 300, 25); titleShoppingGuideFiling.text = @"导购报备/成交客户排行(前5名)"; titleShoppingGuideFiling.textColor = [UIColor blackColor]; titleShoppingGuideFiling.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [shoppingGuideFilingTitleView addSubview:titleShoppingGuideFiling]; [shoppingGuideFilingContent addSubview:shoppingGuideFilingTitleView]; UIView *separator4=[UIView new]; separator4.frame=CGRectMake(0,shoppingGuideFilingTitleView.frame.size.height-1, shoppingGuideFilingTitleView.frame.size.width-20, 0.5); [separator4 setBackgroundColor:[UIColor lightGrayColor]]; [shoppingGuideFilingTitleView addSubview:separator4 ]; UIView *vShoppingGuideFilingDate =[UIView new]; vShoppingGuideFilingDate.frame=CGRectMake(0, CGRectGetMaxY(shoppingGuideFilingTitleView.frame)+topMargin, Screen_Width, 25); [shoppingGuideFilingContent addSubview:vShoppingGuideFilingDate]; _btnShoppingGuideStartDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnShoppingGuideStartDate setTitle:_shoppingGuideStartDate forState:UIControlStateNormal]; [_btnShoppingGuideStartDate setBackgroundColor:[UIColor whiteColor]]; [_btnShoppingGuideStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnShoppingGuideStartDate.titleLabel.font= [UIFont systemFontOfSize:18]; [_btnShoppingGuideStartDate addTarget:self action:@selector(btnSelectShoppingGuideStartDate) forControlEvents:UIControlEventTouchUpInside]; _btnShoppingGuideStartDate.frame = CGRectMake(Screen_Width/2-120 ,0 , 110, 25); [vShoppingGuideFilingDate addSubview:_btnShoppingGuideStartDate]; UILabel *separatorShoppingGuideLbl=[UILabel new]; separatorShoppingGuideLbl.frame=CGRectMake(CGRectGetMaxX(_btnShoppingGuideStartDate.frame), 0, 20, 25); separatorShoppingGuideLbl.text=@"--"; separatorShoppingGuideLbl.textColor = [UIColor blackColor]; separatorShoppingGuideLbl.font = [UIFont systemFontOfSize: 18]; [vShoppingGuideFilingDate addSubview:separatorShoppingGuideLbl]; _btnShoppingGuideEndDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnShoppingGuideEndDate setTitle:_shoppingGuideEndDate forState:UIControlStateNormal]; [_btnShoppingGuideEndDate setBackgroundColor:[UIColor whiteColor]]; [_btnShoppingGuideEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnShoppingGuideEndDate.titleLabel.font= [UIFont systemFontOfSize:18]; [_btnShoppingGuideEndDate addTarget:self action:@selector(btnSelectShoppingGuideEndDate) forControlEvents:UIControlEventTouchUpInside]; _btnShoppingGuideEndDate.frame = CGRectMake(CGRectGetMaxX(separatorShoppingGuideLbl.frame) ,0 , 110, 25); [vShoppingGuideFilingDate addSubview:_btnShoppingGuideEndDate]; UIView *filingCustomerCountView = [[UIView alloc]init]; filingCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(vShoppingGuideFilingDate.frame)+topMargin,Screen_Width/2, rowHeight); lblFilingCustomerCount= [[UILabel alloc]init]; lblFilingCustomerCount.frame = CGRectMake(0, 0,filingCustomerCountView.frame.size.width, 25); lblFilingCustomerCount.textAlignment=UITextAlignmentCenter; lblFilingCustomerCount.textColor = [UIColor blackColor]; lblFilingCustomerCount.text=@"0"; lblFilingCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [filingCustomerCountView addSubview:lblFilingCustomerCount]; UILabel *lblTitleFilingCustomerCount = [[UILabel alloc]init]; lblTitleFilingCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblFilingCustomerCount.frame),filingCustomerCountView.frame.size.width, 25); lblTitleFilingCustomerCount.text = @"报备客户数"; lblTitleFilingCustomerCount.textColor = [UIColor blackColor]; lblTitleFilingCustomerCount.textAlignment=UITextAlignmentCenter; lblTitleFilingCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [filingCustomerCountView addSubview:lblTitleFilingCustomerCount]; [shoppingGuideFilingContent addSubview:filingCustomerCountView]; UIView *middleSeparator6=[UIView new]; middleSeparator6.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(vShoppingGuideFilingDate.frame)+topMargin, 0.5, 45); middleSeparator6.backgroundColor=[UIColor lightGrayColor]; [shoppingGuideFilingContent addSubview:middleSeparator6]; UIView *transactionCustomerCountView = [[UIView alloc]init]; transactionCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(vShoppingGuideFilingDate.frame)+topMargin, Screen_Width/2, rowHeight); lblTransactionCustomerCount = [[UILabel alloc]init]; lblTransactionCustomerCount.frame = CGRectMake(0, 0, transactionCustomerCountView.frame.size.width, 25); lblTransactionCustomerCount.textAlignment=UITextAlignmentCenter; lblTransactionCustomerCount.text=@"0"; lblTransactionCustomerCount.textColor = [UIColor blackColor]; lblTransactionCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [transactionCustomerCountView addSubview:lblTransactionCustomerCount]; UILabel *lblTransactionCustomerCountTitle = [[UILabel alloc]init]; lblTransactionCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblTransactionCustomerCount.frame), transactionCustomerCountView.frame.size.width, 25); lblTransactionCustomerCountTitle.text = @"成交客户数"; lblTransactionCustomerCountTitle.textAlignment=UITextAlignmentCenter; lblTransactionCustomerCountTitle.textColor = [UIColor blackColor]; lblTransactionCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [transactionCustomerCountView addSubview:lblTransactionCustomerCountTitle]; [shoppingGuideFilingContent addSubview:transactionCustomerCountView]; shoppingGuidePieBorderV=[CustomBorderView new]; shoppingGuidePieBorderV.frame=CGRectMake(5, CGRectGetMaxY(filingCustomerCountView.frame)+topMargin,Screen_Width-30, 200); [shoppingGuidePieBorderV setBackgroundColor:[UIColor whiteColor]]; [shoppingGuidePieBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [shoppingGuideFilingContent addSubview:shoppingGuidePieBorderV]; _transactionView = [[MyView alloc]initWithFrame:CGRectMake(5,5, shoppingGuidePieBorderV.frame.size.width-10,190)]; [shoppingGuidePieBorderV addSubview:_transactionView]; UIView *transactionPercentView = [[UIView alloc]init]; transactionPercentView.frame = CGRectMake(5,CGRectGetMaxY(shoppingGuidePieBorderV.frame)-30, shoppingGuideFilingContent.frame.size.width-10, 25); lblTransactionPercent= [[UILabel alloc]init]; lblTransactionPercent.frame = CGRectMake(0, 0, transactionPercentView.frame.size.width, 25); lblTransactionPercent.textColor = [UIColor blackColor]; lblTransactionPercent.text=@"成交率0.00%"; lblTransactionPercent.font = [UIFont systemFontOfSize:22]; lblTransactionPercent.textAlignment=NSTextAlignmentCenter; [transactionPercentView addSubview:lblTransactionPercent]; [shoppingGuideFilingContent addSubview:transactionPercentView]; shoppingGuideChartBorderV=[CustomBorderView new]; shoppingGuideChartBorderV.frame=CGRectMake(5, CGRectGetMaxY(transactionPercentView.frame)+topMargin,Screen_Width-30, 350); [shoppingGuideChartBorderV setBackgroundColor:[UIColor whiteColor]]; [shoppingGuideChartBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [shoppingGuideFilingContent addSubview:shoppingGuideChartBorderV]; _transactionChartView=[[HorizontalBarChartView alloc]init]; _transactionChartView.frame=CGRectMake(0, 0,shoppingGuideChartBorderV.frame.size.width, 350); [shoppingGuideChartBorderV addSubview:_transactionChartView]; shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10); shoppingGuideFilingContent.layer.cornerRadius=CornerRadius; height=CGRectGetMaxY(shoppingGuideFilingContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound){ //配送情况 deliveryStatusContent=[UIView new]; deliveryStatusContent.backgroundColor=[UIColor whiteColor]; deliveryStatusContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0); [content addSubview:deliveryStatusContent]; UIView *deliveryStatusTitleView = [[UIView alloc]init]; deliveryStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45); UIView *deliveryStatusImgView=[UIImageView new]; deliveryStatusImgView.frame=CGRectMake(10, 10,10 , 25); [deliveryStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]]; [deliveryStatusTitleView addSubview:deliveryStatusImgView]; UILabel *titleDeliveryStatus = [[UILabel alloc]init]; titleDeliveryStatus.frame = CGRectMake(CGRectGetMaxX(deliveryStatusImgView.frame)+10, 10, 100, 25); titleDeliveryStatus.text = @"配送情况"; titleDeliveryStatus.textColor = [UIColor blackColor]; titleDeliveryStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [deliveryStatusTitleView addSubview:titleDeliveryStatus]; [deliveryStatusContent addSubview:deliveryStatusTitleView]; UIView *separator7=[UIView new]; separator7.frame=CGRectMake(0,deliveryStatusTitleView.frame.size.height-1, deliveryStatusTitleView.frame.size.width-20, 0.5); [separator7 setBackgroundColor:[UIColor lightGrayColor]]; [deliveryStatusTitleView addSubview:separator7 ]; UIView *vDeliveryStatusDate =[UIView new]; vDeliveryStatusDate.frame=CGRectMake(0, CGRectGetMaxY(deliveryStatusTitleView.frame)+topMargin, Screen_Width, 25); [deliveryStatusContent addSubview:vDeliveryStatusDate]; _btnDeliveryStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnDeliveryStatusStartDate setTitle:_shoppingGuideStartDate forState:UIControlStateNormal]; [_btnDeliveryStatusStartDate setBackgroundColor:[UIColor whiteColor]]; [_btnDeliveryStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnDeliveryStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:18]; [_btnDeliveryStatusStartDate addTarget:self action:@selector(btnSelectDeliveryStatusStartDate) forControlEvents:UIControlEventTouchUpInside]; _btnDeliveryStatusStartDate.frame = CGRectMake(Screen_Width/2-120 ,0 , 110, 25); [vDeliveryStatusDate addSubview:_btnDeliveryStatusStartDate]; UILabel *separatorDeliveryStatusLbl=[UILabel new]; separatorDeliveryStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnDeliveryStatusStartDate.frame), 0, 20, 25); separatorDeliveryStatusLbl.text=@"--"; separatorDeliveryStatusLbl.textColor = [UIColor blackColor]; separatorDeliveryStatusLbl.font = [UIFont systemFontOfSize: 18]; [vDeliveryStatusDate addSubview:separatorDeliveryStatusLbl]; _btnDeliveryStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnDeliveryStatusEndDate setTitle:_deliveryStatusEndDate forState:UIControlStateNormal]; [_btnDeliveryStatusEndDate setBackgroundColor:[UIColor whiteColor]]; [_btnDeliveryStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnDeliveryStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:18]; [_btnDeliveryStatusEndDate addTarget:self action:@selector(btnSelectDeliveryStatusEndDate) forControlEvents:UIControlEventTouchUpInside]; _btnDeliveryStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorDeliveryStatusLbl.frame) ,0 , 110, 25); [vDeliveryStatusDate addSubview:_btnDeliveryStatusEndDate]; deliveryStatusBorderV=[CustomBorderView new]; deliveryStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(vDeliveryStatusDate.frame)+topMargin,Screen_Width-30, 200); [deliveryStatusBorderV setBackgroundColor:[UIColor whiteColor]]; [deliveryStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [deliveryStatusContent addSubview:deliveryStatusBorderV]; _deliveryStatusView = [[MyView alloc]initWithFrame:CGRectMake(0,0 ,deliveryStatusBorderV.frame.size.width-10,190)]; [deliveryStatusBorderV addSubview:_deliveryStatusView]; UIView *deliveryPercentView = [[UIView alloc]init]; deliveryPercentView.frame = CGRectMake(5,CGRectGetMaxY(deliveryStatusBorderV.frame)-30, Screen_Width-30, 25); lblDeliveryPercent= [[UILabel alloc]init]; lblDeliveryPercent.frame = CGRectMake(0, 0, deliveryPercentView.frame.size.width, 25); lblDeliveryPercent.textColor = [UIColor blackColor]; lblDeliveryPercent.font = [UIFont systemFontOfSize:22]; lblDeliveryPercent.text=@"完成率0.00%"; lblDeliveryPercent.textAlignment=NSTextAlignmentCenter; [deliveryPercentView addSubview:lblDeliveryPercent]; [deliveryStatusContent addSubview:deliveryPercentView]; UIView *needDeliveryCustomerCountView = [[UIView alloc]init]; needDeliveryCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(deliveryPercentView.frame)+topMargin,Screen_Width/2, rowHeight); lblNeedDeliveryCustomerCount= [[UILabel alloc]init]; lblNeedDeliveryCustomerCount.frame = CGRectMake(0, 0,needDeliveryCustomerCountView.frame.size.width, 25); lblNeedDeliveryCustomerCount.textAlignment=UITextAlignmentCenter; lblNeedDeliveryCustomerCount.textColor = [UIColor blackColor]; lblNeedDeliveryCustomerCount.text=@"0"; lblNeedDeliveryCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [needDeliveryCustomerCountView addSubview:lblNeedDeliveryCustomerCount]; UILabel *lblTitleNeedDeliveryCustomerCount = [[UILabel alloc]init]; lblTitleNeedDeliveryCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblNeedDeliveryCustomerCount.frame),needDeliveryCustomerCountView.frame.size.width, 25); lblTitleNeedDeliveryCustomerCount.text = @"需配送数"; lblTitleNeedDeliveryCustomerCount.textColor = [UIColor blackColor]; lblTitleNeedDeliveryCustomerCount.textAlignment=UITextAlignmentCenter; lblTitleNeedDeliveryCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [needDeliveryCustomerCountView addSubview:lblTitleNeedDeliveryCustomerCount]; [deliveryStatusContent addSubview:needDeliveryCustomerCountView]; UIView *middleSeparator8=[UIView new]; middleSeparator8.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(deliveryPercentView.frame)+topMargin, 0.5, 45); middleSeparator8.backgroundColor=[UIColor lightGrayColor]; [deliveryStatusContent addSubview:middleSeparator8]; UIView *deliveredCustomerCountView = [[UIView alloc]init]; deliveredCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(deliveryPercentView.frame)+topMargin, Screen_Width/2, rowHeight); lblDeliveredCustomerCount = [[UILabel alloc]init]; lblDeliveredCustomerCount.frame = CGRectMake(0, 0, deliveredCustomerCountView.frame.size.width, 25); lblDeliveredCustomerCount.textAlignment=UITextAlignmentCenter; lblDeliveredCustomerCount.text=@"0"; lblDeliveredCustomerCount.textColor = [UIColor blackColor]; lblDeliveredCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [deliveredCustomerCountView addSubview:lblDeliveredCustomerCount]; UILabel *lblDeliveredCustomerCountTitle = [[UILabel alloc]init]; lblDeliveredCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblDeliveredCustomerCount.frame), deliveredCustomerCountView.frame.size.width, 25); lblDeliveredCustomerCountTitle.text = @"已配送数"; lblDeliveredCustomerCountTitle.textAlignment=UITextAlignmentCenter; lblDeliveredCustomerCountTitle.textColor = [UIColor blackColor]; lblDeliveredCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [deliveredCustomerCountView addSubview:lblDeliveredCustomerCountTitle]; [deliveryStatusContent addSubview:deliveredCustomerCountView]; nextDayNeedDeliveyCountView = [[UIView alloc]init]; nextDayNeedDeliveyCountView.frame = CGRectMake(0,CGRectGetMaxY(needDeliveryCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); lblNextDayNeedDeliveryCount= [[UILabel alloc]init]; lblNextDayNeedDeliveryCount.frame = CGRectMake(0, 0,nextDayNeedDeliveyCountView.frame.size.width, 25); lblNextDayNeedDeliveryCount.textAlignment=UITextAlignmentCenter; lblNextDayNeedDeliveryCount.textColor = [UIColor blackColor]; lblNextDayNeedDeliveryCount.text=@"0"; lblNextDayNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextDayNeedDeliveyCountView addSubview:lblNextDayNeedDeliveryCount]; UILabel *lblTitleNextDayNeedDeliveryCount = [[UILabel alloc]init]; lblTitleNextDayNeedDeliveryCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextDayNeedDeliveryCount.frame),nextDayNeedDeliveyCountView.frame.size.width, 50); lblTitleNextDayNeedDeliveryCount.text = @"未来1天需配送数"; lblTitleNextDayNeedDeliveryCount.textColor = [UIColor blackColor]; lblTitleNextDayNeedDeliveryCount.textAlignment=UITextAlignmentCenter; lblTitleNextDayNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [lblTitleNextDayNeedDeliveryCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextDayNeedDeliveryCount.numberOfLines = 0; [nextDayNeedDeliveyCountView addSubview:lblTitleNextDayNeedDeliveryCount]; [deliveryStatusContent addSubview:nextDayNeedDeliveyCountView]; UIView *nextTwoDaysNeedDeliveyCountView = [[UIView alloc]init]; nextTwoDaysNeedDeliveyCountView.frame = CGRectMake(Screen_Width/3,CGRectGetMaxY(needDeliveryCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); lblNextTwoDaysNeedDeliveryCount= [[UILabel alloc]init]; lblNextTwoDaysNeedDeliveryCount.frame = CGRectMake(0, 0,nextTwoDaysNeedDeliveyCountView.frame.size.width, 25); lblNextTwoDaysNeedDeliveryCount.textAlignment=UITextAlignmentCenter; lblNextTwoDaysNeedDeliveryCount.textColor = [UIColor blackColor]; lblNextTwoDaysNeedDeliveryCount.text=@"0"; lblNextTwoDaysNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextTwoDaysNeedDeliveyCountView addSubview:lblNextTwoDaysNeedDeliveryCount]; UILabel *lblTitleNextTwoDaysNeedDeliveryCount = [[UILabel alloc]init]; lblTitleNextTwoDaysNeedDeliveryCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextTwoDaysNeedDeliveryCount.frame),nextTwoDaysNeedDeliveyCountView.frame.size.width,50); lblTitleNextTwoDaysNeedDeliveryCount.text = @"未来2天需配送数"; lblTitleNextTwoDaysNeedDeliveryCount.textColor = [UIColor blackColor]; lblTitleNextTwoDaysNeedDeliveryCount.textAlignment=UITextAlignmentCenter; [lblTitleNextTwoDaysNeedDeliveryCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextTwoDaysNeedDeliveryCount.numberOfLines = 0; lblTitleNextTwoDaysNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextTwoDaysNeedDeliveyCountView addSubview:lblTitleNextTwoDaysNeedDeliveryCount]; [deliveryStatusContent addSubview:nextTwoDaysNeedDeliveyCountView]; nextThreeDaysNeedDeliveyCountView= [[UIView alloc]init]; nextThreeDaysNeedDeliveyCountView.frame = CGRectMake(Screen_Width/3*2,CGRectGetMaxY(needDeliveryCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); [deliveryStatusContent addSubview:nextThreeDaysNeedDeliveyCountView]; lblNextThreeDaysNeedDeliveryCount= [[UILabel alloc]init]; lblNextThreeDaysNeedDeliveryCount.frame = CGRectMake(0, 0,nextThreeDaysNeedDeliveyCountView.frame.size.width, 25); lblNextThreeDaysNeedDeliveryCount.textAlignment=UITextAlignmentCenter; lblNextThreeDaysNeedDeliveryCount.textColor = [UIColor blackColor]; lblNextThreeDaysNeedDeliveryCount.text=@"0"; lblNextThreeDaysNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextThreeDaysNeedDeliveyCountView addSubview:lblNextThreeDaysNeedDeliveryCount]; UILabel *lblTitleNextThreeDaysNeedDeliveryCount = [[UILabel alloc]init]; lblTitleNextThreeDaysNeedDeliveryCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextThreeDaysNeedDeliveryCount.frame),nextThreeDaysNeedDeliveyCountView.frame.size.width-10, 50); lblTitleNextThreeDaysNeedDeliveryCount.text = @"未来3天需配送数"; lblTitleNextThreeDaysNeedDeliveryCount.textColor = [UIColor blackColor]; [lblTitleNextThreeDaysNeedDeliveryCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextThreeDaysNeedDeliveryCount.numberOfLines = 0; lblTitleNextThreeDaysNeedDeliveryCount.textAlignment=UITextAlignmentCenter; lblTitleNextThreeDaysNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextThreeDaysNeedDeliveyCountView addSubview:lblTitleNextThreeDaysNeedDeliveryCount]; deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30); deliveryStatusContent.layer.cornerRadius=CornerRadius; height=CGRectGetMaxY(deliveryStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound){ installStatusContent=[UIView new]; installStatusContent.backgroundColor=[UIColor whiteColor]; installStatusContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0); [content addSubview:installStatusContent]; UIView *installStatusTitleView = [[UIView alloc]init]; installStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45); UIView *installStatusImgView=[UIImageView new]; installStatusImgView.frame=CGRectMake(10, 10,10 , 25); [installStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]]; [installStatusTitleView addSubview:installStatusImgView]; UILabel *titleInstallStatus = [[UILabel alloc]init]; titleInstallStatus.frame = CGRectMake(CGRectGetMaxX(installStatusImgView.frame)+10, 10, 100, 25); titleInstallStatus.text = @"安装情况"; titleInstallStatus.textColor = [UIColor blackColor]; titleInstallStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [installStatusTitleView addSubview:titleInstallStatus]; [installStatusContent addSubview:installStatusTitleView]; UIView *separator8=[UIView new]; separator8.frame=CGRectMake(0,installStatusTitleView.frame.size.height-1, installStatusTitleView.frame.size.width-20, 0.5); [separator8 setBackgroundColor:[UIColor lightGrayColor]]; [installStatusTitleView addSubview:separator8]; UIView *vInstallStatusDate =[UIView new]; vInstallStatusDate.frame=CGRectMake(0, CGRectGetMaxY(installStatusTitleView.frame)+topMargin, Screen_Width, 25); [installStatusContent addSubview:vInstallStatusDate]; _btnInstallStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnInstallStatusStartDate setTitle:_installStatusStartDate forState:UIControlStateNormal]; [_btnInstallStatusStartDate setBackgroundColor:[UIColor whiteColor]]; [_btnInstallStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnInstallStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:18]; [_btnInstallStatusStartDate addTarget:self action:@selector(btnSelectInstallStatusStartDate) forControlEvents:UIControlEventTouchUpInside]; _btnInstallStatusStartDate.frame = CGRectMake(Screen_Width/2-120 ,0 , 110, 25); [vInstallStatusDate addSubview:_btnInstallStatusStartDate]; UILabel *separatorInstallStatusLbl=[UILabel new]; separatorInstallStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnInstallStatusStartDate.frame), 0, 20, 25); separatorInstallStatusLbl.text=@"--"; separatorInstallStatusLbl.textColor = [UIColor blackColor]; separatorInstallStatusLbl.font = [UIFont systemFontOfSize: 18]; [vInstallStatusDate addSubview:separatorInstallStatusLbl]; _btnInstallStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnInstallStatusEndDate setTitle:_installStatusEndDate forState:UIControlStateNormal]; [_btnInstallStatusEndDate setBackgroundColor:[UIColor whiteColor]]; [_btnInstallStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnInstallStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:18]; [_btnInstallStatusEndDate addTarget:self action:@selector(btnSelectInstallStatusEndDate) forControlEvents:UIControlEventTouchUpInside]; _btnInstallStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorInstallStatusLbl.frame) ,0 , 110, 25); [vInstallStatusDate addSubview:_btnInstallStatusEndDate]; installStatusBorderV=[CustomBorderView new]; installStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(vInstallStatusDate.frame)+topMargin,Screen_Width-30, 200); [installStatusBorderV setBackgroundColor:[UIColor whiteColor]]; [installStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [installStatusContent addSubview:installStatusBorderV]; _installStatusView = [[MyView alloc]initWithFrame:CGRectMake(5,5, installStatusBorderV.frame.size.width-10,190)]; [installStatusBorderV addSubview:_installStatusView]; UIView *installPercentView = [[UIView alloc]init]; installPercentView.frame = CGRectMake(5,CGRectGetMaxY(installStatusBorderV.frame)-30, Screen_Width-30, 25); lblInstallPercent= [[UILabel alloc]init]; lblInstallPercent.frame = CGRectMake(0, 0, installPercentView.frame.size.width, 25); lblInstallPercent.textColor = [UIColor blackColor]; lblInstallPercent.font = [UIFont systemFontOfSize:22]; lblInstallPercent.text=@"完成率0%"; lblInstallPercent.textAlignment=NSTextAlignmentCenter; [installPercentView addSubview:lblInstallPercent]; [installStatusContent addSubview:installPercentView]; UIView *needInstallCustomerCountView = [[UIView alloc]init]; needInstallCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(installPercentView.frame)+topMargin,Screen_Width/2, rowHeight); lblNeedInstallCustomerCount= [[UILabel alloc]init]; lblNeedInstallCustomerCount.frame = CGRectMake(0, 0,needInstallCustomerCountView.frame.size.width, 25); lblNeedInstallCustomerCount.textAlignment=UITextAlignmentCenter; lblNeedInstallCustomerCount.textColor = [UIColor blackColor]; lblNeedInstallCustomerCount.text=@"0"; lblNeedInstallCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [needInstallCustomerCountView addSubview:lblNeedInstallCustomerCount]; UILabel *lblTitleNeedInstallCustomerCount = [[UILabel alloc]init]; lblTitleNeedInstallCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblNeedInstallCustomerCount.frame),needInstallCustomerCountView.frame.size.width, 25); lblTitleNeedInstallCustomerCount.text = @"需安装数"; lblTitleNeedInstallCustomerCount.textColor = [UIColor blackColor]; lblTitleNeedInstallCustomerCount.textAlignment=UITextAlignmentCenter; lblTitleNeedInstallCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [needInstallCustomerCountView addSubview:lblTitleNeedInstallCustomerCount]; [installStatusContent addSubview:needInstallCustomerCountView]; UIView *middleSeparator9=[UIView new]; middleSeparator9.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(installPercentView.frame)+topMargin, 0.5, 45); middleSeparator9.backgroundColor=[UIColor lightGrayColor]; [installStatusContent addSubview:middleSeparator9]; UIView *installedCustomerCountView = [[UIView alloc]init]; installedCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(installPercentView.frame)+topMargin, Screen_Width/2, rowHeight); lblInstalledCustomerCount = [[UILabel alloc]init]; lblInstalledCustomerCount.frame = CGRectMake(0, 0, installedCustomerCountView.frame.size.width, 25); lblInstalledCustomerCount.textAlignment=UITextAlignmentCenter; lblInstalledCustomerCount.text=@"0"; lblInstalledCustomerCount.textColor = [UIColor blackColor]; lblInstalledCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [installedCustomerCountView addSubview:lblInstalledCustomerCount]; UILabel *lblInstalledCustomerCountTitle = [[UILabel alloc]init]; lblInstalledCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblInstalledCustomerCount.frame), installedCustomerCountView.frame.size.width, 25); lblInstalledCustomerCountTitle.text = @"已安装数"; lblInstalledCustomerCountTitle.textAlignment=UITextAlignmentCenter; lblInstalledCustomerCountTitle.textColor = [UIColor blackColor]; lblInstalledCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [installedCustomerCountView addSubview:lblInstalledCustomerCountTitle]; [installStatusContent addSubview:installedCustomerCountView]; nextDayNeedInstallCountView= [[UIView alloc]init]; nextDayNeedInstallCountView.frame = CGRectMake(0,CGRectGetMaxY(needInstallCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); lblNextDayNeedInstallCount= [[UILabel alloc]init]; lblNextDayNeedInstallCount.frame = CGRectMake(0, 0,nextDayNeedInstallCountView.frame.size.width, 25); lblNextDayNeedInstallCount.textAlignment=UITextAlignmentCenter; lblNextDayNeedInstallCount.textColor = [UIColor blackColor]; lblNextDayNeedInstallCount.text=@"0"; lblNextDayNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextDayNeedInstallCountView addSubview:lblNextDayNeedInstallCount]; UILabel *lblTitleNextDayNeedInstallCount = [[UILabel alloc]init]; lblTitleNextDayNeedInstallCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextDayNeedInstallCount.frame),nextDayNeedInstallCountView.frame.size.width, 50); lblTitleNextDayNeedInstallCount.text = @"未来1天需安装数"; lblTitleNextDayNeedInstallCount.textColor = [UIColor blackColor]; lblTitleNextDayNeedInstallCount.textAlignment=UITextAlignmentCenter; lblTitleNextDayNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [lblTitleNextDayNeedInstallCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextDayNeedInstallCount.numberOfLines = 0; [nextDayNeedInstallCountView addSubview:lblTitleNextDayNeedInstallCount]; [installStatusContent addSubview:nextDayNeedInstallCountView]; UIView *nextTwoDaysNeedInstallCountView = [[UIView alloc]init]; nextTwoDaysNeedInstallCountView.frame = CGRectMake(Screen_Width/3,CGRectGetMaxY(needInstallCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); lblNextTwoDaysNeedInstallCount= [[UILabel alloc]init]; lblNextTwoDaysNeedInstallCount.frame = CGRectMake(0, 0,nextTwoDaysNeedInstallCountView.frame.size.width, 25); lblNextTwoDaysNeedInstallCount.textAlignment=UITextAlignmentCenter; lblNextTwoDaysNeedInstallCount.textColor = [UIColor blackColor]; lblNextTwoDaysNeedInstallCount.text=@"0"; lblNextTwoDaysNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextTwoDaysNeedInstallCountView addSubview:lblNextTwoDaysNeedInstallCount]; UILabel *lblTitleNextTwoDaysNeedInstallCount = [[UILabel alloc]init]; lblTitleNextTwoDaysNeedInstallCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextTwoDaysNeedInstallCount.frame),nextTwoDaysNeedInstallCountView.frame.size.width,50); lblTitleNextTwoDaysNeedInstallCount.text = @"未来2天需安装数"; lblTitleNextTwoDaysNeedInstallCount.textColor = [UIColor blackColor]; lblTitleNextTwoDaysNeedInstallCount.textAlignment=UITextAlignmentCenter; [lblTitleNextTwoDaysNeedInstallCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextTwoDaysNeedInstallCount.numberOfLines = 0; lblTitleNextTwoDaysNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextTwoDaysNeedInstallCountView addSubview:lblTitleNextTwoDaysNeedInstallCount]; [installStatusContent addSubview:nextTwoDaysNeedInstallCountView]; UIView *nextThreeDaysNeedInstallCountView = [[UIView alloc]init]; nextThreeDaysNeedInstallCountView.frame = CGRectMake(Screen_Width/3*2,CGRectGetMaxY(needInstallCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); [installStatusContent addSubview:nextThreeDaysNeedInstallCountView]; lblNextThreeDaysNeedInstallCount= [[UILabel alloc]init]; lblNextThreeDaysNeedInstallCount.frame = CGRectMake(0, 0,nextThreeDaysNeedInstallCountView.frame.size.width, 25); lblNextThreeDaysNeedInstallCount.textAlignment=UITextAlignmentCenter; lblNextThreeDaysNeedInstallCount.textColor = [UIColor blackColor]; lblNextThreeDaysNeedInstallCount.text=@"0"; lblNextThreeDaysNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextThreeDaysNeedInstallCountView addSubview:lblNextThreeDaysNeedInstallCount]; UILabel *lblTitleNextThreeDaysNeedInstallCount = [[UILabel alloc]init]; lblTitleNextThreeDaysNeedInstallCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextThreeDaysNeedInstallCount.frame),nextThreeDaysNeedDeliveyCountView.frame.size.width-10, 50); lblTitleNextThreeDaysNeedInstallCount.text = @"未来3天需安装数"; lblTitleNextThreeDaysNeedInstallCount.textColor = [UIColor blackColor]; [lblTitleNextThreeDaysNeedInstallCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextThreeDaysNeedInstallCount.numberOfLines = 0; lblTitleNextThreeDaysNeedInstallCount.textAlignment=UITextAlignmentCenter; lblTitleNextThreeDaysNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextThreeDaysNeedInstallCountView addSubview:lblTitleNextThreeDaysNeedInstallCount]; installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30); installStatusContent.layer.cornerRadius=CornerRadius; height=CGRectGetMaxY(installStatusContent.frame); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound){ //维修情况 repairStatusContent=[UIView new]; repairStatusContent.backgroundColor=[UIColor whiteColor]; repairStatusContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0); [content addSubview:repairStatusContent]; UIView *repairStatusTitleView = [[UIView alloc]init]; repairStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45); UIView *repairStatusImgView=[UIImageView new]; repairStatusImgView.frame=CGRectMake(10, 10,10 , 25); [repairStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]]; [repairStatusTitleView addSubview:repairStatusImgView]; UILabel *titleRepairStatus = [[UILabel alloc]init]; titleRepairStatus.frame = CGRectMake(CGRectGetMaxX(repairStatusImgView.frame)+10, 10, 100, 25); titleRepairStatus.text = @"维修情况"; titleRepairStatus.textColor = [UIColor blackColor]; titleRepairStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize]; [repairStatusTitleView addSubview:titleRepairStatus]; [repairStatusContent addSubview:repairStatusTitleView]; UIView *separator10=[UIView new]; separator10.frame=CGRectMake(0,repairStatusTitleView.frame.size.height-1, repairStatusTitleView.frame.size.width-20, 0.5); [separator10 setBackgroundColor:[UIColor lightGrayColor]]; [repairStatusTitleView addSubview:separator10]; UIView *vRepairStatusDate =[UIView new]; vRepairStatusDate.frame=CGRectMake(0, CGRectGetMaxY(repairStatusTitleView.frame)+topMargin, Screen_Width, 25); [repairStatusContent addSubview:vRepairStatusDate]; _btnRepairStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnRepairStatusStartDate setTitle:_repairStatusStartDate forState:UIControlStateNormal]; [_btnRepairStatusStartDate setBackgroundColor:[UIColor whiteColor]]; [_btnRepairStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnRepairStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:18]; [_btnRepairStatusStartDate addTarget:self action:@selector(btnSelectRepairStatusStartDate) forControlEvents:UIControlEventTouchUpInside]; _btnRepairStatusStartDate.frame = CGRectMake(Screen_Width/2-120 ,0 , 110, 25); [vRepairStatusDate addSubview:_btnRepairStatusStartDate]; UILabel *separatorRepairStatusLbl=[UILabel new]; separatorRepairStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnRepairStatusStartDate.frame), 0, 20, 25); separatorRepairStatusLbl.text=@"--"; separatorRepairStatusLbl.textColor = [UIColor blackColor]; separatorRepairStatusLbl.font = [UIFont systemFontOfSize: 18]; [vRepairStatusDate addSubview:separatorRepairStatusLbl]; _btnRepairStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom]; [_btnRepairStatusEndDate setTitle:_repairStatusEndDate forState:UIControlStateNormal]; [_btnRepairStatusEndDate setBackgroundColor:[UIColor whiteColor]]; [_btnRepairStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; _btnRepairStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:18]; [_btnRepairStatusEndDate addTarget:self action:@selector(btnSelectRepairStatusEndDate) forControlEvents:UIControlEventTouchUpInside]; _btnRepairStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorRepairStatusLbl.frame) ,0 , 110, 25); [vRepairStatusDate addSubview:_btnRepairStatusEndDate]; repairStatusBorderV=[CustomBorderView new]; repairStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(vRepairStatusDate.frame)+topMargin,Screen_Width-30, 200); [repairStatusBorderV setBackgroundColor:[UIColor whiteColor]]; [repairStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]]; [repairStatusContent addSubview:repairStatusBorderV]; _repairStatusView = [[MyView alloc]initWithFrame:CGRectMake(5,5, repairStatusBorderV.frame.size.width-10,190)]; [repairStatusBorderV addSubview:_repairStatusView]; UIView *repairPercentView = [[UIView alloc]init]; repairPercentView.frame = CGRectMake(5,CGRectGetMaxY(repairStatusBorderV.frame)-30, Screen_Width-30, 25); lblRepairPercent= [[UILabel alloc]init]; lblRepairPercent.frame = CGRectMake(0, 0, repairPercentView.frame.size.width, 25); lblRepairPercent.textColor = [UIColor blackColor]; lblRepairPercent.font = [UIFont systemFontOfSize:22]; lblRepairPercent.text=@"完成率0%"; lblRepairPercent.textAlignment=NSTextAlignmentCenter; [repairPercentView addSubview:lblRepairPercent]; [repairStatusContent addSubview:repairPercentView]; UIView *needRepairCustomerCountView = [[UIView alloc]init]; needRepairCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(repairPercentView.frame)+topMargin,Screen_Width/2, rowHeight); lblNeedRepairCustomerCount= [[UILabel alloc]init]; lblNeedRepairCustomerCount.frame = CGRectMake(0, 0,needRepairCustomerCountView.frame.size.width, 25); lblNeedRepairCustomerCount.textAlignment=UITextAlignmentCenter; lblNeedRepairCustomerCount.textColor = [UIColor blackColor]; lblNeedRepairCustomerCount.text=@"0"; lblNeedRepairCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [needRepairCustomerCountView addSubview:lblNeedRepairCustomerCount]; UILabel *lblTitleNeedRepairCustomerCount = [[UILabel alloc]init]; lblTitleNeedRepairCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblNeedRepairCustomerCount.frame),needRepairCustomerCountView.frame.size.width, 25); lblTitleNeedRepairCustomerCount.text = @"需维修数"; lblTitleNeedRepairCustomerCount.textColor = [UIColor blackColor]; lblTitleNeedRepairCustomerCount.textAlignment=UITextAlignmentCenter; lblTitleNeedRepairCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [needRepairCustomerCountView addSubview:lblTitleNeedRepairCustomerCount]; [repairStatusContent addSubview:needRepairCustomerCountView]; UIView *middleSeparator10=[UIView new]; middleSeparator10.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(repairPercentView.frame)+topMargin, 0.5, 45); middleSeparator10.backgroundColor=[UIColor lightGrayColor]; [repairStatusContent addSubview:middleSeparator10]; UIView *repairedCustomerCountView = [[UIView alloc]init]; repairedCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(repairPercentView.frame)+topMargin, Screen_Width/2, rowHeight); lblRepairedCustomerCount = [[UILabel alloc]init]; lblRepairedCustomerCount.frame = CGRectMake(0, 0, repairedCustomerCountView.frame.size.width, 25); lblRepairedCustomerCount.textAlignment=UITextAlignmentCenter; lblRepairedCustomerCount.text=@"0"; lblRepairedCustomerCount.textColor = [UIColor blackColor]; lblRepairedCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [repairedCustomerCountView addSubview:lblRepairedCustomerCount]; UILabel *lblRepairedCustomerCountTitle = [[UILabel alloc]init]; lblRepairedCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblRepairedCustomerCount.frame), repairedCustomerCountView.frame.size.width, 25); lblRepairedCustomerCountTitle.text = @"已维修数"; lblRepairedCustomerCountTitle.textAlignment=UITextAlignmentCenter; lblRepairedCustomerCountTitle.textColor = [UIColor blackColor]; lblRepairedCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [repairedCustomerCountView addSubview:lblRepairedCustomerCountTitle]; [repairStatusContent addSubview:repairedCustomerCountView]; nextDayNeedRepairCountView= [[UIView alloc]init]; nextDayNeedRepairCountView.frame = CGRectMake(0,CGRectGetMaxY(needRepairCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); lblNextDayNeedRepairCount= [[UILabel alloc]init]; lblNextDayNeedRepairCount.frame = CGRectMake(0, 0,nextDayNeedRepairCountView.frame.size.width, 25); lblNextDayNeedRepairCount.textAlignment=UITextAlignmentCenter; lblNextDayNeedRepairCount.textColor = [UIColor blackColor]; lblNextDayNeedRepairCount.text=@"0"; lblNextDayNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextDayNeedRepairCountView addSubview:lblNextDayNeedRepairCount]; UILabel *lblTitleNextDayNeedRepairCount = [[UILabel alloc]init]; lblTitleNextDayNeedRepairCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextDayNeedRepairCount.frame),nextDayNeedRepairCountView.frame.size.width, 50); lblTitleNextDayNeedRepairCount.text = @"未来1天需维修数"; lblTitleNextDayNeedRepairCount.textColor = [UIColor blackColor]; lblTitleNextDayNeedRepairCount.textAlignment=UITextAlignmentCenter; lblTitleNextDayNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [lblTitleNextDayNeedRepairCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextDayNeedRepairCount.numberOfLines = 0; [nextDayNeedRepairCountView addSubview:lblTitleNextDayNeedRepairCount]; [repairStatusContent addSubview:nextDayNeedRepairCountView]; UIView *nextTwoDaysNeedRepairCountView = [[UIView alloc]init]; nextTwoDaysNeedRepairCountView.frame = CGRectMake(Screen_Width/3,CGRectGetMaxY(needRepairCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); lblNextTwoDaysNeedRepairCount= [[UILabel alloc]init]; lblNextTwoDaysNeedRepairCount.frame = CGRectMake(0, 0,nextTwoDaysNeedRepairCountView.frame.size.width, 25); lblNextTwoDaysNeedRepairCount.textAlignment=UITextAlignmentCenter; lblNextTwoDaysNeedRepairCount.textColor = [UIColor blackColor]; lblNextTwoDaysNeedRepairCount.text=@"0"; lblNextTwoDaysNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextTwoDaysNeedRepairCountView addSubview:lblNextTwoDaysNeedRepairCount]; UILabel *lblTitleNextTwoDaysNeedRepairCount = [[UILabel alloc]init]; lblTitleNextTwoDaysNeedRepairCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextTwoDaysNeedRepairCount.frame),nextTwoDaysNeedRepairCountView.frame.size.width,50); lblTitleNextTwoDaysNeedRepairCount.text = @"未来2天需维修数"; lblTitleNextTwoDaysNeedRepairCount.textColor = [UIColor blackColor]; lblTitleNextTwoDaysNeedRepairCount.textAlignment=UITextAlignmentCenter; [lblTitleNextTwoDaysNeedRepairCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextTwoDaysNeedRepairCount.numberOfLines = 0; lblTitleNextTwoDaysNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextTwoDaysNeedRepairCountView addSubview:lblTitleNextTwoDaysNeedRepairCount]; [repairStatusContent addSubview:nextTwoDaysNeedRepairCountView]; UIView *nextThreeDaysNeedRepairCountView = [[UIView alloc]init]; nextThreeDaysNeedRepairCountView.frame = CGRectMake(Screen_Width/3*2,CGRectGetMaxY(needRepairCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight); [repairStatusContent addSubview:nextThreeDaysNeedRepairCountView]; lblNextThreeDaysNeedRepairCount= [[UILabel alloc]init]; lblNextThreeDaysNeedRepairCount.frame = CGRectMake(0, 0,nextThreeDaysNeedRepairCountView.frame.size.width, 25); lblNextThreeDaysNeedRepairCount.textAlignment=UITextAlignmentCenter; lblNextThreeDaysNeedRepairCount.textColor = [UIColor blackColor]; lblNextThreeDaysNeedRepairCount.text=@"0"; lblNextThreeDaysNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextThreeDaysNeedRepairCountView addSubview:lblNextThreeDaysNeedRepairCount]; UILabel *lblTitleNextThreeDaysNeedRepairCount = [[UILabel alloc]init]; lblTitleNextThreeDaysNeedRepairCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextThreeDaysNeedRepairCount.frame),nextThreeDaysNeedRepairCountView.frame.size.width-10, 50); lblTitleNextThreeDaysNeedRepairCount.text = @"未来3天需维修数"; lblTitleNextThreeDaysNeedRepairCount.textColor = [UIColor blackColor]; [lblTitleNextThreeDaysNeedRepairCount setLineBreakMode:NSLineBreakByWordWrapping]; lblTitleNextThreeDaysNeedRepairCount.numberOfLines = 0; lblTitleNextThreeDaysNeedRepairCount.textAlignment=UITextAlignmentCenter; lblTitleNextThreeDaysNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18]; [nextThreeDaysNeedRepairCountView addSubview:lblTitleNextThreeDaysNeedRepairCount]; repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30); repairStatusContent.layer.cornerRadius=CornerRadius; height=CGRectGetMaxY(repairStatusContent.frame); } content.frame=CGRectMake(0, 0,Screen_Width,height); scroll.contentSize = CGSizeMake(self.view.frame.size.width, height+rectStatusHeight+rectNavHeight+100); } -(void)goSalesAchievement:(UIButton*)sender { [self changeSalesAchievementDepartmentStaffColor]; if(sender.tag==1007) { salesAchievementTypeId=@"0"; btnSalesAchievementDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnSalesAchievementDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } else{ salesAchievementTypeId=@"1"; btnSalesAchievementStaffMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnSalesAchievementStaff setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } [salesAchievementXArray removeAllObjects]; [salesAchievementYArray removeAllObjects]; [self startLoading]; [self loadSalesAchievementData]; } -(void)goSalesStatus:(UIButton*)sender { [self changeSalesStatusChannelDepartmentColor]; if(sender.tag==1000) { typeId=@"0"; btnSalesStatusChannelMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnSalesStatusChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } else{ typeId=@"1"; btnSalesStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnSalesStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } [salesStatusXArray removeAllObjects]; [salesStatusYArray removeAllObjects]; [self startLoading]; [self loadSalesStatusData]; } -(void)goOrderStatus:(UIButton*)sender { [self changeOrderStatusChannelDepartmentColor]; if(sender.tag==1006) { orderStatusTypeId=@"0"; btnOrderStatusChannelMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnOrderStatusChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } else{ orderStatusTypeId=@"1"; btnOrderStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnOrderStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } [orderStatusXArray removeAllObjects]; [orderStatusYArray removeAllObjects]; [self startLoading]; [self loadOrderStatusData]; } -(void)goCollectionStatus:(UIButton*)sender { [self changeCollectionStatusChannelDepartmentColor]; if(sender.tag==1003) { cashStatusTypeId=@"1"; btnCollectionStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnCollectionStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } if(sender.tag==1004) { cashStatusTypeId=@"0"; btnCollectionStatusChannelMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnCollectionStatusChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } [collectionStatusXArray removeAllObjects]; [collectionStatusYArray removeAllObjects]; [self startLoading]; [self loadCashData]; } /** 画两个柱状图 */ -(void)drawTwoBarchart:(NSMutableArray*)barchartArray receivablesTitleArray:(NSMutableArray*)receivablesTitleArry barChartView:(BarChartView*) chartView axisValueFormatter:(id)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue minimumValue:(double)minimumValue { chartView.delegate = self; chartView.extraBottomOffset=20; chartView.chartDescription.enabled = NO; chartView.pinchZoomEnabled = NO; chartView.drawBarShadowEnabled = NO; chartView.drawGridBackgroundEnabled = NO; chartView.maxVisibleCount = 60; BalloonMarker *marker = [[BalloonMarker alloc] initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0] font: [UIFont systemFontOfSize:12.0] textColor: UIColor.whiteColor insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)]; marker.chartView = chartView; marker.minimumSize = CGSizeMake(80.f, 40.f); chartView.marker = marker; ChartLegend *legend = chartView.legend; legend.horizontalAlignment = ChartLegendHorizontalAlignmentCenter; legend.verticalAlignment = ChartLegendVerticalAlignmentBottom; legend.orientation = ChartLegendOrientationHorizontal ; legend.drawInside = NO; legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0f]; legend.yOffset = 1.0; legend.xOffset = 1.0; legend.yEntrySpace =1; ChartXAxis *xAxis = chartView.xAxis; xAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]; xAxis.axisMinimum = 0.0; xAxis.granularity = 1.0f; xAxis.labelCount=count; xAxis.labelRotationAngle=20; xAxis.drawGridLinesEnabled=NO; xAxis.centerAxisLabelsEnabled = YES; xAxis.labelPosition = XAxisLabelPositionBottom; xAxis.valueFormatter =formatter ; ChartYAxis *leftAxis = chartView.leftAxis; leftAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]; leftAxis.valueFormatter = [[YAxisValueFormatter alloc] init]; leftAxis.drawGridLinesEnabled = YES; leftAxis.gridColor = [UIColor colorWithRed:200/255.0f green:200/255.0f blue:200/255.0f alpha:1];//网格线颜色 leftAxis.spaceTop = 0.35; leftAxis.granularityEnabled=YES; leftAxis.gridLineWidth =1; if(minimumValue<0) { leftAxis.axisMinimum = minimumValue; } else { leftAxis.axisMinimum=0; } leftAxis.axisMaximum=maximumValue+100; leftAxis.decimals=2; // leftAxis.granularity=maximumValue/5; chartView.rightAxis.enabled = NO; float groupSpace = 0.1f; float barSpace = 0.15f; float barWidth = 0.3f; NSMutableArray *yVals1 = [[NSMutableArray alloc] init]; NSMutableArray *yVals2 = [[NSMutableArray alloc] init]; int start =0; long end = barchartArray.count; for (int i = start; i < end; i++) { NSMutableDictionary *barchartDic=barchartArray[i]; double y1=0; double y2=0; if([[barchartDic allKeys] containsObject:@"planAmount"]) { y1= [[barchartDic objectForKey:@"planAmount"]doubleValue]; } if([[barchartDic allKeys] containsObject:@"saleAmount"]) { y2=[[barchartDic objectForKey:@"saleAmount"]doubleValue]; } [yVals1 addObject:[[BarChartDataEntry alloc] initWithX:i y:y1]]; [yVals2 addObject:[[BarChartDataEntry alloc] initWithX:i y:y2]]; } BarChartDataSet *set1 = nil, *set2 = nil; if (chartView.data.dataSetCount > 0) { set1 = (BarChartDataSet *)chartView.data.dataSets[0]; set2 = (BarChartDataSet *)chartView.data.dataSets[1]; [set1 replaceEntries:yVals1]; [set2 replaceEntries:yVals2]; BarChartData *data = chartView.barData; chartView.xAxis.axisMinimum = start; chartView.xAxis.axisMaximum = [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end + start; [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace]; [chartView.data notifyDataChanged]; [chartView notifyDataSetChanged]; } else { set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:receivablesTitleArry[0]]; [set1 setColor:[UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1]]; set2 = [[BarChartDataSet alloc] initWithEntries:yVals2 label:receivablesTitleArry[1]]; [set2 setColor:[UIColor colorWithRed:235/255.0f green:125/255.0f blue:60/255.0f alpha:1]]; [set1 setDrawValuesEnabled:NO]; [set2 setDrawValuesEnabled:NO]; NSMutableArray *dataSets = [[NSMutableArray alloc] init]; [dataSets addObject:set1]; [dataSets addObject:set2]; BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets]; [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]]; data.barWidth = barWidth; // restrict the x-axis range chartView.xAxis.axisMinimum = start; // groupWidthWithGroupSpace(...) is a helper that calculates the width each group needs based on the provided parameters chartView.xAxis.axisMaximum = start+ [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end; [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace]; chartView.data = data; } } -(void)drawHorizontalTwoBarchart:(NSMutableArray*)barchartArray receivablesTitleArray:(NSMutableArray*)receivablesTitleArry barChartView:(HorizontalBarChartView*) chartView axisValueFormatter:(id)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue minimumValue:(double)minimumValue { chartView.delegate = self; chartView.extraBottomOffset=20; chartView.chartDescription.enabled = NO; chartView.pinchZoomEnabled = NO; chartView.drawBarShadowEnabled = NO; chartView.drawGridBackgroundEnabled = NO; chartView.maxVisibleCount = 60; BalloonMarker *marker = [[BalloonMarker alloc] initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0] font: [UIFont systemFontOfSize:12.0] textColor: UIColor.whiteColor insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)]; marker.chartView = chartView; marker.minimumSize = CGSizeMake(80.f, 40.f); chartView.marker = marker; ChartLegend *legend = chartView.legend; legend.horizontalAlignment = ChartLegendHorizontalAlignmentCenter; legend.verticalAlignment = ChartLegendVerticalAlignmentBottom; legend.orientation = ChartLegendOrientationHorizontal ; legend.drawInside = NO; legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0f]; legend.yOffset = 1.0; legend.xOffset = 1.0; legend.yEntrySpace =1; ChartXAxis *xAxis = chartView.xAxis; xAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]; xAxis.axisMinimum = 0.0; xAxis.granularity = 1.0f; xAxis.labelCount=count; xAxis.labelRotationAngle=20; xAxis.drawGridLinesEnabled=NO; xAxis.centerAxisLabelsEnabled = YES; xAxis.labelPosition = XAxisLabelPositionBottom; xAxis.valueFormatter =formatter ; ChartYAxis *leftAxis = chartView.leftAxis; leftAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]; leftAxis.valueFormatter = [[YAxisValueFormatter alloc] init]; leftAxis.drawGridLinesEnabled = YES; leftAxis.gridColor = [UIColor colorWithRed:200/255.0f green:200/255.0f blue:200/255.0f alpha:1];//网格线颜色 leftAxis.spaceTop = 0.35; leftAxis.granularityEnabled=YES; leftAxis.gridLineWidth =1; if(minimumValue<0) { leftAxis.axisMinimum = minimumValue; } else { leftAxis.axisMinimum=0; } leftAxis.axisMaximum=maximumValue+100; leftAxis.decimals=2; // leftAxis.granularity=maximumValue/5; chartView.rightAxis.enabled = NO; float groupSpace = 0.1f; float barSpace = 0.15f; float barWidth = 0.3f; NSMutableArray *yVals1 = [[NSMutableArray alloc] init]; NSMutableArray *yVals2 = [[NSMutableArray alloc] init]; int start =0; long end = barchartArray.count; for (int i = start; i < end; i++) { NSMutableDictionary *barchartDic=barchartArray[i]; double y1=0; double y2=0; if([[barchartDic allKeys] containsObject:@"transactionCount"]) { y1= [[barchartDic objectForKey:@"transactionCount"]doubleValue]; } if([[barchartDic allKeys] containsObject:@"filingCount"]) { y2=[[barchartDic objectForKey:@"filingCount"]doubleValue]; } [yVals1 addObject:[[BarChartDataEntry alloc] initWithX:i y:y1]]; [yVals2 addObject:[[BarChartDataEntry alloc] initWithX:i y:y2]]; } BarChartDataSet *set1 = nil, *set2 = nil; if (chartView.data.dataSetCount > 0) { set1 = (BarChartDataSet *)chartView.data.dataSets[0]; set2 = (BarChartDataSet *)chartView.data.dataSets[1]; [set1 replaceEntries:yVals1]; [set2 replaceEntries:yVals2]; BarChartData *data = chartView.barData; chartView.xAxis.axisMinimum = start; chartView.xAxis.axisMaximum = [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end + start; [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace]; [chartView.data notifyDataChanged]; [chartView notifyDataSetChanged]; } else { set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:receivablesTitleArry[0]]; [set1 setColor:[UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1]]; set2 = [[BarChartDataSet alloc] initWithEntries:yVals2 label:receivablesTitleArry[1]]; [set2 setColor:[UIColor colorWithRed:235/255.0f green:125/255.0f blue:60/255.0f alpha:1]]; [set1 setDrawValuesEnabled:NO]; [set2 setDrawValuesEnabled:NO]; NSMutableArray *dataSets = [[NSMutableArray alloc] init]; [dataSets addObject:set1]; [dataSets addObject:set2]; BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets]; [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]]; data.barWidth = barWidth; // restrict the x-axis range chartView.xAxis.axisMinimum = start; // groupWidthWithGroupSpace(...) is a helper that calculates the width each group needs based on the provided parameters chartView.xAxis.axisMaximum = start+ [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end; [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace]; chartView.data = data; } } /** 切换渠道部门按钮颜色 */ -(void)changeSalesStatusChannelDepartmentColor { btnSalesStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnSalesStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btnSalesStatusDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnSalesStatusDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } -(void)changeSalesAchievementDepartmentStaffColor { btnSalesAchievementDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnSalesAchievementDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btnSalesAchievementStaffMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnSalesAchievementStaff setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } -(void)changeOrderStatusChannelDepartmentColor { btnOrderStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnOrderStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btnOrderStatusDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnOrderStatusDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } -(void)selectSalesAchievementCustomDate { [self changeSalesAchievementMonthColor]; [_btnSalesAchievementCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; btnSalesAchievementCustomMaskLayer.strokeColor=[UIColor redColor].CGColor; ITDatePickerController *datePickerController = [[ITDatePickerController alloc] init]; datePickerController.tag = 100; datePickerController.delegate = self; datePickerController.showToday = NO; datePickerController.defaultDate = nil; [self presentViewController:datePickerController animated:YES completion:nil]; } -(void)getSalesAchievementCurrentMonth { [self changeSalesAchievementMonthColor]; btnSalesAchievementCurrentMonthMaskLayer.strokeColor=[UIColor redColor].CGColor; [_btnSalesAchievemmentToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; //NSDate转NSString _salesAchievementMonth = [DateFormat getCurrentNoSeparateMonth]; [_btnSalesAchievemmentToday setTitle: [DateFormat getCurrentMonth] forState:UIControlStateNormal]; [self clearSalesAchievementData]; [salesAchievementXArray removeAllObjects]; [salesAchievementYArray removeAllObjects]; [self startLoading]; [self loadSalesAchievementData]; } -(void)changeSalesAchievementMonthColor { btnSalesAchievementCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnSalesAchievementCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btnSalesAchievementCurrentMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnSalesAchievemmentToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } /** 切换收款状态渠道部门按钮颜色 */ -(void)changeCollectionStatusChannelDepartmentColor { btnCollectionStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnCollectionStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btnCollectionStatusDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor; [_btnCollectionStatusDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } -(void)btnSelectShoppingGuideStartDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempShoppingGuideStartDate=date; } andCompletionBlock:^(void){ _shoppingGuideStartDate = _tempShoppingGuideStartDate; [weakself.btnShoppingGuideStartDate setTitle:_shoppingGuideStartDate forState:UIControlStateNormal]; [self clearShoppingGuideFilingData]; [self startLoading]; [self loadShoppingGuideData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectShoppingGuideEndDate { _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempShoppingGuideEndDate=date; } andCompletionBlock:^(void){ _shoppingGuideEndDate = _tempShoppingGuideEndDate; [_btnShoppingGuideEndDate setTitle:_shoppingGuideEndDate forState:UIControlStateNormal]; [self clearShoppingGuideFilingData]; [self startLoading]; [self loadShoppingGuideData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectCollectionStatusStartDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempCollectionStatusStartDate=date; } andCompletionBlock:^(void){ _collectionStatusStartDate = _tempCollectionStatusStartDate; [weakself.btnCollectionStatusStartDate setTitle:_collectionStatusStartDate forState:UIControlStateNormal]; [self startLoading]; [collectionStatusXArray removeAllObjects]; [collectionStatusYArray removeAllObjects]; [self clearCollectionStatusData]; [self loadCashData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectDeliveryStatusStartDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempDeliveryStatusStartDate=date; } andCompletionBlock:^(void){ _deliveryStatusStartDate = _tempDeliveryStatusStartDate; [weakself.btnDeliveryStatusStartDate setTitle:_deliveryStatusStartDate forState:UIControlStateNormal]; [self startLoading]; [self clearDeliveryData]; [self loadDeliveryData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectDeliveryStatusEndDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempDeliveryStatusEndDate=date; } andCompletionBlock:^(void){ _deliveryStatusEndDate = _tempDeliveryStatusEndDate; [weakself.btnDeliveryStatusEndDate setTitle:_deliveryStatusEndDate forState:UIControlStateNormal]; [self startLoading]; [self clearDeliveryData]; [self loadDeliveryData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectCollectionStatusEndDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempCollectionStatusEndDate=date; } andCompletionBlock:^(void){ _collectionStatusEndDate = _tempCollectionStatusEndDate; [weakself.btnCollectionStatusEndDate setTitle:_collectionStatusEndDate forState:UIControlStateNormal]; [self startLoading]; [collectionStatusXArray removeAllObjects]; [collectionStatusYArray removeAllObjects]; [self clearCollectionStatusData]; [self loadCashData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectInstallStatusStartDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempInstallStatusStartDate=date; } andCompletionBlock:^(void){ _installStatusStartDate = _tempInstallStatusStartDate; [weakself.btnInstallStatusStartDate setTitle:_installStatusStartDate forState:UIControlStateNormal]; [self startLoading]; [self clearInstallData]; [self loadInstallData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectInstallStatusEndDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempInstallStatusEndDate=date; } andCompletionBlock:^(void){ _installStatusEndDate = _tempInstallStatusEndDate; [weakself.btnInstallStatusEndDate setTitle:_installStatusEndDate forState:UIControlStateNormal]; [self startLoading]; [self clearInstallData]; [self loadInstallData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectRepairStatusStartDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempRepairStatusStartDate=date; } andCompletionBlock:^(void){ _repairStatusStartDate = _tempRepairStatusStartDate; [weakself.btnRepairStatusStartDate setTitle:_repairStatusStartDate forState:UIControlStateNormal]; [self startLoading]; [self clearRepairData]; [self loadRepairData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectRepairStatusEndDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempRepairStatusEndDate=date; } andCompletionBlock:^(void){ _repairStatusEndDate = _tempRepairStatusEndDate; [weakself.btnRepairStatusEndDate setTitle:_repairStatusEndDate forState:UIControlStateNormal]; [self startLoading]; [self clearRepairData]; [self loadRepairData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectOrderStatusStartDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempOrderStatusStartDate=date; } andCompletionBlock:^(void){ _orderStatusStartDate = _tempOrderStatusStartDate; [weakself.btnOrderStatusStartDate setTitle:_orderStatusStartDate forState:UIControlStateNormal]; [self startLoading]; [orderStatusXArray removeAllObjects]; [orderStatusYArray removeAllObjects]; [self clearOrderStatusData]; [self loadOrderStatusData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } -(void)btnSelectOrderStatusEndDate { __weak typeof(self) weakself=self; _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""]; [_dealDatePicker configureSelectionBlock:^(NSString *date){ _tempOrderStatusEndDate=date; } andCompletionBlock:^(void){ _orderStatusEndDate = _tempOrderStatusEndDate; [weakself.btnOrderStatusEndDate setTitle:_orderStatusEndDate forState:UIControlStateNormal]; [self clearOrderStatusData]; [self startLoading]; [orderStatusXArray removeAllObjects]; [orderStatusYArray removeAllObjects]; [self loadOrderStatusData]; } andCancelBlock:^(void){ }]; [_dealDatePicker show]; } /** 画单个柱状图 */ -(void)drawSingleBarchart:(NSMutableArray*)barchartArray chartView:(BarChartView*)chart axisValueFormatter:(id)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue minimumValue:(double)minimumValue { chart.chartDescription.enabled = NO; chart.legend.enabled = NO; chart.drawGridBackgroundEnabled = NO; chart.dragEnabled = NO; [chart setScaleEnabled:NO]; chart.pinchZoomEnabled = NO; chart.extraBottomOffset=20; chart.rightAxis.enabled = NO; chart.delegate = self; chart.drawBarShadowEnabled = NO; chart.drawValueAboveBarEnabled = YES; BalloonMarker *marker = [[BalloonMarker alloc] initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0] font: [UIFont systemFontOfSize:12.0] textColor: UIColor.whiteColor insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)]; marker.chartView = chart; marker.minimumSize = CGSizeMake(80.f, 40.f); chart.marker = marker; chart.maxVisibleCount = 60; ChartXAxis *xAxis = chart.xAxis; xAxis.labelPosition = XAxisLabelPositionBottom; xAxis.labelFont = [UIFont systemFontOfSize:10.f]; xAxis.drawGridLinesEnabled = NO; xAxis.granularity = 1.0; // only intervals of 1 day xAxis.labelCount = count; xAxis.labelRotationAngle=20; xAxis.valueFormatter = formatter; ChartYAxis *leftAxis = chart.leftAxis; leftAxis.labelFont = [UIFont systemFontOfSize:10.f]; leftAxis.axisMaximum=maximumValue+100; leftAxis.labelPosition = YAxisLabelPositionOutsideChart; leftAxis.spaceTop = 0.15; if(minimumValue<0) { leftAxis.axisMinimum =minimumValue; } else{ leftAxis.axisMinimum = 0.0; } double start = 0; NSMutableArray *yVals1 = [[NSMutableArray alloc] init]; for (int i = start; i < barchartArray.count; i++) { BarChartDataEntry *dataEntry; dataEntry= [[BarChartDataEntry alloc] initWithX:i y:[[barchartArray objectAtIndex:i]doubleValue] icon: [UIImage imageNamed:@"icon"] ]; [yVals1 addObject:dataEntry]; } BarChartDataSet *set1 = nil; UIColor *blueColor= [UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1]; NSMutableArray *colorArray=[[NSMutableArray alloc]init]; [colorArray addObject:blueColor]; if (chart.data.dataSetCount > 0) { set1 = (BarChartDataSet *)chart.data.dataSets[0]; [set1 replaceEntries: yVals1]; [chart.data notifyDataChanged]; [chart notifyDataSetChanged]; } else { set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:@"资金"]; [set1 setColors:colorArray]; set1.drawIconsEnabled = NO; [set1 setDrawValuesEnabled:NO]; NSMutableArray *dataSets = [[NSMutableArray alloc] init]; [dataSets addObject:set1]; BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets]; [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.0f]]; data.barWidth = 0.5f; chart.data = data; } } /** * 异步执行 + 并发队列 * 特点:可以开启多个线程,任务交替(同时)执行。 */ - (void)asyncConcurrent { dispatch_queue_t queue = dispatch_queue_create("com.test.queue", DISPATCH_QUEUE_CONCURRENT); if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){ dispatch_async(queue, ^{ // 追加任务 1 [NSThread sleepForTimeInterval:1]; // 模拟耗时操作 [self loadSalesStatusData]; }); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){ dispatch_async(queue, ^{ // 追加任务 1 [NSThread sleepForTimeInterval:1]; // 模拟耗时操作 [self loadCashData]; }); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){ dispatch_async(queue, ^{ // 追加任务 1 [NSThread sleepForTimeInterval:1]; // 模拟耗时操作 [self loadOrderStatusData]; }); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound){ dispatch_async(queue, ^{ // 追加任务 1 [NSThread sleepForTimeInterval:1]; // 模拟耗时操作 [self loadShoppingGuideData]; }); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound){ dispatch_async(queue, ^{ // 追加任务 1 [NSThread sleepForTimeInterval:1]; // 模拟耗时操作 [self loadDeliveryData]; }); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound){ dispatch_async(queue, ^{ // 追加任务 1 [NSThread sleepForTimeInterval:1]; // 模拟耗时操作 [self loadInstallData]; }); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound){ dispatch_async(queue, ^{ // 追加任务 1 [NSThread sleepForTimeInterval:1]; // 模拟耗时操作 [self loadRepairData]; }); } if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_ACHIEVEMENT_IPHONE].location!=NSNotFound){ dispatch_async(queue, ^{ // 追加任务 1 [NSThread sleepForTimeInterval:1]; // 模拟耗时操作 [self loadSalesAchievementData]; }); } } -(void)loadDeliveryData { NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"GetSalesStatisticalAnalysisDistributionDataIphone" forKey:@"Action"]; [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"]; [dict setObject:kkUserCode forKey:@"UserCode"]; [dict setObject:kkUserPwd forKey:@"UserPassword"]; [dict setObject:kkSessionKey forKey:@"SessionKey"]; [dict setObject:_deliveryStatusStartDate forKeyedSubscript:@"AccountDateFrom"]; [dict setObject:_deliveryStatusEndDate forKeyedSubscript:@"AccountDateTo"]; _deliveryDownManager = [[ASIDownManager alloc] init]; _deliveryDownManager.delegate = self; _deliveryDownManager.onRequestSuccess = @selector(onDeliveryStatusLoadFinish:); _deliveryDownManager.onRequestFail = @selector(onDeliveryStatusLoadFail:); [_deliveryDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil]; } -(void)loadRepairData { NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"GetSalesStatisticalAnalysisRepairDataIphone" forKey:@"Action"]; [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"]; [dict setObject:kkUserCode forKey:@"UserCode"]; [dict setObject:kkUserPwd forKey:@"UserPassword"]; [dict setObject:kkSessionKey forKey:@"SessionKey"]; [dict setObject:_repairStatusStartDate forKeyedSubscript:@"AccountDateFrom"]; [dict setObject:_repairStatusEndDate forKeyedSubscript:@"AccountDateTo"]; _repairDownManager = [[ASIDownManager alloc] init]; _repairDownManager.delegate = self; _repairDownManager.onRequestSuccess = @selector(onRepairStatusLoadFinish:); _repairDownManager.onRequestFail = @selector(onRepairStatusLoadFail:); [_repairDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil]; } -(void)loadInstallData { NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"GetSalesStatisticalAnalysisInstallationDataIphone" forKey:@"Action"]; [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"]; [dict setObject:kkUserCode forKey:@"UserCode"]; [dict setObject:kkUserPwd forKey:@"UserPassword"]; [dict setObject:kkSessionKey forKey:@"SessionKey"]; [dict setObject:_installStatusStartDate forKeyedSubscript:@"AccountDateFrom"]; [dict setObject:_installStatusEndDate forKeyedSubscript:@"AccountDateTo"]; _installDownManager = [[ASIDownManager alloc] init]; _installDownManager.delegate = self; _installDownManager.onRequestSuccess = @selector(onInstallStatusLoadFinish:); _installDownManager.onRequestFail = @selector(onInstallStatusLoadFail:); [_installDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil]; } /** 加载销售利润数据源 */ -(void)loadSalesStatusData { NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"GetSalesStatisticalAnalysisSaleDataIphone" forKey:@"Action"]; [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"]; [dict setObject:kkUserCode forKey:@"UserCode"]; [dict setObject:kkUserPwd forKey:@"UserPassword"]; [dict setObject:kkSessionKey forKey:@"SessionKey"]; [dict setObject:typeId forKeyedSubscript:@"TypeID"]; [dict setObject:_salesStatusStartDate forKeyedSubscript:@"AccountDateFrom"]; [dict setObject:_salesStatusEndDate forKeyedSubscript:@"AccountDateTo"]; _salesStatusDownManager = [[ASIDownManager alloc] init]; _salesStatusDownManager.delegate = self; _salesStatusDownManager.onRequestSuccess = @selector(onSalesStatusLoadFinish:); _salesStatusDownManager.onRequestFail = @selector(onSalesStatusLoadFail:); [_salesStatusDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil]; } -(void)loadSalesAchievementData { NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"GetSalesStatisticalAnalysisAchievementDataIphone" forKey:@"Action"]; [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"]; [dict setObject:kkUserCode forKey:@"UserCode"]; [dict setObject:kkUserPwd forKey:@"UserPassword"]; [dict setObject:kkSessionKey forKey:@"SessionKey"]; [dict setObject:salesAchievementTypeId forKeyedSubscript:@"TypeID"]; [dict setObject:_salesAchievementMonth forKeyedSubscript:@"AccountMonth"]; _salesAchievementDownManager = [[ASIDownManager alloc] init]; _salesAchievementDownManager.delegate = self; _salesAchievementDownManager.onRequestSuccess = @selector(onSalesAchievementLoadFinish:); _salesAchievementDownManager.onRequestFail = @selector(onSalesAchievementLoadFail:); [_salesAchievementDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil]; } -(void)loadOrderStatusData { NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"GetSalesStatisticalAnalysisOrderData" forKey:@"Action"]; [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"]; [dict setObject:kkUserCode forKey:@"UserCode"]; [dict setObject:kkUserPwd forKey:@"UserPassword"]; [dict setObject:kkSessionKey forKey:@"SessionKey"]; [dict setObject:orderStatusTypeId forKeyedSubscript:@"TypeID"]; [dict setObject:_orderStatusStartDate forKeyedSubscript:@"AccountDateFrom"]; [dict setObject:_orderStatusEndDate forKeyedSubscript:@"AccountDateTo"]; _orderStatusDownManager = [[ASIDownManager alloc] init]; _orderStatusDownManager.delegate = self; _orderStatusDownManager.onRequestSuccess = @selector(onOrderStatusLoadFinish:); _orderStatusDownManager.onRequestFail = @selector(onOrderStatusLoadFail:); [_orderStatusDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil]; } -(void)loadShoppingGuideData { NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"GetSalesStatisticalAnalysisRecordDataIphone" forKey:@"Action"]; [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"]; [dict setObject:kkUserCode forKey:@"UserCode"]; [dict setObject:kkUserPwd forKey:@"UserPassword"]; [dict setObject:kkSessionKey forKey:@"SessionKey"]; [dict setObject:_shoppingGuideStartDate forKeyedSubscript:@"AccountDateFrom"]; [dict setObject:_shoppingGuideEndDate forKeyedSubscript:@"AccountDateTo"]; _shoppingGuideDownManager = [[ASIDownManager alloc] init]; _shoppingGuideDownManager.delegate = self; _shoppingGuideDownManager.onRequestSuccess = @selector(onShoppingGuideLoadFinish:); _shoppingGuideDownManager.onRequestFail = @selector(onShoppingGuideLoadFail:); [_shoppingGuideDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil]; } -(void)loadCashData { NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL]; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"GetSalesStatisticalAnalysisCashDataIphone" forKey:@"Action"]; [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"]; [dict setObject:kkUserCode forKey:@"UserCode"]; [dict setObject:kkUserPwd forKey:@"UserPassword"]; [dict setObject:kkSessionKey forKey:@"SessionKey"]; [dict setObject:cashStatusTypeId forKeyedSubscript:@"TypeID"]; [dict setObject:_collectionStatusStartDate forKeyedSubscript:@"AccountDateFrom"]; [dict setObject:_collectionStatusEndDate forKeyedSubscript:@"AccountDateTo"]; _cashStatusDownManager = [[ASIDownManager alloc] init]; _cashStatusDownManager.delegate = self; _cashStatusDownManager.onRequestSuccess = @selector(onCashStatusLoadFinish:); _cashStatusDownManager.onRequestFail = @selector(onCashStatusLoadFail:); [_cashStatusDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil]; } #pragma mark - 代理函数 - (void)datePickerController:(ITDatePickerController *)datePickerController didSelectedDate:(NSDate *)date dateString:(NSString *)dateString { NSInteger tag = datePickerController.tag; if (datePickerController.tag == 100) { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM"] ; NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init]; [dateFormatter1 setDateFormat:@"yyyyMM"]; //NSDate转NSString _salesAchievementMonth = [dateFormatter1 stringFromDate:date]; [_btnSalesAchievementCustom setTitle: [dateFormatter stringFromDate:date] forState:UIControlStateNormal]; [self clearSalesAchievementData]; [salesAchievementYArray removeAllObjects]; [salesAchievementXArray removeAllObjects]; [self startLoading]; [self loadSalesAchievementData]; } } -(void)onSalesAchievementLoadFinish:(ASIDownManager *)sender { [self stopLoading]; RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr]; int status= resultModel.status; if(status==0) { NSDictionary *resultDic=(NSDictionary*)[resultModel result]; NSArray *tableArray= [resultDic objectForKey:@"Table"]; NSArray *table1Array= [resultDic objectForKey:@"Table1"]; double totalPlanAmount=0; if(tableArray!=nil&&tableArray.count>0) { double totalAmount=0; NSMutableArray *salesAchievementArray=[[NSMutableArray alloc]init]; for(int i=0;i0) { NSDictionary *table1Dic=[table1Array objectAtIndex:0]; totalPlanAmount= [[table1Dic objectForKey:@"PlanAmount"]doubleValue]; } NSString *totalAmountStr=[NSString stringWithFormat:@"%.2f",totalAmount]; NSString *totalPlanAmountStr=[NSString stringWithFormat:@"%.2f",totalPlanAmount]; double percent; if(totalPlanAmount==0) { percent=0; } else { percent= totalAmount/totalPlanAmount*100; } [_salesAchievementChart progress:percent ]; lblSalesAchievementPercent.text=[NSString stringWithFormat:@"%@%.2f%@",@"完成率",percent,@"%"]; totalAmountStr=[Util thousandSeparatorFormat:totalAmountStr]; totalPlanAmountStr=[Util thousandSeparatorFormat:totalPlanAmountStr]; lblSalesAchievementPlanAmount.text=totalPlanAmountStr; lblSalesAchievementSalesAmount.text=totalAmountStr; IntAxisValueFormatter *formatter3=[[IntAxisValueFormatter alloc]init]; [formatter3 setTitle:salesAchievementXArray]; double maximumValue3= [self getYAxisMaximumValue:salesAchievementArray]; double minimumValue3=[self getYAxisMinimumValue:salesAchievementArray]; [self drawTwoBarchart:salesAchievementYArray receivablesTitleArray:salesAchievementTitleArray barChartView:_salesAchievementChartView axisValueFormatter:formatter3 xAxisLabelCount:salesAchievementXArray.count maximumValue:maximumValue3 minimumValue:minimumValue3]; } else { [ _salesAchievementChartView clear]; [_salesAchievementChartView notifyDataSetChanged]; } } } -(void)onSalesAchievementLoadFail:(ASIDownManager *)sender { [self stopLoading]; } -(void)onRepairStatusLoadFinish:(ASIDownManager *)sender { [self stopLoading]; RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr]; int status= resultModel.status; if(status==0) { NSDictionary *resultDic=(NSDictionary*)[resultModel result]; NSArray *resultArray=[resultDic objectForKey:@"Table"]; if(resultArray!=nil&&resultArray.count>0) { NSDictionary *dic=[resultArray objectAtIndex:0]; int repairNo= [[dic objectForKey:@"RepairNo"]intValue]; int repairOkNo= [[dic objectForKey:@"RepairOkNo"]intValue]; int repairNoOne= [[dic objectForKey:@"RepairNo_One"]intValue]; int repairNoTwo=[[dic objectForKey:@"RepairNo_Two"]intValue]; int repairNoThree=[[dic objectForKey:@"RepairNo_Three"]intValue]; lblNeedRepairCustomerCount.text=[NSString stringWithFormat:@"%d",repairNo]; lblRepairedCustomerCount.text=[NSString stringWithFormat:@"%d",repairOkNo]; lblNextDayNeedRepairCount.text=[NSString stringWithFormat:@"%d",repairNoOne]; lblNextTwoDaysNeedRepairCount.text=[NSString stringWithFormat:@"%d",repairNoTwo]; lblNextThreeDaysNeedRepairCount.text=[NSString stringWithFormat:@"%d",repairNoThree]; double percent=0; if(repairNo==0) { percent=0; } else{ percent= (double)repairOkNo/(double)repairNo*100; } NSString *percentStr= [NSString stringWithFormat:@"%.2f",percent]; [_repairStatusView progress:[percentStr floatValue]]; lblRepairPercent.text=[NSString stringWithFormat:@"%@%.2f%@",@"完成率",percent,@"%"]; } } } -(void)onRepairStatusLoadFail:(ASIDownManager *)sender { [self stopLoading]; } -(void)onDeliveryStatusLoadFinish:(ASIDownManager *)sender { [self stopLoading]; RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr]; int status= resultModel.status; if(status==0) { NSDictionary *resultDic=(NSDictionary*)[resultModel result]; NSArray *resultArray=[resultDic objectForKey:@"Table"]; if(resultArray!=nil&&resultArray.count>0) { NSDictionary *dic=[resultArray objectAtIndex:0]; int deliveryNo= [[dic objectForKey:@"DeliveryNo"]intValue]; int deliveryOkNo= [[dic objectForKey:@"DeliveryOkNo"]intValue]; int deliveryNoOne= [[dic objectForKey:@"DeliveryNo_One"]intValue]; int deliveryNoTwo=[[dic objectForKey:@"DeliveryNo_Two"]intValue]; int deliveryNoThree=[[dic objectForKey:@"DeliveryNo_Three"]intValue]; lblNeedDeliveryCustomerCount.text=[NSString stringWithFormat:@"%d",deliveryNo]; lblDeliveredCustomerCount.text=[NSString stringWithFormat:@"%d",deliveryOkNo]; lblNextDayNeedDeliveryCount.text=[NSString stringWithFormat:@"%d",deliveryNoOne]; lblNextTwoDaysNeedDeliveryCount.text=[NSString stringWithFormat:@"%d",deliveryNoTwo]; lblNextThreeDaysNeedDeliveryCount.text=[NSString stringWithFormat:@"%d",deliveryNoThree]; double percent=0; if(deliveryNo==0) { percent=0; } else{ percent= (double)deliveryOkNo/(double)deliveryNo*100; } [_deliveryStatusView progress:percent ]; lblDeliveryPercent.text=[NSString stringWithFormat:@"%@%.2f%@",@"完成率",percent,@"%"]; } } } -(void)onDeliveryStatusLoadFail:(ASIDownManager *)sender { [self stopLoading]; } -(void)onInstallStatusLoadFinish:(ASIDownManager *)sender { [self stopLoading]; RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr]; int status= resultModel.status; if(status==0) { NSDictionary *resultDic=(NSDictionary*)[resultModel result]; if(resultDic!=nil) { NSArray *resultArray=[resultDic objectForKey:@"Table"]; if(resultArray!=nil&&resultArray.count>0) { NSDictionary *dic=[resultArray objectAtIndex:0]; int installNo= [[dic objectForKey:@"InstallationNo"]intValue]; int installOkNo= [[dic objectForKey:@"InstallationOkNo"]intValue]; int installNoOne= [[dic objectForKey:@"InstallationNo_One"]intValue]; int installNoTwo=[[dic objectForKey:@"InstallationNo_Two"]intValue]; int installNoThree=[[dic objectForKey:@"InstallationNo_Three"]intValue]; lblNeedInstallCustomerCount.text=[NSString stringWithFormat:@"%d",installNo]; lblInstalledCustomerCount.text=[NSString stringWithFormat:@"%d",installOkNo]; lblNextDayNeedInstallCount.text=[NSString stringWithFormat:@"%d",installNoOne]; lblNextTwoDaysNeedInstallCount.text=[NSString stringWithFormat:@"%d",installNoTwo]; lblNextThreeDaysNeedInstallCount.text=[NSString stringWithFormat:@"%d",installNoThree]; double percent=0; if(installNo==0) { percent=0; } else{ percent= (double)installOkNo/(double)installNo*100; } [_installStatusView progress:percent]; lblInstallPercent.text=[NSString stringWithFormat:@"%@%.2f%@",@"完成率",percent,@"%"]; } } } } -(void)onInstallStatusLoadFail:(ASIDownManager *)sender { [self stopLoading]; } -(void)onShoppingGuideLoadFinish:(ASIDownManager *)sender { [self stopLoading]; RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr]; int status= resultModel.status; if(status==0) { NSDictionary *resultDic=(NSDictionary*)[resultModel result]; if(resultDic!=nil) { NSArray *table1Array= [resultDic objectForKey:@"Table1"]; NSArray *tableArray= [resultDic objectForKey:@"Table"]; if(table1Array!=nil&&table1Array.count>0) { NSDictionary *table1Dic=[table1Array objectAtIndex:0]; int num= [[table1Dic objectForKey:@"Num"]intValue]; int okNum= [[table1Dic objectForKey:@"OkNum"]intValue]; double transactionPercent=0; if(num==0) { transactionPercent=0; } else{ transactionPercent= okNum/num*100; } lblFilingCustomerCount.text=[NSString stringWithFormat:@"%d",num]; lblTransactionCustomerCount.text=[NSString stringWithFormat:@"%d",okNum]; [_transactionView progress:transactionPercent ]; } if(tableArray!=nil&&tableArray.count>0) { NSMutableArray *yArray=[[NSMutableArray alloc]init]; for(int i=0;i0) { for(int i=0;i0) { NSDictionary *table1Dic=[table1Array objectAtIndex:0]; int customerReturnNo=[[table1Dic objectForKey:@"CustomerReturnNo"]intValue]; int customerNo=[[table1Dic objectForKey:@"CustomerNo"]intValue]; double amount=[[table1Dic objectForKey:@"Amount"]doubleValue]; double returnAmount=[[table1Dic objectForKey:@"ReturnAmount"]doubleValue]; lblOrderCustomerCount.text=[NSString stringWithFormat:@"%d",customerNo]; lblUnsubscribeCustomerCount.text=[NSString stringWithFormat:@"%d",customerReturnNo]; NSString *amountStr=[NSString stringWithFormat:@"%.2f",amount]; amountStr=[Util thousandSeparatorFormat:amountStr]; lblOrderAmount.text=amountStr; NSString *returnAmountStr=[NSString stringWithFormat:@"%.2f",returnAmount]; returnAmountStr=[Util thousandSeparatorFormat:returnAmountStr]; lblUnsubscribeAmount.text=returnAmountStr; } } } } -(void)onOrderStatusLoadFail:(ASIDownManager *)sender { [self stopLoading]; } -(void)onCashStatusLoadFinish:(ASIDownManager *)sender { [self stopLoading]; RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr]; int status= resultModel.status; if(status==0) { NSDictionary *resultDic=(NSDictionary*)resultModel.result; if(resultDic!=nil) { NSArray *resultArray=[resultDic objectForKey:@"Table"]; if(resultArray!=nil&&resultArray.count>0) { double totalAmount=0; for(int i=0;i0) { NSDictionary *table1Dic= [table1Array objectAtIndex:0]; int customerNewNo=[[table1Dic objectForKey:@"CustomerNewNo"]intValue]; int customerNo=[[table1Dic objectForKey:@"CustomerNo"]intValue]; lblSalesAddCustomer.text=[NSString stringWithFormat:@"%d",customerNewNo]; lblSalesCustomerCount.text=[NSString stringWithFormat:@"%d",customerNo]; } if(tableArray!=nil&&tableArray.count>0) { double totalAmount=0; for(int i=0;i