| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- //
- // InstallReceiptedListFrame.m
- // IBOSS
- //
- // Created by guan hong hou on 2017/7/13.
- // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
- // 功能描述:安装已回执frame
- #import "InstallReceiptedListFrame.h"
- #import "DateFormat.h"
- #import "NSString+Tools.h"
- #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
- #define kTitleFont [UIFont systemFontOfSize:14]
- @implementation InstallReceiptedListFrame
- #pragma mark - 私有函数
- /**
- 设置安装已回执frame
- @param installationInfoModel <#installationInfoModel description#>
- */
- - (void)setInstallationListFrame:(InstallReceiptListModel *)installationInfoModel{
- _installationReceiptListModel = installationInfoModel;
- NSDictionary *installationDict = @{NSFontAttributeName:kTitleFont};
- CGFloat xpadding = 10;
- NSString *receiptNoTitle = @"回执单号:";
- CGRect lblReceiptNoFrame = [receiptNoTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:installationDict];
- lblReceiptNoFrame.origin.x = xpadding;
- lblReceiptNoFrame.origin.y = 15;
- _lblReceiptNoF = lblReceiptNoFrame;
-
- NSString *receiptNoStr = [_installationReceiptListModel receiptNo];
- if(receiptNoStr != nil && receiptNoStr.length > 0){
- CGRect receiptNoFrame = [receiptNoStr textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:installationDict];
- receiptNoFrame.origin.y = 15;
- receiptNoFrame.origin.x = CGRectGetMaxX(_lblReceiptNoF);
- _receiptNoF = receiptNoFrame;
- }
-
- _btnCancelReceiptF=CGRectMake(Screen_Width-70, 15,60,17);
- _separatorF = CGRectMake(0,CGRectGetMaxY(_lblReceiptNoF) + 15, Screen_Width, 1);
-
- NSString *arrangementNoTitle = @"安排单号:";
- CGRect lblArrangementNoFrame = [arrangementNoTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:installationDict];
- lblArrangementNoFrame.origin.x = xpadding;
- lblArrangementNoFrame.origin.y = CGRectGetMaxY(_separatorF)+15;
- _lblArrangementNoF = lblArrangementNoFrame;
- NSString *arrangementNoStr = [_installationReceiptListModel arrangementNo];
- if(arrangementNoStr != nil&&arrangementNoStr.length > 0){
- CGRect arrangementNoFrame = [arrangementNoStr textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:installationDict];
- arrangementNoFrame.origin.x = CGRectGetMaxX(_lblArrangementNoF) ;
- arrangementNoFrame.origin.y = CGRectGetMaxY(_separatorF) + 15;
- _arrangementNoF = arrangementNoFrame;
- }
-
-
- NSString *installationNoTitle = @"安装单号:";
- CGRect lblInstallationNoFrame = [installationNoTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:installationDict];
- lblInstallationNoFrame.origin.x = xpadding;
- lblInstallationNoFrame.origin.y = CGRectGetMaxY(_lblArrangementNoF) +15;
- _lblInstallationNoF = lblInstallationNoFrame;
- NSString *installationNoStr = [_installationReceiptListModel installationNo];
- if(installationNoStr != nil && installationNoStr.length > 0){
- CGRect installationNoFrame = [installationNoStr textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:installationDict];
- installationNoFrame.origin.x = CGRectGetMaxX(_lblInstallationNoF);
- installationNoFrame.origin.y = CGRectGetMaxY(_lblArrangementNoF) + 15;
- _installationNoF = installationNoFrame;
- }
- NSString *customerNameTitle = @"客户名称:";
- CGRect lblCustomerNameFrame = [customerNameTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:installationDict];
- lblCustomerNameFrame.origin.x = xpadding;
- lblCustomerNameFrame.origin.y = CGRectGetMaxY(_lblInstallationNoF) + 15;
- _lblCustomerNameF=lblCustomerNameFrame;
- NSString *customerName = [_installationReceiptListModel customerName];
- if(customerName != nil &&customerName.length > 0){
- CGRect customerNameFrame = [customerName textRectWithSize:CGSizeMake(Screen_Width-CGRectGetMaxX(_lblCustomerNameF) - 5, MAXFLOAT) attributes:installationDict];
- customerNameFrame.origin.x = CGRectGetMaxX(_lblCustomerNameF);
- customerNameFrame.origin.y = CGRectGetMaxY( _lblInstallationNoF) + 15;
- _customerNameF = customerNameFrame;
- }
-
- NSString *customerAddressTitle = @"客户地址:";
- CGRect lblCustomerAddressFrame = [customerAddressTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:installationDict];
- lblCustomerAddressFrame.origin.x = xpadding;
- lblCustomerAddressFrame.origin.y = CGRectGetMaxY(_lblCustomerNameF) + 15;
- _lblCustomerAddressF=lblCustomerAddressFrame;
-
- NSString *customerAddress = [_installationReceiptListModel customerAddress];
- if(customerAddress != nil &&customerAddress.length > 0){
-
- CGRect customerAddressFrame=CGRectMake( CGRectGetMaxX(_lblCustomerAddressF), CGRectGetMaxY(_lblCustomerNameF)+15, Screen_Width- CGRectGetMaxX(_lblCustomerAddressF)-5, 16.7);
- _customerAddressF = customerAddressFrame;
- }
-
- NSString *customerTelephoneTitle = @"客户电话:";
- CGRect lblCustomerTelephoneFrame = [customerTelephoneTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:installationDict];
- lblCustomerTelephoneFrame.origin.x = xpadding;
- lblCustomerTelephoneFrame.origin.y = CGRectGetMaxY(_lblCustomerAddressF) + 15;
- _lblCustomerTelephoneF = lblCustomerTelephoneFrame;
-
- NSString *customerTelephone = [_installationReceiptListModel customerTelephone];
- if(customerTelephone != nil && customerTelephone.length > 0){
- CGRect customerTelephoneFrame=CGRectMake( CGRectGetMaxX(_lblCustomerTelephoneF)+2, CGRectGetMaxY(_lblCustomerAddressF)+15, Screen_Width- CGRectGetMaxX(_lblCustomerTelephoneF)-2-5, 16.7);
- _customerTelephoneF = customerTelephoneFrame;
- }
-
-
- NSString *receiptDateTitle = @"回执日期:";
- CGRect lblReceiptDateFrame = [receiptDateTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:installationDict];
- lblReceiptDateFrame.origin.x = xpadding;
- lblReceiptDateFrame.origin.y = CGRectGetMaxY(_lblCustomerTelephoneF) + 15;
- _lblReceiptDateF = lblReceiptDateFrame;
- NSString *receiptDate = [_installationReceiptListModel receiptDate];
- receiptDate = [DateFormat dateFormatSplit:receiptDate];
- if(receiptDate != nil && receiptDate.length > 0){
- CGRect receiptDateFrame = [receiptDate textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:installationDict];
- receiptDateFrame.origin.x = CGRectGetMaxX(_lblReceiptDateF) ;
- receiptDateFrame.origin.y = CGRectGetMaxY(_lblCustomerTelephoneF) + 15;
- _receiptDateF = receiptDateFrame;
- }
-
-
- NSString *receiptStatusTitle = @"回执状态:";
- CGRect lblReceiptStatusFrame = [receiptStatusTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:installationDict];
- lblReceiptStatusFrame.origin.x=Screen_Width /2;
- lblReceiptStatusFrame.origin.y=CGRectGetMaxY(_lblCustomerTelephoneF)+15;
- _lblReceiptStatusF= lblReceiptStatusFrame;
- NSString *receiptType = [_installationReceiptListModel receiptType];
- if ([receiptType isEqualToString:@"1"]) {
- receiptType = @"完成";
- }
- if ([receiptType isEqualToString:@"3"]) {
- receiptType = @"推迟安装";
- }
- if(receiptType != nil&&receiptType.length>0){
- CGRect receiptStatusFrame = [receiptType textRectWithSize:CGSizeMake(Screen_Width-CGRectGetMaxX(_lblReceiptStatusF)-5, MAXFLOAT) attributes:installationDict];
- receiptStatusFrame.origin.x =CGRectGetMaxX(_lblReceiptStatusF);
- receiptStatusFrame.origin.y =CGRectGetMaxY(_lblCustomerTelephoneF)+15;
- _receiptStatusF= receiptStatusFrame;
-
- }
-
- _cellHeight=CGRectGetMaxY(_lblReceiptDateF)+5;
- }
- @end
|