ProcurementApplyListCell.m 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. //
  2. // ProcurementApplyListCell.m
  3. // IBOSS
  4. //
  5. // Created by guan hong hou on 2018/7/23.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "ProcurementApplyListCell.h"
  9. @implementation ProcurementApplyListCell
  10. -(void)setProcurementApplyListCell:(ProcurementApplyListModel*)procurementModel{
  11. _applyListModel=procurementModel;
  12. if(_applyListModel==nil){
  13. return;
  14. }
  15. CGFloat heightLine = 1;
  16. CGFloat heightRow = 31;
  17. CGFloat lblx = 20;
  18. CGFloat lbly = 0;
  19. CGFloat lblwidth = 70;
  20. CGFloat lblheight = 31;
  21. CGFloat valuex = 85;
  22. CGFloat valuey = 0;
  23. CGFloat valueheight = 31;
  24. //分割线
  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 *vApplyNo = [UIView new];
  30. vApplyNo.frame=CGRectMake(0,CGRectGetMaxY(topSeparator.frame)+8, Screen_Width, heightRow);
  31. [self.contentView addSubview:vApplyNo];
  32. _lblApplyNo = [UILabel new];
  33. _lblApplyNo.frame=CGRectMake(lblx, valuey,Screen_Width-120-lblx, valueheight);
  34. _lblApplyNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  35. [vApplyNo addSubview:_lblApplyNo];
  36. _lblApplyNo.text = _applyListModel.applyNo;
  37. // 跟进标识
  38. _lblApplyStatus = [UILabel new];
  39. _lblApplyStatus.frame=CGRectMake(Screen_Width-130 , valuey,110, valueheight);
  40. _lblApplyStatus.textColor = LabelGrayTextColor;
  41. _lblApplyStatus.textAlignment = NSTextAlignmentRight;
  42. _lblApplyStatus.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  43. _lblApplyStatus.text=_applyListModel.invoiceStatusName;
  44. [vApplyNo addSubview:_lblApplyStatus];
  45. //分割线
  46. UIView *viewBackgroud = [UIView new];
  47. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vApplyNo.frame)+8, Screen_Width, heightLine);
  48. [self.contentView addSubview:viewBackgroud];
  49. UIButton *btnLine = [UIButton buttonWithType:UIButtonTypeCustom];
  50. [btnLine setBackgroundImage:[UIImage imageNamed:@"dash"] forState:UIControlStateNormal];
  51. btnLine.frame = CGRectMake(0 ,0 , Screen_Width, heightLine);
  52. [viewBackgroud addSubview:btnLine];
  53. //客户地址 —————————
  54. UIView *vOrderNo = [UIView new];
  55. vOrderNo.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width, heightRow);
  56. [self.contentView addSubview:vOrderNo];
  57. UILabel *lblOrderNoTitle = [UILabel new];
  58. lblOrderNoTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  59. lblOrderNoTitle.text = @"订单单号:";
  60. lblOrderNoTitle.textColor = [UIColor blackColor];
  61. lblOrderNoTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  62. [vOrderNo addSubview:lblOrderNoTitle];
  63. _lblOrderNo = [UILabel new];
  64. _lblOrderNo.frame=CGRectMake(valuex, valuey, Screen_Width-CGRectGetMaxX(lblOrderNoTitle.frame)-5, valueheight);
  65. _lblOrderNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  66. [vOrderNo addSubview:_lblOrderNo];
  67. _lblOrderNo.text = _applyListModel.orderNo;
  68. UIView *vCustomerCodeAndName = [UIView new];
  69. vCustomerCodeAndName.frame=CGRectMake(0, CGRectGetMaxY(vOrderNo.frame), Screen_Width, heightRow);
  70. [self.contentView addSubview:vCustomerCodeAndName];
  71. UIView *vCustomerCode = [UIView new];
  72. vCustomerCode.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  73. [vCustomerCodeAndName addSubview:vCustomerCode];
  74. UILabel *lblCustomerCodeTitle = [UILabel new];
  75. lblCustomerCodeTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  76. lblCustomerCodeTitle.text = @"客户编码:";
  77. lblCustomerCodeTitle.textColor = [UIColor blackColor];
  78. lblCustomerCodeTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  79. [vCustomerCode addSubview:lblCustomerCodeTitle];
  80. _lblCustomerCode = [UILabel new];
  81. _lblCustomerCode.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
  82. _lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  83. [vCustomerCode addSubview:_lblCustomerCode];
  84. _lblCustomerCode.text = _applyListModel.customerCode;
  85. UIView *vCustomerName = [UIView new];
  86. vCustomerName.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
  87. [vCustomerCodeAndName addSubview:vCustomerName];
  88. UILabel *lblCustomerNameTitle = [UILabel new];
  89. lblCustomerNameTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  90. lblCustomerNameTitle.text = @"客户名称:";
  91. lblCustomerNameTitle.textColor = [UIColor blackColor];
  92. lblCustomerNameTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  93. [vCustomerName addSubview:lblCustomerNameTitle];
  94. _lblCustomerName = [UILabel new];
  95. _lblCustomerName.frame=CGRectMake(CGRectGetMaxX(lblCustomerNameTitle.frame), valuey, Screen_Width/2 - valuex , valueheight);
  96. _lblCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  97. [vCustomerName addSubview:_lblCustomerName];
  98. _lblCustomerName.text = _applyListModel.customerName;
  99. UIView *vDate = [UIView new];
  100. vDate.frame=CGRectMake(0, CGRectGetMaxY(vCustomerCodeAndName.frame), Screen_Width, heightRow);
  101. [self.contentView addSubview:vDate];
  102. UIView *vAccountDate = [UIView new];
  103. vAccountDate.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  104. [vDate addSubview:vAccountDate];
  105. UILabel *lblAccountDateTitle = [UILabel new];
  106. lblAccountDateTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  107. lblAccountDateTitle.text = @"账务日期:";
  108. lblAccountDateTitle.textColor = [UIColor blackColor];
  109. lblAccountDateTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  110. [vAccountDate addSubview:lblAccountDateTitle];
  111. _lblAccountDate = [UILabel new];
  112. _lblAccountDate.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
  113. _lblAccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  114. [vAccountDate addSubview:_lblAccountDate];
  115. _lblAccountDate.text = _applyListModel.accountDate;
  116. UIView *vArrivalDate = [UIView new];
  117. vArrivalDate.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
  118. [vDate addSubview:vArrivalDate];
  119. UILabel *lblArrivalDateTitle = [UILabel new];
  120. lblArrivalDateTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  121. lblArrivalDateTitle.text = @"到货日期:";
  122. lblArrivalDateTitle.textColor = [UIColor blackColor];
  123. lblArrivalDateTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  124. [vArrivalDate addSubview:lblArrivalDateTitle];
  125. _lblArrivalDate = [UILabel new];
  126. _lblArrivalDate.frame=CGRectMake(CGRectGetMaxX(lblArrivalDateTitle.frame), valuey, Screen_Width/2 - valuex , valueheight);
  127. _lblArrivalDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  128. [vArrivalDate addSubview:_lblArrivalDate];
  129. _lblArrivalDate.text = _applyListModel.arrivalDate;
  130. UIView *vApply = [UIView new];
  131. vApply.frame=CGRectMake(0, CGRectGetMaxY(vDate.frame), Screen_Width, heightRow);
  132. [self.contentView addSubview:vApply];
  133. UIView *vApplyDepartment = [UIView new];
  134. vApplyDepartment.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
  135. [vApply addSubview:vApplyDepartment];
  136. UILabel *lblApplyDepartmentTitle = [UILabel new];
  137. lblApplyDepartmentTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  138. lblApplyDepartmentTitle.text = @"申请部门:";
  139. lblApplyDepartmentTitle.textColor = [UIColor blackColor];
  140. lblApplyDepartmentTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  141. [vApplyDepartment addSubview:lblApplyDepartmentTitle];
  142. _lblApplyDepartment = [UILabel new];
  143. _lblApplyDepartment.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
  144. _lblApplyDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  145. [vApplyDepartment addSubview:_lblApplyDepartment];
  146. _lblApplyDepartment.text = _applyListModel.organizationName;
  147. UIView *vApplicant = [UIView new];
  148. vApplicant.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
  149. [vApply addSubview:vApplicant];
  150. UILabel *lblApplicantTitle = [UILabel new];
  151. lblApplicantTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
  152. lblApplicantTitle.text = @"申 请 者:";
  153. lblApplicantTitle.textColor = [UIColor blackColor];
  154. lblApplicantTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  155. [vApplicant addSubview:lblApplicantTitle];
  156. _lblApplicant = [UILabel new];
  157. _lblApplicant.frame=CGRectMake(CGRectGetMaxX(lblApplicantTitle.frame), valuey, Screen_Width/2 - valuex , valueheight);
  158. _lblApplicant.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  159. [vApplicant addSubview:_lblApplicant];
  160. _lblApplicant.text = _applyListModel.applicant;
  161. //分割线
  162. viewBackgroud = [UIView new];
  163. viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vApply.frame)+8, Screen_Width,1);
  164. viewBackgroud.backgroundColor = LineBackgroundColor;
  165. [self.contentView addSubview:viewBackgroud];
  166. //按钮 —————————
  167. CGFloat btnweidth = 80;
  168. CGFloat btnmargin = 100;
  169. UIView *vEdit = [UIView new];
  170. vEdit.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width,39);
  171. [self.contentView addSubview:vEdit];
  172. _btnProcurementDetail = [UIButton buttonWithType:UIButtonTypeCustom];
  173. [_btnProcurementDetail setTitle:@"采购明细表" forState:UIControlStateNormal];
  174. [_btnProcurementDetail setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  175. [_btnProcurementDetail addTarget:self action:@selector(btnGoProcurementDetail) forControlEvents:UIControlEventTouchUpInside];
  176. _btnProcurementDetail.layer.cornerRadius = 4;
  177. _btnProcurementDetail.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
  178. _btnProcurementDetail.frame = CGRectMake(Screen_Width - btnmargin ,valuey , btnweidth, valueheight);
  179. [vEdit addSubview:_btnProcurementDetail];
  180. }
  181. -(void)btnGoCheck{
  182. }
  183. -(void)btnGoProcurementDetail
  184. {
  185. if([self.delegate respondsToSelector:@selector(goProcurementDetail:)])
  186. {
  187. [self.delegate goProcurementDetail:_position];
  188. }
  189. }
  190. @end