OrderSalesDetailTableViewCell.m 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. //
  2. // OrderSalesDetailTableViewCell.m
  3. // IBOSS
  4. //
  5. // Created by guan hong hou on 2017/5/26.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:订单销售单详细单元格
  9. //
  10. #import "OrderSalesDetailTableViewCell.h"
  11. @implementation OrderSalesDetailTableViewCell
  12. /**
  13. 初始化
  14. @param style <#style description#>
  15. @param reuseIdentifier <#reuseIdentifier description#>
  16. @return <#return value description#>
  17. */
  18. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  19. {
  20. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  21. if (self) {
  22. self.layer.cornerRadius=CornerRadius;
  23. self.backgroundColor = [UIColor whiteColor];
  24. }
  25. return self;
  26. }
  27. /**
  28. cell的初始化ui
  29. @param orderItem <#orderItem description#>
  30. */
  31. - (void)parseOrderSalesDetailInfo:(OrderSaleListDetailModel *)orderItem{
  32. UIView *contentView = [[UIView alloc]init];
  33. CGFloat xpadding = 10;
  34. CGFloat ypadding = 15;
  35. [self addSubview:contentView];
  36. UILabel *lblTitleDetailInvoiceNo = [[UILabel alloc]init];
  37. lblTitleDetailInvoiceNo.frame=CGRectMake(xpadding,ypadding,67,16);
  38. lblTitleDetailInvoiceNo.text = @"单 号:";
  39. lblTitleDetailInvoiceNo.font=orderTextFont;
  40. [contentView addSubview:lblTitleDetailInvoiceNo];
  41. _lblDetailInvoiceNo = [[UILabel alloc]init];
  42. _lblDetailInvoiceNo.frame=CGRectMake(CGRectGetMaxX(lblTitleDetailInvoiceNo.frame),ypadding,250, 16);
  43. _lblDetailInvoiceNo.text=orderItem.detailInvoiceNo;
  44. _lblDetailInvoiceNo.font=orderTextFont;
  45. [contentView addSubview:_lblDetailInvoiceNo];
  46. UILabel *lblTitleInvoicesTypeName = [[UILabel alloc]init];
  47. lblTitleInvoicesTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleDetailInvoiceNo.frame)+ypadding,67,16);
  48. lblTitleInvoicesTypeName.text = @"单据类型:";
  49. lblTitleInvoicesTypeName.font=orderTextFont;
  50. [contentView addSubview:lblTitleInvoicesTypeName];
  51. _lblInvoicesTypeName = [[UILabel alloc]init];
  52. _lblInvoicesTypeName.font=orderTextFont;
  53. _lblInvoicesTypeName.text=orderItem.invoiceTypeName;
  54. _lblInvoicesTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleInvoicesTypeName.frame),CGRectGetMaxY(lblTitleDetailInvoiceNo.frame)+ypadding,250, 16);
  55. _lblInvoicesTypeName.font=orderTextFont;
  56. [contentView addSubview:_lblInvoicesTypeName];
  57. UILabel *lblTitleSalesDetailTypeName = [[UILabel alloc]init];
  58. lblTitleSalesDetailTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleInvoicesTypeName.frame)+ypadding,67,16);
  59. lblTitleSalesDetailTypeName.text = @"明细类型:";
  60. lblTitleSalesDetailTypeName.font=orderTextFont;
  61. [contentView addSubview:lblTitleSalesDetailTypeName];
  62. _lblSalesDetailTypeName = [[UILabel alloc]init];
  63. _lblSalesDetailTypeName.font=orderTextFont;
  64. _lblSalesDetailTypeName.text=orderItem.salesDetailTypeName;
  65. _lblSalesDetailTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleSalesDetailTypeName.frame),CGRectGetMaxY( lblTitleInvoicesTypeName.frame)+ypadding,250, 16);
  66. _lblSalesDetailTypeName.font=orderTextFont;
  67. [contentView addSubview:_lblSalesDetailTypeName];
  68. UILabel *lblTitleOrderSalesTypeName = [[UILabel alloc]init];
  69. lblTitleOrderSalesTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleSalesDetailTypeName.frame)+ypadding,67,16);
  70. lblTitleOrderSalesTypeName.text = @"业务类型:";
  71. lblTitleOrderSalesTypeName.font=orderTextFont;
  72. [contentView addSubview:lblTitleOrderSalesTypeName];
  73. _lblOrderSalesTypeName = [[UILabel alloc]init];
  74. _lblOrderSalesTypeName.font=orderTextFont;
  75. _lblOrderSalesTypeName.text=orderItem.orderSalesTypeName;
  76. _lblOrderSalesTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleOrderSalesTypeName.frame),CGRectGetMaxY( lblTitleSalesDetailTypeName.frame)+ypadding,250, 16);
  77. _lblOrderSalesTypeName.font=orderTextFont;
  78. [contentView addSubview:_lblOrderSalesTypeName];
  79. UILabel *lblTitleOnlyCode = [[UILabel alloc]init];
  80. lblTitleOnlyCode.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOrderSalesTypeName.frame)+ypadding,67,16);
  81. lblTitleOnlyCode.text = @"唯一编码:";
  82. lblTitleOnlyCode.font=orderTextFont;
  83. [contentView addSubview:lblTitleOnlyCode];
  84. _lblOnlyCode = [[UILabel alloc]init];
  85. _lblOnlyCode.font=orderTextFont;
  86. _lblOnlyCode.text=orderItem.onlyCode;
  87. _lblOnlyCode.frame=CGRectMake(CGRectGetMaxX( lblTitleOnlyCode.frame),CGRectGetMaxY( lblTitleOrderSalesTypeName.frame)+ypadding,250, 16);
  88. _lblOnlyCode.font=orderTextFont;
  89. [contentView addSubview:_lblOnlyCode];
  90. UILabel *lblTitleCode = [[UILabel alloc]init];
  91. lblTitleCode.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOnlyCode.frame)+ypadding,67,16);
  92. lblTitleCode.text = @"商品编码:";
  93. lblTitleCode.font=orderTextFont;
  94. [contentView addSubview:lblTitleCode];
  95. _lblCode = [[UILabel alloc]init];
  96. _lblCode.font=orderTextFont;
  97. _lblCode.text=orderItem.code;
  98. _lblCode.frame=CGRectMake(CGRectGetMaxX( lblTitleCode.frame),CGRectGetMaxY( lblTitleOnlyCode.frame)+ypadding,250, 16);
  99. _lblCode.font=orderTextFont;
  100. [contentView addSubview:_lblCode];
  101. UILabel *lblTitleBrandName = [[UILabel alloc]init];
  102. lblTitleBrandName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleCode.frame)+ypadding,67,16);
  103. lblTitleBrandName.text = @"商品品牌:";
  104. lblTitleBrandName.font=orderTextFont;
  105. [contentView addSubview:lblTitleBrandName];
  106. _lblBrandName = [[UILabel alloc]init];
  107. _lblBrandName.font=orderTextFont;
  108. _lblBrandName.text=orderItem.brandName;
  109. _lblBrandName.frame=CGRectMake(CGRectGetMaxX( lblTitleBrandName.frame),CGRectGetMaxY( lblTitleCode.frame)+ypadding,250, 16);
  110. _lblBrandName.font=orderTextFont;
  111. [contentView addSubview:_lblBrandName];
  112. UILabel *lblTitleKindName = [[UILabel alloc]init];
  113. lblTitleKindName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleBrandName.frame)+ypadding,67,16);
  114. lblTitleKindName.text = @"商品种类:";
  115. lblTitleKindName.font=orderTextFont;
  116. [contentView addSubview:lblTitleKindName];
  117. _lblKindName = [[UILabel alloc]init];
  118. _lblKindName.font=orderTextFont;
  119. _lblKindName.text=orderItem.kindName;
  120. _lblKindName.frame=CGRectMake(CGRectGetMaxX( lblTitleKindName.frame),CGRectGetMaxY( lblTitleBrandName.frame)+ypadding,250, 16);
  121. _lblBrandName.font=orderTextFont;
  122. [contentView addSubview:_lblKindName];
  123. UILabel *lblTitleVarietyName = [[UILabel alloc]init];
  124. lblTitleVarietyName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleKindName.frame)+ypadding,67,16);
  125. lblTitleVarietyName.text = @"商品品种:";
  126. lblTitleVarietyName.font=orderTextFont;
  127. [contentView addSubview:lblTitleVarietyName];
  128. _lblVarietyName = [[UILabel alloc]init];
  129. _lblVarietyName.font=orderTextFont;
  130. _lblVarietyName.text=orderItem.varietyName;
  131. _lblVarietyName.frame=CGRectMake(CGRectGetMaxX( lblTitleVarietyName.frame),CGRectGetMaxY( lblTitleKindName.frame)+ypadding,250, 16);
  132. _lblVarietyName.font=orderTextFont;
  133. [contentView addSubview:_lblVarietyName];
  134. UILabel *lblTitleSeriesName = [[UILabel alloc]init];
  135. lblTitleSeriesName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleVarietyName.frame)+ypadding,67,16);
  136. lblTitleSeriesName.text = @"商品系列:";
  137. lblTitleSeriesName.font=orderTextFont;
  138. [contentView addSubview:lblTitleSeriesName];
  139. _lblSeriesName = [[UILabel alloc]init];
  140. _lblSeriesName.font=orderTextFont;
  141. _lblSeriesName.text=orderItem.seriesName;
  142. _lblSeriesName.frame=CGRectMake(CGRectGetMaxX( lblTitleSeriesName.frame),CGRectGetMaxY( lblTitleVarietyName.frame)+ypadding,250, 16);
  143. _lblSeriesName.font=orderTextFont;
  144. [contentView addSubview:_lblSeriesName];
  145. UILabel *lblTitleUnitName = [[UILabel alloc]init];
  146. lblTitleUnitName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSeriesName.frame)+ypadding,67,16);
  147. lblTitleUnitName.text = @"计量单位:";
  148. lblTitleUnitName.font=orderTextFont;
  149. [contentView addSubview:lblTitleUnitName];
  150. _lblUnitName = [[UILabel alloc]init];
  151. _lblUnitName.font=orderTextFont;
  152. _lblUnitName.text=orderItem.unitName;
  153. _lblUnitName.frame=CGRectMake(CGRectGetMaxX( lblTitleUnitName.frame),CGRectGetMaxY( lblTitleSeriesName.frame)+ypadding,250, 16);
  154. _lblUnitName.font=orderTextFont;
  155. [contentView addSubview:_lblUnitName];
  156. UILabel *lblTitleSpecification = [[UILabel alloc]init];
  157. lblTitleSpecification.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleUnitName.frame)+ypadding,67,16);
  158. lblTitleSpecification.text = @"商品规格:";
  159. lblTitleSpecification.font=orderTextFont;
  160. [contentView addSubview:lblTitleSpecification];
  161. _lblSpecification = [[UILabel alloc]init];
  162. _lblSpecification.font=orderTextFont;
  163. _lblSpecification.text=orderItem.specification;
  164. _lblSpecification.frame=CGRectMake(CGRectGetMaxX( lblTitleSpecification.frame),CGRectGetMaxY( lblTitleUnitName.frame)+ypadding,250, 16);
  165. _lblSpecification.font=orderTextFont;
  166. [contentView addSubview:_lblSpecification];
  167. UILabel *lblTitleGradeName = [[UILabel alloc]init];
  168. lblTitleGradeName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSpecification.frame)+ypadding,67,16);
  169. lblTitleGradeName.text = @"商品等级:";
  170. lblTitleGradeName.font=orderTextFont;
  171. [contentView addSubview:lblTitleGradeName];
  172. _lblGradeName = [[UILabel alloc]init];
  173. _lblGradeName.font=orderTextFont;
  174. _lblGradeName.text=orderItem.gradeName;
  175. _lblGradeName.frame=CGRectMake(CGRectGetMaxX( lblTitleGradeName.frame),CGRectGetMaxY( lblTitleSpecification.frame)+ypadding,250, 16);
  176. _lblGradeName.font=orderTextFont;
  177. [contentView addSubview:_lblGradeName];
  178. UILabel *lblTitleColorNumber = [[UILabel alloc]init];
  179. lblTitleColorNumber.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleGradeName.frame)+ypadding,67,16);
  180. lblTitleColorNumber.text = @"色 号:";
  181. lblTitleColorNumber.font=orderTextFont;
  182. [contentView addSubview:lblTitleColorNumber];
  183. _lblColorNumber = [[UILabel alloc]init];
  184. _lblColorNumber.font=orderTextFont;
  185. _lblColorNumber.text=orderItem.colorNumber;
  186. _lblColorNumber.frame=CGRectMake(CGRectGetMaxX( lblTitleColorNumber.frame),CGRectGetMaxY( lblTitleGradeName.frame)+ypadding,250, 16);
  187. _lblColorNumber.font=orderTextFont;
  188. [contentView addSubview:_lblColorNumber];
  189. UILabel *lblTitleSalesQuantity = [[UILabel alloc]init];
  190. lblTitleSalesQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleColorNumber.frame)+ypadding,67,16);
  191. lblTitleSalesQuantity.text = @"销售数量:";
  192. lblTitleSalesQuantity.font=orderTextFont;
  193. [contentView addSubview:lblTitleSalesQuantity];
  194. _lblSalesQuantity = [[UILabel alloc]init];
  195. _lblSalesQuantity.font=orderTextFont;
  196. _lblSalesQuantity.text=orderItem.salesQuantity;
  197. _lblSalesQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleSalesQuantity.frame),CGRectGetMaxY( lblTitleColorNumber.frame)+ypadding,250, 16);
  198. _lblSalesQuantity.font=orderTextFont;
  199. [contentView addSubview:_lblSalesQuantity];
  200. UILabel *lblTitleOrderQuantity = [[UILabel alloc]init];
  201. lblTitleOrderQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSalesQuantity.frame)+ypadding,67,16);
  202. lblTitleOrderQuantity.text = @"订单数量:";
  203. lblTitleOrderQuantity.font=orderTextFont;
  204. [contentView addSubview:lblTitleOrderQuantity];
  205. _lblOrderQuantity = [[UILabel alloc]init];
  206. _lblOrderQuantity.font=orderTextFont;
  207. _lblOrderQuantity.text=orderItem.orderQuantity;
  208. _lblOrderQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleOrderQuantity.frame),CGRectGetMaxY( lblTitleSalesQuantity.frame)+ypadding,250, 16);
  209. _lblOrderQuantity.font=orderTextFont;
  210. [contentView addSubview:_lblOrderQuantity];
  211. NSString *salesPrice=orderItem.salesPrice;
  212. if(![salesPrice isEqualToString:@""]){
  213. UILabel *lblTitleSalesPrice = [[UILabel alloc]init]; lblTitleSalesPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOrderQuantity.frame)+ypadding,67,16);
  214. lblTitleSalesPrice.text = @"销售价格:";
  215. lblTitleSalesPrice.font=orderTextFont;
  216. [contentView addSubview:lblTitleSalesPrice];
  217. _lblSalesPrice = [[UILabel alloc]init];
  218. _lblSalesPrice.font=orderTextFont;
  219. _lblSalesPrice.text=orderItem.salesPrice;
  220. _lblSalesPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleSalesPrice.frame),CGRectGetMaxY( lblTitleOrderQuantity.frame)+ypadding,250, 16);
  221. _lblSalesPrice.font=orderTextFont;
  222. [contentView addSubview:_lblSalesPrice];
  223. UILabel *lblTitleGoodsSettlementPrice = [[UILabel alloc]init];
  224. lblTitleGoodsSettlementPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSalesPrice.frame)+ypadding,80,16);
  225. lblTitleGoodsSettlementPrice.text = @"商品结算价:";
  226. lblTitleGoodsSettlementPrice.font=orderTextFont;
  227. [contentView addSubview:lblTitleGoodsSettlementPrice];
  228. _lblGoodsSettlementPrice = [[UILabel alloc]init];
  229. _lblGoodsSettlementPrice.font=orderTextFont;
  230. _lblGoodsSettlementPrice.text=orderItem.goodsSettlementPrice;
  231. _lblGoodsSettlementPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementPrice.frame),CGRectGetMaxY( lblTitleSalesPrice.frame)+ypadding,250, 16);
  232. _lblGoodsSettlementPrice.font=orderTextFont;
  233. [contentView addSubview:_lblGoodsSettlementPrice];
  234. UILabel *lblTitleGoodsSettlementAmount = [[UILabel alloc]init];
  235. lblTitleGoodsSettlementAmount.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,80,16);
  236. lblTitleGoodsSettlementAmount.text = @"结算价金额:";
  237. lblTitleGoodsSettlementAmount.font=orderTextFont;
  238. [contentView addSubview:lblTitleGoodsSettlementAmount];
  239. _lblGoodsSettlementAmount = [[UILabel alloc]init];
  240. _lblGoodsSettlementAmount.font=orderTextFont;
  241. _lblGoodsSettlementAmount.text=orderItem.goodsSettlementAmount;
  242. _lblGoodsSettlementAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementAmount.frame),CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,250, 16);
  243. _lblGoodsSettlementAmount.font=orderTextFont;
  244. [contentView addSubview:_lblGoodsSettlementAmount];
  245. UILabel *lblTitleAmount = [[UILabel alloc]init];
  246. lblTitleAmount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleGoodsSettlementAmount.frame)+ypadding,67,16);
  247. lblTitleAmount.text = @"金 额:";
  248. lblTitleAmount.font=orderTextFont;
  249. [contentView addSubview:lblTitleAmount];
  250. _lblAmount = [[UILabel alloc]init];
  251. _lblAmount.font=orderTextFont;
  252. _lblAmount.text=orderItem.amount;
  253. _lblAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleAmount.frame),CGRectGetMaxY( lblTitleGoodsSettlementAmount.frame)+ypadding,250, 16);
  254. _lblAmount.font=orderTextFont;
  255. [contentView addSubview:_lblAmount];
  256. UILabel *lblTitleMarkedPrice = [[UILabel alloc]init];
  257. lblTitleMarkedPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleAmount.frame)+ypadding,67,16);
  258. lblTitleMarkedPrice.text = @"标 价:";
  259. lblTitleMarkedPrice.font=orderTextFont;
  260. [contentView addSubview:lblTitleMarkedPrice];
  261. _lblMarkedPrice = [[UILabel alloc]init];
  262. _lblMarkedPrice.font=orderTextFont;
  263. _lblMarkedPrice.text=orderItem.markedPrice;
  264. _lblMarkedPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleMarkedPrice.frame),CGRectGetMaxY( lblTitleAmount.frame)+ypadding,250, 16);
  265. _lblMarkedPrice.font=orderTextFont;
  266. [contentView addSubview:_lblMarkedPrice];
  267. UILabel *lblTitleDiscount = [[UILabel alloc]init];
  268. lblTitleDiscount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleMarkedPrice.frame)+ypadding,67,16);
  269. lblTitleDiscount.text = @"折 扣:";
  270. lblTitleDiscount.font=orderTextFont;
  271. [contentView addSubview:lblTitleDiscount];
  272. _lblDiscount = [[UILabel alloc]init];
  273. _lblDiscount.font=orderTextFont;
  274. _lblDiscount.text=orderItem.discount;
  275. _lblDiscount.frame=CGRectMake(CGRectGetMaxX( lblTitleDiscount.frame),CGRectGetMaxY( lblTitleMarkedPrice.frame)+ypadding,250, 16);
  276. _lblDiscount.font=orderTextFont;
  277. [contentView addSubview:_lblDiscount];
  278. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame))
  279. ;
  280. if([orderItem.invoiceType isEqualToString:@"2"]){
  281. UILabel *lblTitleOutQuantity = [[UILabel alloc]init];
  282. lblTitleOutQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleDiscount.frame)+ypadding,67,16);
  283. lblTitleOutQuantity.text = @"出库数量:";
  284. lblTitleOutQuantity.font=orderTextFont;
  285. [contentView addSubview:lblTitleOutQuantity];
  286. _lblOutQuantity = [[UILabel alloc]init];
  287. _lblOutQuantity.font=orderTextFont;
  288. _lblOutQuantity.text=orderItem.outQuantity;
  289. _lblOutQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleOutQuantity.frame),CGRectGetMaxY( lblTitleDiscount.frame)+ypadding,250, 16);
  290. _lblOutQuantity.font=orderTextFont;
  291. [contentView addSubview:_lblOutQuantity];
  292. UILabel *lblTitleOutAmount = [[UILabel alloc]init];
  293. lblTitleOutAmount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOutQuantity.frame)+ypadding,67,16);
  294. lblTitleOutAmount.text = @"出库金额:";
  295. lblTitleOutAmount.font=orderTextFont;
  296. [contentView addSubview:lblTitleOutAmount];
  297. _lblOutAmount= [[UILabel alloc]init];
  298. _lblOutAmount.font=orderTextFont;
  299. _lblOutAmount.text=orderItem.outAmount;
  300. _lblOutAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleOutAmount.frame),CGRectGetMaxY( lblTitleOutQuantity.frame)+ypadding,250, 16);
  301. _lblOutAmount.font=orderTextFont;
  302. [contentView addSubview:_lblOutAmount];
  303. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleOutAmount.frame));
  304. }
  305. else{
  306. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame));
  307. }
  308. }
  309. else{
  310. UILabel *lblTitleGoodsSettlementPrice = [[UILabel alloc]init]; lblTitleGoodsSettlementPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOrderQuantity.frame)+ypadding,80,16);
  311. lblTitleGoodsSettlementPrice.text = @"商品结算价:";
  312. lblTitleGoodsSettlementPrice.font=orderTextFont;
  313. [contentView addSubview:lblTitleGoodsSettlementPrice];
  314. _lblGoodsSettlementPrice = [[UILabel alloc]init];
  315. _lblGoodsSettlementPrice.font=orderTextFont;
  316. _lblGoodsSettlementPrice.text=orderItem.goodsSettlementPrice;
  317. _lblGoodsSettlementPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementPrice.frame),CGRectGetMaxY( lblTitleOrderQuantity.frame)+ypadding,250, 16);
  318. _lblGoodsSettlementPrice.font=orderTextFont;
  319. [contentView addSubview:_lblGoodsSettlementPrice];
  320. UILabel *lblTitleGoodsSettlementAmount = [[UILabel alloc]init];
  321. lblTitleGoodsSettlementAmount.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,80,16);
  322. lblTitleGoodsSettlementAmount.text = @"结算价金额:";
  323. lblTitleGoodsSettlementAmount.font=orderTextFont;
  324. [contentView addSubview:lblTitleGoodsSettlementAmount];
  325. _lblGoodsSettlementAmount = [[UILabel alloc]init];
  326. _lblGoodsSettlementAmount.font=orderTextFont;
  327. _lblGoodsSettlementAmount.text=orderItem.goodsSettlementAmount;
  328. _lblGoodsSettlementAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementAmount.frame),CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,250, 16);
  329. _lblGoodsSettlementAmount.font=orderTextFont;
  330. [contentView addSubview:_lblGoodsSettlementAmount];
  331. UILabel *lblTitleMarkedPrice = [[UILabel alloc]init];
  332. lblTitleMarkedPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleGoodsSettlementAmount.frame)+ypadding,67,16);
  333. lblTitleMarkedPrice.text = @"标 价:";
  334. lblTitleMarkedPrice.font=orderTextFont;
  335. [contentView addSubview:lblTitleMarkedPrice];
  336. _lblMarkedPrice = [[UILabel alloc]init];
  337. _lblMarkedPrice.font=orderTextFont;
  338. _lblMarkedPrice.text=orderItem.markedPrice;
  339. _lblMarkedPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleMarkedPrice.frame),CGRectGetMaxY( lblTitleGoodsSettlementAmount.frame)+ypadding,250, 16);
  340. _lblMarkedPrice.font=orderTextFont;
  341. [contentView addSubview:_lblMarkedPrice];
  342. UILabel *lblTitleDiscount = [[UILabel alloc]init];
  343. lblTitleDiscount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleMarkedPrice.frame)+ypadding,67,16);
  344. lblTitleDiscount.text = @"折 扣:";
  345. lblTitleDiscount.font=orderTextFont;
  346. [contentView addSubview:lblTitleDiscount];
  347. _lblDiscount = [[UILabel alloc]init];
  348. _lblDiscount.font=orderTextFont;
  349. _lblDiscount.text=orderItem.discount;
  350. _lblDiscount.frame=CGRectMake(CGRectGetMaxX( lblTitleDiscount.frame),CGRectGetMaxY( lblTitleMarkedPrice.frame)+ypadding,250, 16);
  351. _lblDiscount.font=orderTextFont;
  352. [contentView addSubview:_lblDiscount];
  353. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame))
  354. ;
  355. if([orderItem.invoiceType isEqualToString:@"2"]){
  356. UILabel *lblTitleOutQuantity = [[UILabel alloc]init];
  357. lblTitleOutQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleDiscount.frame)+ypadding,67,16);
  358. lblTitleOutQuantity.text = @"出库数量:";
  359. lblTitleOutQuantity.font=orderTextFont;
  360. [contentView addSubview:lblTitleOutQuantity];
  361. _lblOutQuantity = [[UILabel alloc]init];
  362. _lblOutQuantity.font=orderTextFont;
  363. _lblOutQuantity.text=orderItem.outQuantity;
  364. _lblOutQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleOutQuantity.frame),CGRectGetMaxY( lblTitleDiscount.frame)+ypadding,250, 16);
  365. _lblOutQuantity.font=orderTextFont;
  366. [contentView addSubview:_lblOutQuantity];
  367. UILabel *lblTitleOutAmount = [[UILabel alloc]init];
  368. lblTitleOutAmount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOutQuantity.frame)+ypadding,67,16);
  369. lblTitleOutAmount.text = @"出库金额:";
  370. lblTitleOutAmount.font=orderTextFont;
  371. [contentView addSubview:lblTitleOutAmount];
  372. _lblOutAmount= [[UILabel alloc]init];
  373. _lblOutAmount.font=orderTextFont;
  374. _lblOutAmount.text=orderItem.outAmount;
  375. _lblOutAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleOutAmount.frame),CGRectGetMaxY( lblTitleOutQuantity.frame)+ypadding,250, 16);
  376. _lblOutAmount.font=orderTextFont;
  377. [contentView addSubview:_lblOutAmount];
  378. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleOutAmount.frame));
  379. }
  380. else{
  381. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame));
  382. }
  383. }
  384. if(orderItem.promotionOrderSalesPriceFlag)
  385. {
  386. UILabel *lblTitlePromotionOrderSalesPrice = [[UILabel alloc]init];
  387. lblTitlePromotionOrderSalesPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(contentView.frame)+ypadding,67,16);
  388. lblTitlePromotionOrderSalesPrice.text = @"策略价格:";
  389. lblTitlePromotionOrderSalesPrice.font=orderTextFont;
  390. [contentView addSubview:lblTitlePromotionOrderSalesPrice];
  391. _lblPromotionOrderSalesPrice = [[UILabel alloc]init];
  392. _lblPromotionOrderSalesPrice.font=orderTextFont;
  393. _lblPromotionOrderSalesPrice.text=orderItem.promotionOrderSalesPrice;
  394. _lblPromotionOrderSalesPrice.frame=CGRectMake(CGRectGetMaxX( lblTitlePromotionOrderSalesPrice.frame),CGRectGetMaxY( contentView.frame)+ypadding,250, 16);
  395. _lblPromotionOrderSalesPrice.font=orderTextFont;
  396. [contentView addSubview:_lblPromotionOrderSalesPrice];
  397. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitlePromotionOrderSalesPrice.frame));
  398. }
  399. if(orderItem.promotionRateFlag)
  400. {
  401. UILabel *lblTitlePromotionRate = [[UILabel alloc]init];
  402. lblTitlePromotionRate.frame=CGRectMake(xpadding,CGRectGetMaxY(contentView.frame)+ypadding,80,16);
  403. lblTitlePromotionRate.text = @"活动折扣比:";
  404. lblTitlePromotionRate.font=orderTextFont;
  405. [contentView addSubview:lblTitlePromotionRate];
  406. _lblPromotionRate = [[UILabel alloc]init];
  407. _lblPromotionRate.font=orderTextFont;
  408. _lblPromotionRate.text=orderItem.promotionRate;
  409. _lblPromotionRate.frame=CGRectMake(CGRectGetMaxX( lblTitlePromotionRate.frame),CGRectGetMaxY( contentView.frame)+ypadding,250, 16);
  410. _lblPromotionRate.font=orderTextFont;
  411. [contentView addSubview:_lblPromotionRate];
  412. contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitlePromotionRate.frame)+ypadding);
  413. }
  414. _height=CGRectGetMaxY(contentView.frame);
  415. }
  416. @end