//
//  NotuceRecordCell.m
//  XFFruit
//
//  Created by mac on 15/9/16.
//  Copyright (c) 2015年 Xummer. All rights reserved.
//

#import "NotuceRecordCell.h"
#define LeftMargin 10
@implementation NotuceRecordCell

- (void)awakeFromNib {
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self =  [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self bulidLayout];
    }
    return self;
}

- (void)bulidLayout
{
    self.contentView.backgroundColor = XXFBgColor;
    
    UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(20, 5, ScreenSize.width - 40, 130 -10)];
    bgView.backgroundColor = [UIColor whiteColor];
    bgView.layer.cornerRadius = 5;
    bgView.layer.masksToBounds = YES;
    [self.contentView addSubview:bgView];
    
    self.createdLable = [[UILabel alloc]initWithFrame:CGRectMake(LeftMargin, 0, bgView.width - 100, 30)];//业务时间
    self.createdLable.font = GXF_FIFTEENTEN_SIZE;
    self.createdLable.text = @"2015-04-05 09:05:05";
    
    self.creatorLable = [[UILabel alloc]initWithFrame:CGRectMake(self.createdLable.right, 0, bgView.width - self.createdLable.width - LeftMargin * 2, 30)];//业务人
    self.creatorLable.font = GXF_FIFTEENTEN_SIZE;
    self.creatorLable.textAlignment = NSTextAlignmentRight;
    self.creatorLable.text = @"张三";
    
    self.traceIdLable = [[UILabel alloc]initWithFrame:CGRectMake(self.createdLable.x, self.createdLable.bottom, bgView.width - LeftMargin*2, 20)];//采购通知单uuid
    self.traceIdLable.font = GXF_FIFTEENTEN_SIZE;
    self.traceIdLable.text = @"采购通知单号：1358959008854";
    
    self.typeLable = [[UILabel alloc]initWithFrame:CGRectMake(self.createdLable.x, self.traceIdLable.bottom, bgView.width- LeftMargin*2, 20)];//业务类型
    self.typeLable.font = GXF_FIFTEENTEN_SIZE;
    self.typeLable.text = @"类型：接受任务";
    
    self.remarkLable = [[UILabel alloc]initWithFrame:CGRectMake(self.createdLable.x, self.typeLable.bottom, bgView.width-LeftMargin*2, 20)];//日志描述信息
    self.remarkLable.font = GXF_FIFTEENTEN_SIZE;
    self.remarkLable.text = @"描述：fdsafdsaggjgoirjohgjfdl";
    
    [bgView addSubview:self.createdLable];
    [bgView addSubview:self.creatorLable];
    [bgView addSubview:self.traceIdLable];
    [bgView addSubview:self.remarkLable];
    [bgView addSubview:self.typeLable];
    [bgView addSubview:self.uuidLable];
}

- (void)setNoticeRecode:(NoticeRecord *)noticeRecode{
    self.creatorLable.text = [NSString stringWithFormat:@"%@",noticeRecode.creator];
    self.createdLable.text = [NSString stringWithFormat:@"%@",noticeRecode.created];
    self.traceIdLable.text = [NSString stringWithFormat:@"采购通知单号：%@",noticeRecode.traceId];
    self.typeLable.text = [NSString stringWithFormat:@"类型：%@",noticeRecode.type];
    self.remarkLable.text = [NSString stringWithFormat:@"备注：%@",noticeRecode.remark];
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
