| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- //
- // RepairReceiptListCell.m
- // IBOSS
- //
- // Created by apple on 16/1/19.
- // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
- //
- //功能描述:维修已回执单元格类
- #import "RepairReceiptListCell.h"
- #import "DateFormat.h"
- #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
- #define kTitleFont [UIFont systemFontOfSize:14]
- @implementation RepairReceiptListCell
- #pragma 公有函数
- /**
- 设置单元格选中样式
- @param selected <#selected description#>
- @param animated <#animated description#>
- */
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- }
- /**
- 初始化单元格
- @param style <#style description#>
- @param reuseIdentifier <#reuseIdentifier description#>
- @return <#return value description#>
- */
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if(self){
- self.layer.cornerRadius=CornerRadius;
- self.layer.backgroundColor = [UIColor clearColor].CGColor;
- self.layer.masksToBounds=YES;
- }
- return self;
- }
- /**
- 设置维修已回执frame
- @param frame <#frame description#>
- */
- - (void)parseInfoFrame:(RepairReceiptFrame*)frame{
- UILabel *receiptNoLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptNoF]];
- receiptNoLabelView.backgroundColor = [UIColor clearColor];
- receiptNoLabelView.textColor = [UIColor blackColor];
- receiptNoLabelView.text = @"回执单号:";
- receiptNoLabelView.font =kTitleFont;
- receiptNoLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview:receiptNoLabelView];
- NSString *receiptNoStr = [frame.repairReceiptModel receiptNo];
- if(receiptNoStr != nil&& receiptNoStr.length>0){
- _receiptNo= [[UILabel alloc] initWithFrame:[frame receiptNoF]];
- _receiptNo.backgroundColor = [UIColor clearColor];
- _receiptNo.textColor = [UIColor blackColor];
- _receiptNo.textAlignment = NSTextAlignmentLeft;
- _receiptNo.font =kTitleFont;
- [self addSubview: _receiptNo];
- _receiptNo.text=receiptNoStr;
- }
- UIView *separator = [UIView new];
- separator.frame = [frame separatorF];
- separator.backgroundColor=LineBackgroundColor;
- [self addSubview:separator];
- UILabel *arrangementNoLabelView = [[UILabel alloc] initWithFrame:[frame lblArrangementNoF]];
- arrangementNoLabelView.backgroundColor = [UIColor clearColor];
- arrangementNoLabelView.textColor =LabelGrayTextColor;
- arrangementNoLabelView.text = @"安排单号:";
- arrangementNoLabelView.font =kTextFont;
- arrangementNoLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview:arrangementNoLabelView];
- NSString *arrangementNoStr = [frame.repairReceiptModel arrangementNo];
- if(arrangementNoStr != nil&& arrangementNoStr.length>0){
- _arragementNo= [[UILabel alloc] initWithFrame:[frame arrangementNoF]];
- _arragementNo.backgroundColor = [UIColor clearColor];
- _arragementNo.textColor = [UIColor blackColor];
- _arragementNo.textAlignment = NSTextAlignmentLeft;
- _arragementNo.font =kTextFont;
- [self addSubview: _arragementNo];
- _arragementNo.text=arrangementNoStr;
- }
-
- UILabel *repairNoLabelView = [[UILabel alloc] initWithFrame:[frame lblRepairNoF]];
- repairNoLabelView.backgroundColor = [UIColor clearColor];
- repairNoLabelView.textColor =LabelGrayTextColor;
- repairNoLabelView.text = @"维修单号:";
- repairNoLabelView.font =kTextFont;
- repairNoLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview:repairNoLabelView];
- NSString *repairNoStr = [frame.repairReceiptModel repairNo];
- if(repairNoStr != nil&& repairNoStr.length>0){
- _repairNo= [[UILabel alloc] initWithFrame:[frame repairNoF]];
- _repairNo.backgroundColor = [UIColor clearColor];
- _repairNo.textColor = [UIColor blackColor];
- _repairNo.textAlignment = NSTextAlignmentLeft;
- _repairNo.font =kTextFont;
- [self addSubview: _repairNo];
- _repairNo.text=repairNoStr;
- }
-
- UILabel *customerNameLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerNameF]];
- customerNameLabelView.backgroundColor = [UIColor clearColor];
- customerNameLabelView.textColor =LabelGrayTextColor;
- customerNameLabelView.text = @"客户名称:";
- customerNameLabelView.font =kTextFont;
- customerNameLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview:customerNameLabelView];
- NSString *customerNameStr = [frame.repairReceiptModel customerName];
- if(customerNameStr != nil&& customerNameStr.length>0){
- _customerName= [[UILabel alloc] initWithFrame:[frame customerNameF]];
- _customerName.backgroundColor = [UIColor clearColor];
- _customerName.textColor = [UIColor blackColor];
- _customerName.textAlignment = NSTextAlignmentLeft;
- _customerName.font =kTextFont;
- [self addSubview: _customerName];
- _customerName.text=customerNameStr;
- }
- UILabel *serviceStaffLabelView = [[UILabel alloc] initWithFrame:[frame lblServiceStaffF]];
- serviceStaffLabelView.backgroundColor = [UIColor clearColor];
- serviceStaffLabelView.textColor =LabelGrayTextColor;
- serviceStaffLabelView.text = @"服务员工:";
- serviceStaffLabelView.font =kTextFont;
- serviceStaffLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview:serviceStaffLabelView];
- NSString *serviceStaffNameStr = [frame.repairReceiptModel serviceStaffName];
- if(serviceStaffNameStr != nil&& serviceStaffNameStr.length>0){
- _serviceStaffName= [[UILabel alloc] initWithFrame:[frame serviceStaffF]];
- _serviceStaffName.backgroundColor = [UIColor clearColor];
- _serviceStaffName.textColor = [UIColor blackColor];
- _serviceStaffName.textAlignment = NSTextAlignmentLeft;
- _serviceStaffName.font =kTextFont;
- [self addSubview: _serviceStaffName];
- _serviceStaffName.text=serviceStaffNameStr;
- }
-
-
-
- UILabel *customerAddressLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerAddressF]];
- customerAddressLabelView.backgroundColor = [UIColor clearColor];
- customerAddressLabelView.textColor = LabelGrayTextColor;
- customerAddressLabelView.text = @"客户地址:";
- customerAddressLabelView.font = kTextFont;
- customerAddressLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview: customerAddressLabelView];
- _customerAddress = [[UILabel alloc] initWithFrame:[frame customerAddressF]];
- NSString *customerAddressStr = [frame.repairReceiptModel customerAddress];
- if(customerAddressStr != nil && customerAddressStr.length > 0){
- _customerAddress.backgroundColor = [UIColor clearColor];
- _customerAddress.textColor = [UIColor blackColor];
- _customerAddress.textAlignment = NSTextAlignmentLeft;
- _customerAddress.font = kTextFont;
- [self addSubview:_customerAddress];
- _customerAddress.text = customerAddressStr;
- }
-
- UILabel *customerTelephoneLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerTelephoneF]];
- customerTelephoneLabelView.backgroundColor = [UIColor clearColor];
- customerTelephoneLabelView.textColor = LabelGrayTextColor;
- customerTelephoneLabelView.text = @"客户电话:";
- customerTelephoneLabelView.font = kTextFont;
- customerTelephoneLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview: customerTelephoneLabelView];
- _customerTelephone = [[UILabel alloc] initWithFrame:[frame customerTelephoneF]];
- NSString *customerTelephoneStr = [frame.repairReceiptModel customerTelephone];
- if(customerTelephoneStr != nil && customerTelephoneStr.length > 0){
- _customerTelephone.backgroundColor = [UIColor clearColor];
- _customerTelephone.textColor = [UIColor blackColor];
- _customerTelephone.textAlignment = NSTextAlignmentLeft;
- _customerTelephone.font = kTextFont;
- [self addSubview:_customerTelephone];
- _customerTelephone.text = customerTelephoneStr;
- }
-
- UILabel *receiptDateLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptDateF]];
- receiptDateLabelView.backgroundColor = [UIColor clearColor];
- receiptDateLabelView.textColor =LabelGrayTextColor;
- receiptDateLabelView.text = @"回执日期:";
- receiptDateLabelView.font =kTextFont;
- receiptDateLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview:receiptDateLabelView];
- NSString *receiptDateStr = [frame.repairReceiptModel receiptDate];
- if(receiptDateStr != nil&& receiptDateStr.length>0){
- receiptDateStr= [DateFormat dateFormatSplit:receiptDateStr];
- _receiptDate= [[UILabel alloc] initWithFrame:[frame receiptDateF]];
- _receiptDate.backgroundColor = [UIColor clearColor];
- _receiptDate.textColor = [UIColor blackColor];
- _receiptDate.textAlignment = NSTextAlignmentLeft;
- _receiptDate.font =kTextFont;
- [self addSubview: _receiptDate];
- _receiptDate.text=receiptDateStr;
- }
-
- UILabel *receiptStatusLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptStatusF]];
- receiptStatusLabelView.backgroundColor = [UIColor clearColor];
- receiptStatusLabelView.textColor =LabelGrayTextColor;
- receiptStatusLabelView.text = @"回执状态:";
- receiptStatusLabelView.font =kTextFont;
- receiptStatusLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview:receiptStatusLabelView];
- NSString *recReceiptType = [frame.repairReceiptModel recReceiptType];
- if ([recReceiptType isEqualToString:@"1"]) {
- recReceiptType = @"完成";
- }
- if ([recReceiptType isEqualToString:@"0"]) {
- recReceiptType = @"再安排";
- }
- if(recReceiptType != nil&& recReceiptType.length>0){
- _receiptType= [[UILabel alloc] initWithFrame:[frame receiptStatusF]];
- _receiptType.backgroundColor = [UIColor clearColor];
- _receiptType.textColor = [UIColor blackColor];
- _receiptType.textAlignment = NSTextAlignmentLeft;
- _receiptType.font =kTextFont;
- [self addSubview: _receiptType];
- _receiptType.text=recReceiptType;
- }
-
- }
- @end
|