StockingGoodsCell.m 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. //
  2. // StockingGoodsCell.m
  3. // IBOSSmini
  4. //
  5. // Created by apple on 2017/5/17.
  6. // Copyright © 2017年 elongtian. All rights reserved.
  7. //
  8. #import "StockingGoodsCell.h"
  9. @implementation StockingGoodsCell
  10. /**
  11. 后台代码创建单元cell
  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. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  18. return self;
  19. }
  20. - (void)setModel:(StockingModel *)m{
  21. CGFloat heightLine = 1;
  22. CGFloat heightRow = 40;
  23. CGFloat lblx = 20;
  24. CGFloat lbly = 8;
  25. CGFloat lblwidth = 80;
  26. CGFloat lblheight = 25;
  27. CGFloat valuex = 90;
  28. CGFloat valuey = 8;
  29. CGFloat valuewidth = 120;
  30. CGFloat valueheight = 25;
  31. //title==================
  32. UIView *vTitle = [UIView new];
  33. vTitle.frame=CGRectMake(0, 0, Screen_Width, 10);
  34. vTitle.backgroundColor = LineBackgroundColor;
  35. [self.contentView addSubview:vTitle];
  36. //唯一编码==================
  37. UIView *vOnlyCode = [UIView new];
  38. vOnlyCode.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame), Screen_Width, heightRow);
  39. [self.contentView addSubview:vOnlyCode];
  40. UILabel *lblOnlyCode=[UILabel new];
  41. lblOnlyCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  42. lblOnlyCode.text=@"唯一编码:";
  43. lblOnlyCode.textColor = [UIColor blackColor];
  44. lblOnlyCode.font = [UIFont systemFontOfSize: TitleFontOfSize];
  45. [vOnlyCode addSubview:lblOnlyCode];
  46. UILabel *lblonlyCodeValue = [UILabel new];
  47. lblonlyCodeValue.frame=CGRectMake(valuex, valuey, Screen_Width-valuex-lblx, valueheight);
  48. lblonlyCodeValue.font = [UIFont systemFontOfSize: TitleFontOfSize];
  49. lblonlyCodeValue.text = m.onlyCode;
  50. [vOnlyCode addSubview:lblonlyCodeValue];
  51. //分割线
  52. UIView *viewBackgroud = [UIView new];
  53. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vOnlyCode.frame), Screen_Width, heightLine);
  54. viewBackgroud.backgroundColor = LineBackgroundColor;
  55. [self.contentView addSubview:viewBackgroud];
  56. //库存数量 等级==================
  57. UIView *vCountAndGrade = [UIView new];
  58. vCountAndGrade.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame), Screen_Width, heightRow);
  59. [self.contentView addSubview:vCountAndGrade];
  60. UIView *vNo = [UIView new];
  61. vNo.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  62. [vCountAndGrade addSubview:vNo];
  63. UILabel *lblno=[UILabel new];
  64. lblno.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  65. lblno.text=@"库存数量:";
  66. lblno.textColor = [UIColor blackColor];
  67. lblno.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  68. [vNo addSubview:lblno];
  69. UILabel *lblNoValue = [UILabel new];
  70. lblNoValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  71. lblNoValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  72. lblNoValue.text = m.quantity;
  73. [vNo addSubview:lblNoValue];
  74. UIView *vGrade = [UIView new];
  75. vGrade.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  76. [vCountAndGrade addSubview:vGrade];
  77. UILabel *lblGrade=[UILabel new];
  78. lblGrade.frame=CGRectMake(lblx, lbly, lblwidth/2, lblheight);
  79. lblGrade.text=@"等级:";
  80. lblGrade.textColor = [UIColor blackColor];
  81. lblGrade.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  82. [vGrade addSubview:lblGrade];
  83. UILabel *gradeName = [UILabel new];
  84. gradeName.frame=CGRectMake(CGRectGetMaxX(lblGrade.frame), valuey, valuewidth, valueheight);
  85. gradeName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  86. gradeName.text = m.gradeName;
  87. [vGrade addSubview:gradeName];
  88. //色号 规格==================
  89. UIView *vColorAndSpecification = [UIView new];
  90. vColorAndSpecification.frame=CGRectMake(0, CGRectGetMaxY(vCountAndGrade.frame), Screen_Width, heightRow);
  91. [self.contentView addSubview:vColorAndSpecification];
  92. UIView *vColor = [UIView new];
  93. vColor.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  94. [vColorAndSpecification addSubview:vColor];
  95. UILabel *lblColor=[UILabel new];
  96. lblColor.frame=CGRectMake(lblx, lbly, lblwidth/2, lblheight);
  97. lblColor.text=@"色号:";
  98. lblColor.textColor = [UIColor blackColor];
  99. lblColor.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  100. [vColor addSubview:lblColor];
  101. UILabel *lblcolorNumber = [UILabel new];
  102. lblcolorNumber.frame=CGRectMake(CGRectGetMaxX(lblColor.frame), valuey, valuewidth, valueheight);
  103. lblcolorNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  104. lblcolorNumber.text = m.colorNumber;
  105. [vColor addSubview:lblcolorNumber];
  106. UIView *vSpecification = [UIView new];
  107. vSpecification.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  108. [vColorAndSpecification addSubview:vSpecification];
  109. UILabel *lblSpecification=[UILabel new];
  110. lblSpecification.frame=CGRectMake(lblx, lbly, lblwidth/2, lblheight);
  111. lblSpecification.text=@"规格:";
  112. lblSpecification.textColor = [UIColor blackColor];
  113. lblSpecification.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  114. [vSpecification addSubview:lblSpecification];
  115. UILabel *specification = [UILabel new];
  116. specification.frame=CGRectMake(CGRectGetMaxX(lblSpecification.frame), valuey, valuewidth, valueheight);
  117. specification.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  118. specification.text = m.specification;
  119. [vSpecification addSubview:specification];
  120. //库区 仓位==================
  121. UIView *vWareAndPos = [UIView new];
  122. vWareAndPos.frame=CGRectMake(0, CGRectGetMaxY(vColorAndSpecification.frame), Screen_Width, heightRow);
  123. [self.contentView addSubview:vWareAndPos];
  124. UIView *vWare = [UIView new];
  125. vWare.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  126. [vWareAndPos addSubview:vWare];
  127. UILabel *lblWare=[UILabel new];
  128. lblWare.frame=CGRectMake(lblx, lbly, lblwidth/2, lblheight);
  129. lblWare.text=@"库区:";
  130. lblWare.textColor = [UIColor blackColor];
  131. lblWare.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  132. [vWare addSubview:lblWare];
  133. UILabel *wareHouseName = [UILabel new];
  134. wareHouseName.frame=CGRectMake(CGRectGetMaxX(lblWare.frame), valuey, valuewidth, valueheight);
  135. wareHouseName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  136. wareHouseName.text = m.warehouseName;
  137. [vWare addSubview:wareHouseName];
  138. UIView *vPos = [UIView new];
  139. vPos.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  140. [vWareAndPos addSubview:vPos];
  141. UILabel *lblPos=[UILabel new];
  142. lblPos.frame=CGRectMake(lblx, lbly, lblwidth/2, lblheight);
  143. lblPos.text=@"仓位:";
  144. lblPos.textColor = [UIColor blackColor];
  145. lblPos.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  146. [vPos addSubview:lblPos];
  147. UILabel *positionNumber = [UILabel new];
  148. positionNumber.frame=CGRectMake(CGRectGetMaxX(lblPos.frame), valuey, valuewidth, valueheight);
  149. positionNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  150. positionNumber.text = m.positionNumber;
  151. [vPos addSubview:positionNumber];
  152. //分割线
  153. viewBackgroud = [UIView new];
  154. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vWareAndPos.frame), Screen_Width, 10);
  155. viewBackgroud.backgroundColor = LineBackgroundColor;
  156. //[self.contentView addSubview:viewBackgroud];
  157. }
  158. @end