| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- //
- // SingleProfitCell.m
- // IBOSSmini
- //
- // Created by apple on 2017/5/18.
- // Copyright © 2017年 elongtian. All rights reserved.
- //
- #import "SingleProfitCell.h"
- @implementation SingleProfitCell
- - (void)awakeFromNib{
- [super awakeFromNib];
- }
- /**
- 后台代码创建单元cell
-
- @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];
- [self initUI];
- return self;
- }
- /**
- 初始化ui
- */
- - (void)initUI{
- CGFloat heightLine = 1;
- CGFloat heightRow = 40;
- CGFloat lblx = 20;
- CGFloat lbly = 8;
- CGFloat lblwidth = 80;
- CGFloat lblheight = 25;
-
- CGFloat valuex = 90;
- CGFloat valuey = 8;
- CGFloat valueheight = 25;
-
- //title==================
- UIView *vTitle = [UIView new];
- vTitle.frame=CGRectMake(0, 0, Screen_Width, 10);
- vTitle.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:vTitle];
-
- //客户名称==================
- UIView *vcustomerName = [UIView new];
- vcustomerName.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vcustomerName];
- UILabel *lblcustomerName=[UILabel new];
- lblcustomerName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblcustomerName.text=@"客户名称:";
- lblcustomerName.textColor = [UIColor blackColor];
- lblcustomerName.font = [UIFont systemFontOfSize: TitleFontOfSize];
- [vcustomerName addSubview:lblcustomerName];
-
- _lblValueCreateTime = [UILabel new];
- _lblValueCreateTime.frame=CGRectMake(Screen_Width - 95 - lblx, valuey, 95, valueheight);
- _lblValueCreateTime.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblValueCreateTime.textAlignment = NSTextAlignmentRight;
- _lblValueCreateTime.textColor = LabelGrayTextColor;
- [vcustomerName addSubview:_lblValueCreateTime];
-
- _lblValueCustomerName = [UILabel new];
- _lblValueCustomerName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex-lblwidth- lblx , valueheight);
- _lblValueCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vcustomerName addSubview:_lblValueCustomerName];
-
- //分割线
- UIView *viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vcustomerName.frame), Screen_Width, heightLine);
- viewBackgroud.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:viewBackgroud];
-
- //业务类型 业务员==================
- UIView *vCustomerTypeStaff = [UIView new];
- vCustomerTypeStaff.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vCustomerTypeStaff];
-
- UIView *vCustomerType = [UIView new];
- vCustomerType.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vCustomerTypeStaff addSubview:vCustomerType];
-
- UILabel *lblBrand=[UILabel new];
- lblBrand.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblBrand.text=@"业务类型:";
- lblBrand.textColor = LabelGrayTextColor;
- lblBrand.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerType addSubview:lblBrand];
- _lblValueCustomerType = [UILabel new];
- _lblValueCustomerType.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
- _lblValueCustomerType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
-
- [vCustomerType addSubview:_lblValueCustomerType];
-
- UIView *vStaff = [UIView new];
- vStaff.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
- [vCustomerTypeStaff addSubview:vStaff];
-
- UILabel *lblStaff=[UILabel new];
- lblStaff.frame=CGRectMake(5, lbly, 60, lblheight);
- lblStaff.text=@"业务员:";
- lblStaff.textColor = LabelGrayTextColor;
- lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaff addSubview:lblStaff];
- _lblValueStaff = [UILabel new];
- _lblValueStaff.frame=CGRectMake(60, valuey, Screen_Width/2 - 60 - 10, valueheight);
- _lblValueStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaff addSubview:_lblValueStaff];
-
- //业务部门==================
- UIView *vOrg = [UIView new];
- vOrg.frame=CGRectMake(0, CGRectGetMaxY(vCustomerTypeStaff.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vOrg];
-
- UILabel *lblOrg=[UILabel new];
- lblOrg.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblOrg.text=@"业务部门:";
- lblOrg.textColor = LabelGrayTextColor;
- lblOrg.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vOrg addSubview:lblOrg];
- _lblValueOrg = [UILabel new];
- _lblValueOrg.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
- _lblValueOrg.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vOrg addSubview:_lblValueOrg];
-
- //分割线
- viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vOrg.frame), Screen_Width, heightLine);
- viewBackgroud.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:viewBackgroud];
-
- UIView *vBottom = [UIView new];
- vBottom.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vBottom];
- _lblValueIncomeAndCostAndProfit = [UILabel new];
- _lblValueIncomeAndCostAndProfit.frame=CGRectMake(lblx, valuey, Screen_Width - 2*lblx, valueheight);
- _lblValueIncomeAndCostAndProfit.textAlignment = NSTextAlignmentRight;
- _lblValueIncomeAndCostAndProfit.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vBottom addSubview:_lblValueIncomeAndCostAndProfit];
- //
- // NSString *str = [NSString stringWithFormat:@"(收入:¥%@;成本:¥%@;毛利:¥%@)",m.inventoryQuantity,m.price];
-
- }
- @end
|