| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- //
- // SingleProfitAnalyseListCell.m
- // IBOSS
- //
- // Created by 关宏厚 on 2019/4/11.
- // Copyright © 2019 elongtian. All rights reserved.
- //
- #import "SingleProfitAnalyseListCell.h"
- @implementation SingleProfitAnalyseListCell
- /**
- @param style <#style description#>
- @param reuseIdentifier <#reuseIdentifier description#>
- @return <#return value description#>
- */
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- return self;
- }
- -(void)setSingleProfitAnalyseListCell:(SingleProfitAnalyseListModel*) singleProfitListModel
- {
- CGFloat heightLine = 1;
- CGFloat heightRow = 31;
- CGFloat lblx = 20;
- CGFloat lbly = 0;
- CGFloat lblwidth = 70;
- CGFloat lblheight = 31;
- CGFloat valuey = 0;
- CGFloat valueheight = 31;
-
- UIView *vSeparator = [UIView new];
- vSeparator.frame=CGRectMake(0, 0, Screen_Width, 10);
- vSeparator.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:vSeparator];
-
- UIView *vDepartment = [UIView new];
- vDepartment.frame=CGRectMake(0, CGRectGetMaxY(vSeparator.frame)+8, Screen_Width, heightRow);
- [self.contentView addSubview:vDepartment];
-
- UILabel *lblDepartmentTitle= [UILabel new];
- lblDepartmentTitle.frame=CGRectMake(lblx, lbly, lblwidth+2, lblheight);
- lblDepartmentTitle.text = @"业务部门:";
- lblDepartmentTitle.textColor = [UIColor blackColor];
- lblDepartmentTitle.font = [UIFont systemFontOfSize: TitleFontOfSize];
- [vDepartment addSubview:lblDepartmentTitle];
-
- _lblDepartment = [UILabel new];
- _lblDepartment.frame=CGRectMake(CGRectGetMaxX(lblDepartmentTitle.frame), valuey, Screen_Width -CGRectGetMaxX(lblDepartmentTitle.frame)-lblx-95 , valueheight);
- _lblDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vDepartment addSubview:_lblDepartment];
- _lblDepartment.text=singleProfitListModel.organizationName;
-
- _lblInvoiceType = [UILabel new];
- _lblInvoiceType.frame=CGRectMake(Screen_Width - 95 - lblx, valuey, 95, valueheight);
- _lblInvoiceType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblInvoiceType.textAlignment = NSTextAlignmentRight;
- _lblInvoiceType.textColor = LabelGrayTextColor;
- [vDepartment addSubview:_lblInvoiceType];
- _lblInvoiceType.text=singleProfitListModel.invoiceTypeName;
-
- //分割线
- UIView *viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vDepartment.frame)+8, Screen_Width, heightLine);
- viewBackgroud.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:viewBackgroud];
-
- UIView *vStaffAndServiceAmount = [UIView new];
- vStaffAndServiceAmount.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vStaffAndServiceAmount];
-
- UIView *vStaffAmount = [UIView new];
- vStaffAmount.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vStaffAndServiceAmount addSubview:vStaffAmount];
-
- UILabel *lblStaffAmountTitle = [UILabel new];
- lblStaffAmountTitle.frame=CGRectMake(lblx, lbly,90, lblheight);
- lblStaffAmountTitle.text = @"业务员业绩:";
- lblStaffAmountTitle.textColor = [UIColor lightGrayColor];
- lblStaffAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaffAmount addSubview:lblStaffAmountTitle];
- _lblStaffAmount = [UILabel new];
- _lblStaffAmount.frame=CGRectMake(CGRectGetMaxX(lblStaffAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblStaffAmountTitle.frame), valueheight);
- _lblStaffAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaffAmount addSubview:_lblStaffAmount];
- _lblStaffAmount.text = singleProfitListModel.staffAmount;
-
- UIView *vServiceAmount = [UIView new];
- vServiceAmount.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
- [vStaffAndServiceAmount addSubview:vServiceAmount];
-
- UILabel *lblServiceAmountTitle = [UILabel new];
- lblServiceAmountTitle.frame=CGRectMake(5, lbly,90, lblheight);
- lblServiceAmountTitle.text = @"服务人员业绩:";
- lblServiceAmountTitle.textColor = [UIColor lightGrayColor];
- lblServiceAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vServiceAmount addSubview:lblServiceAmountTitle];
-
- _lblServiceAmount = [UILabel new];
- _lblServiceAmount.frame=CGRectMake(CGRectGetMaxX(lblServiceAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblServiceAmountTitle.frame) , valueheight);
- _lblServiceAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vServiceAmount addSubview:_lblServiceAmount];
- _lblServiceAmount.text = singleProfitListModel.serviceAmount;
-
- UIView *vFeeAndRateOfMargin = [UIView new];
- vFeeAndRateOfMargin.frame=CGRectMake(0, CGRectGetMaxY(vStaffAndServiceAmount.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vFeeAndRateOfMargin];
-
- UIView *vFeeAmount = [UIView new];
- vFeeAmount.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vFeeAndRateOfMargin addSubview:vFeeAmount];
-
- UILabel *lblFeeAmountTitle = [UILabel new];
- lblFeeAmountTitle.frame=CGRectMake(lblx, lbly,lblwidth, lblheight);
- lblFeeAmountTitle.text = @"费用:";
- lblFeeAmountTitle.textColor = [UIColor lightGrayColor];
- lblFeeAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vFeeAmount addSubview:lblFeeAmountTitle];
-
- _lblFeeAmount = [UILabel new];
- _lblFeeAmount.frame=CGRectMake(CGRectGetMaxX(lblFeeAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblFeeAmountTitle.frame), valueheight);
- _lblFeeAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vFeeAmount addSubview:_lblFeeAmount];
- _lblFeeAmount.text = singleProfitListModel.feeAmount;
-
- UIView *vRateOfMargin = [UIView new];
- vRateOfMargin.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
- [vFeeAndRateOfMargin addSubview:vRateOfMargin];
-
- UILabel *lblRateOfMarginTitle = [UILabel new];
- lblRateOfMarginTitle.frame=CGRectMake(5, lbly,90, lblheight);
- lblRateOfMarginTitle.text = @"毛利率:";
- lblRateOfMarginTitle.textColor = [UIColor lightGrayColor];
- lblRateOfMarginTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vRateOfMargin addSubview:lblRateOfMarginTitle];
-
- _lblRateOfMargin = [UILabel new];
- _lblRateOfMargin.frame=CGRectMake(CGRectGetMaxX(lblRateOfMarginTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblRateOfMarginTitle.frame) , valueheight);
- _lblRateOfMargin.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vRateOfMargin addSubview:_lblRateOfMargin];
- _lblRateOfMargin.text = singleProfitListModel.rateOfMargin;
-
-
- UIView *vCustomerAndRebates = [UIView new];
- vCustomerAndRebates.frame=CGRectMake(0, CGRectGetMaxY(vFeeAndRateOfMargin.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vCustomerAndRebates];
-
- UIView *vCustomerAmount = [UIView new];
- vCustomerAmount.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vCustomerAndRebates addSubview:vCustomerAmount];
-
- UILabel *lblCustomerAmountTitle = [UILabel new];
- lblCustomerAmountTitle.frame=CGRectMake(lblx, lbly,120, lblheight);
- lblCustomerAmountTitle.text = @"中间客户返利:";
- lblCustomerAmountTitle.textColor = [UIColor lightGrayColor];
- lblCustomerAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerAmount addSubview:lblCustomerAmountTitle];
-
- _lblCustomerAmount = [UILabel new];
- _lblCustomerAmount.frame=CGRectMake(CGRectGetMaxX(lblCustomerAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblCustomerAmountTitle.frame), valueheight);
- _lblCustomerAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerAmount addSubview:_lblCustomerAmount];
- _lblCustomerAmount.text = singleProfitListModel.customerAmount;
-
- UIView *vRebatesSum = [UIView new];
- vRebatesSum.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
- [vCustomerAndRebates addSubview:vRebatesSum];
-
- UILabel *lblRebatesSumTitle = [UILabel new];
- lblRebatesSumTitle.frame=CGRectMake(5, lbly,90, lblheight);
- lblRebatesSumTitle.text = @"返利金额:";
- lblRebatesSumTitle.textColor = [UIColor lightGrayColor];
- lblRebatesSumTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vRebatesSum addSubview:lblRebatesSumTitle];
-
- _lblRebatesSum = [UILabel new];
- _lblRebatesSum.frame=CGRectMake(CGRectGetMaxX(lblRebatesSumTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblRebatesSumTitle.frame) , valueheight);
- _lblRebatesSum.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vRebatesSum addSubview:_lblRebatesSum];
- _lblRebatesSum.text = singleProfitListModel.rebatesSum;
-
- UIView *vIncomeAndCost = [UIView new];
- vIncomeAndCost.frame=CGRectMake(0, CGRectGetMaxY(vCustomerAndRebates.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vIncomeAndCost];
-
- UIView *vIncome = [UIView new];
- vIncome.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vIncomeAndCost addSubview:vIncome];
-
- UILabel *lblIncomeTitle = [UILabel new];
- lblIncomeTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblIncomeTitle.text = @"收入:";
- lblIncomeTitle.textColor = [UIColor lightGrayColor];
- lblIncomeTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vIncome addSubview:lblIncomeTitle];
- _lblIncome = [UILabel new]; _lblIncome.frame=CGRectMake(CGRectGetMaxX(lblIncomeTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblIncomeTitle.frame), valueheight);
- _lblIncome.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vIncome addSubview:_lblIncome];
- _lblIncome.text = singleProfitListModel.amount;
-
- UIView *vCost = [UIView new];
- vCost.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
- [vIncomeAndCost addSubview:vCost];
-
- UILabel *lblCostTitle = [UILabel new];
- lblCostTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
- lblCostTitle.text = @"成本:";
- lblCostTitle.textColor = [UIColor lightGrayColor];
- lblCostTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCost addSubview:lblCostTitle];
-
- _lblCost = [UILabel new];
- _lblCost.frame=CGRectMake(CGRectGetMaxX(lblCostTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblCostTitle.frame) , valueheight);
- _lblCost.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCost addSubview:_lblCost];
- _lblCost.text = singleProfitListModel.costAmount;
-
- UIView *vMarginAndProfit = [UIView new];
- vMarginAndProfit.frame=CGRectMake(0, CGRectGetMaxY(vIncomeAndCost.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vMarginAndProfit];
-
-
- UIView *vMargin = [UIView new];
- vMargin.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vMarginAndProfit addSubview:vMargin];
-
- UILabel *lblMarginTitle = [UILabel new];
- lblMarginTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblMarginTitle.text = @"毛利:";
- lblMarginTitle.textColor = [UIColor lightGrayColor];
- lblMarginTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vMargin addSubview:lblMarginTitle];
- _lblMargin = [UILabel new]; _lblMargin.frame=CGRectMake(CGRectGetMaxX(lblMarginTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblMarginTitle.frame), valueheight);
- _lblMargin.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vMargin addSubview:_lblMargin];
- _lblMargin.text = singleProfitListModel.marginAmount;
-
- UIView *vProfit = [UIView new];
- vProfit.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
- [vMarginAndProfit addSubview:vProfit];
-
- UILabel *lblProfitTitle = [UILabel new];
- lblProfitTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
- lblProfitTitle.text = @"利润:";
- lblProfitTitle.textColor = [UIColor lightGrayColor];
- lblProfitTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vProfit addSubview:lblProfitTitle];
-
- _lblProfit = [UILabel new];
- _lblProfit.frame=CGRectMake(CGRectGetMaxX(lblProfitTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblProfitTitle.frame) , valueheight);
- _lblProfit.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vProfit addSubview:_lblProfit];
- _lblProfit.text = singleProfitListModel.profitAmount;
-
- viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vMarginAndProfit.frame)+8, Screen_Width, heightLine);
- viewBackgroud.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:viewBackgroud];
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- }
- @end
|