| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- //
- // RequirementReceiptFrame.m
- // IBOSSHSH
- //
- // Created by ssl on 2018/1/12.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "DispatchReceiptFrame.h"
- #import "NSString+Tools.h"
- #import "DateFormat.h"
- #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
- #define kTitleFont [UIFont systemFontOfSize:14]
- @implementation DispatchReceiptFrame
- #pragma mark - 私有函数
- - (void)setReceiptedListFrame:(DispatchReceiptModel *)deliveryListModel{
- _deliveryListModel = deliveryListModel;
- NSDictionary *receiptDict = @{NSFontAttributeName:kTitleFont};
- CGFloat xpadding = 10;
- NSString *receiptNoTitle = @"回执单号:";
- CGRect lblReceiptNoFrame = [receiptNoTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblReceiptNoFrame.origin.x = xpadding;
- lblReceiptNoFrame.origin.y = 15;
- _lblReceiptNoF = lblReceiptNoFrame;
-
- NSString *receiptNo = [deliveryListModel recReceiptNo];
- if(receiptNo != nil && receiptNo.length > 0){
- CGRect receiptNoFrame = [receiptNo textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- receiptNoFrame.origin.x = CGRectGetMaxX(_lblReceiptNoF);
- receiptNoFrame.origin.y = 15;
- _receiptNoF=receiptNoFrame;
- }
-
- _btnDialTelephoneF=CGRectMake(Screen_Width-56,8,32,32);
-
-
- _separatorF=CGRectMake(0,CGRectGetMaxY(_lblReceiptNoF)+15, Screen_Width, 1);
-
-
- NSString *dispatchNoTitle = @"派工单号:";
- CGRect lblDispatchNoFrame = [dispatchNoTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblDispatchNoFrame.origin.x = xpadding;
- lblDispatchNoFrame.origin.y = CGRectGetMaxY(_separatorF) + 15;
- _lblDispatchNoF = lblDispatchNoFrame;
-
- NSString *dispatchNo = [deliveryListModel arrangementNo];
- if(dispatchNo != nil&&dispatchNo.length > 0){
- CGRect dispatchNoFrame = [dispatchNo textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- dispatchNoFrame.origin.x = CGRectGetMaxX(_lblDispatchNoF) ;
- dispatchNoFrame.origin.y = CGRectGetMaxY(_separatorF) + 15;
- _dispatchNoF = dispatchNoFrame;
- }
-
- NSString *customerNameTitle = @"客户名称:";
- CGRect lblCustomerNameFrame = [customerNameTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblCustomerNameFrame.origin.x = xpadding;
- lblCustomerNameFrame.origin.y = CGRectGetMaxY(_lblDispatchNoF) + 15;
- _lblCustomerNameF = lblCustomerNameFrame;
-
- NSString *customerName = [_deliveryListModel customerName];
- if(customerName != nil && customerName.length > 0){
- CGRect customerNameFrame = [customerName textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- customerNameFrame.origin.x = CGRectGetMaxX(_lblCustomerNameF)+2;
- customerNameFrame.origin.y = CGRectGetMaxY(_lblDispatchNoF)+15;
- _customerNameF = customerNameFrame;
- }
-
-
- NSString *telephoneTitle = @"联系电话:";
- CGRect lblTelephoneFrame = [telephoneTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblTelephoneFrame.origin.x = xpadding;
- lblTelephoneFrame.origin.y = CGRectGetMaxY(_lblCustomerNameF) + 15;
- _lblTelephoneF = lblTelephoneFrame;
-
- NSString *telephone = [_deliveryListModel telephone];
- if(telephone != nil && telephone.length > 0){
- CGRect telephoneFrame = [telephone textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- telephoneFrame.origin.x = CGRectGetMaxX(_lblTelephoneF)+2;
- telephoneFrame.origin.y = CGRectGetMaxY(_lblCustomerNameF)+15;
- _telephoneF = telephoneFrame;
- }
-
-
- NSString *serviceStaffNameTitle = @"服务人员:";
- CGRect lblServiceStaffNameFrame = [serviceStaffNameTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblServiceStaffNameFrame.origin.x = xpadding;
- lblServiceStaffNameFrame.origin.y = CGRectGetMaxY(_lblTelephoneF) + 15;
- _lblServiceStaffNameF = lblServiceStaffNameFrame;
-
- NSString *serviceStaffName = [_deliveryListModel serviceStaffName];
- if(serviceStaffName != nil && serviceStaffName.length > 0){
- CGRect serviceStaffNameFrame = [serviceStaffName textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- serviceStaffNameFrame.origin.x = CGRectGetMaxX(_lblCustomerNameF)+2;
- serviceStaffNameFrame.origin.y = CGRectGetMaxY(_lblTelephoneF)+15;
- _serviceStaffNameF = serviceStaffNameFrame;
- }
-
-
-
-
- NSString *receiptDateTitle = @"回执日期:";
- CGRect lblReceiptDateFrame = [receiptDateTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblReceiptDateFrame.origin.x = xpadding;
- lblReceiptDateFrame.origin.y = CGRectGetMaxY(_lblServiceStaffNameF) + 15;
- _lblReceiptDateF = lblReceiptDateFrame;
-
- NSString *receiptDate = [_deliveryListModel receiptTime];
- receiptDate = [DateFormat dateFormatSplit:receiptDate];
- if(receiptDate != nil &&receiptDate.length > 0){
- CGRect receiptDateFrame = [receiptDate textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- receiptDateFrame.origin.x = CGRectGetMaxX(_lblReceiptDateF) ;
- receiptDateFrame.origin.y = CGRectGetMaxY(_lblServiceStaffNameF) + 15;
- _receiptDateF = receiptDateFrame;
- }
-
-
- NSString *receiptTypeTitle = @"回执类型:";
- CGRect lblReceiptTypeFrame = [receiptTypeTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblReceiptTypeFrame.origin.x = Screen_Width/2;
- lblReceiptTypeFrame.origin.y = CGRectGetMaxY(_lblServiceStaffNameF) + 15;
- _lblReceiptTypeTitleF = lblReceiptTypeFrame;
-
- NSString *receiptTypeStr;
- if(deliveryListModel.receiptType==1){
- receiptTypeStr = @"撤销回执";
- }else{
- receiptTypeStr = @"回执";
- }
- if(receiptTypeStr != nil &&receiptTypeStr.length > 0){
- CGRect receiptTypeFrame = [receiptTypeStr textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- receiptTypeFrame.origin.x = CGRectGetMaxX(_lblReceiptTypeTitleF) ;
- receiptTypeFrame.origin.y = CGRectGetMaxY(_lblServiceStaffNameF) + 15;
- _receiptTypeF = receiptTypeFrame;
- }
-
-
-
-
- NSString *deliveryFlagTitle=@"送货回执标识:";
- CGRect lblDeliveryFlagTitleFrame = [deliveryFlagTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblDeliveryFlagTitleFrame.origin.x = xpadding;
- lblDeliveryFlagTitleFrame.origin.y = CGRectGetMaxY(_lblReceiptDateF) + 15;
- _deliveryFlagTitleF = lblDeliveryFlagTitleFrame;
-
-
- NSString *deliveryFlag = [_deliveryListModel deliveryReceiptFlag];
- NSString *deliveryFlagStr;
- if([deliveryFlag intValue]==0)
- {
- deliveryFlagStr=@"否";
- }
- else{
- deliveryFlagStr=@"是";
- }
- if(deliveryFlagStr != nil && deliveryFlagStr.length > 0){
- CGRect deliveryFlagFrame = [deliveryFlagStr textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- deliveryFlagFrame.origin.x = CGRectGetMaxX(_deliveryFlagTitleF);
- deliveryFlagFrame.origin.y = CGRectGetMaxY(_lblReceiptDateF) + 15;
- _deliveryFlagF = deliveryFlagFrame;
- }
-
-
- NSString *installFlagTitle=@"安装回执标识:";
- CGRect lblInstallFlagTitleFrame = [installFlagTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:receiptDict];
- lblInstallFlagTitleFrame.origin.x = Screen_Width / 2;
- lblInstallFlagTitleFrame.origin.y = CGRectGetMaxY(_lblReceiptDateF) + 15;
- _installFlagTitleF = lblInstallFlagTitleFrame;
-
-
- NSString *installFlag = [_deliveryListModel installReceiptFlag];
- NSString *installFlagStr;
- if([installFlag intValue]==0)
- {
- installFlagStr=@"否";
- }
- else{
- installFlagStr=@"是";
- }
- if(installFlagStr != nil && installFlagStr.length > 0){
- CGRect installFlagFrame = [installFlagStr textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:receiptDict];
- installFlagFrame.origin.x = CGRectGetMaxX(_installFlagTitleF);
- installFlagFrame.origin.y = CGRectGetMaxY(_lblReceiptDateF) + 15;
- _installFlagF = installFlagFrame;
- }
-
-
-
- // _bottomLineF = CGRectMake(0, CGRectGetMaxY(_deliveryFlagTitleF)+15, SCREENWIDTH, 1);
- //
- // _returnReceiptF = CGRectMake(SCREENWIDTH -110, CGRectGetMaxY(_bottomLineF)+15, 70, 30);
- _cellHeight = CGRectGetMaxY(_deliveryFlagTitleF)+15;
- }
- @end
|