ExpenseCell.m 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. //
  2. // ExpenseCell.m
  3. // IBOSS
  4. //
  5. // Created by apple on 2017/7/10.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:费用明细表单元格
  9. //
  10. #import "ExpenseCell.h"
  11. @implementation ExpenseCell
  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 *vFeeDirectionItem = [UIView new];
  46. vFeeDirectionItem.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame)+8, Screen_Width, heightRow);
  47. [self.contentView addSubview:vFeeDirectionItem];
  48. UIView *vFeeDirection = [UIView new];
  49. vFeeDirection.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  50. [vFeeDirectionItem addSubview:vFeeDirection];
  51. UILabel *lblFeeDirection = [UILabel new];
  52. lblFeeDirection.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  53. lblFeeDirection.text = @"费用方向:";
  54. lblFeeDirection.textColor = LabelGrayTextColor;
  55. lblFeeDirection.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  56. [vFeeDirection addSubview:lblFeeDirection];
  57. _lblValueFeeDirection = [UILabel new];
  58. _lblValueFeeDirection.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
  59. _lblValueFeeDirection.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  60. [vFeeDirection addSubview:_lblValueFeeDirection];
  61. UIView *vFeeItem = [UIView new];
  62. vFeeItem.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  63. [vFeeDirectionItem addSubview:vFeeItem];
  64. UILabel *lblFeeItem = [UILabel new];
  65. lblFeeItem.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  66. lblFeeItem.text = @"费用项目:";
  67. lblFeeItem.textColor = LabelGrayTextColor;
  68. lblFeeItem.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  69. [vFeeItem addSubview:lblFeeItem];
  70. _lblValueFeeItem = [UILabel new];
  71. _lblValueFeeItem.frame=CGRectMake(lblwidth, valuey, Screen_Width/2 - lblwidth - 10, valueheight);
  72. _lblValueFeeItem.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  73. [vFeeItem addSubview:_lblValueFeeItem];
  74. //分割线
  75. UIView *viewBackgroud = [UIView new];
  76. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vFeeDirectionItem.frame)+8, Screen_Width, heightLine);
  77. viewBackgroud.backgroundColor = LineBackgroundColor;
  78. [self.contentView addSubview:viewBackgroud];
  79. //业务部门 业务员 —————————
  80. UIView *vOrgStaff = [UIView new];
  81. vOrgStaff.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width, heightRow);
  82. [self.contentView addSubview:vOrgStaff];
  83. UIView *vOrg = [UIView new];
  84. vOrg.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  85. [vOrgStaff addSubview:vOrg];
  86. UILabel *lblOrg = [UILabel new];
  87. lblOrg.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  88. lblOrg.text = @"业务部门:";
  89. lblOrg.textColor = LabelGrayTextColor;
  90. lblOrg.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  91. [vOrg addSubview:lblOrg];
  92. _lblValueOrg = [UILabel new];
  93. _lblValueOrg.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
  94. _lblValueOrg.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  95. [vOrg addSubview:_lblValueOrg];
  96. UIView *vStaff = [UIView new];
  97. vStaff.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  98. [vOrgStaff addSubview:vStaff];
  99. UILabel *lblStaff = [UILabel new];
  100. lblStaff.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  101. lblStaff.text = @"业 务 员:";
  102. lblStaff.textColor = LabelGrayTextColor;
  103. lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  104. [vStaff addSubview:lblStaff];
  105. _lblValueStaff = [UILabel new];
  106. _lblValueStaff.frame=CGRectMake(lblwidth, valuey, Screen_Width/2 - lblwidth - 10, valueheight);
  107. _lblValueStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  108. [vStaff addSubview:_lblValueStaff];
  109. //费用金额 支付金额 —————————
  110. UIView *vFeePaySum = [UIView new];
  111. vFeePaySum.frame=CGRectMake(0, CGRectGetMaxY(vOrgStaff.frame), Screen_Width, heightRow);
  112. [self.contentView addSubview:vFeePaySum];
  113. UIView *vFeeSum = [UIView new];
  114. vFeeSum.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  115. [vFeePaySum addSubview:vFeeSum];
  116. UILabel *lblFeeSum = [UILabel new];
  117. lblFeeSum.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  118. lblFeeSum.text = @"费用金额:";
  119. lblFeeSum.textColor = LabelGrayTextColor;
  120. lblFeeSum.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  121. [vFeeSum addSubview:lblFeeSum];
  122. _lblValueFeeSum = [UILabel new];
  123. _lblValueFeeSum.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
  124. _lblValueFeeSum.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  125. [vFeeSum addSubview:_lblValueFeeSum];
  126. UIView *vPaySum = [UIView new];
  127. vPaySum.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  128. [vFeePaySum addSubview:vPaySum];
  129. UILabel *lblPaySum = [UILabel new];
  130. lblPaySum.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  131. lblPaySum.text = @"支付金额:";
  132. lblPaySum.textColor = LabelGrayTextColor;
  133. lblPaySum.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  134. [vPaySum addSubview:lblPaySum];
  135. _lblValuePaySum = [UILabel new];
  136. _lblValuePaySum.frame=CGRectMake(lblwidth, valuey, Screen_Width/2 - lblwidth - 10, valueheight);
  137. _lblValuePaySum.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  138. [vPaySum addSubview:_lblValuePaySum];
  139. }
  140. @end