RepairReceiptListCell.m 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. //
  2. // RepairReceiptListCell.m
  3. // IBOSS
  4. //
  5. // Created by apple on 16/1/19.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. //功能描述:维修已回执单元格类
  9. #import "RepairReceiptListCell.h"
  10. #import "DateFormat.h"
  11. #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
  12. #define kTitleFont [UIFont systemFontOfSize:14]
  13. @implementation RepairReceiptListCell
  14. #pragma 公有函数
  15. /**
  16. 设置单元格选中样式
  17. @param selected <#selected description#>
  18. @param animated <#animated description#>
  19. */
  20. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  21. [super setSelected:selected animated:animated];
  22. }
  23. /**
  24. 初始化单元格
  25. @param style <#style description#>
  26. @param reuseIdentifier <#reuseIdentifier description#>
  27. @return <#return value description#>
  28. */
  29. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  30. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  31. if(self){
  32. self.layer.cornerRadius=CornerRadius;
  33. self.layer.backgroundColor = [UIColor clearColor].CGColor;
  34. self.layer.masksToBounds=YES;
  35. }
  36. return self;
  37. }
  38. /**
  39. 设置维修已回执frame
  40. @param frame <#frame description#>
  41. */
  42. - (void)parseInfoFrame:(RepairReceiptFrame*)frame{
  43. UILabel *receiptNoLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptNoF]];
  44. receiptNoLabelView.backgroundColor = [UIColor clearColor];
  45. receiptNoLabelView.textColor = [UIColor blackColor];
  46. receiptNoLabelView.text = @"回执单号:";
  47. receiptNoLabelView.font =kTitleFont;
  48. receiptNoLabelView.textAlignment = NSTextAlignmentLeft;
  49. [self addSubview:receiptNoLabelView];
  50. NSString *receiptNoStr = [frame.repairReceiptModel receiptNo];
  51. if(receiptNoStr != nil&& receiptNoStr.length>0){
  52. _receiptNo= [[UILabel alloc] initWithFrame:[frame receiptNoF]];
  53. _receiptNo.backgroundColor = [UIColor clearColor];
  54. _receiptNo.textColor = [UIColor blackColor];
  55. _receiptNo.textAlignment = NSTextAlignmentLeft;
  56. _receiptNo.font =kTitleFont;
  57. [self addSubview: _receiptNo];
  58. _receiptNo.text=receiptNoStr;
  59. }
  60. UIView *separator = [UIView new];
  61. separator.frame = [frame separatorF];
  62. separator.backgroundColor=LineBackgroundColor;
  63. [self addSubview:separator];
  64. UILabel *arrangementNoLabelView = [[UILabel alloc] initWithFrame:[frame lblArrangementNoF]];
  65. arrangementNoLabelView.backgroundColor = [UIColor clearColor];
  66. arrangementNoLabelView.textColor =LabelGrayTextColor;
  67. arrangementNoLabelView.text = @"安排单号:";
  68. arrangementNoLabelView.font =kTextFont;
  69. arrangementNoLabelView.textAlignment = NSTextAlignmentLeft;
  70. [self addSubview:arrangementNoLabelView];
  71. NSString *arrangementNoStr = [frame.repairReceiptModel arrangementNo];
  72. if(arrangementNoStr != nil&& arrangementNoStr.length>0){
  73. _arragementNo= [[UILabel alloc] initWithFrame:[frame arrangementNoF]];
  74. _arragementNo.backgroundColor = [UIColor clearColor];
  75. _arragementNo.textColor = [UIColor blackColor];
  76. _arragementNo.textAlignment = NSTextAlignmentLeft;
  77. _arragementNo.font =kTextFont;
  78. [self addSubview: _arragementNo];
  79. _arragementNo.text=arrangementNoStr;
  80. }
  81. UILabel *repairNoLabelView = [[UILabel alloc] initWithFrame:[frame lblRepairNoF]];
  82. repairNoLabelView.backgroundColor = [UIColor clearColor];
  83. repairNoLabelView.textColor =LabelGrayTextColor;
  84. repairNoLabelView.text = @"维修单号:";
  85. repairNoLabelView.font =kTextFont;
  86. repairNoLabelView.textAlignment = NSTextAlignmentLeft;
  87. [self addSubview:repairNoLabelView];
  88. NSString *repairNoStr = [frame.repairReceiptModel repairNo];
  89. if(repairNoStr != nil&& repairNoStr.length>0){
  90. _repairNo= [[UILabel alloc] initWithFrame:[frame repairNoF]];
  91. _repairNo.backgroundColor = [UIColor clearColor];
  92. _repairNo.textColor = [UIColor blackColor];
  93. _repairNo.textAlignment = NSTextAlignmentLeft;
  94. _repairNo.font =kTextFont;
  95. [self addSubview: _repairNo];
  96. _repairNo.text=repairNoStr;
  97. }
  98. UILabel *customerNameLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerNameF]];
  99. customerNameLabelView.backgroundColor = [UIColor clearColor];
  100. customerNameLabelView.textColor =LabelGrayTextColor;
  101. customerNameLabelView.text = @"客户名称:";
  102. customerNameLabelView.font =kTextFont;
  103. customerNameLabelView.textAlignment = NSTextAlignmentLeft;
  104. [self addSubview:customerNameLabelView];
  105. NSString *customerNameStr = [frame.repairReceiptModel customerName];
  106. if(customerNameStr != nil&& customerNameStr.length>0){
  107. _customerName= [[UILabel alloc] initWithFrame:[frame customerNameF]];
  108. _customerName.backgroundColor = [UIColor clearColor];
  109. _customerName.textColor = [UIColor blackColor];
  110. _customerName.textAlignment = NSTextAlignmentLeft;
  111. _customerName.font =kTextFont;
  112. [self addSubview: _customerName];
  113. _customerName.text=customerNameStr;
  114. }
  115. UILabel *serviceStaffLabelView = [[UILabel alloc] initWithFrame:[frame lblServiceStaffF]];
  116. serviceStaffLabelView.backgroundColor = [UIColor clearColor];
  117. serviceStaffLabelView.textColor =LabelGrayTextColor;
  118. serviceStaffLabelView.text = @"服务员工:";
  119. serviceStaffLabelView.font =kTextFont;
  120. serviceStaffLabelView.textAlignment = NSTextAlignmentLeft;
  121. [self addSubview:serviceStaffLabelView];
  122. NSString *serviceStaffNameStr = [frame.repairReceiptModel serviceStaffName];
  123. if(serviceStaffNameStr != nil&& serviceStaffNameStr.length>0){
  124. _serviceStaffName= [[UILabel alloc] initWithFrame:[frame serviceStaffF]];
  125. _serviceStaffName.backgroundColor = [UIColor clearColor];
  126. _serviceStaffName.textColor = [UIColor blackColor];
  127. _serviceStaffName.textAlignment = NSTextAlignmentLeft;
  128. _serviceStaffName.font =kTextFont;
  129. [self addSubview: _serviceStaffName];
  130. _serviceStaffName.text=serviceStaffNameStr;
  131. }
  132. UILabel *customerAddressLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerAddressF]];
  133. customerAddressLabelView.backgroundColor = [UIColor clearColor];
  134. customerAddressLabelView.textColor = LabelGrayTextColor;
  135. customerAddressLabelView.text = @"客户地址:";
  136. customerAddressLabelView.font = kTextFont;
  137. customerAddressLabelView.textAlignment = NSTextAlignmentLeft;
  138. [self addSubview: customerAddressLabelView];
  139. _customerAddress = [[UILabel alloc] initWithFrame:[frame customerAddressF]];
  140. NSString *customerAddressStr = [frame.repairReceiptModel customerAddress];
  141. if(customerAddressStr != nil && customerAddressStr.length > 0){
  142. _customerAddress.backgroundColor = [UIColor clearColor];
  143. _customerAddress.textColor = [UIColor blackColor];
  144. _customerAddress.textAlignment = NSTextAlignmentLeft;
  145. _customerAddress.font = kTextFont;
  146. [self addSubview:_customerAddress];
  147. _customerAddress.text = customerAddressStr;
  148. }
  149. UILabel *customerTelephoneLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerTelephoneF]];
  150. customerTelephoneLabelView.backgroundColor = [UIColor clearColor];
  151. customerTelephoneLabelView.textColor = LabelGrayTextColor;
  152. customerTelephoneLabelView.text = @"客户电话:";
  153. customerTelephoneLabelView.font = kTextFont;
  154. customerTelephoneLabelView.textAlignment = NSTextAlignmentLeft;
  155. [self addSubview: customerTelephoneLabelView];
  156. _customerTelephone = [[UILabel alloc] initWithFrame:[frame customerTelephoneF]];
  157. NSString *customerTelephoneStr = [frame.repairReceiptModel customerTelephone];
  158. if(customerTelephoneStr != nil && customerTelephoneStr.length > 0){
  159. _customerTelephone.backgroundColor = [UIColor clearColor];
  160. _customerTelephone.textColor = [UIColor blackColor];
  161. _customerTelephone.textAlignment = NSTextAlignmentLeft;
  162. _customerTelephone.font = kTextFont;
  163. [self addSubview:_customerTelephone];
  164. _customerTelephone.text = customerTelephoneStr;
  165. }
  166. UILabel *receiptDateLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptDateF]];
  167. receiptDateLabelView.backgroundColor = [UIColor clearColor];
  168. receiptDateLabelView.textColor =LabelGrayTextColor;
  169. receiptDateLabelView.text = @"回执日期:";
  170. receiptDateLabelView.font =kTextFont;
  171. receiptDateLabelView.textAlignment = NSTextAlignmentLeft;
  172. [self addSubview:receiptDateLabelView];
  173. NSString *receiptDateStr = [frame.repairReceiptModel receiptDate];
  174. if(receiptDateStr != nil&& receiptDateStr.length>0){
  175. receiptDateStr= [DateFormat dateFormatSplit:receiptDateStr];
  176. _receiptDate= [[UILabel alloc] initWithFrame:[frame receiptDateF]];
  177. _receiptDate.backgroundColor = [UIColor clearColor];
  178. _receiptDate.textColor = [UIColor blackColor];
  179. _receiptDate.textAlignment = NSTextAlignmentLeft;
  180. _receiptDate.font =kTextFont;
  181. [self addSubview: _receiptDate];
  182. _receiptDate.text=receiptDateStr;
  183. }
  184. UILabel *receiptStatusLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptStatusF]];
  185. receiptStatusLabelView.backgroundColor = [UIColor clearColor];
  186. receiptStatusLabelView.textColor =LabelGrayTextColor;
  187. receiptStatusLabelView.text = @"回执状态:";
  188. receiptStatusLabelView.font =kTextFont;
  189. receiptStatusLabelView.textAlignment = NSTextAlignmentLeft;
  190. [self addSubview:receiptStatusLabelView];
  191. NSString *recReceiptType = [frame.repairReceiptModel recReceiptType];
  192. if ([recReceiptType isEqualToString:@"1"]) {
  193. recReceiptType = @"完成";
  194. }
  195. if ([recReceiptType isEqualToString:@"0"]) {
  196. recReceiptType = @"再安排";
  197. }
  198. if(recReceiptType != nil&& recReceiptType.length>0){
  199. _receiptType= [[UILabel alloc] initWithFrame:[frame receiptStatusF]];
  200. _receiptType.backgroundColor = [UIColor clearColor];
  201. _receiptType.textColor = [UIColor blackColor];
  202. _receiptType.textAlignment = NSTextAlignmentLeft;
  203. _receiptType.font =kTextFont;
  204. [self addSubview: _receiptType];
  205. _receiptType.text=recReceiptType;
  206. }
  207. }
  208. @end