StockingCell.m 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. //
  2. // StockingCell.m
  3. // IBOSS
  4. //
  5. // Created by apple on 2017/5/17.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:盘点单元格
  9. //
  10. #import "StockingCell.h"
  11. @implementation StockingCell
  12. /**
  13. 后台代码创建单元cell
  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. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  20. return self;
  21. }
  22. /**
  23. 模型
  24. @param m <#m description#>
  25. */
  26. - (void)setModel:(StockingModel *)m{
  27. CGFloat heightLine = 1;
  28. CGFloat heightRow = 31;
  29. CGFloat lblx = 20;
  30. CGFloat lblvaluex = 5;
  31. CGFloat lbly = 0;
  32. CGFloat lblwidth = 80;
  33. CGFloat lblheight = 31;
  34. CGFloat valuex = 90;
  35. CGFloat valuey = 0;
  36. CGFloat valuewidth = 120;
  37. CGFloat valueheight = 31;
  38. //title —————————
  39. UIView *vTitle = [UIView new];
  40. vTitle.frame=CGRectMake(0, 0, Screen_Width, 10);
  41. vTitle.backgroundColor = LineBackgroundColor;
  42. [self.contentView addSubview:vTitle];
  43. //盘点单号 —————————
  44. UIView *vNo = [UIView new];
  45. vNo.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame)+8, Screen_Width, heightRow);
  46. [self.contentView addSubview:vNo];
  47. UILabel *lblno = [UILabel new];
  48. lblno.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  49. lblno.text = @"盘点单号:";
  50. lblno.textColor = [UIColor blackColor];
  51. lblno.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  52. [vNo addSubview:lblno];
  53. UILabel *lblNoValue = [UILabel new];
  54. lblNoValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  55. lblNoValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  56. lblNoValue.text = m.stockingNo;
  57. [vNo addSubview:lblNoValue];
  58. //分割线
  59. UIView *viewBackgroud = [UIView new];
  60. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vNo.frame)+8, Screen_Width, heightLine);
  61. viewBackgroud.backgroundColor = LineBackgroundColor;
  62. [self.contentView addSubview:viewBackgroud];
  63. //唯一编码 等级 —————————
  64. UIView *vOnlyCodeAndGrade = [UIView new];
  65. vOnlyCodeAndGrade.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width, heightRow);
  66. [self.contentView addSubview:vOnlyCodeAndGrade];
  67. UIView *vOnlyCode = [UIView new];
  68. vOnlyCode.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  69. [vOnlyCodeAndGrade addSubview:vOnlyCode];
  70. UILabel *lblOnlyCode = [UILabel new];
  71. lblOnlyCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  72. lblOnlyCode.text = @"唯一编码:";
  73. lblOnlyCode.textColor = LabelGrayTextColor;
  74. lblOnlyCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  75. [vOnlyCode addSubview:lblOnlyCode];
  76. UILabel *lblonlyCodeValue = [UILabel new];
  77. lblonlyCodeValue.frame=CGRectMake(valuex, valuey, valuewidth, valueheight);
  78. lblonlyCodeValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  79. lblonlyCodeValue.text = m.onlyCode;
  80. [vOnlyCode addSubview:lblonlyCodeValue];
  81. UIView *vGrade = [UIView new];
  82. vGrade.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  83. [vOnlyCodeAndGrade addSubview:vGrade];
  84. UILabel *lblGrade = [UILabel new];
  85. lblGrade.frame=CGRectMake(lblvaluex, lbly, lblwidth/2, lblheight);
  86. lblGrade.text = @"等级:";
  87. lblGrade.textColor = LabelGrayTextColor;
  88. lblGrade.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  89. [vGrade addSubview:lblGrade];
  90. UILabel *gradeName = [UILabel new];
  91. gradeName.frame=CGRectMake(CGRectGetMaxX(lblGrade.frame), valuey, valuewidth, valueheight);
  92. gradeName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  93. gradeName.text = m.gradeName;
  94. [vGrade addSubview:gradeName];
  95. //色号 规格 —————————
  96. UIView *vColorAndSpecification = [UIView new];
  97. vColorAndSpecification.frame=CGRectMake(0, CGRectGetMaxY(vOnlyCodeAndGrade.frame), Screen_Width, heightRow);
  98. [self.contentView addSubview:vColorAndSpecification];
  99. UIView *vColor = [UIView new];
  100. vColor.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  101. [vColorAndSpecification addSubview:vColor];
  102. UILabel *lblColor = [UILabel new];
  103. lblColor.frame=CGRectMake(lblx, lbly, lblwidth/2, lblheight);
  104. lblColor.text = @"色号:";
  105. lblColor.textColor = LabelGrayTextColor;
  106. lblColor.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  107. [vColor addSubview:lblColor];
  108. UILabel *lblcolorNumber = [UILabel new];
  109. lblcolorNumber.frame=CGRectMake(CGRectGetMaxX(lblColor.frame), valuey, valuewidth, valueheight);
  110. lblcolorNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  111. lblcolorNumber.text = m.colorNumber;
  112. [vColor addSubview:lblcolorNumber];
  113. UIView *vSpecification = [UIView new];
  114. vSpecification.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  115. [vColorAndSpecification addSubview:vSpecification];
  116. UILabel *lblSpecification = [UILabel new];
  117. lblSpecification.frame=CGRectMake(lblvaluex, lbly, lblwidth/2, lblheight);
  118. lblSpecification.text = @"规格:";
  119. lblSpecification.textColor = LabelGrayTextColor;
  120. lblSpecification.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  121. [vSpecification addSubview:lblSpecification];
  122. UILabel *specification = [UILabel new];
  123. specification.frame=CGRectMake(CGRectGetMaxX(lblSpecification.frame), valuey, valuewidth, valueheight);
  124. specification.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  125. specification.text = m.specification;
  126. [vSpecification addSubview:specification];
  127. //库区 仓位 —————————
  128. UIView *vWareAndPos = [UIView new];
  129. vWareAndPos.frame=CGRectMake(0, CGRectGetMaxY(vColorAndSpecification.frame), Screen_Width, heightRow);
  130. [self.contentView addSubview:vWareAndPos];
  131. UIView *vWare = [UIView new];
  132. vWare.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  133. [vWareAndPos addSubview:vWare];
  134. UILabel *lblWare = [UILabel new];
  135. lblWare.frame=CGRectMake(lblx, lbly, lblwidth/2, lblheight);
  136. lblWare.text = @"库区:";
  137. lblWare.textColor = LabelGrayTextColor;
  138. lblWare.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  139. [vWare addSubview:lblWare];
  140. UILabel *wareHouseName = [UILabel new];
  141. wareHouseName.frame=CGRectMake(CGRectGetMaxX(lblWare.frame), valuey, valuewidth, valueheight);
  142. wareHouseName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  143. wareHouseName.text = m.warehouseName;
  144. [vWare addSubview:wareHouseName];
  145. UIView *vPos = [UIView new];
  146. vPos.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  147. [vWareAndPos addSubview:vPos];
  148. UILabel *lblPos = [UILabel new];
  149. lblPos.frame=CGRectMake(lblvaluex, lbly, lblwidth/2, lblheight);
  150. lblPos.text = @"仓位:";
  151. lblPos.textColor = LabelGrayTextColor;
  152. lblPos.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  153. [vPos addSubview:lblPos];
  154. UILabel *positionNumber = [UILabel new];
  155. positionNumber.frame=CGRectMake(CGRectGetMaxX(lblPos.frame), valuey, valuewidth, valueheight);
  156. positionNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  157. positionNumber.text = m.positionNumber;
  158. [vPos addSubview:positionNumber];
  159. //盘点人 时间 —————————
  160. UIView *vCreaterAndTime = [UIView new];
  161. vCreaterAndTime.frame=CGRectMake(0, CGRectGetMaxY(vWareAndPos.frame), Screen_Width, heightRow);
  162. [self.contentView addSubview:vCreaterAndTime];
  163. UIView *vCreater = [UIView new];
  164. vCreater.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  165. [vCreaterAndTime addSubview:vCreater];
  166. UILabel *lblCreater = [UILabel new];
  167. lblCreater.frame=CGRectMake(lblx, lbly, 55, lblheight);
  168. lblCreater.text = @"盘点人:";
  169. lblCreater.textColor = LabelGrayTextColor;
  170. lblCreater.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  171. [vCreater addSubview:lblCreater];
  172. UILabel *createUser = [UILabel new];
  173. createUser.frame=CGRectMake(CGRectGetMaxX(lblCreater.frame), valuey, valuewidth , valueheight);
  174. createUser.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  175. createUser.text = m.createUser;
  176. [vCreater addSubview:createUser];
  177. UIView *vTime = [UIView new];
  178. vTime.frame=CGRectMake(Screen_Width/2, 0, Screen_Width/2, heightRow);
  179. [vCreaterAndTime addSubview:vTime];
  180. UILabel *lblTime = [UILabel new];
  181. lblTime.frame=CGRectMake(lblvaluex, lbly, 68, lblheight);
  182. lblTime.text = @"盘点时间:";
  183. lblTime.textColor = LabelGrayTextColor;
  184. lblTime.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  185. [vTime addSubview:lblTime];
  186. UILabel *stime = [UILabel new];
  187. stime.frame=CGRectMake(CGRectGetMaxX(lblTime.frame), valuey, valuewidth, valueheight);
  188. stime.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  189. stime.text = m.createTime;
  190. [vTime addSubview:stime];
  191. //分割线
  192. viewBackgroud = [UIView new];
  193. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vCreaterAndTime.frame)+8, Screen_Width, 10);
  194. viewBackgroud.backgroundColor = LineBackgroundColor;
  195. //[self.contentView addSubview:viewBackgroud];
  196. }
  197. @end