| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- //
- // UnReceiptListCell.m
- // IBOSS
- //
- // Created by guan hong hou on 16/4/14.
- // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
- //
- // 功能描述:配送未回执列表单元格
- #import "UnReceiptListCell.h"
- #import "DateFormat.h"
- #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
- #define kTitleFont [UIFont systemFontOfSize:14]
- @interface UnReceiptListCell(){
-
- }
- @end
- @implementation UnReceiptListCell
- #pragma mark - 公共函数
- /**
- 初始化单元格
- @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 <#selected description#>
- @param animated <#animated description#>
- */
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
-
- }
- /**
- 设置未回执frame
- @param frame <#frame description#>
- */
- - (void)setUnReceiptListFrame:(UnReceiptListFrame *)frame{
- UILabel *deliveryNoLabelView = [[UILabel alloc] initWithFrame:[frame lblDeliveryNoF]];
- deliveryNoLabelView.backgroundColor = [UIColor clearColor];
- deliveryNoLabelView.textColor = [UIColor blackColor];
- deliveryNoLabelView.text = @"送货单号:";
- deliveryNoLabelView.textAlignment = NSTextAlignmentLeft;
- deliveryNoLabelView.font = kTitleFont;
- [self.contentView addSubview: deliveryNoLabelView];
- NSString *deliveryNoStr = [frame.unReceiptListModel deliveryNo];
- if(deliveryNoStr != nil&&deliveryNoStr.length>0){
- _deliveryNo = [[UILabel alloc] initWithFrame:[frame deliveryNoF]];
- _deliveryNo.backgroundColor = [UIColor clearColor];
- _deliveryNo.textColor = [UIColor blackColor];
- _deliveryNo.textAlignment = NSTextAlignmentLeft;
- _deliveryNo.font = kTitleFont;
- [self.contentView addSubview: _deliveryNo];
- _deliveryNo.text=deliveryNoStr;
- }
- _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 *arrangementNoLabelView = [[UILabel alloc] initWithFrame:[frame lblArrangementNoF]];
- arrangementNoLabelView.textColor = LabelGrayTextColor;
- arrangementNoLabelView.text = @"安排单号:";
- arrangementNoLabelView.font =kTextFont;
- arrangementNoLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: arrangementNoLabelView];
- NSString *arrangmentNoStr = [frame.unReceiptListModel arrangementNo];
- if(arrangmentNoStr != nil&&arrangmentNoStr.length>0){
- _arrangementNo= [[UILabel alloc] initWithFrame:[frame arrangementNoF]];
- _arrangementNo.backgroundColor = [UIColor clearColor];
- _arrangementNo.textColor = [UIColor blackColor];
- _arrangementNo.textAlignment = NSTextAlignmentLeft;
- _arrangementNo.font =kTextFont;
- [self.contentView addSubview:_arrangementNo];
- _arrangementNo.text=arrangmentNoStr;
- }
- 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 = [frame.unReceiptListModel 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 lblCustomerTelephoneF]];
- telephoneLabelView.backgroundColor = [UIColor clearColor];
- telephoneLabelView.textColor =LabelGrayTextColor;
- telephoneLabelView.text = @"客户电话:";
- telephoneLabelView.font =kTextFont;
- telephoneLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview:telephoneLabelView];
-
- NSString *telephoneStr= [frame.unReceiptListModel telephone];
- _telephoneNumber=telephoneStr;
- if(telephoneStr != nil&&telephoneStr.length>0){
- _telephone= [[UILabel alloc] initWithFrame:[frame customerTelephoneF]];
- _telephone.backgroundColor = [UIColor clearColor];
- _telephone.textColor = [UIColor blackColor];
- _telephone.textAlignment = NSTextAlignmentLeft;
- _telephone.font =kTextFont;
- [self.contentView addSubview:_telephone];
- _telephone.text=telephoneStr;
- }
- UILabel *lblDeliveryDate = [[UILabel alloc] initWithFrame:[frame lblDeliveryDateF]];
- lblDeliveryDate.backgroundColor = [UIColor clearColor];
- lblDeliveryDate.textColor = LabelGrayTextColor;
- lblDeliveryDate.text = @"送货日期:";
- lblDeliveryDate.textAlignment = NSTextAlignmentLeft;
- lblDeliveryDate.font =kTextFont;
- [self.contentView addSubview:lblDeliveryDate];
- NSString *deliveryDateStr = [frame.unReceiptListModel deliveryDate];
- deliveryDateStr= [DateFormat dateFormatSplit:deliveryDateStr];
- if(deliveryDateStr == nil||deliveryDateStr.length>0){
- UILabel *deliveryDate= [[UILabel alloc] initWithFrame:[frame deliveryDateF]];
- deliveryDate.backgroundColor = [UIColor clearColor];
- deliveryDate.textColor = [UIColor blackColor];
- deliveryDate.text=deliveryDateStr;
- deliveryDate.textAlignment = NSTextAlignmentLeft;
- deliveryDate.font =kTextFont;
- [self.contentView addSubview:deliveryDate];
- }
-
- UILabel *lblTruckName= [[UILabel alloc] initWithFrame:[frame lblTruckNameF]];
- lblTruckName.backgroundColor = [UIColor clearColor];
- lblTruckName.textColor = LabelGrayTextColor;
- lblTruckName.text = @"车牌号码:";
- lblTruckName.font =kTextFont;
- lblTruckName.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblTruckName];
-
- NSString *truckNameStr = [frame.unReceiptListModel truckName];
- if(truckNameStr != nil&&truckNameStr.length>0){
- _truckName = [[UILabel alloc] initWithFrame:[frame truckNameF]];
- _truckName.backgroundColor = [UIColor clearColor];
- _truckName.textColor = [UIColor blackColor];
- _truckName.textAlignment = NSTextAlignmentLeft;
- _truckName.font =kTextFont;
- [self.contentView addSubview:_truckName];
- _truckName.text=truckNameStr;
- }
-
- UILabel *lblCustomerAddress= [[UILabel alloc] initWithFrame:[frame lblCustomerAddressF]];
- lblCustomerAddress.backgroundColor = [UIColor clearColor];
- lblCustomerAddress.textColor = LabelGrayTextColor;
- lblCustomerAddress.text = @"客户地址:";
- lblCustomerAddress.font =kTextFont;
- lblCustomerAddress.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblCustomerAddress];
- NSString *customerAddressStr = [frame.unReceiptListModel deliveryAddress];
-
- _customerAddress = [[UILabel alloc] initWithFrame:[frame customerAddressF]];
- _customerAddress.backgroundColor = [UIColor clearColor];
- _customerAddress.textColor = [UIColor blackColor];
- _customerAddress.textAlignment = NSTextAlignmentLeft;
- _customerAddress.numberOfLines=0;
- _customerAddress.font =kTextFont;
- [self.contentView addSubview:_customerAddress];
- _customerAddress.text=customerAddressStr;
-
- NSString *organizationName=[frame.unReceiptListModel organizationName];
- NSString *staffName=[frame.unReceiptListModel staffName];
-
-
- UILabel *lblTitleOrganization= [[UILabel alloc] initWithFrame:[frame lblOrganizationNameF]];
- lblTitleOrganization.backgroundColor = [UIColor clearColor];
- lblTitleOrganization.textColor = LabelGrayTextColor;
- lblTitleOrganization.text = @"业务部门:";
- lblTitleOrganization.font =kTextFont;
- lblTitleOrganization.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblTitleOrganization];
-
- if(organizationName!=nil&&organizationName.length>0){
- _lblDepartment = [[UILabel alloc] initWithFrame:[frame organizationNameF]];
- _lblDepartment.backgroundColor = [UIColor clearColor];
- _lblDepartment.textColor = [UIColor blackColor];
- _lblDepartment.textAlignment = NSTextAlignmentLeft;
- _lblDepartment.numberOfLines=0;
- _lblDepartment.font =kTextFont;
- [self.contentView addSubview:_lblDepartment];
- _lblDepartment.text=organizationName;
- }
-
- UILabel *lblTitleStaff= [[UILabel alloc] initWithFrame:[frame lblStaffNameF]];
- lblTitleStaff.backgroundColor = [UIColor clearColor];
- lblTitleStaff.textColor = LabelGrayTextColor;
- lblTitleStaff.text = @"业 务 员:";
- lblTitleStaff.font =kTextFont;
- lblTitleStaff.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblTitleStaff];
- if(staffName!=nil&&staffName.length>0){
- _lblStaff = [[UILabel alloc] initWithFrame:[frame staffNameF]];
- _lblStaff.backgroundColor = [UIColor clearColor];
- _lblStaff.textColor = [UIColor blackColor];
- _lblStaff.textAlignment = NSTextAlignmentLeft;
- _lblStaff.numberOfLines=0;
- _lblStaff.font =kTextFont;
- [self.contentView addSubview:_lblStaff];
- _lblStaff.text=staffName;
- }
-
- }
-
- -(void)dialTelephone{
- if(_telephoneNumber!=nil&&_telephoneNumber.length>0)
- if([self.telephoneDelegate respondsToSelector:@selector(dialTelephone:)])
- {
- [self.telephoneDelegate dialTelephone:_telephoneNumber];
- }
- }
-
- @end
|