OrderSalesDetailTableViewCell.m 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. //
  2. // OrderSalesDetailTableViewCell.m
  3. // IBOSSmini
  4. //
  5. // Created by guan hong hou on 2017/5/26.
  6. // Copyright © 2017年 elongtian. All rights reserved.
  7. //
  8. #import "OrderSalesDetailTableViewCell.h"
  9. @implementation OrderSalesDetailTableViewCell
  10. /**
  11. 初始化
  12. @param style <#style description#>
  13. @param reuseIdentifier <#reuseIdentifier description#>
  14. @return <#return value description#>
  15. */
  16. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  17. {
  18. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  19. if (self) {
  20. self.layer.cornerRadius=CornerRadius;
  21. self.backgroundColor=[UIColor whiteColor];
  22. }
  23. return self;
  24. }
  25. /**
  26. cell的初始化ui
  27. @param orderItem <#orderItem description#>
  28. */
  29. -(void)parseOrderSalesDetailInfo:(OrderSaleListDetailModel *)orderItem{
  30. UIView *contentView=[[UIView alloc]init];
  31. CGFloat xpadding=5;
  32. CGFloat ypadding=10;
  33. [self addSubview:contentView];
  34. UILabel *lblTitleDetailInvoiceNo=[[UILabel alloc]init];
  35. lblTitleDetailInvoiceNo.frame=CGRectMake(xpadding,ypadding,80,25);
  36. lblTitleDetailInvoiceNo.text=@"单 号:";
  37. lblTitleDetailInvoiceNo.font=orderTextFont;
  38. [contentView addSubview:lblTitleDetailInvoiceNo];
  39. _lblDetailInvoiceNo=[[UILabel alloc]init];
  40. _lblDetailInvoiceNo.frame=CGRectMake(CGRectGetMaxX(lblTitleDetailInvoiceNo.frame),ypadding,250, 25);
  41. _lblDetailInvoiceNo.text=orderItem.detailInvoiceNo;
  42. _lblDetailInvoiceNo.font=orderTextFont;
  43. [contentView addSubview:_lblDetailInvoiceNo];
  44. UILabel *lblTitleInvoicesTypeName=[[UILabel alloc]init];
  45. lblTitleInvoicesTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleDetailInvoiceNo.frame)+ypadding,80,25);
  46. lblTitleInvoicesTypeName.text=@"单据类型:";
  47. lblTitleInvoicesTypeName.font=orderTextFont;
  48. [contentView addSubview:lblTitleInvoicesTypeName];
  49. _lblInvoicesTypeName=[[UILabel alloc]init];
  50. _lblInvoicesTypeName.font=orderTextFont;
  51. _lblInvoicesTypeName.text=orderItem.invoiceTypeName;
  52. _lblInvoicesTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleInvoicesTypeName.frame),CGRectGetMaxY(lblTitleDetailInvoiceNo.frame)+ypadding,250, 25);
  53. _lblInvoicesTypeName.font=orderTextFont;
  54. [contentView addSubview:_lblInvoicesTypeName];
  55. UILabel *lblTitleSalesDetailTypeName=[[UILabel alloc]init];
  56. lblTitleSalesDetailTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleInvoicesTypeName.frame)+ypadding,80,25);
  57. lblTitleSalesDetailTypeName.text=@"明细类型:";
  58. lblTitleSalesDetailTypeName.font=orderTextFont;
  59. [contentView addSubview:lblTitleSalesDetailTypeName];
  60. _lblSalesDetailTypeName=[[UILabel alloc]init];
  61. _lblSalesDetailTypeName.font=orderTextFont;
  62. _lblSalesDetailTypeName.text=orderItem.salesDetailTypeName;
  63. _lblSalesDetailTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleSalesDetailTypeName.frame),CGRectGetMaxY( lblTitleInvoicesTypeName.frame)+ypadding,250, 25);
  64. _lblSalesDetailTypeName.font=orderTextFont;
  65. [contentView addSubview:_lblSalesDetailTypeName];
  66. UILabel *lblTitleOrderSalesTypeName=[[UILabel alloc]init];
  67. lblTitleOrderSalesTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleSalesDetailTypeName.frame)+ypadding,80,25);
  68. lblTitleOrderSalesTypeName.text=@"业务类型:";
  69. lblTitleOrderSalesTypeName.font=orderTextFont;
  70. [contentView addSubview:lblTitleOrderSalesTypeName];
  71. _lblOrderSalesTypeName=[[UILabel alloc]init];
  72. _lblOrderSalesTypeName.font=orderTextFont;
  73. _lblOrderSalesTypeName.text=orderItem.orderSalesTypeName;
  74. _lblOrderSalesTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleOrderSalesTypeName.frame),CGRectGetMaxY( lblTitleSalesDetailTypeName.frame)+ypadding,250, 25);
  75. _lblOrderSalesTypeName.font=orderTextFont;
  76. [contentView addSubview:_lblOrderSalesTypeName];
  77. UILabel *lblTitleOnlyCode=[[UILabel alloc]init];
  78. lblTitleOnlyCode.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOrderSalesTypeName.frame)+ypadding,80,25);
  79. lblTitleOnlyCode.text=@"唯一编码:";
  80. lblTitleOnlyCode.font=orderTextFont;
  81. [contentView addSubview:lblTitleOnlyCode];
  82. _lblOnlyCode=[[UILabel alloc]init];
  83. _lblOnlyCode.font=orderTextFont;
  84. _lblOnlyCode.text=orderItem.onlyCode;
  85. _lblOnlyCode.frame=CGRectMake(CGRectGetMaxX( lblTitleOnlyCode.frame),CGRectGetMaxY( lblTitleOrderSalesTypeName.frame)+ypadding,250, 25);
  86. _lblOnlyCode.font=orderTextFont;
  87. [contentView addSubview:_lblOnlyCode];
  88. UILabel *lblTitleCode=[[UILabel alloc]init];
  89. lblTitleCode.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOnlyCode.frame)+ypadding,80,25);
  90. lblTitleCode.text=@"商品编码:";
  91. lblTitleCode.font=orderTextFont;
  92. [contentView addSubview:lblTitleCode];
  93. _lblCode=[[UILabel alloc]init];
  94. _lblCode.font=orderTextFont;
  95. _lblCode.text=orderItem.code;
  96. _lblCode.frame=CGRectMake(CGRectGetMaxX( lblTitleCode.frame),CGRectGetMaxY( lblTitleOnlyCode.frame)+ypadding,250, 25);
  97. _lblCode.font=orderTextFont;
  98. [contentView addSubview:_lblCode];
  99. UILabel *lblTitleBrandName=[[UILabel alloc]init];
  100. lblTitleBrandName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleCode.frame)+ypadding,80,25);
  101. lblTitleBrandName.text=@"商品品牌:";
  102. lblTitleBrandName.font=orderTextFont;
  103. [contentView addSubview:lblTitleBrandName];
  104. _lblBrandName=[[UILabel alloc]init];
  105. _lblBrandName.font=orderTextFont;
  106. _lblBrandName.text=orderItem.brandName;
  107. _lblBrandName.frame=CGRectMake(CGRectGetMaxX( lblTitleBrandName.frame),CGRectGetMaxY( lblTitleCode.frame)+ypadding,250, 25);
  108. _lblBrandName.font=orderTextFont;
  109. [contentView addSubview:_lblBrandName];
  110. UILabel *lblTitleKindName=[[UILabel alloc]init];
  111. lblTitleKindName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleBrandName.frame)+ypadding,80,25);
  112. lblTitleKindName.text=@"商品种类:";
  113. lblTitleKindName.font=orderTextFont;
  114. [contentView addSubview:lblTitleKindName];
  115. _lblKindName=[[UILabel alloc]init];
  116. _lblKindName.font=orderTextFont;
  117. _lblKindName.text=orderItem.kindName;
  118. _lblKindName.frame=CGRectMake(CGRectGetMaxX( lblTitleKindName.frame),CGRectGetMaxY( lblTitleBrandName.frame)+ypadding,250, 25);
  119. _lblBrandName.font=orderTextFont;
  120. [contentView addSubview:_lblKindName];
  121. UILabel *lblTitleVarietyName=[[UILabel alloc]init];
  122. lblTitleVarietyName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleKindName.frame)+ypadding,80,25);
  123. lblTitleVarietyName.text=@"商品品种:";
  124. lblTitleVarietyName.font=orderTextFont;
  125. [contentView addSubview:lblTitleVarietyName];
  126. _lblVarietyName=[[UILabel alloc]init];
  127. _lblVarietyName.font=orderTextFont;
  128. _lblVarietyName.text=orderItem.varietyName;
  129. _lblVarietyName.frame=CGRectMake(CGRectGetMaxX( lblTitleVarietyName.frame),CGRectGetMaxY( lblTitleKindName.frame)+ypadding,250, 25);
  130. _lblVarietyName.font=orderTextFont;
  131. [contentView addSubview:_lblVarietyName];
  132. UILabel *lblTitleSeriesName=[[UILabel alloc]init];
  133. lblTitleSeriesName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleVarietyName.frame)+ypadding,80,25);
  134. lblTitleSeriesName.text=@"商品系列:";
  135. lblTitleSeriesName.font=orderTextFont;
  136. [contentView addSubview:lblTitleSeriesName];
  137. _lblSeriesName=[[UILabel alloc]init];
  138. _lblSeriesName.font=orderTextFont;
  139. _lblSeriesName.text=orderItem.seriesName;
  140. _lblSeriesName.frame=CGRectMake(CGRectGetMaxX( lblTitleSeriesName.frame),CGRectGetMaxY( lblTitleVarietyName.frame)+ypadding,250, 25);
  141. _lblSeriesName.font=orderTextFont;
  142. [contentView addSubview:_lblSeriesName];
  143. UILabel *lblTitleUnitName=[[UILabel alloc]init];
  144. lblTitleUnitName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSeriesName.frame)+ypadding,80,25);
  145. lblTitleUnitName.text=@"计量单位:";
  146. lblTitleUnitName.font=orderTextFont;
  147. [contentView addSubview:lblTitleUnitName];
  148. _lblUnitName=[[UILabel alloc]init];
  149. _lblUnitName.font=orderTextFont;
  150. _lblUnitName.text=orderItem.unitName;
  151. _lblUnitName.frame=CGRectMake(CGRectGetMaxX( lblTitleUnitName.frame),CGRectGetMaxY( lblTitleSeriesName.frame)+ypadding,250, 25);
  152. _lblUnitName.font=orderTextFont;
  153. [contentView addSubview:_lblUnitName];
  154. UILabel *lblTitleSpecification=[[UILabel alloc]init];
  155. lblTitleSpecification.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleUnitName.frame)+ypadding,80,25);
  156. lblTitleSpecification.text=@"商品规格:";
  157. lblTitleSpecification.font=orderTextFont;
  158. [contentView addSubview:lblTitleSpecification];
  159. _lblSpecification=[[UILabel alloc]init];
  160. _lblSpecification.font=orderTextFont;
  161. _lblSpecification.text=orderItem.specification;
  162. _lblSpecification.frame=CGRectMake(CGRectGetMaxX( lblTitleSpecification.frame),CGRectGetMaxY( lblTitleUnitName.frame)+ypadding,250, 25);
  163. _lblSpecification.font=orderTextFont;
  164. [contentView addSubview:_lblSpecification];
  165. UILabel *lblTitleGradeName=[[UILabel alloc]init];
  166. lblTitleGradeName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSpecification.frame)+ypadding,80,25);
  167. lblTitleGradeName.text=@"商品等级:";
  168. lblTitleGradeName.font=orderTextFont;
  169. [contentView addSubview:lblTitleGradeName];
  170. _lblGradeName=[[UILabel alloc]init];
  171. _lblGradeName.font=orderTextFont;
  172. _lblGradeName.text=orderItem.gradeName;
  173. _lblGradeName.frame=CGRectMake(CGRectGetMaxX( lblTitleGradeName.frame),CGRectGetMaxY( lblTitleSpecification.frame)+ypadding,250, 25);
  174. _lblGradeName.font=orderTextFont;
  175. [contentView addSubview:_lblGradeName];
  176. UILabel *lblTitleColorNumber=[[UILabel alloc]init];
  177. lblTitleColorNumber.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleGradeName.frame)+ypadding,80,25);
  178. lblTitleColorNumber.text=@"色 号:";
  179. lblTitleColorNumber.font=orderTextFont;
  180. [contentView addSubview:lblTitleColorNumber];
  181. _lblColorNumber=[[UILabel alloc]init];
  182. _lblColorNumber.font=orderTextFont;
  183. _lblColorNumber.text=orderItem.colorNumber;
  184. _lblColorNumber.frame=CGRectMake(CGRectGetMaxX( lblTitleColorNumber.frame),CGRectGetMaxY( lblTitleGradeName.frame)+ypadding,250, 25);
  185. _lblColorNumber.font=orderTextFont;
  186. [contentView addSubview:_lblColorNumber];
  187. UILabel *lblTitleSalesQuantity=[[UILabel alloc]init];
  188. lblTitleSalesQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleColorNumber.frame)+ypadding,80,25);
  189. lblTitleSalesQuantity.text=@"销售数量:";
  190. lblTitleSalesQuantity.font=orderTextFont;
  191. [contentView addSubview:lblTitleSalesQuantity];
  192. _lblSalesQuantity=[[UILabel alloc]init];
  193. _lblSalesQuantity.font=orderTextFont;
  194. _lblSalesQuantity.text=orderItem.salesQuantity;
  195. _lblSalesQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleSalesQuantity.frame),CGRectGetMaxY( lblTitleColorNumber.frame)+ypadding,250, 25);
  196. _lblSalesQuantity.font=orderTextFont;
  197. [contentView addSubview:_lblSalesQuantity];
  198. UILabel *lblTitleOrderQuantity=[[UILabel alloc]init];
  199. lblTitleOrderQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSalesQuantity.frame)+ypadding,80,25);
  200. lblTitleOrderQuantity.text=@"订单数量:";
  201. lblTitleOrderQuantity.font=orderTextFont;
  202. [contentView addSubview:lblTitleOrderQuantity];
  203. _lblOrderQuantity=[[UILabel alloc]init];
  204. _lblOrderQuantity.font=orderTextFont;
  205. _lblOrderQuantity.text=orderItem.orderQuantity;
  206. _lblOrderQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleOrderQuantity.frame),CGRectGetMaxY( lblTitleSalesQuantity.frame)+ypadding,250, 25);
  207. _lblOrderQuantity.font=orderTextFont;
  208. [contentView addSubview:_lblOrderQuantity];
  209. UILabel *lblTitleSalesPrice=[[UILabel alloc]init];
  210. lblTitleSalesPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOrderQuantity.frame)+ypadding,80,25);
  211. lblTitleSalesPrice.text=@"销售价格:";
  212. lblTitleSalesPrice.font=orderTextFont;
  213. [contentView addSubview:lblTitleSalesPrice];
  214. _lblSalesPrice=[[UILabel alloc]init];
  215. _lblSalesPrice.font=orderTextFont;
  216. _lblSalesPrice.text=orderItem.salesPrice;
  217. _lblSalesPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleSalesPrice.frame),CGRectGetMaxY( lblTitleOrderQuantity.frame)+ypadding,250, 25);
  218. _lblSalesPrice.font=orderTextFont;
  219. [contentView addSubview:_lblSalesPrice];
  220. UILabel *lblTitleGoodsSettlementPrice=[[UILabel alloc]init];
  221. lblTitleGoodsSettlementPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSalesPrice.frame)+ypadding,80,25);
  222. lblTitleGoodsSettlementPrice.text=@"商品结算价:";
  223. lblTitleGoodsSettlementPrice.font=orderTextFont;
  224. [contentView addSubview:lblTitleGoodsSettlementPrice];
  225. _lblGoodsSettlementPrice=[[UILabel alloc]init];
  226. _lblGoodsSettlementPrice.font=orderTextFont;
  227. _lblGoodsSettlementPrice.text=orderItem.goodsSettlementPrice;
  228. _lblGoodsSettlementPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementPrice.frame),CGRectGetMaxY( lblTitleSalesPrice.frame)+ypadding,250, 25);
  229. _lblGoodsSettlementPrice.font=orderTextFont;
  230. [contentView addSubview:_lblGoodsSettlementPrice];
  231. UILabel *lblTitleGoodsSettlementAmount=[[UILabel alloc]init];
  232. lblTitleGoodsSettlementAmount.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,80,25);
  233. lblTitleGoodsSettlementAmount.text=@"结算价金额:";
  234. lblTitleGoodsSettlementAmount.font=orderTextFont;
  235. [contentView addSubview:lblTitleGoodsSettlementAmount];
  236. _lblGoodsSettlementAmount=[[UILabel alloc]init];
  237. _lblGoodsSettlementAmount.font=orderTextFont;
  238. _lblGoodsSettlementAmount.text=orderItem.goodsSettlementAmount;
  239. _lblGoodsSettlementAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementAmount.frame),CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,250, 25);
  240. _lblGoodsSettlementAmount.font=orderTextFont;
  241. [contentView addSubview:_lblGoodsSettlementAmount];
  242. UILabel *lblTitleAmount=[[UILabel alloc]init];
  243. lblTitleAmount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleGoodsSettlementAmount.frame)+ypadding,80,25);
  244. lblTitleAmount.text=@"金 额:";
  245. lblTitleAmount.font=orderTextFont;
  246. [contentView addSubview:lblTitleAmount];
  247. _lblAmount=[[UILabel alloc]init];
  248. _lblAmount.font=orderTextFont;
  249. _lblAmount.text=orderItem.amount;
  250. _lblAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleAmount.frame),CGRectGetMaxY( lblTitleGoodsSettlementAmount.frame)+ypadding,250, 25);
  251. _lblAmount.font=orderTextFont;
  252. [contentView addSubview:_lblAmount];
  253. UILabel *lblTitleMarkedPrice=[[UILabel alloc]init];
  254. lblTitleMarkedPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleAmount.frame)+ypadding,80,25);
  255. lblTitleMarkedPrice.text=@"标 价:";
  256. lblTitleMarkedPrice.font=orderTextFont;
  257. [contentView addSubview:lblTitleMarkedPrice];
  258. _lblMarkedPrice=[[UILabel alloc]init];
  259. _lblMarkedPrice.font=orderTextFont;
  260. _lblMarkedPrice.text=orderItem.markedPrice;
  261. _lblMarkedPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleMarkedPrice.frame),CGRectGetMaxY( lblTitleAmount.frame)+ypadding,250, 25);
  262. _lblMarkedPrice.font=orderTextFont;
  263. [contentView addSubview:_lblMarkedPrice];
  264. UILabel *lblTitleDiscount=[[UILabel alloc]init];
  265. lblTitleDiscount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleMarkedPrice.frame)+ypadding,80,25);
  266. lblTitleDiscount.text=@"折 扣:";
  267. lblTitleDiscount.font=orderTextFont;
  268. [contentView addSubview:lblTitleDiscount];
  269. _lblDiscount=[[UILabel alloc]init];
  270. _lblDiscount.font=orderTextFont;
  271. _lblDiscount.text=orderItem.discount;
  272. _lblDiscount.frame=CGRectMake(CGRectGetMaxX( lblTitleDiscount.frame),CGRectGetMaxY( lblTitleMarkedPrice.frame)+ypadding,250, 25);
  273. _lblDiscount.font=orderTextFont;
  274. [contentView addSubview:_lblDiscount];
  275. // UIView *bottomSeparator=[[UIView alloc]init];
  276. // bottomSeparator.frame=CGRectMake(xpadding, CGRectGetMaxY(lblTitleDiscount.frame), Screen_Width, 10);
  277. // bottomSeparator.backgroundColor=[UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1];
  278. // [contentView addSubview:bottomSeparator];
  279. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame))
  280. ;
  281. }
  282. @end