SingleProfitAnalyseListCell.m 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. //
  2. // SingleProfitAnalyseListCell.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2019/4/11.
  6. // Copyright © 2019 elongtian. All rights reserved.
  7. //
  8. #import "SingleProfitAnalyseListCell.h"
  9. @implementation SingleProfitAnalyseListCell
  10. /**
  11. @param style <#style description#>
  12. @param reuseIdentifier <#reuseIdentifier description#>
  13. @return <#return value description#>
  14. */
  15. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  16. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  17. return self;
  18. }
  19. -(void)setSingleProfitAnalyseListCell:(SingleProfitAnalyseListModel*) singleProfitListModel
  20. {
  21. CGFloat heightLine = 1;
  22. CGFloat heightRow = 31;
  23. CGFloat lblx = 20;
  24. CGFloat lbly = 0;
  25. CGFloat lblwidth = 70;
  26. CGFloat lblheight = 31;
  27. CGFloat valuey = 0;
  28. CGFloat valueheight = 31;
  29. UIView *vSeparator = [UIView new];
  30. vSeparator.frame=CGRectMake(0, 0, Screen_Width, 10);
  31. vSeparator.backgroundColor = LineBackgroundColor;
  32. [self.contentView addSubview:vSeparator];
  33. UIView *vDepartment = [UIView new];
  34. vDepartment.frame=CGRectMake(0, CGRectGetMaxY(vSeparator.frame)+8, Screen_Width, heightRow);
  35. [self.contentView addSubview:vDepartment];
  36. UILabel *lblDepartmentTitle= [UILabel new];
  37. lblDepartmentTitle.frame=CGRectMake(lblx, lbly, lblwidth+2, lblheight);
  38. lblDepartmentTitle.text = @"业务部门:";
  39. lblDepartmentTitle.textColor = [UIColor blackColor];
  40. lblDepartmentTitle.font = [UIFont systemFontOfSize: TitleFontOfSize];
  41. [vDepartment addSubview:lblDepartmentTitle];
  42. _lblDepartment = [UILabel new];
  43. _lblDepartment.frame=CGRectMake(CGRectGetMaxX(lblDepartmentTitle.frame), valuey, Screen_Width -CGRectGetMaxX(lblDepartmentTitle.frame)-lblx-95 , valueheight);
  44. _lblDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  45. [vDepartment addSubview:_lblDepartment];
  46. _lblDepartment.text=singleProfitListModel.organizationName;
  47. _lblInvoiceType = [UILabel new];
  48. _lblInvoiceType.frame=CGRectMake(Screen_Width - 95 - lblx, valuey, 95, valueheight);
  49. _lblInvoiceType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  50. _lblInvoiceType.textAlignment = NSTextAlignmentRight;
  51. _lblInvoiceType.textColor = LabelGrayTextColor;
  52. [vDepartment addSubview:_lblInvoiceType];
  53. _lblInvoiceType.text=singleProfitListModel.invoiceTypeName;
  54. //分割线
  55. UIView *viewBackgroud = [UIView new];
  56. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vDepartment.frame)+8, Screen_Width, heightLine);
  57. viewBackgroud.backgroundColor = LineBackgroundColor;
  58. [self.contentView addSubview:viewBackgroud];
  59. UIView *vStaffAndServiceAmount = [UIView new];
  60. vStaffAndServiceAmount.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame), Screen_Width, heightRow);
  61. [self.contentView addSubview:vStaffAndServiceAmount];
  62. UIView *vStaffAmount = [UIView new];
  63. vStaffAmount.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  64. [vStaffAndServiceAmount addSubview:vStaffAmount];
  65. UILabel *lblStaffAmountTitle = [UILabel new];
  66. lblStaffAmountTitle.frame=CGRectMake(lblx, lbly,90, lblheight);
  67. lblStaffAmountTitle.text = @"业务员业绩:";
  68. lblStaffAmountTitle.textColor = [UIColor lightGrayColor];
  69. lblStaffAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  70. [vStaffAmount addSubview:lblStaffAmountTitle];
  71. _lblStaffAmount = [UILabel new];
  72. _lblStaffAmount.frame=CGRectMake(CGRectGetMaxX(lblStaffAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblStaffAmountTitle.frame), valueheight);
  73. _lblStaffAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  74. [vStaffAmount addSubview:_lblStaffAmount];
  75. _lblStaffAmount.text = singleProfitListModel.staffAmount;
  76. UIView *vServiceAmount = [UIView new];
  77. vServiceAmount.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
  78. [vStaffAndServiceAmount addSubview:vServiceAmount];
  79. UILabel *lblServiceAmountTitle = [UILabel new];
  80. lblServiceAmountTitle.frame=CGRectMake(5, lbly,90, lblheight);
  81. lblServiceAmountTitle.text = @"服务人员业绩:";
  82. lblServiceAmountTitle.textColor = [UIColor lightGrayColor];
  83. lblServiceAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  84. [vServiceAmount addSubview:lblServiceAmountTitle];
  85. _lblServiceAmount = [UILabel new];
  86. _lblServiceAmount.frame=CGRectMake(CGRectGetMaxX(lblServiceAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblServiceAmountTitle.frame) , valueheight);
  87. _lblServiceAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  88. [vServiceAmount addSubview:_lblServiceAmount];
  89. _lblServiceAmount.text = singleProfitListModel.serviceAmount;
  90. UIView *vFeeAndRateOfMargin = [UIView new];
  91. vFeeAndRateOfMargin.frame=CGRectMake(0, CGRectGetMaxY(vStaffAndServiceAmount.frame), Screen_Width, heightRow);
  92. [self.contentView addSubview:vFeeAndRateOfMargin];
  93. UIView *vFeeAmount = [UIView new];
  94. vFeeAmount.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  95. [vFeeAndRateOfMargin addSubview:vFeeAmount];
  96. UILabel *lblFeeAmountTitle = [UILabel new];
  97. lblFeeAmountTitle.frame=CGRectMake(lblx, lbly,lblwidth, lblheight);
  98. lblFeeAmountTitle.text = @"费用:";
  99. lblFeeAmountTitle.textColor = [UIColor lightGrayColor];
  100. lblFeeAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  101. [vFeeAmount addSubview:lblFeeAmountTitle];
  102. _lblFeeAmount = [UILabel new];
  103. _lblFeeAmount.frame=CGRectMake(CGRectGetMaxX(lblFeeAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblFeeAmountTitle.frame), valueheight);
  104. _lblFeeAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  105. [vFeeAmount addSubview:_lblFeeAmount];
  106. _lblFeeAmount.text = singleProfitListModel.feeAmount;
  107. UIView *vRateOfMargin = [UIView new];
  108. vRateOfMargin.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
  109. [vFeeAndRateOfMargin addSubview:vRateOfMargin];
  110. UILabel *lblRateOfMarginTitle = [UILabel new];
  111. lblRateOfMarginTitle.frame=CGRectMake(5, lbly,90, lblheight);
  112. lblRateOfMarginTitle.text = @"毛利率:";
  113. lblRateOfMarginTitle.textColor = [UIColor lightGrayColor];
  114. lblRateOfMarginTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  115. [vRateOfMargin addSubview:lblRateOfMarginTitle];
  116. _lblRateOfMargin = [UILabel new];
  117. _lblRateOfMargin.frame=CGRectMake(CGRectGetMaxX(lblRateOfMarginTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblRateOfMarginTitle.frame) , valueheight);
  118. _lblRateOfMargin.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  119. [vRateOfMargin addSubview:_lblRateOfMargin];
  120. _lblRateOfMargin.text = singleProfitListModel.rateOfMargin;
  121. UIView *vCustomerAndRebates = [UIView new];
  122. vCustomerAndRebates.frame=CGRectMake(0, CGRectGetMaxY(vFeeAndRateOfMargin.frame), Screen_Width, heightRow);
  123. [self.contentView addSubview:vCustomerAndRebates];
  124. UIView *vCustomerAmount = [UIView new];
  125. vCustomerAmount.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  126. [vCustomerAndRebates addSubview:vCustomerAmount];
  127. UILabel *lblCustomerAmountTitle = [UILabel new];
  128. lblCustomerAmountTitle.frame=CGRectMake(lblx, lbly,120, lblheight);
  129. lblCustomerAmountTitle.text = @"中间客户返利:";
  130. lblCustomerAmountTitle.textColor = [UIColor lightGrayColor];
  131. lblCustomerAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  132. [vCustomerAmount addSubview:lblCustomerAmountTitle];
  133. _lblCustomerAmount = [UILabel new];
  134. _lblCustomerAmount.frame=CGRectMake(CGRectGetMaxX(lblCustomerAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblCustomerAmountTitle.frame), valueheight);
  135. _lblCustomerAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  136. [vCustomerAmount addSubview:_lblCustomerAmount];
  137. _lblCustomerAmount.text = singleProfitListModel.customerAmount;
  138. UIView *vRebatesSum = [UIView new];
  139. vRebatesSum.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
  140. [vCustomerAndRebates addSubview:vRebatesSum];
  141. UILabel *lblRebatesSumTitle = [UILabel new];
  142. lblRebatesSumTitle.frame=CGRectMake(5, lbly,90, lblheight);
  143. lblRebatesSumTitle.text = @"返利金额:";
  144. lblRebatesSumTitle.textColor = [UIColor lightGrayColor];
  145. lblRebatesSumTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  146. [vRebatesSum addSubview:lblRebatesSumTitle];
  147. _lblRebatesSum = [UILabel new];
  148. _lblRebatesSum.frame=CGRectMake(CGRectGetMaxX(lblRebatesSumTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblRebatesSumTitle.frame) , valueheight);
  149. _lblRebatesSum.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  150. [vRebatesSum addSubview:_lblRebatesSum];
  151. _lblRebatesSum.text = singleProfitListModel.rebatesSum;
  152. UIView *vIncomeAndCost = [UIView new];
  153. vIncomeAndCost.frame=CGRectMake(0, CGRectGetMaxY(vCustomerAndRebates.frame), Screen_Width, heightRow);
  154. [self.contentView addSubview:vIncomeAndCost];
  155. UIView *vIncome = [UIView new];
  156. vIncome.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  157. [vIncomeAndCost addSubview:vIncome];
  158. UILabel *lblIncomeTitle = [UILabel new];
  159. lblIncomeTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  160. lblIncomeTitle.text = @"收入:";
  161. lblIncomeTitle.textColor = [UIColor lightGrayColor];
  162. lblIncomeTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  163. [vIncome addSubview:lblIncomeTitle];
  164. _lblIncome = [UILabel new]; _lblIncome.frame=CGRectMake(CGRectGetMaxX(lblIncomeTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblIncomeTitle.frame), valueheight);
  165. _lblIncome.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  166. [vIncome addSubview:_lblIncome];
  167. _lblIncome.text = singleProfitListModel.amount;
  168. UIView *vCost = [UIView new];
  169. vCost.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
  170. [vIncomeAndCost addSubview:vCost];
  171. UILabel *lblCostTitle = [UILabel new];
  172. lblCostTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  173. lblCostTitle.text = @"成本:";
  174. lblCostTitle.textColor = [UIColor lightGrayColor];
  175. lblCostTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  176. [vCost addSubview:lblCostTitle];
  177. _lblCost = [UILabel new];
  178. _lblCost.frame=CGRectMake(CGRectGetMaxX(lblCostTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblCostTitle.frame) , valueheight);
  179. _lblCost.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  180. [vCost addSubview:_lblCost];
  181. _lblCost.text = singleProfitListModel.costAmount;
  182. UIView *vMarginAndProfit = [UIView new];
  183. vMarginAndProfit.frame=CGRectMake(0, CGRectGetMaxY(vIncomeAndCost.frame), Screen_Width, heightRow);
  184. [self.contentView addSubview:vMarginAndProfit];
  185. UIView *vMargin = [UIView new];
  186. vMargin.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  187. [vMarginAndProfit addSubview:vMargin];
  188. UILabel *lblMarginTitle = [UILabel new];
  189. lblMarginTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  190. lblMarginTitle.text = @"毛利:";
  191. lblMarginTitle.textColor = [UIColor lightGrayColor];
  192. lblMarginTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  193. [vMargin addSubview:lblMarginTitle];
  194. _lblMargin = [UILabel new]; _lblMargin.frame=CGRectMake(CGRectGetMaxX(lblMarginTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblMarginTitle.frame), valueheight);
  195. _lblMargin.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  196. [vMargin addSubview:_lblMargin];
  197. _lblMargin.text = singleProfitListModel.marginAmount;
  198. UIView *vProfit = [UIView new];
  199. vProfit.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
  200. [vMarginAndProfit addSubview:vProfit];
  201. UILabel *lblProfitTitle = [UILabel new];
  202. lblProfitTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  203. lblProfitTitle.text = @"利润:";
  204. lblProfitTitle.textColor = [UIColor lightGrayColor];
  205. lblProfitTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  206. [vProfit addSubview:lblProfitTitle];
  207. _lblProfit = [UILabel new];
  208. _lblProfit.frame=CGRectMake(CGRectGetMaxX(lblProfitTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblProfitTitle.frame) , valueheight);
  209. _lblProfit.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  210. [vProfit addSubview:_lblProfit];
  211. _lblProfit.text = singleProfitListModel.profitAmount;
  212. viewBackgroud = [UIView new];
  213. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vMarginAndProfit.frame)+8, Screen_Width, heightLine);
  214. viewBackgroud.backgroundColor = LineBackgroundColor;
  215. [self.contentView addSubview:viewBackgroud];
  216. }
  217. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  218. [super setSelected:selected animated:animated];
  219. }
  220. @end