| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- //
- // DailyReconciliationDetailCell.m
- // IBOSSmini
- //
- // Created by apple on 2017/5/16.
- // Copyright © 2017年 elongtian. All rights reserved.
- //
- #import "DailyReconciliationDetailCell.h"
- @interface DailyReconciliationDetailCell(){
- CGFloat totalHeight;
- }
- @end
- @implementation DailyReconciliationDetailCell
- /**
- 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];
-
- return self;
- }
- /**
- 模型设置
-
- @param customer customer description
- */
- - (void)setDModel:(DayAccountDetailModel *)dModel{
- if (dModel==nil) {
- return;
- }
-
- //CGFloat heightRow = 40;
- CGFloat lblx = 10;
- CGFloat lbly = 8;
- CGFloat lblheight = 25;
-
- self.vBottom = [UIView new];
- [self.contentView addSubview:self.vBottom];
-
- //业务单号=================
- _businessNumber=[UILabel new];
- _businessNumber.frame=CGRectMake(lblx, lbly, Screen_Width - 2*lblx, lblheight);
- _businessNumber.textColor = [UIColor blackColor];
- _businessNumber.text = dModel.businessNumber;
- _businessNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [self.vBottom addSubview:_businessNumber];
-
- UIView *viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(_businessNumber.frame) - 1 + lbly, Screen_Width, 1);
- viewBackgroud.backgroundColor = LineBackgroundColor;
- [self.vBottom addSubview:viewBackgroud];
-
- //据类型=================
- _typeNo = [UILabel new];
- _typeNo.frame=CGRectMake(lblx, CGRectGetMaxY(_businessNumber.frame)+ lbly, Screen_Width - 2*lblx, lblheight);
- _typeNo.textColor = [UIColor blackColor];
- _typeNo.text = dModel.typeNo;
- _typeNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [self.vBottom addSubview:_typeNo];
-
- //账款操作类型=================
- _billOperation = [UILabel new];
- _billOperation.frame=CGRectMake(lblx, CGRectGetMaxY(_typeNo.frame)+ lbly, Screen_Width - 2*lblx, lblheight);
- _billOperation.textColor = [UIColor blackColor];
- _billOperation.text = dModel.billOperation;
- _billOperation.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [self.vBottom addSubview:_billOperation];
-
- totalHeight = CGRectGetMaxY(_billOperation.frame)+ lbly;
-
- //销售货款总额
- if (dModel.receivableAmount!=nil && dModel.receivableAmount.length>0) {
- _receiptAmount = [UILabel new];
- _receiptAmount.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
- _receiptAmount.textColor = [UIColor blackColor];
- _receiptAmount.text = dModel.receivableAmount;
- _receiptAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [self.vBottom addSubview:_receiptAmount];
-
- totalHeight = CGRectGetMaxY(_receiptAmount.frame)+ lbly;
- }
- //结算方式
- if (dModel.settleWay!=nil && dModel.settleWay.length>0) {
- _settleWay = [UILabel new];
- _settleWay.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
- _settleWay.textColor = [UIColor blackColor];
- _settleWay.text = dModel.settleWay;
- _settleWay.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [self.vBottom addSubview:_settleWay];
-
- totalHeight = CGRectGetMaxY(_settleWay.frame)+ lbly;
- }
-
- //收款额
- if (dModel.receiptAmount!=nil && dModel.receiptAmount.length>0) {
- _receiptAmount = [UILabel new];
- _receiptAmount.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
- _receiptAmount.textColor = [UIColor blackColor];
- _receiptAmount.text = dModel.receiptAmount;
- _receiptAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [self.vBottom addSubview:_receiptAmount];
-
- totalHeight = CGRectGetMaxY(_receiptAmount.frame)+ lbly;
- }
- //使用定金
- if (dModel.earnestAmount!=nil && dModel.earnestAmount.length>0) {
- _earnestAmount = [UILabel new];
- _earnestAmount.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
- _earnestAmount.textColor = [UIColor blackColor];
- _earnestAmount.text = dModel.earnestAmount;
- _earnestAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [self.vBottom addSubview:_earnestAmount];
-
- totalHeight = CGRectGetMaxY(_earnestAmount.frame)+ lbly;
- }
- //使用预存
-
- if (dModel.depositAmount!=nil && dModel.depositAmount.length>0) {
- _depositAmount = [UILabel new];
- _depositAmount.frame=CGRectMake(lblx, totalHeight, Screen_Width - 2*lblx, lblheight);
- _depositAmount.textColor = [UIColor blackColor];
- _depositAmount.text = dModel.depositAmount;
- _depositAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [self.vBottom addSubview:_depositAmount];
- totalHeight = CGRectGetMaxY(_depositAmount.frame)+ lbly;
- }
-
-
- self.vBottom.frame=CGRectMake(lblx, 5, Screen_Width - 2*lblx, totalHeight);
- [self addSubview:self.vBottom];
-
- UIView *v = [UIView new];
- v.frame = CGRectMake(0, CGRectGetMaxY(self.vBottom.frame), Screen_Width, 10);
- v.backgroundColor = LineBackgroundColor;
- [self addSubview:v];
- }
- /**
- * cell的高度
- *
- * @return <#return value description#>
- */
- - (CGFloat)height{
- return CGRectGetMaxY(self.vBottom.frame) + 10;
- }
- @end
|