| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- //
- // ProcurementApplyListCell.m
- // IBOSS
- //
- // Created by guan hong hou on 2018/7/23.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "ProcurementApplyListCell.h"
- @implementation ProcurementApplyListCell
- -(void)setProcurementApplyListCell:(ProcurementApplyListModel*)procurementModel{
-
- _applyListModel=procurementModel;
-
- if(_applyListModel==nil){
- return;
- }
- CGFloat heightLine = 1;
- CGFloat heightRow = 31;
- CGFloat lblx = 20;
- CGFloat lbly = 0;
- CGFloat lblwidth = 70;
- CGFloat lblheight = 31;
- CGFloat valuex = 85;
- CGFloat valuey = 0;
- CGFloat valueheight = 31;
-
- //分割线
- UIView *topSeparator = [UIView new];
- topSeparator.frame = CGRectMake(0,0, Screen_Width, 10);
- topSeparator.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:topSeparator];
- UIView *vApplyNo = [UIView new];
- vApplyNo.frame=CGRectMake(0,CGRectGetMaxY(topSeparator.frame)+8, Screen_Width, heightRow);
- [self.contentView addSubview:vApplyNo];
-
- _lblApplyNo = [UILabel new];
- _lblApplyNo.frame=CGRectMake(lblx, valuey,Screen_Width-120-lblx, valueheight);
- _lblApplyNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vApplyNo addSubview:_lblApplyNo];
- _lblApplyNo.text = _applyListModel.applyNo;
-
- // 跟进标识
- _lblApplyStatus = [UILabel new];
- _lblApplyStatus.frame=CGRectMake(Screen_Width-130 , valuey,110, valueheight);
- _lblApplyStatus.textColor = LabelGrayTextColor;
- _lblApplyStatus.textAlignment = NSTextAlignmentRight;
- _lblApplyStatus.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _lblApplyStatus.text=_applyListModel.invoiceStatusName;
- [vApplyNo addSubview:_lblApplyStatus];
-
- //分割线
- UIView *viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vApplyNo.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 *vOrderNo = [UIView new];
- vOrderNo.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width, heightRow);
-
- [self.contentView addSubview:vOrderNo];
-
- UILabel *lblOrderNoTitle = [UILabel new];
- lblOrderNoTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblOrderNoTitle.text = @"订单单号:";
- lblOrderNoTitle.textColor = [UIColor blackColor];
- lblOrderNoTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vOrderNo addSubview:lblOrderNoTitle];
- _lblOrderNo = [UILabel new];
- _lblOrderNo.frame=CGRectMake(valuex, valuey, Screen_Width-CGRectGetMaxX(lblOrderNoTitle.frame)-5, valueheight);
- _lblOrderNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vOrderNo addSubview:_lblOrderNo];
- _lblOrderNo.text = _applyListModel.orderNo;
-
-
- UIView *vCustomerCodeAndName = [UIView new];
- vCustomerCodeAndName.frame=CGRectMake(0, CGRectGetMaxY(vOrderNo.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vCustomerCodeAndName];
-
- UIView *vCustomerCode = [UIView new];
-
- vCustomerCode.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vCustomerCodeAndName addSubview:vCustomerCode];
-
- UILabel *lblCustomerCodeTitle = [UILabel new];
- lblCustomerCodeTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblCustomerCodeTitle.text = @"客户编码:";
- lblCustomerCodeTitle.textColor = [UIColor blackColor];
- lblCustomerCodeTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerCode addSubview:lblCustomerCodeTitle];
- _lblCustomerCode = [UILabel new];
- _lblCustomerCode.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
- _lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerCode addSubview:_lblCustomerCode];
- _lblCustomerCode.text = _applyListModel.customerCode;
-
- UIView *vCustomerName = [UIView new];
- vCustomerName.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
- [vCustomerCodeAndName addSubview:vCustomerName];
-
- UILabel *lblCustomerNameTitle = [UILabel new];
- lblCustomerNameTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
- lblCustomerNameTitle.text = @"客户名称:";
- lblCustomerNameTitle.textColor = [UIColor blackColor];
- lblCustomerNameTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerName addSubview:lblCustomerNameTitle];
-
- _lblCustomerName = [UILabel new];
- _lblCustomerName.frame=CGRectMake(CGRectGetMaxX(lblCustomerNameTitle.frame), valuey, Screen_Width/2 - valuex , valueheight);
- _lblCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerName addSubview:_lblCustomerName];
- _lblCustomerName.text = _applyListModel.customerName;
-
-
- UIView *vDate = [UIView new];
- vDate.frame=CGRectMake(0, CGRectGetMaxY(vCustomerCodeAndName.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vDate];
-
- UIView *vAccountDate = [UIView new];
-
- vAccountDate.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vDate addSubview:vAccountDate];
-
- UILabel *lblAccountDateTitle = [UILabel new];
- lblAccountDateTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblAccountDateTitle.text = @"账务日期:";
- lblAccountDateTitle.textColor = [UIColor blackColor];
- lblAccountDateTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vAccountDate addSubview:lblAccountDateTitle];
- _lblAccountDate = [UILabel new];
- _lblAccountDate.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
- _lblAccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vAccountDate addSubview:_lblAccountDate];
- _lblAccountDate.text = _applyListModel.accountDate;
-
- UIView *vArrivalDate = [UIView new];
- vArrivalDate.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
- [vDate addSubview:vArrivalDate];
-
- UILabel *lblArrivalDateTitle = [UILabel new];
- lblArrivalDateTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
- lblArrivalDateTitle.text = @"到货日期:";
- lblArrivalDateTitle.textColor = [UIColor blackColor];
- lblArrivalDateTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vArrivalDate addSubview:lblArrivalDateTitle];
-
- _lblArrivalDate = [UILabel new];
- _lblArrivalDate.frame=CGRectMake(CGRectGetMaxX(lblArrivalDateTitle.frame), valuey, Screen_Width/2 - valuex , valueheight);
- _lblArrivalDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vArrivalDate addSubview:_lblArrivalDate];
- _lblArrivalDate.text = _applyListModel.arrivalDate;
-
-
- UIView *vApply = [UIView new];
- vApply.frame=CGRectMake(0, CGRectGetMaxY(vDate.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vApply];
-
- UIView *vApplyDepartment = [UIView new];
-
- vApplyDepartment.frame=CGRectMake(0, 0, Screen_Width/2, heightRow);
- [vApply addSubview:vApplyDepartment];
-
- UILabel *lblApplyDepartmentTitle = [UILabel new];
- lblApplyDepartmentTitle.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- lblApplyDepartmentTitle.text = @"申请部门:";
- lblApplyDepartmentTitle.textColor = [UIColor blackColor];
- lblApplyDepartmentTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vApplyDepartment addSubview:lblApplyDepartmentTitle];
- _lblApplyDepartment = [UILabel new];
- _lblApplyDepartment.frame=CGRectMake(valuex, valuey, Screen_Width/2 - valuex, valueheight);
- _lblApplyDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vApplyDepartment addSubview:_lblApplyDepartment];
- _lblApplyDepartment.text = _applyListModel.organizationName;
-
- UIView *vApplicant = [UIView new];
- vApplicant.frame=CGRectMake(Screen_Width / 2, 0, Screen_Width / 2, heightRow);
- [vApply addSubview:vApplicant];
-
- UILabel *lblApplicantTitle = [UILabel new];
- lblApplicantTitle.frame=CGRectMake(5, lbly, lblwidth, lblheight);
- lblApplicantTitle.text = @"申 请 者:";
- lblApplicantTitle.textColor = [UIColor blackColor];
- lblApplicantTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vApplicant addSubview:lblApplicantTitle];
-
- _lblApplicant = [UILabel new];
- _lblApplicant.frame=CGRectMake(CGRectGetMaxX(lblApplicantTitle.frame), valuey, Screen_Width/2 - valuex , valueheight);
- _lblApplicant.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vApplicant addSubview:_lblApplicant];
- _lblApplicant.text = _applyListModel.applicant;
-
- //分割线
- viewBackgroud = [UIView new];
- viewBackgroud.frame = CGRectMake(0, CGRectGetMaxY(vApply.frame)+8, Screen_Width,1);
- viewBackgroud.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:viewBackgroud];
-
- //按钮 —————————
- CGFloat btnweidth = 80;
- CGFloat btnmargin = 100;
-
- UIView *vEdit = [UIView new];
- vEdit.frame=CGRectMake(0, CGRectGetMaxY(viewBackgroud.frame)+8, Screen_Width,39);
- [self.contentView addSubview:vEdit];
-
- _btnProcurementDetail = [UIButton buttonWithType:UIButtonTypeCustom];
- [_btnProcurementDetail setTitle:@"采购明细表" forState:UIControlStateNormal];
- [_btnProcurementDetail setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- [_btnProcurementDetail addTarget:self action:@selector(btnGoProcurementDetail) forControlEvents:UIControlEventTouchUpInside];
- _btnProcurementDetail.layer.cornerRadius = 4;
- _btnProcurementDetail.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
- _btnProcurementDetail.frame = CGRectMake(Screen_Width - btnmargin ,valuey , btnweidth, valueheight);
- [vEdit addSubview:_btnProcurementDetail];
- }
- -(void)btnGoCheck{
-
- }
- -(void)btnGoProcurementDetail
- {
- if([self.delegate respondsToSelector:@selector(goProcurementDetail:)])
- {
- [self.delegate goProcurementDetail:_position];
- }
- }
- @end
|