CustomerCurrentListCell.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. //
  2. // CustomerCurrentListCell.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2021/2/25.
  6. // Copyright © 2021 elongtian. All rights reserved.
  7. //
  8. #import "CustomerCurrentListCell.h"
  9. @implementation CustomerCurrentListCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. }
  13. -(void) setCustomerCurrentListCell:(CustomerCurrentSummaryListModel*)currentSummaryListModel advanceFlag:(NSString*)advanceFlag
  14. {
  15. CGFloat heightRow = 40;
  16. CGFloat lblx = 20;
  17. CGFloat lbly = 8;
  18. CGFloat lblwidth = 100;
  19. CGFloat lblheight = 25;
  20. CGFloat valuey = 8;
  21. CGFloat valueheight = 25;
  22. //客户名称 —————————
  23. UIView *vCustomerName = [UIView new];
  24. vCustomerName.frame=CGRectMake(0, 8, Screen_Width, heightRow);
  25. [self.contentView addSubview:vCustomerName];
  26. UILabel *lblTitleCustomerName = [UILabel new];
  27. lblTitleCustomerName.frame=CGRectMake(lblx, lbly, lblwidth+2, lblheight);
  28. lblTitleCustomerName.text = @"客户名称:";
  29. lblTitleCustomerName.textColor =LabelGrayTextColor;
  30. lblTitleCustomerName.font = [UIFont systemFontOfSize: TitleFontOfSize];
  31. [vCustomerName addSubview:lblTitleCustomerName];
  32. _lblCustomerName= [UILabel new];
  33. _lblCustomerName.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerName.frame), valuey, Screen_Width -CGRectGetMaxX(lblTitleCustomerName.frame), valueheight);
  34. _lblCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  35. [vCustomerName addSubview:_lblCustomerName];
  36. _lblCustomerName.text=currentSummaryListModel.customerName;
  37. UIView *vAddress = [UIView new];
  38. vAddress.frame=CGRectMake(0, CGRectGetMaxY(vCustomerName.frame), Screen_Width, heightRow);
  39. [self.contentView addSubview:vAddress];
  40. UILabel *lblAddressTitle=[UILabel new];
  41. lblAddressTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  42. lblAddressTitle.text=@"客户地址:";
  43. lblAddressTitle.textColor =LabelGrayTextColor;
  44. lblAddressTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  45. [vAddress addSubview:lblAddressTitle];
  46. _lblAddress= [UILabel new];
  47. _lblAddress.frame=CGRectMake(CGRectGetMaxX(lblAddressTitle.frame), valuey, Screen_Width -CGRectGetMaxX(lblAddressTitle.frame)-3, valueheight);
  48. _lblAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  49. [vAddress addSubview:_lblAddress];
  50. _lblAddress.text = currentSummaryListModel.address;
  51. UIView *vCustomerCode = [UIView new];
  52. vCustomerCode.frame=CGRectMake(0, CGRectGetMaxY(vAddress.frame), Screen_Width/2, heightRow);
  53. [self.contentView addSubview:vCustomerCode];
  54. UILabel *lblCustomerCodeTitle=[UILabel new];
  55. lblCustomerCodeTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  56. lblCustomerCodeTitle.text=@"客户编码:";
  57. lblCustomerCodeTitle.textColor =LabelGrayTextColor;
  58. lblCustomerCodeTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  59. [vCustomerCode addSubview:lblCustomerCodeTitle];
  60. _lblCustomerCode= [UILabel new];
  61. _lblCustomerCode.frame=CGRectMake(CGRectGetMaxX(lblCustomerCodeTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblCustomerCodeTitle.frame)-3, valueheight);
  62. _lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  63. [vCustomerCode addSubview:_lblCustomerCode];
  64. _lblCustomerCode.text = currentSummaryListModel.customerCode;
  65. UIView *vTelephone = [UIView new];
  66. vTelephone.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(vAddress.frame), Screen_Width / 2, heightRow);
  67. [self.contentView addSubview: vTelephone];
  68. UILabel *lblTelephoneTitle=[UILabel new];
  69. lblTelephoneTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  70. lblTelephoneTitle.text=@"客户电话:";
  71. lblTelephoneTitle.textColor = LabelGrayTextColor;
  72. lblTelephoneTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  73. [vTelephone addSubview:lblTelephoneTitle];
  74. _lblTelephone= [UILabel new];
  75. _lblTelephone.frame=CGRectMake(CGRectGetMaxX(lblTelephoneTitle.frame), valuey, Screen_Width/2-lblwidth-5 , valueheight);
  76. _lblTelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  77. [vTelephone addSubview:_lblTelephone];
  78. _lblTelephone.text = currentSummaryListModel.telephone;
  79. if([advanceFlag intValue]==1)
  80. {
  81. UIView *vLastDepositReceived = [UIView new];
  82. vLastDepositReceived.frame=CGRectMake(0, CGRectGetMaxY(vCustomerCode.frame), Screen_Width/2, heightRow);
  83. [self.contentView addSubview:vLastDepositReceived];
  84. UILabel *lblLastDepositReceivedTitle=[UILabel new];
  85. lblLastDepositReceivedTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  86. lblLastDepositReceivedTitle.text=@"预存期初额:";
  87. lblLastDepositReceivedTitle.textColor =LabelGrayTextColor;
  88. lblLastDepositReceivedTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  89. [vLastDepositReceived addSubview:lblLastDepositReceivedTitle];
  90. _lblLastDepositReceived = [UILabel new];
  91. _lblLastDepositReceived.frame=CGRectMake(CGRectGetMaxX(lblLastDepositReceivedTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblLastDepositReceivedTitle.frame)-3, valueheight);
  92. _lblLastDepositReceived.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  93. [vLastDepositReceived addSubview:_lblLastDepositReceived];
  94. _lblLastDepositReceived.text = currentSummaryListModel.lastDepositReceived;
  95. UIView *vNextDepositReceived = [UIView new];
  96. vNextDepositReceived.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(vCustomerCode.frame), Screen_Width / 2, heightRow);
  97. [self.contentView addSubview: vNextDepositReceived];
  98. UILabel *lblNextDepositReceivedTitle=[UILabel new];
  99. lblNextDepositReceivedTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  100. lblNextDepositReceivedTitle.text=@"预存余额:";
  101. lblNextDepositReceivedTitle.textColor = LabelGrayTextColor;
  102. lblNextDepositReceivedTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  103. [vNextDepositReceived addSubview:lblNextDepositReceivedTitle];
  104. _lblNextDepositReceived= [UILabel new];
  105. _lblNextDepositReceived.frame=CGRectMake(CGRectGetMaxX(lblNextDepositReceivedTitle.frame), valuey, Screen_Width/2-lblwidth-5 , valueheight);
  106. _lblNextDepositReceived.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  107. [vNextDepositReceived addSubview:_lblNextDepositReceived];
  108. _lblNextDepositReceived.text = currentSummaryListModel.nextDepositReceived;
  109. _bottomSeparator = [[UIView alloc]init];
  110. _bottomSeparator.frame =CGRectMake(0, CGRectGetMaxY(vLastDepositReceived.frame),Screen_Width, 10);
  111. _bottomSeparator.backgroundColor = LineBackgroundColor;
  112. [self.contentView addSubview:_bottomSeparator];
  113. _cellHeight=CGRectGetMaxY(_bottomSeparator.frame);
  114. }
  115. if([advanceFlag intValue]==2)
  116. {
  117. UIView *vLastAccountReceivable = [UIView new];
  118. vLastAccountReceivable.frame=CGRectMake(0, CGRectGetMaxY(vCustomerCode.frame), Screen_Width/2, heightRow);
  119. [self.contentView addSubview:vLastAccountReceivable];
  120. UILabel *lblLastAccountReceivableTitle=[UILabel new];
  121. lblLastAccountReceivableTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  122. lblLastAccountReceivableTitle.text=@"应收期初额:";
  123. lblLastAccountReceivableTitle.textColor =LabelGrayTextColor;
  124. lblLastAccountReceivableTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  125. [vLastAccountReceivable addSubview:lblLastAccountReceivableTitle];
  126. _lblLastAccountReceivable = [UILabel new];
  127. _lblLastAccountReceivable.frame=CGRectMake(CGRectGetMaxX(lblLastAccountReceivableTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblLastAccountReceivableTitle.frame)-3, valueheight);
  128. _lblLastAccountReceivable.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  129. [vLastAccountReceivable addSubview:_lblLastAccountReceivable];
  130. _lblLastAccountReceivable.text = currentSummaryListModel.lastAccountReceivable;
  131. UIView *vSalesAmount = [UIView new];
  132. vSalesAmount.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(vCustomerCode.frame), Screen_Width / 2, heightRow);
  133. [self.contentView addSubview: vSalesAmount];
  134. UILabel *lblSalesAmountTitle=[UILabel new];
  135. lblSalesAmountTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  136. lblSalesAmountTitle.text=@"销售额:";
  137. lblSalesAmountTitle.textColor = LabelGrayTextColor;
  138. lblSalesAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  139. [vSalesAmount addSubview:lblSalesAmountTitle];
  140. _lblSalesAmount= [UILabel new];
  141. _lblSalesAmount.frame=CGRectMake(CGRectGetMaxX(lblSalesAmountTitle.frame), valuey, Screen_Width/2-lblwidth-5 , valueheight);
  142. _lblSalesAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  143. [vSalesAmount addSubview:_lblSalesAmount];
  144. _lblSalesAmount.text = currentSummaryListModel.salesAmount;
  145. UIView *vRefundAmount = [UIView new];
  146. vRefundAmount.frame=CGRectMake(0, CGRectGetMaxY(vLastAccountReceivable.frame), Screen_Width/2, heightRow);
  147. [self.contentView addSubview:vRefundAmount];
  148. UILabel *lblRefundAmountTitle=[UILabel new];
  149. lblRefundAmountTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  150. lblRefundAmountTitle.text=@"回款额:";
  151. lblRefundAmountTitle.textColor =LabelGrayTextColor;
  152. lblRefundAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  153. [vRefundAmount addSubview:lblRefundAmountTitle];
  154. _lblRefundAmount = [UILabel new];
  155. _lblRefundAmount.frame=CGRectMake(CGRectGetMaxX(lblRefundAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblRefundAmountTitle.frame)-3, valueheight);
  156. _lblRefundAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  157. [vRefundAmount addSubview:_lblRefundAmount];
  158. _lblRefundAmount.text = currentSummaryListModel.depositReceived;
  159. UIView *vAdjustAmount = [UIView new];
  160. vAdjustAmount.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(vLastAccountReceivable.frame), Screen_Width / 2, heightRow);
  161. [self.contentView addSubview: vAdjustAmount];
  162. UILabel *lblAdjustAmountTitle=[UILabel new];
  163. lblAdjustAmountTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  164. lblAdjustAmountTitle.text=@"调账额:";
  165. lblAdjustAmountTitle.textColor = LabelGrayTextColor;
  166. lblAdjustAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  167. [vAdjustAmount addSubview:lblAdjustAmountTitle];
  168. _lblAdjustAmount= [UILabel new];
  169. _lblAdjustAmount.frame=CGRectMake(CGRectGetMaxX(lblAdjustAmountTitle.frame), valuey, Screen_Width/2-lblwidth-5 , valueheight);
  170. _lblAdjustAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  171. [vAdjustAmount addSubview:_lblAdjustAmount];
  172. _lblAdjustAmount.text = currentSummaryListModel.adjustAmount;
  173. UIView *vVerificationSum = [UIView new];
  174. vVerificationSum.frame=CGRectMake(0, CGRectGetMaxY(vRefundAmount.frame), Screen_Width/2, heightRow);
  175. [self.contentView addSubview:vVerificationSum];
  176. UILabel *lblVerificationSumTitle=[UILabel new];
  177. lblVerificationSumTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  178. lblVerificationSumTitle.text=@"核销额:";
  179. lblVerificationSumTitle.textColor =LabelGrayTextColor;
  180. lblVerificationSumTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  181. [vVerificationSum addSubview:lblVerificationSumTitle];
  182. _lblVerificationSum = [UILabel new];
  183. _lblVerificationSum.frame=CGRectMake(CGRectGetMaxX(lblVerificationSumTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblVerificationSumTitle.frame)-3, valueheight);
  184. _lblVerificationSum.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  185. [vVerificationSum addSubview:_lblVerificationSum];
  186. _lblVerificationSum.text = currentSummaryListModel.verificationSum;
  187. UIView *vNextAccountReceivable = [UIView new];
  188. vNextAccountReceivable.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(vRefundAmount.frame), Screen_Width / 2, heightRow);
  189. [self.contentView addSubview: vNextAccountReceivable];
  190. UILabel *lblNextAccountReceivableTitle=[UILabel new];
  191. lblNextAccountReceivableTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  192. lblNextAccountReceivableTitle.text=@"期末应收:";
  193. lblNextAccountReceivableTitle.textColor = LabelGrayTextColor;
  194. lblNextAccountReceivableTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  195. [vNextAccountReceivable addSubview:lblNextAccountReceivableTitle];
  196. _lblNextAccountReceivable= [UILabel new];
  197. _lblNextAccountReceivable.frame=CGRectMake(CGRectGetMaxX(lblNextAccountReceivableTitle.frame), valuey, Screen_Width/2-lblwidth-5 , valueheight);
  198. _lblNextAccountReceivable.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  199. [vNextAccountReceivable addSubview:_lblNextAccountReceivable];
  200. _lblNextAccountReceivable.text = currentSummaryListModel.nextAccountReceivable;
  201. _bottomSeparator = [[UIView alloc]init];
  202. _bottomSeparator.frame =CGRectMake(0, CGRectGetMaxY(vVerificationSum.frame),Screen_Width, 10);
  203. _bottomSeparator.backgroundColor = LineBackgroundColor;
  204. [self.contentView addSubview:_bottomSeparator];
  205. _cellHeight=CGRectGetMaxY(_bottomSeparator.frame);
  206. }
  207. if([advanceFlag intValue]==3)
  208. {
  209. UIView *vBalanceAmount = [UIView new];
  210. vBalanceAmount.frame=CGRectMake(0, CGRectGetMaxY(vCustomerCode.frame), Screen_Width/2, heightRow);
  211. [self.contentView addSubview:vBalanceAmount];
  212. UILabel *lblBalanceAmountTitle=[UILabel new];
  213. lblBalanceAmountTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  214. lblBalanceAmountTitle.text=@"余额:";
  215. lblBalanceAmountTitle.textColor =LabelGrayTextColor;
  216. lblBalanceAmountTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  217. [vBalanceAmount addSubview:lblBalanceAmountTitle];
  218. _lblBalanceAmount = [UILabel new];
  219. _lblBalanceAmount.frame=CGRectMake(CGRectGetMaxX(lblBalanceAmountTitle.frame), valuey, Screen_Width/2 -CGRectGetMaxX(lblBalanceAmountTitle.frame)-3, valueheight);
  220. _lblBalanceAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  221. [vBalanceAmount addSubview:_lblBalanceAmount];
  222. _lblBalanceAmount.text = currentSummaryListModel.balanceAmount;
  223. UIView *vDepositReceivedEarnest = [UIView new];
  224. vDepositReceivedEarnest.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(vCustomerCode.frame), Screen_Width / 2, heightRow);
  225. [self.contentView addSubview: vDepositReceivedEarnest];
  226. UILabel *lblDepositReceivedEarnestTitle=[UILabel new];
  227. lblDepositReceivedEarnestTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  228. lblDepositReceivedEarnestTitle.text=@"未用定金:";
  229. lblDepositReceivedEarnestTitle.textColor = LabelGrayTextColor;
  230. lblDepositReceivedEarnestTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  231. [vDepositReceivedEarnest addSubview:lblDepositReceivedEarnestTitle];
  232. _lblDepositReceivedEarnest= [UILabel new];
  233. _lblDepositReceivedEarnest.frame=CGRectMake(CGRectGetMaxX(lblDepositReceivedEarnestTitle.frame), valuey, Screen_Width/2-lblwidth-5 , valueheight);
  234. _lblDepositReceivedEarnest.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  235. [vDepositReceivedEarnest addSubview:_lblDepositReceivedEarnest];
  236. _lblDepositReceivedEarnest.text = currentSummaryListModel.depositReceivedEarnest;
  237. _bottomSeparator = [[UIView alloc]init];
  238. _bottomSeparator.frame =CGRectMake(0, CGRectGetMaxY(vBalanceAmount.frame),Screen_Width, 10);
  239. _bottomSeparator.backgroundColor = LineBackgroundColor;
  240. [self.contentView addSubview:_bottomSeparator];
  241. _cellHeight=CGRectGetMaxY(_bottomSeparator.frame);
  242. }
  243. }
  244. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  245. [super setSelected:selected animated:animated];
  246. }
  247. @end