| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- //
- // RequirementReceiptCell.m
- // IBOSSHSH
- //
- // Created by ssl on 2018/1/12.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "DispatchReceiptCell.h"
- #import "DateFormat.h"
- #import "UIColor+hexColor.h"
- #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
- #define kTitleFont [UIFont systemFontOfSize:14]
- @implementation DispatchReceiptCell
- #pragma mark - 公共函数
- /**
- 初始化tableview cell
- @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;
- }
- /**
- 点击效果
-
- @param selected
- @param animated
- */
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
-
- }
- #pragma mark - 私有函数
- /**
- 设置已回执cell
- @param frame <#frame description#>
- */
- - (void)setReceiptedListFrame:(DispatchReceiptFrame *)frame{
- _deliveryListModel = frame.deliveryListModel;
- UILabel *receiptNoLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptNoF]];
- receiptNoLabelView.backgroundColor = [UIColor clearColor];
- receiptNoLabelView.textColor = [UIColor blackColor];
- receiptNoLabelView.text = @"回执单号:";
- receiptNoLabelView.textAlignment = NSTextAlignmentLeft;
- receiptNoLabelView.font = kTitleFont;
- [self.contentView addSubview: receiptNoLabelView];
- NSString *receiptNoStr = [_deliveryListModel recReceiptNo];
- 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.contentView addSubview: _receiptNo];
- _receiptNo.text = receiptNoStr;
- }
-
- _btnDialTelephone=[UIButton buttonWithType:UIButtonTypeCustom];
- _btnDialTelephone.frame=[frame btnDialTelephoneF];
- [self.contentView addSubview:_btnDialTelephone];
- [_btnDialTelephone addTarget:self action:@selector(dialTelephone) forControlEvents:UIControlEventTouchUpInside];
- UIImageView *telephoneImg = [[UIImageView alloc]init];
- telephoneImg.frame=CGRectMake(0,0,32,32);
- [telephoneImg setImage:[UIImage imageNamed:@"dial_telephone"]];
- telephoneImg.userInteractionEnabled=NO;
- [_btnDialTelephone addSubview:telephoneImg];
-
-
- UIView *separator = [UIView new];
- separator.frame = [frame separatorF];
- separator.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:separator];
-
-
-
- UILabel *dispatchNoLabelView = [[UILabel alloc] initWithFrame:[frame lblDispatchNoF]];
- dispatchNoLabelView.textColor = LabelGrayTextColor;
- dispatchNoLabelView.text = @"派工单号:";
- dispatchNoLabelView.font = kTextFont;
- dispatchNoLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: dispatchNoLabelView];
- NSString *dispatchNoStr = [_deliveryListModel arrangementNo];
- if(dispatchNoStr != nil&&dispatchNoStr.length>0){
- _lblDispatchNo= [[UILabel alloc] initWithFrame:[frame dispatchNoF]];
- _lblDispatchNo.backgroundColor = [UIColor clearColor];
- _lblDispatchNo.textColor = [UIColor blackColor];
- _lblDispatchNo.textAlignment = NSTextAlignmentLeft;
- _lblDispatchNo.font = kTextFont;
- [self.contentView addSubview:_lblDispatchNo];
- _lblDispatchNo.text = dispatchNoStr;
- }
-
- UILabel *customerNameLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerNameF]];
- customerNameLabelView.backgroundColor = [UIColor clearColor];
- customerNameLabelView.textColor = LabelGrayTextColor;
- customerNameLabelView.text = @"客户名称:";
- customerNameLabelView.font = kTextFont;
- customerNameLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: customerNameLabelView];
- _customerName = [[UILabel alloc] initWithFrame:[frame customerNameF]];
- NSString *customerNameStr = [_deliveryListModel customerName];
- if(customerNameStr != nil && customerNameStr.length > 0){
- _customerName.backgroundColor = [UIColor clearColor];
- _customerName.textColor = [UIColor blackColor];
- _customerName.textAlignment = NSTextAlignmentLeft;
- _customerName.font = kTextFont;
- [self.contentView addSubview:_customerName];
- _customerName.text = customerNameStr;
- }
-
- UILabel *telephoneLabelView = [[UILabel alloc] initWithFrame:[frame lblTelephoneF]];
- telephoneLabelView.backgroundColor = [UIColor clearColor];
- telephoneLabelView.textColor = LabelGrayTextColor;
- telephoneLabelView.text = @"联系电话:";
- telephoneLabelView.font = kTextFont;
- telephoneLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: telephoneLabelView];
- _telephone = [[UILabel alloc] initWithFrame:[frame telephoneF]];
- _telephoneStr = [_deliveryListModel telephone];
- if(_telephoneStr != nil && _telephoneStr.length > 0){
- _telephone.backgroundColor = [UIColor clearColor];
- _telephone.textColor = [UIColor blackColor];
- _telephone.textAlignment = NSTextAlignmentLeft;
- _telephone.font = kTextFont;
- [self.contentView addSubview:_telephone];
- _telephone.text = _telephoneStr;
- }
-
-
- UILabel *serviceStaffNameLabelView = [[UILabel alloc] initWithFrame:[frame lblServiceStaffNameF]];
- serviceStaffNameLabelView.backgroundColor = [UIColor clearColor];
- serviceStaffNameLabelView.textColor = LabelGrayTextColor;
- serviceStaffNameLabelView.text = @"服务人员:";
- serviceStaffNameLabelView.font = kTextFont;
- serviceStaffNameLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: serviceStaffNameLabelView];
- _serviceStaffName = [[UILabel alloc] initWithFrame:[frame serviceStaffNameF]];
- NSString *serviceStaffNameStr = [_deliveryListModel serviceStaffName];
- if(serviceStaffNameStr != nil && serviceStaffNameStr.length > 0){
- _serviceStaffName.backgroundColor = [UIColor clearColor];
- _serviceStaffName.textColor = [UIColor blackColor];
- _serviceStaffName.textAlignment = NSTextAlignmentLeft;
- _serviceStaffName.font = kTextFont;
- [self.contentView addSubview:_serviceStaffName];
- _serviceStaffName.text = serviceStaffNameStr;
- }
-
- UILabel *receiptDateLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptDateF]];
- receiptDateLabelView.backgroundColor = [UIColor clearColor];
- receiptDateLabelView.textColor = LabelGrayTextColor;
- receiptDateLabelView.text = @"回执日期:";
- receiptDateLabelView.font = kTextFont;
- receiptDateLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview:receiptDateLabelView];
-
- NSString *receiptDateStr = [_deliveryListModel receiptTime];
- receiptDateStr = [DateFormat dateFormatSplit:receiptDateStr];
- if(receiptDateStr != nil&&receiptDateStr.length > 0){
- _receiptDate = [[UILabel alloc] initWithFrame:[frame receiptDateF]];
- _receiptDate.backgroundColor = [UIColor clearColor];
- _receiptDate.textColor = [UIColor blackColor];
- _receiptDate.textAlignment = NSTextAlignmentLeft;
- _receiptDate.font = kTextFont;
- [self.contentView addSubview:_receiptDate];
- _receiptDate.text = receiptDateStr;
- }
-
-
- UILabel *receiptTypeLabelView = [[UILabel alloc] initWithFrame:[frame lblReceiptTypeTitleF]];
- receiptTypeLabelView.backgroundColor = [UIColor clearColor];
- receiptTypeLabelView.textColor = LabelGrayTextColor;
- receiptTypeLabelView.text = @"回执类型:";
- receiptTypeLabelView.font = kTextFont;
- receiptTypeLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview:receiptTypeLabelView];
-
- NSString *receiptTypeStr;
- if(_deliveryListModel.receiptType==1){
- receiptTypeStr = @"撤销回执";
- }else{
- receiptTypeStr = @"回执";
- }
-
- if(receiptTypeStr != nil&&receiptTypeStr.length > 0){
- _lblReceiptType = [[UILabel alloc] initWithFrame:[frame receiptTypeF]];
- _lblReceiptType.backgroundColor = [UIColor clearColor];
- _lblReceiptType.textColor = [UIColor blackColor];
- _lblReceiptType.textAlignment = NSTextAlignmentLeft;
- _lblReceiptType.font = kTextFont;
- [self.contentView addSubview:_lblReceiptType];
- _lblReceiptType.text = receiptTypeStr;
- }
-
-
-
- UILabel *lblDeliveryFlagTitle= [[UILabel alloc] initWithFrame:[frame deliveryFlagTitleF]];
- lblDeliveryFlagTitle.backgroundColor = [UIColor clearColor];
- lblDeliveryFlagTitle.textColor = LabelGrayTextColor;
- lblDeliveryFlagTitle.text = @"送货回执标识:";
- lblDeliveryFlagTitle.font =kTextFont;
- lblDeliveryFlagTitle.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblDeliveryFlagTitle];
-
- NSString *deliveryFlag = [_deliveryListModel deliveryReceiptFlag];
- NSString *deliveryFlagStr;
- if([deliveryFlag intValue]==0)
- {
- deliveryFlagStr=@"否";
- }
- else{
- deliveryFlagStr=@"是";
- }
-
- UILabel *lblDeliveryFlag= [[UILabel alloc] initWithFrame:[frame deliveryFlagF]];
- lblDeliveryFlag.backgroundColor = [UIColor clearColor];
- lblDeliveryFlag.textColor = [UIColor blackColor]; ;
- lblDeliveryFlag.text =deliveryFlagStr;
- lblDeliveryFlag.font =kTextFont;
- lblDeliveryFlag.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblDeliveryFlag];
-
-
-
- UILabel *lblInstallFlagTitle= [[UILabel alloc] initWithFrame:[frame installFlagTitleF]];
- lblInstallFlagTitle.backgroundColor = [UIColor clearColor];
- lblInstallFlagTitle.textColor = LabelGrayTextColor;
- lblInstallFlagTitle.text = @"安装回执标识:";
- lblInstallFlagTitle.font =kTextFont;
- lblInstallFlagTitle.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblInstallFlagTitle];
-
- NSString *installFlag = [_deliveryListModel installReceiptFlag];
- NSString *installFlagStr;
- if([installFlag intValue]==0)
- {
- installFlagStr=@"否";
- }
- else{
- installFlagStr=@"是";
- }
-
- UILabel *lblInstallFlag= [[UILabel alloc] initWithFrame:[frame installFlagF]];
- lblInstallFlag.backgroundColor = [UIColor clearColor];
- lblInstallFlag.textColor = [UIColor blackColor]; ;
- lblInstallFlag.text =installFlagStr;
- lblInstallFlag.font =kTextFont;
- lblInstallFlag.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblInstallFlag];
-
-
-
- // UIView *bottomLine = [[UIView alloc] init];
- // bottomLine.backgroundColor = LineBackgroundColor;
- // bottomLine.frame =[frame bottomLineF];
- // [self.contentView addSubview:bottomLine];
- //
- // UIButton *btnReturnReceipt = [UIButton buttonWithType:UIButtonTypeCustom];
- // //btnReturnReceipt.titleLabel.text = @"撤销";
- // [btnReturnReceipt setTitle:@"撤销" forState: UIControlStateNormal];
- // btnReturnReceipt.titleLabel.font=[UIFont systemFontOfSize:14];
- // if(_deliveryListModel.receiptType==1){
- //
- // [btnReturnReceipt setBackgroundColor:[UIColor hexColor:@"EBEBEB"]];
- //
- // }else{
- // [btnReturnReceipt setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- // }
- // [btnReturnReceipt.layer setCornerRadius:5];
- // btnReturnReceipt.frame = [frame returnReceiptF];
- // [self.contentView addSubview:btnReturnReceipt];
- // if(_deliveryListModel.receiptType!=1){
- // [btnReturnReceipt addTarget:self action:@selector(showReturnReceipt) forControlEvents:UIControlEventTouchUpInside];
- // }
- }
- -(void)dialTelephone{
- if(_telephoneStr!=nil&&_telephoneStr.length>0)
- if([self.telephoneDelegate respondsToSelector:@selector(dialTelephone:)])
- {
- [self.telephoneDelegate dialTelephone:_telephoneStr];
- }
- }
- /**
- 撤销回执
- */
- - (void)showReturnReceipt{
- [_delegate showReturnReceipt:_deliveryListModel];
- }
- @end
|