| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- //
- // RequirementNoReceiptFrame.m
- // IBOSSHSH
- //
- // Created by ssl on 2018/1/12.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "DispatchNoReceiptFrame.h"
- #import "RequirementNoReceiptCell.h"
- #import "NSString+Tools.h"
- #import "DateFormat.h"
- #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
- #define kTitleFont [UIFont systemFontOfSize:14]
- @implementation DispatchNoReceiptFrame
- #pragma mark - 私有函数
- /**
- 设置未回执frame
- @param unReceiptListModel <#unReceiptListModel description#>
- */
- - (void)setUnReceiptListFrame:(DispatchNoReceiptModel *)unReceiptListModel{
- _unReceiptListModel=unReceiptListModel;
- NSDictionary *unReceiptDict = @{NSFontAttributeName:kTitleFont};
-
- NSDictionary *customerNameDict = @{NSFontAttributeName:[UIFont systemFontOfSize:15]};
- CGFloat xpadding = 10;
-
- NSString *customerNameTitle = @"客户名称:";
- CGRect lblCustomerNameFrame = [customerNameTitle textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:customerNameDict];
- lblCustomerNameFrame.origin.x = xpadding;
- lblCustomerNameFrame.origin.y = 15;
- _lblCustomerNameF = lblCustomerNameFrame;
-
- NSString *customerName = [unReceiptListModel customerName];
- if([unReceiptListModel.receivables doubleValue]>0)
- {
- customerName=[NSString stringWithFormat:@"%@%@",customerName,@"[有费用]"];
- }
- if(customerName != nil && customerName.length > 0){
- CGRect customerNameFrame = [customerName textRectWithSize:CGSizeMake(500, MAXFLOAT) attributes:customerNameDict];
- customerNameFrame.origin.x = CGRectGetMaxX(_lblCustomerNameF);
- customerNameFrame.origin.y = 15;
- _customerNameF = customerNameFrame;
- }
-
- _btnDialTelephoneF=CGRectMake(Screen_Width-56,8,32,32);
-
- _separatorF=CGRectMake(0,CGRectGetMaxY(_lblCustomerNameF)+15, Screen_Width, 1);
-
-
- NSString *customerAddressTitle = @"送货地址:";
- CGRect lblCustomerAddressFrame = [customerAddressTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:customerNameDict];
- lblCustomerAddressFrame.origin.x = xpadding;
- lblCustomerAddressFrame.origin.y = CGRectGetMaxY(_separatorF) + 15;
- _lblCustomerAddressF = lblCustomerAddressFrame;
- NSString *customerAddress = [unReceiptListModel deliveryAddress];
- if(customerAddress!=nil&&customerAddress.length>0){
- CGRect customerAddressFrame = [customerAddress textRectWithSize:CGSizeMake(Screen_Width-CGRectGetMaxX(_lblCustomerAddressF)-10, MAXFLOAT) attributes:customerNameDict];
- customerAddressFrame.origin.x = CGRectGetMaxX(_lblCustomerAddressF);
- customerAddressFrame.origin.y = CGRectGetMaxY(_separatorF) + 15;
- _customerAddressF = customerAddressFrame;
-
- }
-
- NSString *telephponeTitle = @"联系电话:";
- CGRect lblTelephoneFrame = [telephponeTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:unReceiptDict];
- lblTelephoneFrame.origin.x = xpadding;
- lblTelephoneFrame.origin.y = CGRectGetMaxY(_lblCustomerAddressF) + 15;
- _lblCustomerTelephoneF = lblTelephoneFrame;
-
- NSString *telephone = [unReceiptListModel telephone];
- if(telephone != nil && telephone.length > 0){
- CGRect telephoneFrame = [telephone textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:unReceiptDict];
- telephoneFrame.origin.x = CGRectGetMaxX(_lblCustomerTelephoneF);
- telephoneFrame.origin.y = CGRectGetMaxY(_lblCustomerAddressF) + 15;
- _customerTelephoneF = telephoneFrame;
- }
-
- NSString *dispatchNoTitle = @"派工单号:";
- CGRect lblDispatchNoFrame = [dispatchNoTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:unReceiptDict];
- lblDispatchNoFrame.origin.x = xpadding;
- lblDispatchNoFrame.origin.y = CGRectGetMaxY(_lblCustomerTelephoneF) + 15;
- _lblDispatchNoF = lblDispatchNoFrame;
-
- NSString *dispatchNo = [unReceiptListModel arrangementNo];
- if(dispatchNo != nil && dispatchNo.length > 0){
- CGRect dispatchNoFrame = CGRectMake(CGRectGetMaxX(_lblDispatchNoF), CGRectGetMaxY(_lblCustomerTelephoneF) + 15, SCREENWIDTH - 20 -CGRectGetMaxX(_lblDispatchNoF), 16);
- _dispatchNoF = dispatchNoFrame;
- }
-
- NSString *deliveryDateTitle = @"送货日期:";
- CGRect lblDeliveryDateFrame = [deliveryDateTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:unReceiptDict];
- lblDeliveryDateFrame.origin.x = xpadding;
- lblDeliveryDateFrame.origin.y = CGRectGetMaxY(_lblDispatchNoF) + 15;
- _lblDeliveryDateF=lblDeliveryDateFrame;
-
- NSString *deliveryDate = [unReceiptListModel deliveryDate];
-
- if(deliveryDate != nil && deliveryDate.length > 0){
- CGRect deliveryDateFrame = [deliveryDate textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:unReceiptDict];
- deliveryDateFrame.origin.x = CGRectGetMaxX(lblDeliveryDateFrame);
- deliveryDateFrame.origin.y = CGRectGetMaxY(_lblDispatchNoF) + 15;
- _deliveryDateF = deliveryDateFrame;
- }
-
- NSString *truckNameTitle = @"车 牌 号:";
- CGRect lblTruckNameFrame = [truckNameTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:unReceiptDict];
- lblTruckNameFrame.origin.x = Screen_Width/2;
- lblTruckNameFrame.origin.y = CGRectGetMaxY(_lblDispatchNoF) + 15;
- _lblTruckNameF = lblTruckNameFrame;
- // NSString *truckName = [unReceiptListModel truckName];
- //
- // CGRect truckNameFrame = [truckName textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:unReceiptDict];
- // truckNameFrame.origin.x = CGRectGetMaxX(_lblTruckNameF);
- // truckNameFrame.origin.y = CGRectGetMaxY(_lblDispatchNoF) + 15;
-
- CGRect truckNameFrm=CGRectMake(CGRectGetMaxX(_lblTruckNameF), CGRectGetMaxY(_lblDispatchNoF) + 15, Screen_Width-CGRectGetMaxX(_lblTruckNameF), 17);
- _truckNameF=truckNameFrm;
-
- NSString *installDateTitle = @"安装日期:";
- CGRect lblInstallDateFrame = [installDateTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:unReceiptDict];
- lblInstallDateFrame.origin.x = xpadding;
- lblInstallDateFrame.origin.y = CGRectGetMaxY( _lblDeliveryDateF) + 15;
- _installDateTitleF=lblInstallDateFrame;
-
- NSString *installDate = [unReceiptListModel installDate];
-
- if(installDate != nil && installDate.length > 0){
- CGRect installDateFrame = [installDate textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:unReceiptDict];
- installDateFrame.origin.x = CGRectGetMaxX( _installDateTitleF);
- installDateFrame.origin.y = CGRectGetMaxY(_lblDeliveryDateF) + 15;
- _installDateF = installDateFrame;
- }
-
- NSString *serviceStaffNameTitle = @"服务人员:";
- CGRect lblServiceStaffNameFrame = [serviceStaffNameTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:unReceiptDict];
- lblServiceStaffNameFrame.origin.x = Screen_Width/2;
- lblServiceStaffNameFrame.origin.y = CGRectGetMaxY(_lblDeliveryDateF) + 15;
- _serviceStaffTitleF = lblServiceStaffNameFrame;
- NSString *serviceStaffName = [unReceiptListModel serviceStaffName];
- if(serviceStaffName != nil && serviceStaffName.length > 0){
- CGRect serviceStaffNameFrame = [serviceStaffName textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:unReceiptDict];
- serviceStaffNameFrame.origin.x = CGRectGetMaxX(_serviceStaffTitleF);
- serviceStaffNameFrame.origin.y = CGRectGetMaxY(_lblDeliveryDateF) + 15;
- _serviceStaffF = serviceStaffNameFrame;
- }
-
-
-
- NSString *deliveryFlagTitle=@"送货回执标识:";
- CGRect lblDeliveryFlagTitleFrame = [deliveryFlagTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:unReceiptDict];
- lblDeliveryFlagTitleFrame.origin.x = xpadding;
- lblDeliveryFlagTitleFrame.origin.y = CGRectGetMaxY(_installDateTitleF) + 15;
- _deliveryFlagTitleF = lblDeliveryFlagTitleFrame;
-
-
- NSString *deliveryFlag = [unReceiptListModel deliveryReceiptFlag];
- NSString *deliveryFlagStr;
- if([deliveryFlag intValue]==0)
- {
- deliveryFlagStr=@"否";
- }
- else{
- deliveryFlagStr=@"是";
- }
- if(deliveryFlagStr != nil && deliveryFlagStr.length > 0){
- CGRect deliveryFlagFrame = [deliveryFlagStr textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:unReceiptDict];
- deliveryFlagFrame.origin.x = CGRectGetMaxX(_deliveryFlagTitleF);
- deliveryFlagFrame.origin.y = CGRectGetMaxY(_installDateTitleF) + 15;
- _deliveryFlagF = deliveryFlagFrame;
- }
-
-
- NSString *installFlagTitle=@"安装回执标识:";
- CGRect lblInstallFlagTitleFrame = [installFlagTitle textRectWithSize:CGSizeMake(120, MAXFLOAT) attributes:unReceiptDict];
- lblInstallFlagTitleFrame.origin.x = Screen_Width/2;
- lblInstallFlagTitleFrame.origin.y = CGRectGetMaxY(_installDateTitleF) + 15;
- _installFlagTitleF = lblInstallFlagTitleFrame;
-
-
- NSString *installFlag = [unReceiptListModel installReceiptFlag];
- NSString *installFlagStr;
- if([installFlag intValue]==0)
- {
- installFlagStr=@"否";
- }
- else{
- installFlagStr=@"是";
- }
- if(installFlagStr != nil && installFlagStr.length > 0){
- CGRect installFlagFrame = [installFlagStr textRectWithSize:CGSizeMake(300, MAXFLOAT) attributes:unReceiptDict];
- installFlagFrame.origin.x = CGRectGetMaxX(_installFlagTitleF);
- installFlagFrame.origin.y = CGRectGetMaxY(_installDateTitleF) + 15;
- _installFlagF = installFlagFrame;
- }
-
-
- NSString *dispatchStatusTitle=@"派工状态:";
- CGRect lblDispatchStatusTitleFrame = [dispatchStatusTitle textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:unReceiptDict];
- lblDispatchStatusTitleFrame.origin.x = xpadding;
- lblDispatchStatusTitleFrame.origin.y = CGRectGetMaxY(_deliveryFlagTitleF) + 15;
- _dispatchStatusTitleF = lblDispatchStatusTitleFrame;
-
- _deliveryTypeF=CGRectMake(CGRectGetMaxX(_dispatchStatusTitleF),CGRectGetMaxY(_deliveryFlagTitleF) + 10,25,25);
-
- NSString *deliveryTypeTitle=@"配送";
-
- CGRect lblDeliveryTypeTitleFrame = [deliveryTypeTitle textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:unReceiptDict];
-
- lblDeliveryTypeTitleFrame.origin.x =CGRectGetMaxX(_deliveryTypeF);
- lblDeliveryTypeTitleFrame.origin.y = CGRectGetMaxY(_deliveryFlagTitleF) + 15;
- _deliveryTypeTitleF = lblDeliveryTypeTitleFrame;
-
- _installTypeF=CGRectMake(CGRectGetMaxX(_deliveryTypeTitleF),CGRectGetMaxY(_deliveryFlagTitleF) + 10,25,25);
-
-
- NSString *installTypeTitle=@"安装";
-
- CGRect lblInstallTypeTitleFrame = [installTypeTitle textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:unReceiptDict];
-
- lblInstallTypeTitleFrame.origin.x =CGRectGetMaxX(_installTypeF);
- lblInstallTypeTitleFrame.origin.y = CGRectGetMaxY(_deliveryFlagTitleF) + 15;
- _installTypeTitleF = lblInstallTypeTitleFrame;
-
-
- _deliveryInstallTypeF=CGRectMake(CGRectGetMaxX(_installTypeTitleF),CGRectGetMaxY(_deliveryFlagTitleF) + 10,25,25);
-
-
- NSString *deliveryInstallTypeTitle=@"送安一体";
-
- CGRect lblDeliveryInstallTypeTitleFrame = [deliveryInstallTypeTitle textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:unReceiptDict];
-
- lblDeliveryInstallTypeTitleFrame.origin.x =CGRectGetMaxX(_deliveryInstallTypeF);
- lblDeliveryInstallTypeTitleFrame.origin.y = CGRectGetMaxY(_deliveryFlagTitleF) + 15;
- _deliveryInstallTypeTitleF = lblDeliveryInstallTypeTitleFrame;
-
- _middleSeparatorF=CGRectMake(0,CGRectGetMaxY(_dispatchStatusTitleF)+10, Screen_Width, 1);
-
- CGFloat btnmargin = 100;
-
- CGFloat btnwidth = 80;
-
- _navigationBtnF= CGRectMake(Screen_Width - 2 * btnmargin ,CGRectGetMaxY(_middleSeparatorF)+10 , btnwidth, 25);
-
- _saveBtnF= CGRectMake(Screen_Width - btnmargin ,CGRectGetMaxY(_middleSeparatorF)+10 , btnwidth, 25);
-
-
- _btnDialTelephoneF=CGRectMake(Screen_Width-56,8,32,32);
-
-
- _cellHeight = CGRectGetMaxY(_navigationBtnF)+15;
-
-
- }
- @end
|