// // OrderSalesDetailTableViewCell.m // IBOSS // // Created by guan hong hou on 2017/5/26. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved. // // 功能描述:订单销售单详细单元格 // #import "OrderSalesDetailTableViewCell.h" @implementation OrderSalesDetailTableViewCell /** 初始化 @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.backgroundColor = [UIColor whiteColor]; } return self; } /** cell的初始化ui @param orderItem <#orderItem description#> */ - (void)parseOrderSalesDetailInfo:(OrderSaleListDetailModel *)orderItem{ UIView *contentView = [[UIView alloc]init]; CGFloat xpadding = 10; CGFloat ypadding = 15; [self addSubview:contentView]; UILabel *lblTitleDetailInvoiceNo = [[UILabel alloc]init]; lblTitleDetailInvoiceNo.frame=CGRectMake(xpadding,ypadding,67,16); lblTitleDetailInvoiceNo.text = @"单 号:"; lblTitleDetailInvoiceNo.font=orderTextFont; [contentView addSubview:lblTitleDetailInvoiceNo]; _lblDetailInvoiceNo = [[UILabel alloc]init]; _lblDetailInvoiceNo.frame=CGRectMake(CGRectGetMaxX(lblTitleDetailInvoiceNo.frame),ypadding,250, 16); _lblDetailInvoiceNo.text=orderItem.detailInvoiceNo; _lblDetailInvoiceNo.font=orderTextFont; [contentView addSubview:_lblDetailInvoiceNo]; UILabel *lblTitleInvoicesTypeName = [[UILabel alloc]init]; lblTitleInvoicesTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleDetailInvoiceNo.frame)+ypadding,67,16); lblTitleInvoicesTypeName.text = @"单据类型:"; lblTitleInvoicesTypeName.font=orderTextFont; [contentView addSubview:lblTitleInvoicesTypeName]; _lblInvoicesTypeName = [[UILabel alloc]init]; _lblInvoicesTypeName.font=orderTextFont; _lblInvoicesTypeName.text=orderItem.invoiceTypeName; _lblInvoicesTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleInvoicesTypeName.frame),CGRectGetMaxY(lblTitleDetailInvoiceNo.frame)+ypadding,250, 16); _lblInvoicesTypeName.font=orderTextFont; [contentView addSubview:_lblInvoicesTypeName]; UILabel *lblTitleSalesDetailTypeName = [[UILabel alloc]init]; lblTitleSalesDetailTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleInvoicesTypeName.frame)+ypadding,67,16); lblTitleSalesDetailTypeName.text = @"明细类型:"; lblTitleSalesDetailTypeName.font=orderTextFont; [contentView addSubview:lblTitleSalesDetailTypeName]; _lblSalesDetailTypeName = [[UILabel alloc]init]; _lblSalesDetailTypeName.font=orderTextFont; _lblSalesDetailTypeName.text=orderItem.salesDetailTypeName; _lblSalesDetailTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleSalesDetailTypeName.frame),CGRectGetMaxY( lblTitleInvoicesTypeName.frame)+ypadding,250, 16); _lblSalesDetailTypeName.font=orderTextFont; [contentView addSubview:_lblSalesDetailTypeName]; UILabel *lblTitleOrderSalesTypeName = [[UILabel alloc]init]; lblTitleOrderSalesTypeName.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleSalesDetailTypeName.frame)+ypadding,67,16); lblTitleOrderSalesTypeName.text = @"业务类型:"; lblTitleOrderSalesTypeName.font=orderTextFont; [contentView addSubview:lblTitleOrderSalesTypeName]; _lblOrderSalesTypeName = [[UILabel alloc]init]; _lblOrderSalesTypeName.font=orderTextFont; _lblOrderSalesTypeName.text=orderItem.orderSalesTypeName; _lblOrderSalesTypeName.frame=CGRectMake(CGRectGetMaxX(lblTitleOrderSalesTypeName.frame),CGRectGetMaxY( lblTitleSalesDetailTypeName.frame)+ypadding,250, 16); _lblOrderSalesTypeName.font=orderTextFont; [contentView addSubview:_lblOrderSalesTypeName]; UILabel *lblTitleOnlyCode = [[UILabel alloc]init]; lblTitleOnlyCode.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOrderSalesTypeName.frame)+ypadding,67,16); lblTitleOnlyCode.text = @"唯一编码:"; lblTitleOnlyCode.font=orderTextFont; [contentView addSubview:lblTitleOnlyCode]; _lblOnlyCode = [[UILabel alloc]init]; _lblOnlyCode.font=orderTextFont; _lblOnlyCode.text=orderItem.onlyCode; _lblOnlyCode.frame=CGRectMake(CGRectGetMaxX( lblTitleOnlyCode.frame),CGRectGetMaxY( lblTitleOrderSalesTypeName.frame)+ypadding,250, 16); _lblOnlyCode.font=orderTextFont; [contentView addSubview:_lblOnlyCode]; UILabel *lblTitleCode = [[UILabel alloc]init]; lblTitleCode.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOnlyCode.frame)+ypadding,67,16); lblTitleCode.text = @"商品编码:"; lblTitleCode.font=orderTextFont; [contentView addSubview:lblTitleCode]; _lblCode = [[UILabel alloc]init]; _lblCode.font=orderTextFont; _lblCode.text=orderItem.code; _lblCode.frame=CGRectMake(CGRectGetMaxX( lblTitleCode.frame),CGRectGetMaxY( lblTitleOnlyCode.frame)+ypadding,250, 16); _lblCode.font=orderTextFont; [contentView addSubview:_lblCode]; UILabel *lblTitleBrandName = [[UILabel alloc]init]; lblTitleBrandName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleCode.frame)+ypadding,67,16); lblTitleBrandName.text = @"商品品牌:"; lblTitleBrandName.font=orderTextFont; [contentView addSubview:lblTitleBrandName]; _lblBrandName = [[UILabel alloc]init]; _lblBrandName.font=orderTextFont; _lblBrandName.text=orderItem.brandName; _lblBrandName.frame=CGRectMake(CGRectGetMaxX( lblTitleBrandName.frame),CGRectGetMaxY( lblTitleCode.frame)+ypadding,250, 16); _lblBrandName.font=orderTextFont; [contentView addSubview:_lblBrandName]; UILabel *lblTitleKindName = [[UILabel alloc]init]; lblTitleKindName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleBrandName.frame)+ypadding,67,16); lblTitleKindName.text = @"商品种类:"; lblTitleKindName.font=orderTextFont; [contentView addSubview:lblTitleKindName]; _lblKindName = [[UILabel alloc]init]; _lblKindName.font=orderTextFont; _lblKindName.text=orderItem.kindName; _lblKindName.frame=CGRectMake(CGRectGetMaxX( lblTitleKindName.frame),CGRectGetMaxY( lblTitleBrandName.frame)+ypadding,250, 16); _lblBrandName.font=orderTextFont; [contentView addSubview:_lblKindName]; UILabel *lblTitleVarietyName = [[UILabel alloc]init]; lblTitleVarietyName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleKindName.frame)+ypadding,67,16); lblTitleVarietyName.text = @"商品品种:"; lblTitleVarietyName.font=orderTextFont; [contentView addSubview:lblTitleVarietyName]; _lblVarietyName = [[UILabel alloc]init]; _lblVarietyName.font=orderTextFont; _lblVarietyName.text=orderItem.varietyName; _lblVarietyName.frame=CGRectMake(CGRectGetMaxX( lblTitleVarietyName.frame),CGRectGetMaxY( lblTitleKindName.frame)+ypadding,250, 16); _lblVarietyName.font=orderTextFont; [contentView addSubview:_lblVarietyName]; UILabel *lblTitleSeriesName = [[UILabel alloc]init]; lblTitleSeriesName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleVarietyName.frame)+ypadding,67,16); lblTitleSeriesName.text = @"商品系列:"; lblTitleSeriesName.font=orderTextFont; [contentView addSubview:lblTitleSeriesName]; _lblSeriesName = [[UILabel alloc]init]; _lblSeriesName.font=orderTextFont; _lblSeriesName.text=orderItem.seriesName; _lblSeriesName.frame=CGRectMake(CGRectGetMaxX( lblTitleSeriesName.frame),CGRectGetMaxY( lblTitleVarietyName.frame)+ypadding,250, 16); _lblSeriesName.font=orderTextFont; [contentView addSubview:_lblSeriesName]; UILabel *lblTitleUnitName = [[UILabel alloc]init]; lblTitleUnitName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSeriesName.frame)+ypadding,67,16); lblTitleUnitName.text = @"计量单位:"; lblTitleUnitName.font=orderTextFont; [contentView addSubview:lblTitleUnitName]; _lblUnitName = [[UILabel alloc]init]; _lblUnitName.font=orderTextFont; _lblUnitName.text=orderItem.unitName; _lblUnitName.frame=CGRectMake(CGRectGetMaxX( lblTitleUnitName.frame),CGRectGetMaxY( lblTitleSeriesName.frame)+ypadding,250, 16); _lblUnitName.font=orderTextFont; [contentView addSubview:_lblUnitName]; UILabel *lblTitleSpecification = [[UILabel alloc]init]; lblTitleSpecification.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleUnitName.frame)+ypadding,67,16); lblTitleSpecification.text = @"商品规格:"; lblTitleSpecification.font=orderTextFont; [contentView addSubview:lblTitleSpecification]; _lblSpecification = [[UILabel alloc]init]; _lblSpecification.font=orderTextFont; _lblSpecification.text=orderItem.specification; _lblSpecification.frame=CGRectMake(CGRectGetMaxX( lblTitleSpecification.frame),CGRectGetMaxY( lblTitleUnitName.frame)+ypadding,250, 16); _lblSpecification.font=orderTextFont; [contentView addSubview:_lblSpecification]; UILabel *lblTitleGradeName = [[UILabel alloc]init]; lblTitleGradeName.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSpecification.frame)+ypadding,67,16); lblTitleGradeName.text = @"商品等级:"; lblTitleGradeName.font=orderTextFont; [contentView addSubview:lblTitleGradeName]; _lblGradeName = [[UILabel alloc]init]; _lblGradeName.font=orderTextFont; _lblGradeName.text=orderItem.gradeName; _lblGradeName.frame=CGRectMake(CGRectGetMaxX( lblTitleGradeName.frame),CGRectGetMaxY( lblTitleSpecification.frame)+ypadding,250, 16); _lblGradeName.font=orderTextFont; [contentView addSubview:_lblGradeName]; UILabel *lblTitleColorNumber = [[UILabel alloc]init]; lblTitleColorNumber.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleGradeName.frame)+ypadding,67,16); lblTitleColorNumber.text = @"色 号:"; lblTitleColorNumber.font=orderTextFont; [contentView addSubview:lblTitleColorNumber]; _lblColorNumber = [[UILabel alloc]init]; _lblColorNumber.font=orderTextFont; _lblColorNumber.text=orderItem.colorNumber; _lblColorNumber.frame=CGRectMake(CGRectGetMaxX( lblTitleColorNumber.frame),CGRectGetMaxY( lblTitleGradeName.frame)+ypadding,250, 16); _lblColorNumber.font=orderTextFont; [contentView addSubview:_lblColorNumber]; UILabel *lblTitleSalesQuantity = [[UILabel alloc]init]; lblTitleSalesQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleColorNumber.frame)+ypadding,67,16); lblTitleSalesQuantity.text = @"销售数量:"; lblTitleSalesQuantity.font=orderTextFont; [contentView addSubview:lblTitleSalesQuantity]; _lblSalesQuantity = [[UILabel alloc]init]; _lblSalesQuantity.font=orderTextFont; _lblSalesQuantity.text=orderItem.salesQuantity; _lblSalesQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleSalesQuantity.frame),CGRectGetMaxY( lblTitleColorNumber.frame)+ypadding,250, 16); _lblSalesQuantity.font=orderTextFont; [contentView addSubview:_lblSalesQuantity]; UILabel *lblTitleOrderQuantity = [[UILabel alloc]init]; lblTitleOrderQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSalesQuantity.frame)+ypadding,67,16); lblTitleOrderQuantity.text = @"订单数量:"; lblTitleOrderQuantity.font=orderTextFont; [contentView addSubview:lblTitleOrderQuantity]; _lblOrderQuantity = [[UILabel alloc]init]; _lblOrderQuantity.font=orderTextFont; _lblOrderQuantity.text=orderItem.orderQuantity; _lblOrderQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleOrderQuantity.frame),CGRectGetMaxY( lblTitleSalesQuantity.frame)+ypadding,250, 16); _lblOrderQuantity.font=orderTextFont; [contentView addSubview:_lblOrderQuantity]; NSString *salesPrice=orderItem.salesPrice; if(![salesPrice isEqualToString:@""]){ UILabel *lblTitleSalesPrice = [[UILabel alloc]init]; lblTitleSalesPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOrderQuantity.frame)+ypadding,67,16); lblTitleSalesPrice.text = @"销售价格:"; lblTitleSalesPrice.font=orderTextFont; [contentView addSubview:lblTitleSalesPrice]; _lblSalesPrice = [[UILabel alloc]init]; _lblSalesPrice.font=orderTextFont; _lblSalesPrice.text=orderItem.salesPrice; _lblSalesPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleSalesPrice.frame),CGRectGetMaxY( lblTitleOrderQuantity.frame)+ypadding,250, 16); _lblSalesPrice.font=orderTextFont; [contentView addSubview:_lblSalesPrice]; UILabel *lblTitleGoodsSettlementPrice = [[UILabel alloc]init]; lblTitleGoodsSettlementPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleSalesPrice.frame)+ypadding,80,16); lblTitleGoodsSettlementPrice.text = @"商品结算价:"; lblTitleGoodsSettlementPrice.font=orderTextFont; [contentView addSubview:lblTitleGoodsSettlementPrice]; _lblGoodsSettlementPrice = [[UILabel alloc]init]; _lblGoodsSettlementPrice.font=orderTextFont; _lblGoodsSettlementPrice.text=orderItem.goodsSettlementPrice; _lblGoodsSettlementPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementPrice.frame),CGRectGetMaxY( lblTitleSalesPrice.frame)+ypadding,250, 16); _lblGoodsSettlementPrice.font=orderTextFont; [contentView addSubview:_lblGoodsSettlementPrice]; UILabel *lblTitleGoodsSettlementAmount = [[UILabel alloc]init]; lblTitleGoodsSettlementAmount.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,80,16); lblTitleGoodsSettlementAmount.text = @"结算价金额:"; lblTitleGoodsSettlementAmount.font=orderTextFont; [contentView addSubview:lblTitleGoodsSettlementAmount]; _lblGoodsSettlementAmount = [[UILabel alloc]init]; _lblGoodsSettlementAmount.font=orderTextFont; _lblGoodsSettlementAmount.text=orderItem.goodsSettlementAmount; _lblGoodsSettlementAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementAmount.frame),CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,250, 16); _lblGoodsSettlementAmount.font=orderTextFont; [contentView addSubview:_lblGoodsSettlementAmount]; UILabel *lblTitleAmount = [[UILabel alloc]init]; lblTitleAmount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleGoodsSettlementAmount.frame)+ypadding,67,16); lblTitleAmount.text = @"金 额:"; lblTitleAmount.font=orderTextFont; [contentView addSubview:lblTitleAmount]; _lblAmount = [[UILabel alloc]init]; _lblAmount.font=orderTextFont; _lblAmount.text=orderItem.amount; _lblAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleAmount.frame),CGRectGetMaxY( lblTitleGoodsSettlementAmount.frame)+ypadding,250, 16); _lblAmount.font=orderTextFont; [contentView addSubview:_lblAmount]; UILabel *lblTitleMarkedPrice = [[UILabel alloc]init]; lblTitleMarkedPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleAmount.frame)+ypadding,67,16); lblTitleMarkedPrice.text = @"标 价:"; lblTitleMarkedPrice.font=orderTextFont; [contentView addSubview:lblTitleMarkedPrice]; _lblMarkedPrice = [[UILabel alloc]init]; _lblMarkedPrice.font=orderTextFont; _lblMarkedPrice.text=orderItem.markedPrice; _lblMarkedPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleMarkedPrice.frame),CGRectGetMaxY( lblTitleAmount.frame)+ypadding,250, 16); _lblMarkedPrice.font=orderTextFont; [contentView addSubview:_lblMarkedPrice]; UILabel *lblTitleDiscount = [[UILabel alloc]init]; lblTitleDiscount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleMarkedPrice.frame)+ypadding,67,16); lblTitleDiscount.text = @"折 扣:"; lblTitleDiscount.font=orderTextFont; [contentView addSubview:lblTitleDiscount]; _lblDiscount = [[UILabel alloc]init]; _lblDiscount.font=orderTextFont; _lblDiscount.text=orderItem.discount; _lblDiscount.frame=CGRectMake(CGRectGetMaxX( lblTitleDiscount.frame),CGRectGetMaxY( lblTitleMarkedPrice.frame)+ypadding,250, 16); _lblDiscount.font=orderTextFont; [contentView addSubview:_lblDiscount]; contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame)) ; if([orderItem.invoiceType isEqualToString:@"2"]){ UILabel *lblTitleOutQuantity = [[UILabel alloc]init]; lblTitleOutQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleDiscount.frame)+ypadding,67,16); lblTitleOutQuantity.text = @"出库数量:"; lblTitleOutQuantity.font=orderTextFont; [contentView addSubview:lblTitleOutQuantity]; _lblOutQuantity = [[UILabel alloc]init]; _lblOutQuantity.font=orderTextFont; _lblOutQuantity.text=orderItem.outQuantity; _lblOutQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleOutQuantity.frame),CGRectGetMaxY( lblTitleDiscount.frame)+ypadding,250, 16); _lblOutQuantity.font=orderTextFont; [contentView addSubview:_lblOutQuantity]; UILabel *lblTitleOutAmount = [[UILabel alloc]init]; lblTitleOutAmount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOutQuantity.frame)+ypadding,67,16); lblTitleOutAmount.text = @"出库金额:"; lblTitleOutAmount.font=orderTextFont; [contentView addSubview:lblTitleOutAmount]; _lblOutAmount= [[UILabel alloc]init]; _lblOutAmount.font=orderTextFont; _lblOutAmount.text=orderItem.outAmount; _lblOutAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleOutAmount.frame),CGRectGetMaxY( lblTitleOutQuantity.frame)+ypadding,250, 16); _lblOutAmount.font=orderTextFont; [contentView addSubview:_lblOutAmount]; contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleOutAmount.frame)); } else{ contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame)); } } else{ UILabel *lblTitleGoodsSettlementPrice = [[UILabel alloc]init]; lblTitleGoodsSettlementPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOrderQuantity.frame)+ypadding,80,16); lblTitleGoodsSettlementPrice.text = @"商品结算价:"; lblTitleGoodsSettlementPrice.font=orderTextFont; [contentView addSubview:lblTitleGoodsSettlementPrice]; _lblGoodsSettlementPrice = [[UILabel alloc]init]; _lblGoodsSettlementPrice.font=orderTextFont; _lblGoodsSettlementPrice.text=orderItem.goodsSettlementPrice; _lblGoodsSettlementPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementPrice.frame),CGRectGetMaxY( lblTitleOrderQuantity.frame)+ypadding,250, 16); _lblGoodsSettlementPrice.font=orderTextFont; [contentView addSubview:_lblGoodsSettlementPrice]; UILabel *lblTitleGoodsSettlementAmount = [[UILabel alloc]init]; lblTitleGoodsSettlementAmount.frame=CGRectMake(xpadding,CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,80,16); lblTitleGoodsSettlementAmount.text = @"结算价金额:"; lblTitleGoodsSettlementAmount.font=orderTextFont; [contentView addSubview:lblTitleGoodsSettlementAmount]; _lblGoodsSettlementAmount = [[UILabel alloc]init]; _lblGoodsSettlementAmount.font=orderTextFont; _lblGoodsSettlementAmount.text=orderItem.goodsSettlementAmount; _lblGoodsSettlementAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleGoodsSettlementAmount.frame),CGRectGetMaxY( lblTitleGoodsSettlementPrice.frame)+ypadding,250, 16); _lblGoodsSettlementAmount.font=orderTextFont; [contentView addSubview:_lblGoodsSettlementAmount]; UILabel *lblTitleMarkedPrice = [[UILabel alloc]init]; lblTitleMarkedPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleGoodsSettlementAmount.frame)+ypadding,67,16); lblTitleMarkedPrice.text = @"标 价:"; lblTitleMarkedPrice.font=orderTextFont; [contentView addSubview:lblTitleMarkedPrice]; _lblMarkedPrice = [[UILabel alloc]init]; _lblMarkedPrice.font=orderTextFont; _lblMarkedPrice.text=orderItem.markedPrice; _lblMarkedPrice.frame=CGRectMake(CGRectGetMaxX( lblTitleMarkedPrice.frame),CGRectGetMaxY( lblTitleGoodsSettlementAmount.frame)+ypadding,250, 16); _lblMarkedPrice.font=orderTextFont; [contentView addSubview:_lblMarkedPrice]; UILabel *lblTitleDiscount = [[UILabel alloc]init]; lblTitleDiscount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleMarkedPrice.frame)+ypadding,67,16); lblTitleDiscount.text = @"折 扣:"; lblTitleDiscount.font=orderTextFont; [contentView addSubview:lblTitleDiscount]; _lblDiscount = [[UILabel alloc]init]; _lblDiscount.font=orderTextFont; _lblDiscount.text=orderItem.discount; _lblDiscount.frame=CGRectMake(CGRectGetMaxX( lblTitleDiscount.frame),CGRectGetMaxY( lblTitleMarkedPrice.frame)+ypadding,250, 16); _lblDiscount.font=orderTextFont; [contentView addSubview:_lblDiscount]; contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame)) ; if([orderItem.invoiceType isEqualToString:@"2"]){ UILabel *lblTitleOutQuantity = [[UILabel alloc]init]; lblTitleOutQuantity.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleDiscount.frame)+ypadding,67,16); lblTitleOutQuantity.text = @"出库数量:"; lblTitleOutQuantity.font=orderTextFont; [contentView addSubview:lblTitleOutQuantity]; _lblOutQuantity = [[UILabel alloc]init]; _lblOutQuantity.font=orderTextFont; _lblOutQuantity.text=orderItem.outQuantity; _lblOutQuantity.frame=CGRectMake(CGRectGetMaxX( lblTitleOutQuantity.frame),CGRectGetMaxY( lblTitleDiscount.frame)+ypadding,250, 16); _lblOutQuantity.font=orderTextFont; [contentView addSubview:_lblOutQuantity]; UILabel *lblTitleOutAmount = [[UILabel alloc]init]; lblTitleOutAmount.frame=CGRectMake(xpadding,CGRectGetMaxY(lblTitleOutQuantity.frame)+ypadding,67,16); lblTitleOutAmount.text = @"出库金额:"; lblTitleOutAmount.font=orderTextFont; [contentView addSubview:lblTitleOutAmount]; _lblOutAmount= [[UILabel alloc]init]; _lblOutAmount.font=orderTextFont; _lblOutAmount.text=orderItem.outAmount; _lblOutAmount.frame=CGRectMake(CGRectGetMaxX( lblTitleOutAmount.frame),CGRectGetMaxY( lblTitleOutQuantity.frame)+ypadding,250, 16); _lblOutAmount.font=orderTextFont; [contentView addSubview:_lblOutAmount]; contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleOutAmount.frame)); } else{ contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitleDiscount.frame)); } } if(orderItem.promotionOrderSalesPriceFlag) { UILabel *lblTitlePromotionOrderSalesPrice = [[UILabel alloc]init]; lblTitlePromotionOrderSalesPrice.frame=CGRectMake(xpadding,CGRectGetMaxY(contentView.frame)+ypadding,67,16); lblTitlePromotionOrderSalesPrice.text = @"策略价格:"; lblTitlePromotionOrderSalesPrice.font=orderTextFont; [contentView addSubview:lblTitlePromotionOrderSalesPrice]; _lblPromotionOrderSalesPrice = [[UILabel alloc]init]; _lblPromotionOrderSalesPrice.font=orderTextFont; _lblPromotionOrderSalesPrice.text=orderItem.promotionOrderSalesPrice; _lblPromotionOrderSalesPrice.frame=CGRectMake(CGRectGetMaxX( lblTitlePromotionOrderSalesPrice.frame),CGRectGetMaxY( contentView.frame)+ypadding,250, 16); _lblPromotionOrderSalesPrice.font=orderTextFont; [contentView addSubview:_lblPromotionOrderSalesPrice]; contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitlePromotionOrderSalesPrice.frame)); } if(orderItem.promotionRateFlag) { UILabel *lblTitlePromotionRate = [[UILabel alloc]init]; lblTitlePromotionRate.frame=CGRectMake(xpadding,CGRectGetMaxY(contentView.frame)+ypadding,80,16); lblTitlePromotionRate.text = @"活动折扣比:"; lblTitlePromotionRate.font=orderTextFont; [contentView addSubview:lblTitlePromotionRate]; _lblPromotionRate = [[UILabel alloc]init]; _lblPromotionRate.font=orderTextFont; _lblPromotionRate.text=orderItem.promotionRate; _lblPromotionRate.frame=CGRectMake(CGRectGetMaxX( lblTitlePromotionRate.frame),CGRectGetMaxY( contentView.frame)+ypadding,250, 16); _lblPromotionRate.font=orderTextFont; [contentView addSubview:_lblPromotionRate]; contentView.frame=CGRectMake(0,0, self.frame.size.width,CGRectGetMaxY(lblTitlePromotionRate.frame)+ypadding); } _height=CGRectGetMaxY(contentView.frame); } @end