// // SingleProfitDetailViewController.m // IBOSSmini // // Created by apple on 2017/5/18. // Copyright © 2017年 elongtian. All rights reserved. // #import "SingleProfitDetailViewController.h" @interface SingleProfitDetailViewController (){ UIScrollView *_scrollView; } @end @implementation SingleProfitDetailViewController /** viewDidLoad函数 */ - (void)viewDidLoad { [super viewDidLoad]; [self showTitle:@""]; [self initUI]; } /** 安全区视图发生变化 */ -(void)viewSafeAreaInsetsDidChange{ _scrollView.frame = self.view.safeAreaLayoutGuide.layoutFrame; [super viewSafeAreaInsetsDidChange]; } /** didReceiveMemoryWarning函数 */ - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } #pragma mark - 私有函数 /** 初始化ui */ - (void)initUI { ; self.navigationItem.title=@"每单利润详细表"; self.view.backgroundColor = LineBackgroundColor; CGFloat heightRow = 30; CGFloat lblx = 10; CGFloat lbly = 3; CGFloat lblwidth = 70; CGFloat lblheight = 25; CGFloat valuex = 80; CGFloat valuey = 3; CGFloat valueheight = 25; _scrollView=[UIScrollView new]; _scrollView.frame=self.view.bounds; [self.view addSubview:_scrollView]; UIView *vTitle = [UIView new]; [_scrollView addSubview:vTitle]; vTitle.backgroundColor = [UIColor whiteColor]; //================== UIView *vNo = [UIView new]; vNo.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame), Screen_Width, heightRow); [vTitle addSubview:vNo]; UILabel *lblNo=[UILabel new]; lblNo.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblNo.text=@"业务单号:"; lblNo.textColor = [UIColor blackColor]; lblNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vNo addSubview:lblNo]; UILabel *lblNoValue = [UILabel new]; lblNoValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblNoValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblNoValue.text = self.sInvoiceNo; [vNo addSubview:lblNoValue]; //================== UIView *vinvoiceType = [UIView new]; vinvoiceType.frame=CGRectMake(0, CGRectGetMaxY(vNo.frame), Screen_Width, heightRow); [vTitle addSubview:vinvoiceType]; UILabel *lblinvoiceType=[UILabel new]; lblinvoiceType.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblinvoiceType.text=@"业务类型:"; lblinvoiceType.textColor = [UIColor blackColor]; lblinvoiceType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vinvoiceType addSubview:lblinvoiceType]; UILabel *invoiceType = [UILabel new]; invoiceType.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); invoiceType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; invoiceType.text = self.sInvoiceType; [vinvoiceType addSubview:invoiceType]; //================== UIView *vorganizationCode = [UIView new]; vorganizationCode.frame=CGRectMake(0, CGRectGetMaxY(vinvoiceType.frame), Screen_Width, heightRow); [vTitle addSubview:vorganizationCode]; UILabel *lblorganizationCode=[UILabel new]; lblorganizationCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblorganizationCode.text=@"部门编码:"; lblorganizationCode.textColor = [UIColor blackColor]; lblorganizationCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vorganizationCode addSubview:lblorganizationCode]; UILabel *organizationCode = [UILabel new]; organizationCode.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); organizationCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; organizationCode.text = self.sOrganizationCode; [vorganizationCode addSubview:organizationCode]; // ================== UIView *vorganizationName = [UIView new]; vorganizationName.frame=CGRectMake(0, CGRectGetMaxY(vorganizationCode.frame), Screen_Width, heightRow); [vTitle addSubview:vorganizationName]; UILabel *lblorganizationName=[UILabel new]; lblorganizationName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblorganizationName.text=@"部门名称:"; lblorganizationName.textColor = [UIColor blackColor]; lblorganizationName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vorganizationName addSubview:lblorganizationName]; UILabel *organizationName = [UILabel new]; organizationName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); organizationName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; organizationName.text = self.sOrganizationName; [vorganizationName addSubview:organizationName]; // ================== UIView *vaccountDate = [UIView new]; vaccountDate.frame=CGRectMake(0, CGRectGetMaxY(vorganizationName.frame), Screen_Width, heightRow); [vTitle addSubview:vaccountDate]; UILabel *lblaccountDate=[UILabel new]; lblaccountDate.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblaccountDate.text=@"账务日期:"; lblaccountDate.textColor = [UIColor blackColor]; lblaccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vaccountDate addSubview:lblaccountDate]; UILabel *accountDate = [UILabel new]; accountDate.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); accountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; accountDate.text = self.sAccountDate; [vaccountDate addSubview:accountDate]; // ================== UIView *vcustomerCode = [UIView new]; vcustomerCode.frame=CGRectMake(0, CGRectGetMaxY(vaccountDate.frame), Screen_Width, heightRow); [vTitle addSubview:vcustomerCode]; UILabel *lblcustomerCode=[UILabel new]; lblcustomerCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblcustomerCode.text=@"客户编码:"; lblcustomerCode.textColor = [UIColor blackColor]; lblcustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vcustomerCode addSubview:lblcustomerCode]; UILabel *customerCode = [UILabel new]; customerCode.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); customerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; customerCode.text = self.sCustomerCode; [vcustomerCode addSubview:customerCode]; //================== UIView *vcustomerName = [UIView new]; vcustomerName.frame=CGRectMake(0, CGRectGetMaxY(vcustomerCode.frame), Screen_Width, heightRow); [vTitle addSubview:vcustomerName]; UILabel *lblcustomerName=[UILabel new]; lblcustomerName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblcustomerName.text=@"客户名称:"; lblcustomerName.textColor = [UIColor blackColor]; lblcustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vcustomerName addSubview:lblcustomerName]; UILabel *customerName = [UILabel new]; customerName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); customerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; customerName.text = self.sCustomerName; [vcustomerName addSubview:customerName]; //================== UIView *vwstaffName = [UIView new]; vwstaffName.frame=CGRectMake(0, CGRectGetMaxY(vcustomerName.frame), Screen_Width, heightRow); [vTitle addSubview:vwstaffName]; UILabel *lblstaffName=[UILabel new]; lblstaffName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblstaffName.text=@"业 务 员:"; lblstaffName.textColor = [UIColor blackColor]; lblstaffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vwstaffName addSubview:lblstaffName]; UILabel *staffName = [UILabel new]; staffName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); staffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; staffName.text = self.sStaffName; [vwstaffName addSubview:staffName]; //================== UIView *vtelephone = [UIView new]; vtelephone.frame=CGRectMake(0, CGRectGetMaxY(vwstaffName.frame), Screen_Width, heightRow); [vTitle addSubview:vtelephone]; UILabel *lbltelephone=[UILabel new]; lbltelephone.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lbltelephone.text=@"联系电话:"; lbltelephone.textColor = [UIColor blackColor]; lbltelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vtelephone addSubview:lbltelephone]; UILabel *positionNumber = [UILabel new]; positionNumber.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); positionNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; positionNumber.text = self.sTelephone; [vtelephone addSubview:positionNumber]; //================== UIView *vcustomerTypeName = [UIView new]; vcustomerTypeName.frame=CGRectMake(0, CGRectGetMaxY(vtelephone.frame), Screen_Width, heightRow); [vTitle addSubview:vcustomerTypeName]; UILabel *lblcustomerTypeName=[UILabel new]; lblcustomerTypeName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblcustomerTypeName.text=@"客户性质:"; lblcustomerTypeName.textColor = [UIColor blackColor]; lblcustomerTypeName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vcustomerTypeName addSubview:lblcustomerTypeName]; UILabel *customerTypeName = [UILabel new]; customerTypeName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); customerTypeName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; customerTypeName.text = self.sCustomerTypeName; [vcustomerTypeName addSubview:customerTypeName]; //================== UIView *vcustomerAddress = [UIView new]; vcustomerAddress.frame=CGRectMake(0, CGRectGetMaxY(vcustomerTypeName.frame), Screen_Width, heightRow); [vTitle addSubview:vcustomerAddress]; UILabel *lblcustomerAddress=[UILabel new]; lblcustomerAddress.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblcustomerAddress.text=@"客户地址:"; lblcustomerAddress.textColor = [UIColor blackColor]; lblcustomerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vcustomerAddress addSubview:lblcustomerAddress]; UILabel *customerAddress = [UILabel new]; customerAddress.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); customerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; customerAddress.text = self.sCustomerAddress; [vcustomerAddress addSubview:customerAddress]; //================== UIView *vchannelName = [UIView new]; vchannelName.frame=CGRectMake(0, CGRectGetMaxY(vcustomerAddress.frame), Screen_Width, heightRow); [vTitle addSubview:vchannelName]; UILabel *lblchannelName=[UILabel new]; lblchannelName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblchannelName.text=@"客户渠道:"; lblchannelName.textColor = [UIColor blackColor]; lblchannelName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vchannelName addSubview:lblchannelName]; UILabel *channelName = [UILabel new]; channelName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); channelName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; channelName.text = self.sChannelName; [vchannelName addSubview:channelName]; // //================== UIView *vincomeAmount = [UIView new]; vincomeAmount.frame=CGRectMake(0, CGRectGetMaxY(vchannelName.frame), Screen_Width, heightRow); [vTitle addSubview:vincomeAmount]; UILabel *lblincomeAmount=[UILabel new]; lblincomeAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblincomeAmount.text=@"收 入:"; lblincomeAmount.textColor = [UIColor blackColor]; lblincomeAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vincomeAmount addSubview:lblincomeAmount]; UILabel *incomeAmount = [UILabel new]; incomeAmount.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); incomeAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; incomeAmount.text = self.sIncomeAmount; [vincomeAmount addSubview:incomeAmount]; //================== UIView *vcostAmount = [UIView new]; vcostAmount.frame=CGRectMake(0, CGRectGetMaxY(vincomeAmount.frame), Screen_Width, heightRow); [vTitle addSubview:vcostAmount]; UILabel *lblcostAmount=[UILabel new]; lblcostAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblcostAmount.text=@"成 本:"; lblcostAmount.textColor = [UIColor blackColor]; lblcostAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vcostAmount addSubview:lblcostAmount]; UILabel *costAmount = [UILabel new]; costAmount.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); costAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; costAmount.text = self.sCostAmount; [vcostAmount addSubview:costAmount]; UIView *vmargin = [UIView new]; vmargin.frame=CGRectMake(0, CGRectGetMaxY(vcostAmount.frame), Screen_Width, heightRow); [vTitle addSubview:vmargin]; UILabel *lblmarginAmount=[UILabel new]; lblmarginAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblmarginAmount.text=@"毛 利:"; lblmarginAmount.textColor = [UIColor blackColor]; lblmarginAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vmargin addSubview:lblmarginAmount]; UILabel *marginAmount = [UILabel new]; marginAmount.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); marginAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; marginAmount.text = self.sMarginAmount; [vmargin addSubview:marginAmount]; UIView *vCustomerAmount = [UIView new]; vCustomerAmount.frame=CGRectMake(0, CGRectGetMaxY(vmargin.frame), Screen_Width, heightRow); [vTitle addSubview:vCustomerAmount]; UILabel *lblcustomerAmount=[UILabel new]; lblcustomerAmount.frame=CGRectMake(lblx, lbly, 100, lblheight); lblcustomerAmount.text=@"中间客户业绩:"; lblcustomerAmount.textColor = [UIColor blackColor]; lblcustomerAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vCustomerAmount addSubview:lblcustomerAmount]; UILabel *customerAmount = [UILabel new]; customerAmount.frame=CGRectMake(110, valuey, Screen_Width - 110 - lblx, valueheight); customerAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; customerAmount.text = self.sCustomerAmount; [vCustomerAmount addSubview:customerAmount]; UIView *vservice = [UIView new]; vservice.frame=CGRectMake(0, CGRectGetMaxY(vCustomerAmount.frame), Screen_Width, heightRow); [vTitle addSubview:vservice]; UILabel *lblservice=[UILabel new]; lblservice.frame=CGRectMake(lblx, lbly, 100, lblheight); lblservice.text=@"服务人员业绩:"; lblservice.textColor = [UIColor blackColor]; lblservice.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vservice addSubview:lblservice]; UILabel *service = [UILabel new]; service.frame=CGRectMake(110, valuey, Screen_Width - 110 - lblx, valueheight); service.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; service.text = self.sServiceAmount; [vservice addSubview:service]; UIView *vfees = [UIView new]; vfees.frame=CGRectMake(0, CGRectGetMaxY(vservice.frame), Screen_Width, heightRow); [vTitle addSubview:vfees]; UILabel *lblfees=[UILabel new]; lblfees.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblfees.text=@"费 用:"; lblfees.textColor = [UIColor blackColor]; lblfees.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vfees addSubview:lblfees]; UILabel *fees = [UILabel new]; fees.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); fees.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; fees.text = self.sFeesAmount; [vfees addSubview:fees]; UIView *vprofit = [UIView new]; vprofit.frame=CGRectMake(0, CGRectGetMaxY(vfees.frame), Screen_Width, heightRow); [vTitle addSubview:vprofit]; UILabel *lblprofit=[UILabel new]; lblprofit.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblprofit.text=@"利 润:"; lblprofit.textColor = [UIColor blackColor]; lblprofit.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vprofit addSubview:lblprofit]; UILabel *profit = [UILabel new]; profit.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); profit.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; profit.text = self.sProfitAmount; [vprofit addSubview:profit]; UIView *vremarks = [UIView new]; vremarks.frame=CGRectMake(0, CGRectGetMaxY(vprofit.frame), Screen_Width, heightRow); [vTitle addSubview:vremarks]; UILabel *lblremarks=[UILabel new]; lblremarks.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblremarks.text=@"备 注:"; lblremarks.textColor = [UIColor blackColor]; lblremarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vremarks addSubview:lblremarks]; UILabel *remarks = [UILabel new]; remarks.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); remarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; remarks.text = self.sRemarks; [vremarks addSubview:remarks]; vTitle.frame=CGRectMake(10, 10, Screen_Width-20, CGRectGetMaxY(vremarks.frame) ); vTitle.layer.cornerRadius = CornerRadius; _scrollView.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vTitle.frame)+rectStatusHeight+rectNavHeight); } @end