// // CustomerBalanceDetailViewController.m // IBOSS // // Created by apple on 2017/5/24. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved. // // 功能描述:客户往来余额详细控制器 // #import "CustomerBalanceDetailViewController.h" @interface CustomerBalanceDetailViewController () @end @implementation CustomerBalanceDetailViewController /** viewDidLoad函数 */ - (void)viewDidLoad { [super viewDidLoad]; [self showTitle:@""]; [self initUI]; } /** 安全区视图发生变化 */ -(void)viewSafeAreaInsetsDidChange{ _scroll.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; _scroll = [UIScrollView new]; _scroll.frame=self.view.bounds; [self.view addSubview:_scroll]; UIView *vTitle = [UIView new]; [_scroll addSubview:vTitle]; vTitle.backgroundColor = [UIColor whiteColor]; UIView *vcustomerName = [UIView new]; vcustomerName.frame=CGRectMake(0, CGRectGetMaxY(vTitle.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 *vchannelName = [UIView new]; vchannelName.frame=CGRectMake(0, CGRectGetMaxY(vcustomerName.frame), Screen_Width, heightRow); [vTitle addSubview:vchannelName]; UILabel *lblname = [UILabel new]; lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblname.text = @"渠道名称:"; lblname.textColor = [UIColor blackColor]; lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vchannelName addSubview:lblname]; UILabel *lblValue = [UILabel new]; lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblValue.text = self.sChannelName; [vchannelName addSubview:lblValue]; UIView *vdictionaryValue = [UIView new]; vdictionaryValue.frame=CGRectMake(0, CGRectGetMaxY(vchannelName.frame), Screen_Width, heightRow); [vTitle addSubview:vdictionaryValue]; lblname = [UILabel new]; lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblname.text = @"客户性质:"; lblname.textColor = [UIColor blackColor]; lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vdictionaryValue addSubview:lblname]; lblValue = [UILabel new]; lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblValue.text = self.sDictionaryValue; [vdictionaryValue addSubview:lblValue]; UIView *vaccountOrganizationName = [UIView new]; vaccountOrganizationName.frame=CGRectMake(0, CGRectGetMaxY(vdictionaryValue.frame), Screen_Width, heightRow); [vTitle addSubview:vaccountOrganizationName]; lblname = [UILabel new]; lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblname.text = @"核算机构:"; lblname.textColor = [UIColor blackColor]; lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vaccountOrganizationName addSubview:lblname]; lblValue = [UILabel new]; lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblValue.text = self.sAccountOrganizationName; [vaccountOrganizationName addSubview:lblValue]; UIView *vorganizationName = [UIView new]; vorganizationName.frame=CGRectMake(0, CGRectGetMaxY(vaccountOrganizationName.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 *vwstaffName = [UIView new]; vwstaffName.frame=CGRectMake(0, CGRectGetMaxY(vorganizationName.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 *vSecondaryStaffName = [UIView new]; vSecondaryStaffName.frame=CGRectMake(0, CGRectGetMaxY(vwstaffName.frame), Screen_Width, heightRow); [vTitle addSubview:vSecondaryStaffName]; UILabel *lblSecondaryStaffName = [UILabel new]; lblSecondaryStaffName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblSecondaryStaffName.text = @"从业务员:"; lblSecondaryStaffName.textColor = [UIColor blackColor]; lblSecondaryStaffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vSecondaryStaffName addSubview:lblSecondaryStaffName]; UILabel *secondaryStaffName = [UILabel new]; secondaryStaffName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); secondaryStaffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; secondaryStaffName.text = self.sSecondaryStaffName; [vSecondaryStaffName addSubview:secondaryStaffName]; // ————————— UIView *vdistrictName = [UIView new]; vdistrictName.frame=CGRectMake(0, CGRectGetMaxY(vSecondaryStaffName.frame), Screen_Width, heightRow); [vTitle addSubview:vdistrictName]; lblname = [UILabel new]; lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblname.text = @"客户区域:"; lblname.textColor = [UIColor blackColor]; lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vdistrictName addSubview:lblname]; lblValue = [UILabel new]; lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblValue.text = self.sDistrictName; [vdistrictName addSubview:lblValue]; // ————————— UIView *vcreditLine = [UIView new]; vcreditLine.frame=CGRectMake(0, CGRectGetMaxY(vdistrictName.frame), Screen_Width, heightRow); [vTitle addSubview:vcreditLine]; lblname = [UILabel new]; lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblname.text = @"信用额度:"; lblname.textColor = [UIColor blackColor]; lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vcreditLine addSubview:lblname]; lblValue = [UILabel new]; lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblValue.text = self.sCreditLine; [vcreditLine addSubview:lblValue]; // ————————— UIView *vtelephone = [UIView new]; vtelephone.frame=CGRectMake(0, CGRectGetMaxY(vcreditLine.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 *vcustomerAddress = [UIView new]; vcustomerAddress.frame=CGRectMake(0, CGRectGetMaxY(vtelephone.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-8, valueheight); customerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; customerAddress.text = self.sAddress; [vcustomerAddress addSubview:customerAddress]; // ————————— UIView *vdepositReceived = [UIView new]; vdepositReceived.frame=CGRectMake(0, CGRectGetMaxY(vcustomerAddress.frame), Screen_Width, heightRow); [vTitle addSubview:vdepositReceived]; lblname = [UILabel new]; lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblname.text = @"预 收 款:"; lblname.textColor = [UIColor blackColor]; lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vdepositReceived addSubview:lblname]; lblValue = [UILabel new]; lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblValue.text = [Util positiveFormat:self.sDepositReceived]; [vdepositReceived addSubview:lblValue]; UIView *vamountReceivable = [UIView new]; vamountReceivable.frame=CGRectMake(0, CGRectGetMaxY(vdepositReceived.frame), Screen_Width, heightRow); [vTitle addSubview:vamountReceivable]; lblname = [UILabel new]; lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblname.text = @"应 收 款:"; lblname.textColor = [UIColor blackColor]; lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vamountReceivable addSubview:lblname]; lblValue = [UILabel new]; lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblValue.text = [Util positiveFormat:self.sAmountReceivable]; [vamountReceivable addSubview:lblValue]; UIView *vearnest = [UIView new]; vearnest.frame=CGRectMake(0, CGRectGetMaxY(vamountReceivable.frame), Screen_Width, heightRow); [vTitle addSubview:vearnest]; lblname = [UILabel new]; lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight); lblname.text = @"定 金:"; lblname.textColor = [UIColor blackColor]; lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; [vearnest addSubview:lblname]; lblValue = [UILabel new]; lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight); lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; lblValue.text = [Util positiveFormat:self.sEarnest]; [vearnest addSubview:lblValue]; // 重新设置frame vTitle.frame=CGRectMake(10, 10, Screen_Width-20, CGRectGetMaxY(vearnest.frame) ); vTitle.layer.cornerRadius = CornerRadius; _scroll.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vTitle.frame)+rectStatusHeight+rectNavHeight); } @end