SalesSlipGoodsListCell.m 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. //
  2. // OrderGoodsListCellTableViewCell.m
  3. // IBOSSmini
  4. //
  5. // Created by guan hong hou on 2018/1/23.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "SalesSlipGoodsListCell.h"
  9. #define orderTextFont [UIFont systemFontOfSize:13]
  10. @implementation SalesSlipGoodsListCell
  11. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  12. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  13. return self;
  14. }
  15. - (void)setSalesGoodsOrder:(SalesSlipGoodsListModel *)salesOrder orderStatus:(NSUInteger)status{
  16. _salesOrderGoodsListModel=salesOrder;
  17. if(_salesOrderGoodsListModel==nil){
  18. return;
  19. }
  20. CGFloat heightLine = 1;
  21. CGFloat heightRow = 40;
  22. CGFloat lblx = 20;
  23. CGFloat lbly = 8;
  24. CGFloat lblwidth = 70;
  25. CGFloat lblheight = 25;
  26. CGFloat valuey = 8;
  27. CGFloat valueheight = 25;
  28. //客户名称
  29. UIView *vOrderNo = [UIView new];
  30. vOrderNo.frame=CGRectMake(0, valuey, Screen_Width, heightRow);
  31. [self.contentView addSubview:vOrderNo];
  32. UILabel *orderNoTitleLbl=[UILabel new];
  33. orderNoTitleLbl.frame=CGRectMake(lblx, lbly, 85, lblheight);
  34. orderNoTitleLbl.text=@"销售单编号:";
  35. orderNoTitleLbl.textColor = [UIColor blackColor];
  36. orderNoTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  37. [vOrderNo addSubview:orderNoTitleLbl];
  38. _orderNoLbl = [UILabel new];
  39. _orderNoLbl.frame=CGRectMake(CGRectGetMaxX(orderNoTitleLbl.frame), valuey, Screen_Width -CGRectGetMaxX(orderNoTitleLbl.frame)-10, valueheight);
  40. _orderNoLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  41. [vOrderNo addSubview:_orderNoLbl];
  42. _orderNoLbl.text = _salesOrderGoodsListModel.salesNo;
  43. _topSeparator=[UIView new];
  44. _topSeparator.frame = CGRectMake(0, CGRectGetMaxY(vOrderNo.frame), Screen_Width, heightLine);
  45. [self.contentView addSubview:_topSeparator];
  46. UIButton *btnLine = [UIButton buttonWithType:UIButtonTypeCustom];
  47. [btnLine setBackgroundImage:[UIImage imageNamed:@"dash"] forState:UIControlStateNormal];
  48. btnLine.frame = CGRectMake(0 ,0 , Screen_Width, heightLine);
  49. [_topSeparator addSubview:btnLine];
  50. UIView *vCheck = [UIView new];
  51. vCheck.frame=CGRectMake(0, CGRectGetMaxY(_topSeparator.frame), Screen_Width, heightRow);
  52. [self.contentView addSubview:vCheck];
  53. _goodsNameLbl=[UILabel new];
  54. _goodsNameLbl.frame=CGRectMake(lblx, valuey, Screen_Width - 90, valueheight);
  55. _goodsNameLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  56. [vCheck addSubview:_goodsNameLbl];
  57. _goodsNameLbl.text =_salesOrderGoodsListModel.goodsName;
  58. [vCheck addSubview:_goodsNameLbl];
  59. _middleSeparator= [UIView new];
  60. _middleSeparator.frame=CGRectMake(0, CGRectGetMaxY(vCheck.frame), Screen_Width, 1);
  61. _middleSeparator.backgroundColor = LineBackgroundColor;
  62. [self.contentView addSubview:_middleSeparator];
  63. UIView *vCode = [UIView new];
  64. vCode.frame=CGRectMake(0,CGRectGetMaxY(_middleSeparator.frame), Screen_Width, heightRow);
  65. [self.contentView addSubview:vCode];
  66. UILabel *goodsCodeTitleLbl= [UILabel new];
  67. goodsCodeTitleLbl.frame=CGRectMake(lblx, valuey,lblwidth, lblheight);
  68. goodsCodeTitleLbl.textColor = [UIColor blackColor];
  69. goodsCodeTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  70. goodsCodeTitleLbl.text=@"商品编码:";
  71. [vCode addSubview:goodsCodeTitleLbl];
  72. _goodsCodeLbl=[UILabel new];
  73. _goodsCodeLbl.frame=CGRectMake(CGRectGetMaxX(goodsCodeTitleLbl.frame), valuey,Screen_Width/2-lblx-5-CGRectGetMaxX(goodsCodeTitleLbl.frame), valueheight);
  74. _goodsCodeLbl.textColor = [UIColor blackColor];
  75. _goodsCodeLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  76. [vCode addSubview:_goodsCodeLbl];
  77. _goodsCodeLbl.text=_salesOrderGoodsListModel.code;
  78. UILabel *onlyCodeTitleLbl= [UILabel new];
  79. onlyCodeTitleLbl.frame=CGRectMake(Screen_Width/2, valuey,lblwidth, lblheight);
  80. onlyCodeTitleLbl.textColor = [UIColor blackColor];
  81. onlyCodeTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  82. onlyCodeTitleLbl.text=@"唯一编码:";
  83. [vCode addSubview:onlyCodeTitleLbl];
  84. _onlyCodeLbl=[UILabel new];
  85. _onlyCodeLbl.frame=CGRectMake(CGRectGetMaxX(onlyCodeTitleLbl.frame), valuey,Screen_Width/2-lblwidth-10, valueheight);
  86. _onlyCodeLbl.textColor = [UIColor blackColor];
  87. _onlyCodeLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  88. [vCode addSubview:_onlyCodeLbl];
  89. _onlyCodeLbl.text=_salesOrderGoodsListModel.onlyCode;
  90. UIView *vPrice = [UIView new];
  91. vPrice.frame=CGRectMake(0,CGRectGetMaxY(vCode.frame), Screen_Width, heightRow);
  92. [self.contentView addSubview:vPrice];
  93. UILabel *orderPriceTitleLbl= [UILabel new];
  94. orderPriceTitleLbl.frame=CGRectMake(lblx, valuey,lblwidth, lblheight);
  95. orderPriceTitleLbl.textColor = [UIColor blackColor];
  96. orderPriceTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  97. orderPriceTitleLbl.text=@"销售价格:";
  98. [vPrice addSubview:orderPriceTitleLbl];
  99. _orderPriceLbl=[UILabel new];
  100. _orderPriceLbl.frame=CGRectMake(CGRectGetMaxX(orderPriceTitleLbl.frame), valuey,Screen_Width/2-lblwidth-10, valueheight);
  101. _orderPriceLbl.textColor = [UIColor blackColor];
  102. _orderPriceLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  103. [vPrice addSubview:_orderPriceLbl];
  104. _orderPriceLbl.text=_salesOrderGoodsListModel.orderPrice;
  105. UILabel *orderQuantityTitleLbl= [UILabel new];
  106. orderQuantityTitleLbl.frame=CGRectMake(Screen_Width/2, valuey,lblwidth, lblheight);
  107. orderQuantityTitleLbl.textColor = [UIColor blackColor];
  108. orderQuantityTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  109. orderQuantityTitleLbl.text=@"销售数量:";
  110. [vPrice addSubview:orderQuantityTitleLbl];
  111. _orderQuantityLbl=[UILabel new];
  112. _orderQuantityLbl.frame=CGRectMake(CGRectGetMaxX(orderQuantityTitleLbl.frame), valuey,Screen_Width/2-lblwidth-10, valueheight);
  113. _orderQuantityLbl.textColor = [UIColor blackColor];
  114. _orderQuantityLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  115. [vPrice addSubview:_orderQuantityLbl];
  116. double orderQuantity= _salesOrderGoodsListModel.factOrderQuantity;
  117. _orderQuantityLbl.text=[NSString stringWithFormat:@"%.2f",orderQuantity];
  118. UIView *vSpecification = [UIView new];
  119. vSpecification.frame=CGRectMake(0,CGRectGetMaxY(vPrice.frame), Screen_Width, heightRow);
  120. [self.contentView addSubview:vSpecification];
  121. UILabel *specificationTitleLbl= [UILabel new];
  122. specificationTitleLbl.frame=CGRectMake(lblx, valuey,lblwidth, lblheight);
  123. specificationTitleLbl.textColor = [UIColor blackColor];
  124. specificationTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  125. specificationTitleLbl.text=@"规 格:";
  126. [vSpecification addSubview:specificationTitleLbl];
  127. _specificationLbl=[UILabel new];
  128. _specificationLbl.frame=CGRectMake(CGRectGetMaxX(specificationTitleLbl.frame), valuey,Screen_Width/2-lblwidth-15, valueheight);
  129. _specificationLbl.textColor = [UIColor blackColor];
  130. _specificationLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  131. [vSpecification addSubview:_specificationLbl];
  132. _specificationLbl.text=_salesOrderGoodsListModel.specification;
  133. UILabel *colorNumberTitleLbl= [UILabel new];
  134. colorNumberTitleLbl.frame=CGRectMake(Screen_Width/2, valuey,lblwidth, lblheight);
  135. colorNumberTitleLbl.textColor = [UIColor blackColor];
  136. colorNumberTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  137. colorNumberTitleLbl.text=@"色 号:";
  138. [vSpecification addSubview:colorNumberTitleLbl];
  139. _colorNumberLbl=[UILabel new];
  140. _colorNumberLbl.frame=CGRectMake(CGRectGetMaxX(colorNumberTitleLbl.frame), valuey,Screen_Width/2-lblwidth-10, valueheight);
  141. _colorNumberLbl.textColor = [UIColor blackColor];
  142. _colorNumberLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  143. [vSpecification addSubview:_colorNumberLbl];
  144. _colorNumberLbl.text=_salesOrderGoodsListModel.colorNumber;
  145. UIView *vBrand = [UIView new];
  146. vBrand.frame=CGRectMake(0,CGRectGetMaxY(vSpecification.frame), Screen_Width, heightRow);
  147. [self.contentView addSubview:vBrand];
  148. UILabel *brandNameTitleLbl= [UILabel new];
  149. brandNameTitleLbl.frame=CGRectMake(lblx, valuey,lblwidth, lblheight);
  150. brandNameTitleLbl.textColor = [UIColor blackColor];
  151. brandNameTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  152. brandNameTitleLbl.text=@"商品品牌:";
  153. [vBrand addSubview:brandNameTitleLbl];
  154. _brandNameLbl=[UILabel new];
  155. _brandNameLbl.frame=CGRectMake(CGRectGetMaxX(brandNameTitleLbl.frame), valuey,Screen_Width-lblwidth-lblx-10, valueheight);
  156. _brandNameLbl.textColor = [UIColor blackColor];
  157. _brandNameLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  158. [vBrand addSubview:_brandNameLbl];
  159. _brandNameLbl.text=_salesOrderGoodsListModel.brandName;
  160. _bottomSeparator= [UIView new];
  161. _bottomSeparator.frame=CGRectMake(0, CGRectGetMaxY(vBrand.frame)+5, Screen_Width, 10);
  162. _bottomSeparator.backgroundColor = LineBackgroundColor;
  163. [self.contentView addSubview:_bottomSeparator];
  164. }
  165. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  166. [super setSelected:selected animated:animated];
  167. }
  168. @end