InventoryFreezeOrderListCell.m 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. //
  2. // InventoryFreezeOrderListCell.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2020/5/7.
  6. // Copyright © 2020 elongtian. All rights reserved.
  7. //
  8. #import "InventoryFreezeOrderListCell.h"
  9. @implementation InventoryFreezeOrderListCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. return self;
  13. }
  14. -(void)setInventoryFreezeOrderListCell:(InventoryFreezeOrderListModel*)orderListModel
  15. {
  16. CGFloat heightLine = 1;
  17. CGFloat heightRow = 31;
  18. CGFloat lblx = 10;
  19. CGFloat lbly = 0;
  20. CGFloat lblwidth = 70;
  21. CGFloat lblheight = 31;
  22. CGFloat valuey = 0;
  23. CGFloat valueheight = 31;
  24. CGFloat topMargin=8;
  25. UIView *topSeparator= [UIView new];
  26. topSeparator.frame=CGRectMake(0, 0, Screen_Width, 10);
  27. topSeparator.backgroundColor = LineBackgroundColor;
  28. [self.contentView addSubview:topSeparator];
  29. UIView *vFreezeNo = [UIView new];
  30. vFreezeNo.frame=CGRectMake(0,CGRectGetMaxY(topSeparator.frame), Screen_Width,35);
  31. [self.contentView addSubview:vFreezeNo];
  32. UILabel *lblFreezeNo = [UILabel new];
  33. lblFreezeNo.frame=CGRectMake(lblx, 5, Screen_Width-lblx-100, valueheight);
  34. lblFreezeNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  35. [vFreezeNo addSubview:lblFreezeNo];
  36. lblFreezeNo.text = orderListModel.freezeNo;
  37. UILabel *lblUnfreezeStatusName = [UILabel new];
  38. lblUnfreezeStatusName.frame=CGRectMake(Screen_Width-100, 5, 100, valueheight);
  39. lblUnfreezeStatusName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  40. [vFreezeNo addSubview:lblUnfreezeStatusName];
  41. [vFreezeNo addSubview:lblFreezeNo];
  42. lblUnfreezeStatusName.text=orderListModel.unfreezeStatusName;
  43. UIView *viewBackgroud = [UIView new];
  44. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vFreezeNo.frame)-1, Screen_Width, 1);
  45. viewBackgroud.backgroundColor = LineBackgroundColor;
  46. [vFreezeNo addSubview:viewBackgroud];
  47. UIView *vCustomerCode = [UIView new];
  48. vCustomerCode.frame=CGRectMake(0,CGRectGetMaxY(vFreezeNo.frame)+10, Screen_Width/2, heightRow);
  49. UILabel *lblTitleCustomerCode = [UILabel new];
  50. lblTitleCustomerCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  51. lblTitleCustomerCode.text = @"客户编码:";
  52. lblTitleCustomerCode.textColor = [UIColor lightGrayColor];
  53. lblTitleCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  54. [vCustomerCode addSubview:lblTitleCustomerCode];
  55. UILabel *lblCustomerCode = [UILabel new];
  56. lblCustomerCode.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleCustomerCode.frame), valueheight);
  57. lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  58. [vCustomerCode addSubview:lblCustomerCode];
  59. lblCustomerCode.text = orderListModel.customerCode;
  60. [self.contentView addSubview:vCustomerCode];
  61. UIView *vCustomerName = [UIView new];
  62. vCustomerName.frame=CGRectMake(Screen_Width/2,CGRectGetMaxY(vFreezeNo.frame)+10, Screen_Width/2, heightRow);
  63. UILabel *lblTitleCustomerName = [UILabel new];
  64. lblTitleCustomerName.frame=CGRectMake(0, lbly, lblwidth, lblheight);
  65. lblTitleCustomerName.text = @"客户名称:";
  66. lblTitleCustomerName.textColor = [UIColor lightGrayColor];
  67. lblTitleCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  68. [vCustomerName addSubview:lblTitleCustomerName];
  69. UILabel *lblCustomerName = [UILabel new];
  70. lblCustomerName.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerName.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleCustomerName.frame), valueheight);
  71. lblCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  72. [vCustomerName addSubview:lblCustomerName];
  73. lblCustomerName.text = orderListModel.customerName;
  74. [self.contentView addSubview:vCustomerName];
  75. UIView *vStaff = [UIView new];
  76. vStaff.frame=CGRectMake(0,CGRectGetMaxY(vCustomerCode.frame), Screen_Width/2, heightRow);
  77. UILabel *lblTitleStaff = [UILabel new];
  78. lblTitleStaff.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  79. lblTitleStaff.text = @"业 务 员:";
  80. lblTitleStaff.textColor = [UIColor lightGrayColor];
  81. lblTitleStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  82. [vStaff addSubview:lblTitleStaff];
  83. UILabel *lblStaff = [UILabel new];
  84. lblStaff.frame=CGRectMake(CGRectGetMaxX(lblTitleStaff.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleStaff.frame), valueheight);
  85. lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  86. [vStaff addSubview:lblStaff];
  87. lblStaff.text = orderListModel.staffName;
  88. [self.contentView addSubview:vStaff];
  89. UIView *vAuditStatus = [UIView new];
  90. vAuditStatus.frame=CGRectMake(Screen_Width/2,CGRectGetMaxY(vCustomerCode.frame), Screen_Width/2, heightRow);
  91. UILabel *lblTitleAuditStatus = [UILabel new];
  92. lblTitleAuditStatus.frame=CGRectMake(0, lbly, lblwidth, lblheight);
  93. lblTitleAuditStatus.text = @"审批状态:";
  94. lblTitleAuditStatus.textColor = [UIColor lightGrayColor];
  95. lblTitleAuditStatus.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  96. [vAuditStatus addSubview:lblTitleAuditStatus];
  97. UILabel *lblAuditStatus = [UILabel new];
  98. lblAuditStatus.frame=CGRectMake(CGRectGetMaxX(lblTitleAuditStatus.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleAuditStatus.frame), valueheight);
  99. lblAuditStatus.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  100. [vAuditStatus addSubview:lblAuditStatus];
  101. lblAuditStatus.text = orderListModel.invoiceStatusName;
  102. [self.contentView addSubview:vAuditStatus];
  103. UIView *vFreezeDate = [UIView new];
  104. vFreezeDate.frame=CGRectMake(0,CGRectGetMaxY(vStaff.frame), Screen_Width/2, heightRow);
  105. UILabel *lblTitleFreezeDate = [UILabel new];
  106. lblTitleFreezeDate.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  107. lblTitleFreezeDate.text = @"冻结截止日期:";
  108. lblTitleFreezeDate.textColor = [UIColor lightGrayColor];
  109. lblTitleFreezeDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  110. [vFreezeDate addSubview:lblTitleFreezeDate];
  111. UILabel *lblFreezeDate = [UILabel new];
  112. lblFreezeDate.frame=CGRectMake(CGRectGetMaxX(lblTitleFreezeDate.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleFreezeDate.frame), valueheight);
  113. lblFreezeDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  114. [vFreezeDate addSubview:lblFreezeDate];
  115. lblFreezeDate.text = orderListModel.freezePeriod;
  116. [self.contentView addSubview:vFreezeDate];
  117. UIView *vAccountDate = [UIView new];
  118. vAccountDate.frame=CGRectMake(Screen_Width/2,CGRectGetMaxY(vStaff.frame), Screen_Width/2, heightRow);
  119. UILabel *lblTitleAccountDate = [UILabel new];
  120. lblTitleAccountDate.frame=CGRectMake(0, lbly, lblwidth, lblheight);
  121. lblTitleAccountDate.text = @"账务日期:";
  122. lblTitleAccountDate.textColor = [UIColor lightGrayColor];
  123. lblTitleAccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  124. [vAccountDate addSubview:lblTitleAccountDate];
  125. UILabel *lblAccountDate = [UILabel new];
  126. lblAccountDate.frame=CGRectMake(CGRectGetMaxX(lblTitleAccountDate.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleAccountDate.frame), valueheight);
  127. lblAccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  128. [vAccountDate addSubview:lblAccountDate];
  129. lblAccountDate.text = orderListModel.accountDate;
  130. [self.contentView addSubview:vAccountDate];
  131. UIView *vFreezeReason=[UIView new];
  132. vFreezeReason.frame=CGRectMake(0,CGRectGetMaxY(vFreezeDate.frame), Screen_Width, heightRow);
  133. UILabel *lblTitleFreezeReason=[UILabel new];
  134. lblTitleFreezeReason.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  135. lblTitleFreezeReason.text = @"冻结原因:";
  136. lblTitleFreezeReason.textColor = [UIColor lightGrayColor];
  137. lblTitleFreezeReason.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  138. [vFreezeReason addSubview:lblTitleFreezeReason];
  139. UILabel *lblFreezeReason=[UILabel new];
  140. lblFreezeReason.frame=CGRectMake(CGRectGetMaxX(lblTitleFreezeReason.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleFreezeReason.frame), valueheight);
  141. lblFreezeReason.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  142. [vFreezeReason addSubview:lblFreezeReason];
  143. lblFreezeReason.text = orderListModel.freezeReason;
  144. [self.contentView addSubview:vFreezeReason];
  145. _height=CGRectGetMaxY(vFreezeReason.frame);
  146. NSString *invoiceStatus= orderListModel.invoiceStatus;
  147. if([invoiceStatus intValue]==0||[invoiceStatus intValue]==2)
  148. {
  149. //按钮 —————————
  150. CGFloat btnweidth = 80;
  151. CGFloat btnmargin = 100;
  152. UIView *viewBackgroud = [UIView new];
  153. viewBackgroud.frame = CGRectMake(0, _height+8, Screen_Width, 1);
  154. viewBackgroud.backgroundColor = LineBackgroundColor;
  155. [self.contentView addSubview:viewBackgroud];
  156. UIView *vEdit = [UIView new];
  157. vEdit.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width, heightRow+8);
  158. [self.contentView addSubview:vEdit];
  159. UIButton *btnEdit = [UIButton buttonWithType:UIButtonTypeCustom];
  160. [btnEdit setTitle:@"编辑" forState:UIControlStateNormal];
  161. [btnEdit setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  162. [btnEdit addTarget:self action:@selector(goEdit) forControlEvents:UIControlEventTouchUpInside];
  163. btnEdit.layer.cornerRadius = 4;
  164. btnEdit.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
  165. btnEdit.frame = CGRectMake(Screen_Width - btnmargin ,valuey , btnweidth, valueheight);
  166. [vEdit addSubview:btnEdit];
  167. _height=CGRectGetMaxY(vEdit.frame);
  168. }
  169. }
  170. -(void)goEdit
  171. {
  172. if([self.delegate respondsToSelector:@selector(editData:)])
  173. {
  174. [self.delegate editData:_position];
  175. }
  176. }
  177. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  178. [super setSelected:selected animated:animated];
  179. }
  180. @end