// // OrderGoodsListCellTableViewCell.m // IBOSSmini // // Created by guan hong hou on 2018/1/23. // Copyright © 2018年 elongtian. All rights reserved. // #import "SalesSlipGoodsListCell.h" #define orderTextFont [UIFont systemFontOfSize:13] @implementation SalesSlipGoodsListCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; return self; } - (void)setSalesGoodsOrder:(SalesSlipGoodsListModel *)salesOrder orderStatus:(NSUInteger)status{ _salesOrderGoodsListModel=salesOrder; if(_salesOrderGoodsListModel==nil){ return; } CGFloat heightLine = 1; CGFloat heightRow = 40; CGFloat lblx = 20; CGFloat lbly = 8; CGFloat lblwidth = 70; CGFloat lblheight = 25; CGFloat valuey = 8; CGFloat valueheight = 25; //客户名称 UIView *vOrderNo = [UIView new]; vOrderNo.frame=CGRectMake(0, valuey, Screen_Width, heightRow); [self.contentView addSubview:vOrderNo]; UILabel *orderNoTitleLbl=[UILabel new]; orderNoTitleLbl.frame=CGRectMake(lblx, lbly, 85, lblheight); orderNoTitleLbl.text=@"销售单编号:"; orderNoTitleLbl.textColor = [UIColor blackColor]; orderNoTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vOrderNo addSubview:orderNoTitleLbl]; _orderNoLbl = [UILabel new]; _orderNoLbl.frame=CGRectMake(CGRectGetMaxX(orderNoTitleLbl.frame), valuey, Screen_Width -CGRectGetMaxX(orderNoTitleLbl.frame)-10, valueheight); _orderNoLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vOrderNo addSubview:_orderNoLbl]; _orderNoLbl.text = _salesOrderGoodsListModel.salesNo; _topSeparator=[UIView new]; _topSeparator.frame = CGRectMake(0, CGRectGetMaxY(vOrderNo.frame), Screen_Width, heightLine); [self.contentView addSubview:_topSeparator]; UIButton *btnLine = [UIButton buttonWithType:UIButtonTypeCustom]; [btnLine setBackgroundImage:[UIImage imageNamed:@"dash"] forState:UIControlStateNormal]; btnLine.frame = CGRectMake(0 ,0 , Screen_Width, heightLine); [_topSeparator addSubview:btnLine]; UIView *vCheck = [UIView new]; vCheck.frame=CGRectMake(0, CGRectGetMaxY(_topSeparator.frame), Screen_Width, heightRow); [self.contentView addSubview:vCheck]; _goodsNameLbl=[UILabel new]; _goodsNameLbl.frame=CGRectMake(lblx, valuey, Screen_Width - 90, valueheight); _goodsNameLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vCheck addSubview:_goodsNameLbl]; _goodsNameLbl.text =_salesOrderGoodsListModel.goodsName; [vCheck addSubview:_goodsNameLbl]; _middleSeparator= [UIView new]; _middleSeparator.frame=CGRectMake(0, CGRectGetMaxY(vCheck.frame), Screen_Width, 1); _middleSeparator.backgroundColor = LineBackgroundColor; [self.contentView addSubview:_middleSeparator]; UIView *vCode = [UIView new]; vCode.frame=CGRectMake(0,CGRectGetMaxY(_middleSeparator.frame), Screen_Width, heightRow); [self.contentView addSubview:vCode]; UILabel *goodsCodeTitleLbl= [UILabel new]; goodsCodeTitleLbl.frame=CGRectMake(lblx, valuey,lblwidth, lblheight); goodsCodeTitleLbl.textColor = [UIColor blackColor]; goodsCodeTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; goodsCodeTitleLbl.text=@"商品编码:"; [vCode addSubview:goodsCodeTitleLbl]; _goodsCodeLbl=[UILabel new]; _goodsCodeLbl.frame=CGRectMake(CGRectGetMaxX(goodsCodeTitleLbl.frame), valuey,Screen_Width/2-lblx-5-CGRectGetMaxX(goodsCodeTitleLbl.frame), valueheight); _goodsCodeLbl.textColor = [UIColor blackColor]; _goodsCodeLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vCode addSubview:_goodsCodeLbl]; _goodsCodeLbl.text=_salesOrderGoodsListModel.code; UILabel *onlyCodeTitleLbl= [UILabel new]; onlyCodeTitleLbl.frame=CGRectMake(Screen_Width/2, valuey,lblwidth, lblheight); onlyCodeTitleLbl.textColor = [UIColor blackColor]; onlyCodeTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; onlyCodeTitleLbl.text=@"唯一编码:"; [vCode addSubview:onlyCodeTitleLbl]; _onlyCodeLbl=[UILabel new]; _onlyCodeLbl.frame=CGRectMake(CGRectGetMaxX(onlyCodeTitleLbl.frame), valuey,Screen_Width/2-lblwidth-10, valueheight); _onlyCodeLbl.textColor = [UIColor blackColor]; _onlyCodeLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vCode addSubview:_onlyCodeLbl]; _onlyCodeLbl.text=_salesOrderGoodsListModel.onlyCode; UIView *vPrice = [UIView new]; vPrice.frame=CGRectMake(0,CGRectGetMaxY(vCode.frame), Screen_Width, heightRow); [self.contentView addSubview:vPrice]; UILabel *orderPriceTitleLbl= [UILabel new]; orderPriceTitleLbl.frame=CGRectMake(lblx, valuey,lblwidth, lblheight); orderPriceTitleLbl.textColor = [UIColor blackColor]; orderPriceTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; orderPriceTitleLbl.text=@"销售价格:"; [vPrice addSubview:orderPriceTitleLbl]; _orderPriceLbl=[UILabel new]; _orderPriceLbl.frame=CGRectMake(CGRectGetMaxX(orderPriceTitleLbl.frame), valuey,Screen_Width/2-lblwidth-10, valueheight); _orderPriceLbl.textColor = [UIColor blackColor]; _orderPriceLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vPrice addSubview:_orderPriceLbl]; _orderPriceLbl.text=_salesOrderGoodsListModel.orderPrice; UILabel *orderQuantityTitleLbl= [UILabel new]; orderQuantityTitleLbl.frame=CGRectMake(Screen_Width/2, valuey,lblwidth, lblheight); orderQuantityTitleLbl.textColor = [UIColor blackColor]; orderQuantityTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; orderQuantityTitleLbl.text=@"销售数量:"; [vPrice addSubview:orderQuantityTitleLbl]; _orderQuantityLbl=[UILabel new]; _orderQuantityLbl.frame=CGRectMake(CGRectGetMaxX(orderQuantityTitleLbl.frame), valuey,Screen_Width/2-lblwidth-10, valueheight); _orderQuantityLbl.textColor = [UIColor blackColor]; _orderQuantityLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vPrice addSubview:_orderQuantityLbl]; double orderQuantity= _salesOrderGoodsListModel.factOrderQuantity; _orderQuantityLbl.text=[NSString stringWithFormat:@"%.2f",orderQuantity]; UIView *vSpecification = [UIView new]; vSpecification.frame=CGRectMake(0,CGRectGetMaxY(vPrice.frame), Screen_Width, heightRow); [self.contentView addSubview:vSpecification]; UILabel *specificationTitleLbl= [UILabel new]; specificationTitleLbl.frame=CGRectMake(lblx, valuey,lblwidth, lblheight); specificationTitleLbl.textColor = [UIColor blackColor]; specificationTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; specificationTitleLbl.text=@"规 格:"; [vSpecification addSubview:specificationTitleLbl]; _specificationLbl=[UILabel new]; _specificationLbl.frame=CGRectMake(CGRectGetMaxX(specificationTitleLbl.frame), valuey,Screen_Width/2-lblwidth-15, valueheight); _specificationLbl.textColor = [UIColor blackColor]; _specificationLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vSpecification addSubview:_specificationLbl]; _specificationLbl.text=_salesOrderGoodsListModel.specification; UILabel *colorNumberTitleLbl= [UILabel new]; colorNumberTitleLbl.frame=CGRectMake(Screen_Width/2, valuey,lblwidth, lblheight); colorNumberTitleLbl.textColor = [UIColor blackColor]; colorNumberTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; colorNumberTitleLbl.text=@"色 号:"; [vSpecification addSubview:colorNumberTitleLbl]; _colorNumberLbl=[UILabel new]; _colorNumberLbl.frame=CGRectMake(CGRectGetMaxX(colorNumberTitleLbl.frame), valuey,Screen_Width/2-lblwidth-10, valueheight); _colorNumberLbl.textColor = [UIColor blackColor]; _colorNumberLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vSpecification addSubview:_colorNumberLbl]; _colorNumberLbl.text=_salesOrderGoodsListModel.colorNumber; UIView *vBrand = [UIView new]; vBrand.frame=CGRectMake(0,CGRectGetMaxY(vSpecification.frame), Screen_Width, heightRow); [self.contentView addSubview:vBrand]; UILabel *brandNameTitleLbl= [UILabel new]; brandNameTitleLbl.frame=CGRectMake(lblx, valuey,lblwidth, lblheight); brandNameTitleLbl.textColor = [UIColor blackColor]; brandNameTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; brandNameTitleLbl.text=@"商品品牌:"; [vBrand addSubview:brandNameTitleLbl]; _brandNameLbl=[UILabel new]; _brandNameLbl.frame=CGRectMake(CGRectGetMaxX(brandNameTitleLbl.frame), valuey,Screen_Width-lblwidth-lblx-10, valueheight); _brandNameLbl.textColor = [UIColor blackColor]; _brandNameLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vBrand addSubview:_brandNameLbl]; _brandNameLbl.text=_salesOrderGoodsListModel.brandName; _bottomSeparator= [UIView new]; _bottomSeparator.frame=CGRectMake(0, CGRectGetMaxY(vBrand.frame)+5, Screen_Width, 10); _bottomSeparator.backgroundColor = LineBackgroundColor; [self.contentView addSubview:_bottomSeparator]; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; } @end