SingleProfitCell.m 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //
  2. // SingleProfitCell.m
  3. // IBOSS
  4. //
  5. // Created by apple on 2017/5/18.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:每单利润表单元格
  9. //
  10. #import "SingleProfitCell.h"
  11. @implementation SingleProfitCell
  12. - (void)awakeFromNib{
  13. [super awakeFromNib];
  14. }
  15. /**
  16. 后台代码创建单元cell
  17. @param style <#style description#>
  18. @param reuseIdentifier <#reuseIdentifier description#>
  19. @return <#return value description#>
  20. */
  21. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  22. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  23. [self initUI];
  24. return self;
  25. }
  26. /**
  27. 初始化ui
  28. */
  29. - (void)initUI{
  30. CGFloat heightLine = 1;
  31. CGFloat heightRow = 31;
  32. CGFloat lblx = 20;
  33. CGFloat lbly = 0;
  34. CGFloat lblwidth = 70;
  35. CGFloat lblheight = 31;
  36. CGFloat valuex = 85;
  37. CGFloat valuey = 0;
  38. CGFloat valueheight = 31;
  39. //title —————————
  40. UIView *vTitle = [UIView new];
  41. vTitle.frame=CGRectMake(0, 0, Screen_Width, 10);
  42. vTitle.backgroundColor = LineBackgroundColor;
  43. [self.contentView addSubview:vTitle];
  44. //客户名称 —————————
  45. UIView *vcustomerName = [UIView new];
  46. vcustomerName.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame)+8, Screen_Width, heightRow);
  47. [self.contentView addSubview:vcustomerName];
  48. UILabel *lblcustomerName = [UILabel new];
  49. lblcustomerName.frame=CGRectMake(lblx, lbly, lblwidth+2, lblheight);
  50. lblcustomerName.text = @"客户名称:";
  51. lblcustomerName.textColor = [UIColor blackColor];
  52. lblcustomerName.font = [UIFont systemFontOfSize: TitleFontOfSize];
  53. [vcustomerName addSubview:lblcustomerName];
  54. _lblValueCreateTime = [UILabel new];
  55. _lblValueCreateTime.frame=CGRectMake(Screen_Width - 95 - lblx, valuey, 95, valueheight);
  56. _lblValueCreateTime.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  57. _lblValueCreateTime.textAlignment = NSTextAlignmentRight;
  58. _lblValueCreateTime.textColor = LabelGrayTextColor;
  59. [vcustomerName addSubview:_lblValueCreateTime];
  60. _lblValueCustomerName = [UILabel new];
  61. _lblValueCustomerName.frame=CGRectMake(valuex+5, valuey, Screen_Width - valuex-lblwidth- lblx , valueheight);
  62. _lblValueCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  63. [vcustomerName addSubview:_lblValueCustomerName];
  64. //分割线
  65. UIView *viewBackgroud = [UIView new];
  66. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vcustomerName.frame)+8, Screen_Width, heightLine);
  67. viewBackgroud.backgroundColor = LineBackgroundColor;
  68. [self.contentView addSubview:viewBackgroud];
  69. //业务类型 业务员 —————————
  70. UIView *vCustomerTypeStaff = [UIView new];
  71. vCustomerTypeStaff.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width, heightRow);
  72. [self.contentView addSubview:vCustomerTypeStaff];
  73. UIView *vCustomerType = [UIView new];
  74. vCustomerType.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  75. [vCustomerTypeStaff addSubview:vCustomerType];
  76. UILabel *lblBrand = [UILabel new];
  77. lblBrand.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  78. lblBrand.text = @"业务类型:";
  79. lblBrand.textColor = LabelGrayTextColor;
  80. lblBrand.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  81. [vCustomerType addSubview:lblBrand];
  82. _lblValueCustomerType = [UILabel new];
  83. _lblValueCustomerType.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
  84. _lblValueCustomerType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  85. [vCustomerType addSubview:_lblValueCustomerType];
  86. UIView *vStaff = [UIView new];
  87. vStaff.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  88. [vCustomerTypeStaff addSubview:vStaff];
  89. UILabel *lblStaff = [UILabel new];
  90. lblStaff.frame=CGRectMake(5, lbly, 55, lblheight);
  91. lblStaff.text = @"业务员:";
  92. lblStaff.textColor = LabelGrayTextColor;
  93. lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  94. [vStaff addSubview:lblStaff];
  95. _lblValueStaff = [UILabel new];
  96. _lblValueStaff.frame=CGRectMake(55, valuey, Screen_Width/2 - 60 - 10, valueheight);
  97. _lblValueStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  98. [vStaff addSubview:_lblValueStaff];
  99. //业务部门 —————————
  100. UIView *vOrg = [UIView new];
  101. vOrg.frame=CGRectMake(0, CGRectGetMaxY(vCustomerTypeStaff.frame), Screen_Width, heightRow);
  102. [self.contentView addSubview:vOrg];
  103. UILabel *lblOrg = [UILabel new];
  104. lblOrg.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  105. lblOrg.text = @"业务部门:";
  106. lblOrg.textColor = LabelGrayTextColor;
  107. lblOrg.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  108. [vOrg addSubview:lblOrg];
  109. _lblValueOrg = [UILabel new];
  110. _lblValueOrg.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  111. _lblValueOrg.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  112. [vOrg addSubview:_lblValueOrg];
  113. //分割线
  114. viewBackgroud = [UIView new];
  115. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vOrg.frame)+8, Screen_Width, heightLine);
  116. viewBackgroud.backgroundColor = LineBackgroundColor;
  117. [self.contentView addSubview:viewBackgroud];
  118. UIView *vBottom = [UIView new];
  119. vBottom.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width, heightRow);
  120. [self.contentView addSubview:vBottom];
  121. _lblValueIncomeAndCostAndProfit = [UILabel new];
  122. _lblValueIncomeAndCostAndProfit.frame=CGRectMake(lblx, valuey, Screen_Width - 2*lblx, valueheight);
  123. _lblValueIncomeAndCostAndProfit.textAlignment = NSTextAlignmentRight;
  124. _lblValueIncomeAndCostAndProfit.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  125. [vBottom addSubview:_lblValueIncomeAndCostAndProfit];
  126. }
  127. @end