| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- //
- // SalesAchievementDataListCellTableViewCell.m
- // IBOSS
- //
- // Created by guan hong hou on 2017/8/22.
- // Copyright © 2017年 elongtian. All rights reserved.
- //
- // 功能描述:销售业绩列表单元格
- #import "SalesAchievementDataListCell.h"
- #define kTextFont [UIFont systemFontOfSize:TitleFontOfSize]
- #define kSubTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
- @implementation SalesAchievementDataListCell
- #pragma 私有函数
- /**
- 设置销售业绩列表frame
- @param frame <#frame description#>
- */
- - (void)setSalesAchievementListFrame:(SalesAchievementListFrame *)frame{
- SalesAchievementRankModel *model = frame.achievementRankModel;
- if(model.objectName != nil && model.objectName.length > 0){
- _lblSalerName = [[UILabel alloc] initWithFrame:[frame salerNameF]];
- _lblSalerName.backgroundColor = [UIColor clearColor];
- _lblSalerName.textColor = [UIColor blackColor];
- _lblSalerName.textAlignment = NSTextAlignmentLeft;
- _lblSalerName.font = kTextFont;
- [self addSubview: _lblSalerName];
- _lblSalerName.text = model.objectName;
- }
- NSString *titleRank=@"排行:";
- UILabel *lblTitleRank=[[UILabel alloc] initWithFrame:[frame lblTitleRankF]];
- lblTitleRank.backgroundColor = [UIColor clearColor];
- lblTitleRank.textColor = [UIColor blackColor];
- lblTitleRank.textAlignment = NSTextAlignmentLeft;
- lblTitleRank.font = kTextFont;
- lblTitleRank.text = titleRank;
- [self addSubview: lblTitleRank];
- NSInteger orderOrder=model.orderSort;
- NSString *orderSortStr= [NSString stringWithFormat:@"%ld",(long)orderOrder];
- if(orderSortStr != nil && orderSortStr.length > 0){
- _lblRank = [[UILabel alloc] initWithFrame:[frame lblRankF]];
- _lblRank.textColor = [UIColor blackColor];
- _lblRank.textAlignment = NSTextAlignmentLeft;
- _lblRank.font = kTextFont;
- [self addSubview:_lblRank];
- _lblRank.text = orderSortStr;
- }
- NSString *titleSalesCustomerCount = @"客户数量:";
- UILabel *lblTitleSalesCustomerCount = [[UILabel alloc] initWithFrame:[frame lblTitleSalesCustomerCountF]];
- lblTitleSalesCustomerCount.backgroundColor = [UIColor clearColor];
- lblTitleSalesCustomerCount.textColor =LabelGrayTextColor;
- lblTitleSalesCustomerCount.textAlignment = NSTextAlignmentLeft;
- lblTitleSalesCustomerCount.font = kSubTextFont;
- lblTitleSalesCustomerCount.text = titleSalesCustomerCount;
- [self addSubview: lblTitleSalesCustomerCount];
- NSInteger salesCustomerCount=model.salesCustomerCount;
- NSString *salesCustomerCountStr= [NSString stringWithFormat:@"%ld",(long)salesCustomerCount];
- if(salesCustomerCountStr != nil && salesCustomerCountStr.length > 0){
- _lblSalesCustomerCount = [[UILabel alloc] initWithFrame:[frame lblSalesCustomerCountF]];
- _lblSalesCustomerCount.textColor = LabelGrayTextColor;
- _lblSalesCustomerCount.textAlignment = NSTextAlignmentLeft;
- _lblSalesCustomerCount.font = kSubTextFont;
- [self addSubview: _lblSalesCustomerCount];
- _lblSalesCustomerCount.text = salesCustomerCountStr;
- }
-
- NSString *titleSalesItemCount = @"单数:";
- UILabel *lblTitleSalesItemCount = [[UILabel alloc] initWithFrame:[frame lblTitleSalesItemCountF]];
- lblTitleSalesItemCount.backgroundColor = [UIColor clearColor];
- lblTitleSalesItemCount.textColor = LabelGrayTextColor;
- lblTitleSalesItemCount.textAlignment = NSTextAlignmentLeft;
- lblTitleSalesItemCount.font = kSubTextFont;
- lblTitleSalesItemCount.text = titleSalesItemCount;
- [self addSubview: lblTitleSalesItemCount];
- NSInteger salesItemCount=model.salesItemCount;
- NSString *salesItemCountStr= [NSString stringWithFormat:@"%ld",(long)salesItemCount];
- if(salesItemCountStr != nil && salesItemCountStr.length > 0){
- _lblSalesItemCount = [[UILabel alloc] initWithFrame:[frame lblSalesItemCountF]];
- _lblSalesItemCount.textColor = LabelGrayTextColor;
- _lblSalesItemCount.textAlignment = NSTextAlignmentLeft;
- _lblSalesItemCount.font = kSubTextFont;
- [self addSubview: _lblSalesItemCount];
- _lblSalesItemCount.text = salesItemCountStr;
- }
-
- NSString *titlePercent = @"比重:";
- UILabel *lblTitlePercent = [[UILabel alloc] initWithFrame:[frame lblTitlePercentF]];
- lblTitlePercent.backgroundColor = [UIColor clearColor];
- lblTitlePercent.textColor = LabelGrayTextColor;
- lblTitlePercent.textAlignment = NSTextAlignmentLeft;
- lblTitlePercent.font = kSubTextFont;
- lblTitlePercent.text = titlePercent;
- [self addSubview: lblTitlePercent];
- NSString *percent = model.percent;
- percent = [NSString stringWithFormat:@"%@%s",percent,"%"];
- if(percent != nil && percent.length > 0){
- _lblPercentage = [[UILabel alloc] initWithFrame:[frame lblPercentF]];
- _lblPercentage.textColor = LabelGrayTextColor;
- _lblPercentage.textAlignment = NSTextAlignmentRight;
- _lblPercentage.font = kSubTextFont;
- [self addSubview:_lblPercentage];
- _lblPercentage.text = percent;
- }
-
- NSString *titleSalesAmount = @"销售金额:";
- UILabel *lblTitleSalesAmount = [[UILabel alloc] initWithFrame:[frame lblTitleSalesAmountF]];
- lblTitleSalesAmount.backgroundColor = [UIColor clearColor];
- lblTitleSalesAmount.textColor = LabelGrayTextColor;
- lblTitleSalesAmount.textAlignment = NSTextAlignmentLeft;
- lblTitleSalesAmount.font = kSubTextFont;
- lblTitleSalesAmount.text = titleSalesAmount;
- [self addSubview: lblTitleSalesAmount];
- double salesAmount = model.goodsAmount;
- NSString *salesAmountStr = [NSString stringWithFormat:@"¥%.2f",salesAmount];
- if(salesAmountStr != nil && salesAmountStr.length > 0){
- _lblSalesAmount = [[UILabel alloc] initWithFrame:[frame lblSalesAmountF]];
- _lblSalesAmount.textColor = LabelGrayTextColor;
- _lblSalesAmount.textAlignment = NSTextAlignmentLeft;
- _lblSalesAmount.font = kSubTextFont;
- [self addSubview:_lblSalesAmount];
- _lblSalesAmount.text = salesAmountStr;
- }
-
- NSString *titleAverage = @"客户平均值:";
- UILabel *lblTitleAverage = [[UILabel alloc] initWithFrame:[frame lblTitleCustomerAverageF]];
- lblTitleAverage.backgroundColor = [UIColor clearColor];
- lblTitleAverage.textColor = LabelGrayTextColor;
- lblTitleAverage.textAlignment = NSTextAlignmentLeft;
- lblTitleAverage.text = titleAverage;
- lblTitleAverage.font = kSubTextFont;
- [self addSubview: lblTitleAverage];
- double average=model.average;
- NSString *averageStr = [NSString stringWithFormat:@"¥%.2f",average];
- if(averageStr != nil&&averageStr.length > 0){
- _lblAverage = [[UILabel alloc] initWithFrame:[frame lblCustomerAverageF]];
- _lblAverage.textColor = LabelGrayTextColor;
- _lblAverage.textAlignment = NSTextAlignmentLeft;
- _lblAverage.font = kSubTextFont;
- [self addSubview: _lblAverage];
- _lblAverage.text = averageStr;
- }
- UIView *separatorView = [[UIView alloc]init];
- separatorView.frame = [frame separatorF];
- separatorView.backgroundColor = LineBackgroundColor;
- [self addSubview:separatorView];
- }
- @end
|