DailyReconciliationDetailCell.m 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. //
  2. // DailyReconciliationDetailCell.m
  3. // IBOSSmini
  4. //
  5. // Created by apple on 2017/5/16.
  6. // Copyright © 2017年 elongtian. All rights reserved.
  7. //
  8. #import "DailyReconciliationDetailCell.h"
  9. @interface DailyReconciliationDetailCell(){
  10. CGFloat totalHeight;
  11. }
  12. @end
  13. @implementation DailyReconciliationDetailCell
  14. /**
  15. cell
  16. @param style <#style description#>
  17. @param reuseIdentifier <#reuseIdentifier description#>
  18. @return <#return value description#>
  19. */
  20. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  21. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  22. return self;
  23. }
  24. /**
  25. 模型设置
  26. @param customer customer description
  27. */
  28. - (void)setDModel:(DayAccountDetailModel *)dModel{
  29. if (dModel==nil) {
  30. return;
  31. }
  32. //CGFloat heightRow = 40;
  33. CGFloat lblx = 10;
  34. CGFloat lbly = 8;
  35. CGFloat lblheight = 25;
  36. self.vBottom = [UIView new];
  37. [self.contentView addSubview:self.vBottom];
  38. //业务单号=================
  39. _businessNumber=[UILabel new];
  40. _businessNumber.frame=CGRectMake(lblx, lbly, Screen_Width - 2*lblx, lblheight);
  41. _businessNumber.textColor = [UIColor blackColor];
  42. _businessNumber.text = dModel.businessNumber;
  43. _businessNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  44. [self.vBottom addSubview:_businessNumber];
  45. UIView *viewBackgroud = [UIView new];
  46. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(_businessNumber.frame) - 1 + lbly, Screen_Width, 1);
  47. viewBackgroud.backgroundColor = LineBackgroundColor;
  48. [self.vBottom addSubview:viewBackgroud];
  49. //据类型=================
  50. _typeNo = [UILabel new];
  51. _typeNo.frame=CGRectMake(lblx, CGRectGetMaxY(_businessNumber.frame)+ lbly, Screen_Width - 2*lblx, lblheight);
  52. _typeNo.textColor = [UIColor blackColor];
  53. _typeNo.text = dModel.typeNo;
  54. _typeNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  55. [self.vBottom addSubview:_typeNo];
  56. //账款操作类型=================
  57. _billOperation = [UILabel new];
  58. _billOperation.frame=CGRectMake(lblx, CGRectGetMaxY(_typeNo.frame)+ lbly, Screen_Width - 2*lblx, lblheight);
  59. _billOperation.textColor = [UIColor blackColor];
  60. _billOperation.text = dModel.billOperation;
  61. _billOperation.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  62. [self.vBottom addSubview:_billOperation];
  63. totalHeight = CGRectGetMaxY(_billOperation.frame)+ lbly;
  64. //销售货款总额
  65. if (dModel.receivableAmount!=nil && dModel.receivableAmount.length>0) {
  66. _receiptAmount = [UILabel new];
  67. _receiptAmount.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
  68. _receiptAmount.textColor = [UIColor blackColor];
  69. _receiptAmount.text = dModel.receivableAmount;
  70. _receiptAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  71. [self.vBottom addSubview:_receiptAmount];
  72. totalHeight = CGRectGetMaxY(_receiptAmount.frame)+ lbly;
  73. }
  74. //结算方式
  75. if (dModel.settleWay!=nil && dModel.settleWay.length>0) {
  76. _settleWay = [UILabel new];
  77. _settleWay.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
  78. _settleWay.textColor = [UIColor blackColor];
  79. _settleWay.text = dModel.settleWay;
  80. _settleWay.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  81. [self.vBottom addSubview:_settleWay];
  82. totalHeight = CGRectGetMaxY(_settleWay.frame)+ lbly;
  83. }
  84. //收款额
  85. if (dModel.receiptAmount!=nil && dModel.receiptAmount.length>0) {
  86. _receiptAmount = [UILabel new];
  87. _receiptAmount.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
  88. _receiptAmount.textColor = [UIColor blackColor];
  89. _receiptAmount.text = dModel.receiptAmount;
  90. _receiptAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  91. [self.vBottom addSubview:_receiptAmount];
  92. totalHeight = CGRectGetMaxY(_receiptAmount.frame)+ lbly;
  93. }
  94. //使用定金
  95. if (dModel.earnestAmount!=nil && dModel.earnestAmount.length>0) {
  96. _earnestAmount = [UILabel new];
  97. _earnestAmount.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
  98. _earnestAmount.textColor = [UIColor blackColor];
  99. _earnestAmount.text = dModel.earnestAmount;
  100. _earnestAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  101. [self.vBottom addSubview:_earnestAmount];
  102. totalHeight = CGRectGetMaxY(_earnestAmount.frame)+ lbly;
  103. }
  104. //使用预存
  105. if (dModel.depositAmount!=nil && dModel.depositAmount.length>0) {
  106. _depositAmount = [UILabel new];
  107. _depositAmount.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
  108. _depositAmount.textColor = [UIColor blackColor];
  109. _depositAmount.text = dModel.depositAmount;
  110. _depositAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  111. [self.vBottom addSubview:_depositAmount];
  112. totalHeight = CGRectGetMaxY(_depositAmount.frame)+ lbly;
  113. }
  114. self.vBottom.frame=CGRectMake(lblx, 5, Screen_Width - 2*lblx, totalHeight);
  115. [self addSubview:self.vBottom];
  116. UIView *v = [UIView new];
  117. v.frame = CGRectMake(0, CGRectGetMaxY(self.vBottom.frame), Screen_Width, 10);
  118. v.backgroundColor = LineBackgroundColor;
  119. [self addSubview:v];
  120. }
  121. /**
  122. * cell的高度
  123. *
  124. * @return <#return value description#>
  125. */
  126. - (CGFloat)height{
  127. return CGRectGetMaxY(self.vBottom.frame) + 10;
  128. }
  129. @end