SingleProfitCell.m 5.9 KB

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