RepairUnReceiptCell.m 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. //
  2. // RepairUnReceiptCell.m
  3. // IBOSS
  4. //
  5. // Created by guan hong hou on 16/4/15.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. //功能描述:维修未回执单元格类
  9. #import "RepairUnReceiptCell.h"
  10. #import "DateFormat.h"
  11. #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
  12. #define kTitleFont [UIFont systemFontOfSize:14]
  13. @implementation RepairUnReceiptCell
  14. #pragma 公有函数
  15. /**
  16. 初始化单元格
  17. @param style <#style description#>
  18. @param reuseIdentifier <#reuseIdentifier description#>
  19. @return <#return value description#>
  20. */
  21. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  22. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  23. if(self){
  24. self.layer.cornerRadius=CornerRadius;
  25. self.layer.backgroundColor = [UIColor clearColor].CGColor;
  26. self.layer.masksToBounds=YES;
  27. }
  28. return self;
  29. }
  30. /**
  31. 设置单元格选中
  32. @param selected <#selected description#>
  33. @param animated <#animated description#>
  34. */
  35. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  36. [super setSelected:selected animated:animated];
  37. }
  38. #pragma 私有函数
  39. /**
  40. 设置维修未回执frame
  41. @param frame <#frame description#>
  42. */
  43. - (void)setUnRepairInfoFrame:(RepairUnReceiptFrame *)frame{
  44. UILabel *repairNoLabelView = [[UILabel alloc] initWithFrame:[frame lblRepairNoF]];
  45. repairNoLabelView.backgroundColor = [UIColor clearColor];
  46. repairNoLabelView.textColor = [UIColor blackColor];
  47. repairNoLabelView.text = @"维修单号:";
  48. repairNoLabelView.font =kTitleFont;
  49. repairNoLabelView.textAlignment = NSTextAlignmentLeft;
  50. [self addSubview:repairNoLabelView];
  51. NSString *repairNo = [frame.unRepairModel repairNo];
  52. if(repairNo != nil&& repairNo.length>0){
  53. _repairNo= [[UILabel alloc] initWithFrame:[frame repairNoF]];
  54. _repairNo.backgroundColor = [UIColor clearColor];
  55. _repairNo.textColor = [UIColor blackColor];
  56. _repairNo.textAlignment = NSTextAlignmentLeft;
  57. _repairNo.font =kTitleFont;
  58. [self addSubview: _repairNo];
  59. _repairNo.text=repairNo;
  60. }
  61. UIView *separator = [UIView new];
  62. separator.frame = [frame separatorF];
  63. separator.backgroundColor=LineBackgroundColor;
  64. [self addSubview:separator];
  65. UILabel *arrangementNoLabelView = [[UILabel alloc] initWithFrame:[frame lblArrangementNoF]];
  66. arrangementNoLabelView.backgroundColor = [UIColor clearColor];
  67. arrangementNoLabelView.textColor =LabelGrayTextColor;
  68. arrangementNoLabelView.text = @"安排单号:";
  69. arrangementNoLabelView.textAlignment = NSTextAlignmentLeft;
  70. arrangementNoLabelView.font =kTextFont;
  71. [self addSubview: arrangementNoLabelView];
  72. NSString *arrangementNo = [frame.unRepairModel arrangementNo];
  73. if(arrangementNo != nil&&arrangementNo.length>0){
  74. _arrangementNo = [[UILabel alloc] initWithFrame:[frame arrangementNoF]];
  75. _arrangementNo.backgroundColor = [UIColor clearColor];
  76. _arrangementNo.textColor = [UIColor blackColor];
  77. _arrangementNo.textAlignment = NSTextAlignmentLeft;
  78. _arrangementNo.font =kTextFont;
  79. [self addSubview: _arrangementNo];
  80. _arrangementNo.text=arrangementNo;
  81. }
  82. UILabel *lblcustomerName = [[UILabel alloc] initWithFrame:[frame lblCustomerNameF]];
  83. lblcustomerName.backgroundColor = [UIColor clearColor];
  84. lblcustomerName.textColor = [UIColor blackColor];
  85. lblcustomerName.text = @"客户名称:";
  86. lblcustomerName.textColor=LabelGrayTextColor;
  87. lblcustomerName.textAlignment = NSTextAlignmentLeft;
  88. lblcustomerName.font =kTextFont;
  89. [self addSubview:lblcustomerName];
  90. NSString *customerName = [frame.unRepairModel customerName];
  91. if(customerName != nil||customerName.length>0){
  92. _customerName = [[UILabel alloc] initWithFrame:[frame customerNameF]];
  93. _customerName.backgroundColor = [UIColor clearColor];
  94. _customerName.textColor = [UIColor blackColor];
  95. _customerName.textAlignment = NSTextAlignmentLeft;
  96. _customerName.font =kTextFont;
  97. [self addSubview:_customerName];
  98. NSString *customerName = [frame.unRepairModel customerName];
  99. _customerName.text=customerName;
  100. }
  101. UILabel *lblCustomerTelephone= [[UILabel alloc] initWithFrame:[frame lblCustomerTelephoneF]];
  102. lblCustomerTelephone.backgroundColor = [UIColor clearColor];
  103. lblCustomerTelephone.textColor = LabelGrayTextColor;
  104. lblCustomerTelephone.text = @"客户电话:";
  105. lblCustomerTelephone.textAlignment = NSTextAlignmentLeft;
  106. lblCustomerTelephone.font =kTextFont;
  107. [self addSubview:lblCustomerTelephone];
  108. NSString *customerTelephone = [frame.unRepairModel telephone];
  109. if(customerTelephone != nil&&customerTelephone.length>0){
  110. _telephone = [[UILabel alloc] initWithFrame:[frame customerTelephoneF]];
  111. _telephone.backgroundColor = [UIColor clearColor];
  112. _telephone.textColor = [UIColor blackColor];
  113. _telephone.textAlignment = NSTextAlignmentLeft;
  114. _telephone.font =kTextFont;
  115. [self addSubview:_telephone];
  116. _telephone.text=customerTelephone;
  117. }
  118. UILabel *repairDateLabelView = [[UILabel alloc] initWithFrame:[frame lblRepairDateF]];
  119. repairDateLabelView.backgroundColor = [UIColor clearColor];
  120. repairDateLabelView.textColor = LabelGrayTextColor;
  121. repairDateLabelView.text = @"维修日期:";
  122. repairDateLabelView.font =kTextFont;
  123. repairDateLabelView.textAlignment = NSTextAlignmentLeft;
  124. [self addSubview:repairDateLabelView];
  125. NSString *repairDate= [frame.unRepairModel repairDate];
  126. if(repairDate != nil&& repairDate.length>0){
  127. NSString *repairTime = [DateFormat dateFormatSplit:repairDate];
  128. _repairDate= [[UILabel alloc] initWithFrame:[frame repairDateF]];
  129. _repairDate.backgroundColor = [UIColor clearColor];
  130. _repairDate.textColor = [UIColor blackColor];
  131. _repairDate.textAlignment = NSTextAlignmentLeft;
  132. _repairDate.font =kTextFont;
  133. [self addSubview:_repairDate];
  134. _repairDate.text=repairTime;
  135. }
  136. UILabel *lblCustomerAddress= [[UILabel alloc] initWithFrame:[frame lblCustomerAddressF]];
  137. lblCustomerAddress.backgroundColor = [UIColor clearColor];
  138. lblCustomerAddress.textColor =LabelGrayTextColor;
  139. lblCustomerAddress.text = @"客户地址:";
  140. lblCustomerAddress.font =kTextFont;
  141. lblCustomerAddress.textAlignment = NSTextAlignmentLeft;
  142. [self addSubview: lblCustomerAddress];
  143. NSString *customerAddressStr = [frame.unRepairModel customerAddress];
  144. if(customerAddressStr != nil&&customerAddressStr.length>0){
  145. _customerAddress = [[UILabel alloc] initWithFrame:[frame customerAddressF]];
  146. _customerAddress.backgroundColor = [UIColor clearColor];
  147. _customerAddress.textColor = [UIColor blackColor];
  148. _customerAddress.textAlignment = NSTextAlignmentLeft;
  149. _customerAddress.numberOfLines=0;
  150. _customerAddress.font =kTextFont;
  151. [self addSubview:_customerAddress];
  152. NSString *customerAddress = [frame.unRepairModel customerAddress];
  153. _customerAddress.text=customerAddress;
  154. }
  155. NSString *organizationName=[frame.unRepairModel organizationName];
  156. NSString *staffName=[frame.unRepairModel staffName];
  157. if((organizationName!=nil&&organizationName.length>0)){
  158. UILabel *lblTitleOrganization= [[UILabel alloc] initWithFrame:[frame lblOrganizationNameF]];
  159. lblTitleOrganization.backgroundColor = [UIColor clearColor];
  160. lblTitleOrganization.textColor = LabelGrayTextColor;
  161. lblTitleOrganization.text = @"业务部门:";
  162. lblTitleOrganization.font =kTextFont;
  163. lblTitleOrganization.textAlignment = NSTextAlignmentLeft;
  164. [self addSubview: lblTitleOrganization];
  165. _lblDepartment = [[UILabel alloc] initWithFrame:[frame organizationNameF]];
  166. _lblDepartment.backgroundColor = [UIColor clearColor];
  167. _lblDepartment.textColor = [UIColor blackColor];
  168. _lblDepartment.textAlignment = NSTextAlignmentLeft;
  169. _lblDepartment.numberOfLines=0;
  170. _lblDepartment.font =kTextFont;
  171. [self addSubview:_lblDepartment];
  172. _lblDepartment.text=organizationName;
  173. if(staffName!=nil&&staffName.length>0){
  174. UILabel *lblTitleStaff= [[UILabel alloc] initWithFrame:[frame lblStaffNameF]];
  175. lblTitleStaff.backgroundColor = [UIColor clearColor];
  176. lblTitleStaff.textColor = LabelGrayTextColor;
  177. lblTitleStaff.text = @"业 务 员:";
  178. lblTitleStaff.font =kTextFont;
  179. lblTitleStaff.textAlignment = NSTextAlignmentLeft;
  180. [self addSubview: lblTitleStaff];
  181. _lblStaff = [[UILabel alloc] initWithFrame:[frame staffNameF]];
  182. _lblStaff.backgroundColor = [UIColor clearColor];
  183. _lblStaff.textColor = [UIColor blackColor];
  184. _lblStaff.textAlignment = NSTextAlignmentLeft;
  185. _lblStaff.numberOfLines=0;
  186. _lblStaff.font =kTextFont;
  187. [self addSubview:_lblStaff];
  188. _lblStaff.text=staffName;
  189. }
  190. }
  191. }
  192. @end