| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- //
- // OrderAuditListCell.m
- // IBOSS
- //
- // Created by 关宏厚 on 2018/11/13.
- // Copyright © 2018 elongtian. All rights reserved.
- //
- #import "OrderAuditListCell.h"
- @implementation OrderAuditListCell
- #pragma mark - 公共函数
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
-
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- return self;
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
-
- }
- #pragma mark - 私有函数
- - (void)setOrderAuditCell:(OrderAuditListModel *)auditListModel{
- if (auditListModel == nil) {
- return;
- }
- CGFloat heightLine = 1;
- CGFloat heightRow = 31;
- CGFloat lblx = 10;
- CGFloat lbly = 0;
- CGFloat lblwidth = 70;
- CGFloat lblheight = 31;
- CGFloat valuey = 0;
- CGFloat valueheight = 31;
- //客户对象 —————————
- UIView *vTitle = [UIView new];
- vTitle.frame=CGRectMake(0, 0, Screen_Width, 10);
- vTitle.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:vTitle];
-
- //客户名称 —————————
- UIView *vOrderNo = [UIView new];
- vOrderNo.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame)+8, Screen_Width, heightRow);
- [self.contentView addSubview:vOrderNo];
- _btnCheck = [UIButton buttonWithType:UIButtonTypeCustom];
- _btnCheck.frame=CGRectMake(lblx,valuey+3, 25, 25);
- [_btnCheck addTarget:self action:@selector(btnGoCheck) forControlEvents:UIControlEventTouchUpInside];
- [vOrderNo addSubview:_btnCheck];
-
-
- UILabel *orderNoView = [UILabel new];
- orderNoView.frame=CGRectMake(CGRectGetMaxX(_btnCheck.frame)+5, valuey,200, valueheight);
- orderNoView.font = [UIFont systemFontOfSize: TitleFontOfSize];
- [vOrderNo addSubview:orderNoView];
- orderNoView.text = auditListModel.orderNo;
-
-
- UILabel *lblCheckFlag = [UILabel new];
- lblCheckFlag.frame=CGRectMake(Screen_Width-90 , valuey,80, valueheight);
- lblCheckFlag.textColor = [UIColor hexColor:LIGHT_BROWN];
- Boolean checkFlag= auditListModel.checkFlag;
- NSString *checkFlagStr;
- if(!checkFlag){
- checkFlagStr=@"未审核";
- }
- else{
- checkFlagStr=@"审核";
- }
- lblCheckFlag.text=checkFlagStr;
- lblCheckFlag.textAlignment = NSTextAlignmentRight;
- lblCheckFlag.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vOrderNo addSubview:lblCheckFlag];
-
- //分割线
- UIView *viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vOrderNo.frame)+8, Screen_Width, heightLine);
-
- [self.contentView addSubview:viewBackgroud];
- UIButton *btnLine = [UIButton buttonWithType:UIButtonTypeCustom];
- [btnLine setBackgroundImage:[UIImage imageNamed:@"dash"] forState:UIControlStateNormal];
- btnLine.frame = CGRectMake(0 ,0 , Screen_Width, heightLine);
- [viewBackgroud addSubview:btnLine];
-
-
- UIView *vCustomerCode = [UIView new];
- vCustomerCode.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width/2, heightRow);
-
- [self.contentView addSubview:vCustomerCode];
-
- UILabel *lblTitleCustomerCode = [UILabel new];
- lblTitleCustomerCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblTitleCustomerCode.text = @"客户编码:";
- lblTitleCustomerCode.textColor = [UIColor blackColor];
- lblTitleCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerCode addSubview:lblTitleCustomerCode];
- UILabel *lblCustomerCode = [UILabel new];
- lblCustomerCode.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleCustomerCode.frame), valueheight);
- lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerCode addSubview:lblCustomerCode];
- lblCustomerCode.text = auditListModel.customerCode;
-
-
- UIView *vBusinessType = [UIView new];
- vBusinessType.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width/2, heightRow);
-
- [self.contentView addSubview:vBusinessType];
-
- UILabel *lblTitleBusinessType = [UILabel new];
- lblTitleBusinessType.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblTitleBusinessType.text = @"业务类型:";
- lblTitleBusinessType.textColor = [UIColor blackColor];
- lblTitleBusinessType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vBusinessType addSubview:lblTitleBusinessType];
-
- UILabel *lblBusinessType = [UILabel new];
- lblBusinessType.frame=CGRectMake(CGRectGetMaxX(lblTitleBusinessType.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleBusinessType.frame), valueheight);
- lblBusinessType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vBusinessType addSubview:lblBusinessType];
- lblBusinessType.text = auditListModel.orderType;
-
-
- UIView *vCustomerName = [UIView new];
- vCustomerName.frame=CGRectMake(0, CGRectGetMaxY(vCustomerCode.frame)+8, Screen_Width/2, heightRow);
-
- [self.contentView addSubview:vCustomerName];
-
- UILabel *lblTitleCustomerName = [UILabel new];
- lblTitleCustomerName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblTitleCustomerName.text = @"客户名称:";
- lblTitleCustomerName.textColor = [UIColor blackColor];
- lblTitleCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerName addSubview:lblTitleCustomerName];
- UILabel *lblCustomerName = [UILabel new];
- lblCustomerName.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerName.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleCustomerName.frame), valueheight);
- lblCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerName addSubview:lblCustomerName];
- lblCustomerName.text = auditListModel.customerName;
-
- UIView *vTelephone = [UIView new];
- vTelephone.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(vCustomerCode.frame)+8, Screen_Width/2, heightRow);
-
- [self.contentView addSubview:vTelephone];
-
- UILabel *lblTitleTelephone = [UILabel new];
- lblTitleTelephone.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblTitleTelephone.text = @"联系电话:";
- lblTitleTelephone.textColor = [UIColor blackColor];
- lblTitleTelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vTelephone addSubview:lblTitleTelephone];
-
- UILabel *lblTelephone = [UILabel new];
- lblTelephone.frame=CGRectMake(CGRectGetMaxX(lblTitleTelephone.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleTelephone.frame), valueheight);
- lblTelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vTelephone addSubview:lblTelephone];
- lblTelephone.text = auditListModel.telephone;
-
- UIView *vAddress = [UIView new];
- vAddress.frame=CGRectMake(0, CGRectGetMaxY(vCustomerName.frame)+8, Screen_Width, heightRow);
-
- [self.contentView addSubview:vAddress];
- UILabel *lblTitleAddress = [UILabel new];
- lblTitleAddress.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblTitleAddress.text = @"客户地址:";
- lblTitleAddress.textColor = [UIColor blackColor];
- lblTitleAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vAddress addSubview:lblTitleAddress];
-
- UILabel *lblAddress= [UILabel new];
- lblAddress.frame=CGRectMake(CGRectGetMaxX(lblTitleAddress.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleAddress.frame), valueheight);
- lblAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vAddress addSubview:lblAddress];
- lblAddress.text = auditListModel.customerAddress;
-
-
- UIView *vDepartment = [UIView new];
- vDepartment.frame=CGRectMake(0, CGRectGetMaxY(vAddress.frame)+8, Screen_Width/2, heightRow);
-
- [self.contentView addSubview:vDepartment];
-
- UILabel *lblTitleDepartment = [UILabel new];
- lblTitleDepartment.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblTitleDepartment.text = @"业务部门:";
- lblTitleDepartment.textColor = [UIColor blackColor];
- lblTitleDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vDepartment addSubview:lblTitleDepartment];
-
- UILabel *lblDepartment = [UILabel new];
- lblDepartment.frame=CGRectMake(CGRectGetMaxX(lblTitleDepartment.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleDepartment.frame), valueheight);
- lblDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vDepartment addSubview:lblDepartment];
- lblDepartment.text = auditListModel.organizationName;
-
-
- UIView *vStaff = [UIView new];
- vStaff.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(vAddress.frame)+8, Screen_Width/2, heightRow);
-
- [self.contentView addSubview:vStaff];
- UILabel *lblTitleStaff = [UILabel new];
- lblTitleStaff.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblTitleStaff.text = @"业务员:";
- lblTitleStaff.textColor = [UIColor blackColor];
- lblTitleStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaff addSubview:lblTitleStaff];
-
- UILabel *lblStaff = [UILabel new];
- lblStaff.frame=CGRectMake(CGRectGetMaxX(lblTitleStaff.frame), valuey, Screen_Width/2-CGRectGetMaxX(lblTitleStaff.frame), valueheight);
- lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaff addSubview:lblStaff];
- lblStaff.text = auditListModel.staffName;
-
-
-
- viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vDepartment.frame)+8, Screen_Width, 1);
- viewBackgroud.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:viewBackgroud];
-
- UIView *vAmount = [UIView new];
- vAmount.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width, heightRow);
-
- [self.contentView addSubview:vAmount];
-
- UILabel *lblAmount=[UILabel new];
- lblAmount.frame=CGRectMake(lblx, valuey, Screen_Width-2*lblx, valueheight);
- lblAmount.textAlignment=NSTextAlignmentRight;
- lblAmount.textColor=[UIColor redColor];
- lblAmount.font = [UIFont systemFontOfSize: SubLabelAndTextFontOfSize];
- lblAmount.text=[NSString stringWithFormat:@"%@%@%@%@%@%@",@"货物总额:",auditListModel.goodsAmount,@"合计金额:",auditListModel.totalAmount,@"费用金额:",auditListModel.feesAmount];
- [vAmount addSubview:lblAmount];
-
- viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vAmount.frame)+8, Screen_Width, 1);
- viewBackgroud.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:viewBackgroud];
-
- }
- /**
- 设置checkbox背景图片
- @param checked <#checked description#>
- */
- - (void) setCheckBackground: (BOOL) checked
- { if(!checked)
- {
-
- [_btnCheck setImage:[UIImage imageNamed:@"order_unchecked"] forState:UIControlStateNormal];
- }
- else
- {
- [_btnCheck setImage:[UIImage imageNamed:@"order_checked"] forState:UIControlStateNormal];
- }
- }
- -(void)btnGoCheck{
- if([self.delegate respondsToSelector:@selector(btnCheckPressed:)])
- {
- [self.delegate btnCheckPressed:_position];
- }
- }
- @end
|