| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620 |
- //
- // RequirementNoReceiptCell.m
- // IBOSSHSH
- //
- // Created by ssl on 2018/1/12.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "DispatchNoReceiptCell.h"
- #import "UIColor+hexColor.h"
- #import "DateFormat.h"
- #define kTextFont [UIFont systemFontOfSize:LabelAndTextFontOfSize]
- #define kTitleFont [UIFont systemFontOfSize:14]
- @interface DispatchNoReceiptCell(){
-
- }
- @end
- @implementation DispatchNoReceiptCell
- #pragma mark - 公共函数
- /**
- 初始化单元格
- @param style <#style description#>
- @param reuseIdentifier <#reuseIdentifier description#>
- @return <#return value description#>
- */
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- self.layer.cornerRadius=CornerRadius;
- self.layer.backgroundColor = [UIColor clearColor].CGColor;
- self.layer.masksToBounds=YES;
-
- }
- return self;
- }
- /**
- 单元格选中事件
- @param selected <#selected description#>
- @param animated <#animated description#>
- */
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
-
- }
- /**
- 设置未回执frame
- @param frame <#frame description#>
- */
- - (void)setUnReceiptListFrame:(DispatchNoReceiptFrame *)frame{
-
- _noReceiptFrame=frame;
- UILabel *customerNameLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerNameF]];
- customerNameLabelView.backgroundColor = [UIColor clearColor];
- customerNameLabelView.textColor = [UIColor blackColor];
- customerNameLabelView.text = @"客户名称:";
- customerNameLabelView.font =[UIFont systemFontOfSize:15];
- customerNameLabelView.textAlignment = NSTextAlignmentLeft;
- [self addSubview: customerNameLabelView];
- _customerName = [[UILabel alloc] initWithFrame:[frame customerNameF]];
- NSString *customerNameStr = [frame.unReceiptListModel customerName];
- if(customerNameStr != nil&&customerNameStr.length>0){
- _customerName.backgroundColor = [UIColor clearColor];
- _customerName.textColor = [UIColor blackColor];
- _customerName.textAlignment = NSTextAlignmentLeft;
- _customerName.font =[UIFont systemFontOfSize:15];
- [self.contentView addSubview:_customerName];
- _customerName.text=customerNameStr;
- }
-
- if([frame.unReceiptListModel.receivables doubleValue]>0)
- {
- _customerName.text=[NSString stringWithFormat:@"%@%@",customerNameStr,@"[有费用]"];
- }
-
- _btnDialTelephone=[UIButton buttonWithType:UIButtonTypeCustom];
- _btnDialTelephone.frame=[frame btnDialTelephoneF];
- [self.contentView addSubview:_btnDialTelephone];
- [_btnDialTelephone addTarget:self action:@selector(dialTelephone) forControlEvents:UIControlEventTouchUpInside];
- UIImageView *telephoneImg = [[UIImageView alloc]init];
- telephoneImg.frame=CGRectMake(0,0,32,32);
- [telephoneImg setImage:[UIImage imageNamed:@"dial_telephone"]];
- telephoneImg.userInteractionEnabled=NO;
- [_btnDialTelephone addSubview:telephoneImg];
-
- UIView *separator = [UIView new];
- separator.frame = [frame separatorF];
- separator.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:separator];
-
-
- UILabel *lblCustomerAddress= [[UILabel alloc] initWithFrame:[frame lblCustomerAddressF]];
- lblCustomerAddress.backgroundColor = [UIColor clearColor];
- lblCustomerAddress.textColor = LabelGrayTextColor;
- lblCustomerAddress.text = @"送货地址:";
- lblCustomerAddress.font =[UIFont systemFontOfSize:15];
- lblCustomerAddress.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblCustomerAddress];
- NSString *customerAddressStr = [frame.unReceiptListModel deliveryAddress];
-
- _customerAddress = [[UILabel alloc] initWithFrame:[frame customerAddressF]];
- _customerAddress.backgroundColor = [UIColor clearColor];
- _customerAddress.textColor = [UIColor blackColor];
- _customerAddress.textAlignment = NSTextAlignmentLeft;
- _customerAddress.numberOfLines=0;
- _customerAddress.font =[UIFont systemFontOfSize:15];
- [self.contentView addSubview:_customerAddress];
- _customerAddress.text=customerAddressStr;
-
-
- UILabel *telephoneLabelView = [[UILabel alloc] initWithFrame:[frame lblCustomerTelephoneF]];
- telephoneLabelView.backgroundColor = [UIColor clearColor];
- telephoneLabelView.textColor =LabelGrayTextColor;
- telephoneLabelView.text = @"联系电话:";
- telephoneLabelView.font =kTextFont;
- telephoneLabelView.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview:telephoneLabelView];
-
- NSString *telephoneStr= [frame.unReceiptListModel telephone];
- if(telephoneStr != nil&&telephoneStr.length>0){
- _telephoneNumber=telephoneStr;
- _telephone= [[UILabel alloc] initWithFrame:[frame customerTelephoneF]];
- _telephone.backgroundColor = [UIColor clearColor];
- _telephone.textColor = [UIColor blackColor];
- _telephone.textAlignment = NSTextAlignmentLeft;
- _telephone.font =kTextFont;
- [self.contentView addSubview:_telephone];
- _telephone.text=telephoneStr;
- }
-
- UILabel *dispatchNoLabelView = [[UILabel alloc] initWithFrame:[frame lblDispatchNoF]];
- dispatchNoLabelView.backgroundColor = [UIColor clearColor];
- dispatchNoLabelView.textColor =LabelGrayTextColor;
- dispatchNoLabelView.text = @"派工单号:";
- dispatchNoLabelView.textAlignment = NSTextAlignmentLeft;
- dispatchNoLabelView.font = kTitleFont;
- [self addSubview: dispatchNoLabelView];
- NSString *dispatchNoStr = [frame.unReceiptListModel arrangementNo];
- if(dispatchNoStr != nil&&dispatchNoStr.length>0){
- _deliveryNo = [[UILabel alloc] initWithFrame:[frame dispatchNoF]];
- _deliveryNo.backgroundColor = [UIColor clearColor];
- _deliveryNo.textColor = [UIColor blackColor];
- _deliveryNo.textAlignment = NSTextAlignmentLeft;
- _deliveryNo.font = kTitleFont;
- [self.contentView addSubview: _deliveryNo];
- _deliveryNo.text=dispatchNoStr;
- }
-
- UILabel *lblDeliveryDate = [[UILabel alloc] initWithFrame:[frame lblDeliveryDateF]];
- lblDeliveryDate.backgroundColor = [UIColor clearColor];
- lblDeliveryDate.textColor = LabelGrayTextColor;
- lblDeliveryDate.text = @"送货日期:";
- lblDeliveryDate.textAlignment = NSTextAlignmentLeft;
- lblDeliveryDate.font =kTextFont;
- [self.contentView addSubview:lblDeliveryDate];
- NSString *deliveryDateStr = [frame.unReceiptListModel deliveryDate];
-
- if(deliveryDateStr!= nil&&deliveryDateStr.length>0){
- UILabel *deliveryDate= [[UILabel alloc] initWithFrame:[frame deliveryDateF]];
- deliveryDate.backgroundColor = [UIColor clearColor];
- deliveryDate.textColor = [UIColor blackColor];
- deliveryDate.text=deliveryDateStr;
- deliveryDate.textAlignment = NSTextAlignmentLeft;
- deliveryDate.font =kTextFont;
- [self.contentView addSubview:deliveryDate];
- }
-
- UILabel *lblTruckName= [[UILabel alloc] initWithFrame:[frame lblTruckNameF]];
- lblTruckName.backgroundColor = [UIColor clearColor];
- lblTruckName.textColor = LabelGrayTextColor;
- lblTruckName.text = @"车 牌 号:";
- lblTruckName.font =kTextFont;
- lblTruckName.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblTruckName];
-
- NSString *truckNameStr = [frame.unReceiptListModel truckName];
-
- _truckName = [[UITextField alloc] initWithFrame:[frame truckNameF]];
- _truckName.placeholder=@"请输入车牌号";
- _truckName.delegate=self;
- _truckName.backgroundColor = [UIColor clearColor];
- _truckName.textColor = [UIColor blackColor];
- _truckName.textAlignment = NSTextAlignmentLeft;
- _truckName.font =kTextFont;
- [self.contentView addSubview:_truckName];
- _truckName.text=truckNameStr;
-
-
-
- UILabel *lblInstallDate = [[UILabel alloc] initWithFrame:[frame installDateTitleF]];
- lblInstallDate.backgroundColor = [UIColor clearColor];
- lblInstallDate.textColor = LabelGrayTextColor;
- lblInstallDate.text = @"安装日期:";
- lblInstallDate.textAlignment = NSTextAlignmentLeft;
- lblInstallDate.font =kTextFont;
- [self.contentView addSubview:lblInstallDate];
-
- NSString *installDateStr = [frame.unReceiptListModel installDate];
-
- if(installDateStr!= nil&&installDateStr.length>0){
- _installDate= [[UILabel alloc] initWithFrame:[frame installDateF]];
- _installDate.backgroundColor = [UIColor clearColor];
- _installDate.textColor = [UIColor blackColor];
-
- _installDate.textAlignment = NSTextAlignmentLeft;
- _installDate.font =kTextFont;
- [self.contentView addSubview:_installDate];
- _installDate.text=installDateStr;
- }
-
-
- UILabel *lblServiceStaff = [[UILabel alloc] initWithFrame:[frame serviceStaffTitleF]];
- lblServiceStaff.backgroundColor = [UIColor clearColor];
- lblServiceStaff.textColor = LabelGrayTextColor;
- lblServiceStaff.text = @"服务人员:";
- lblServiceStaff.textAlignment = NSTextAlignmentLeft;
- lblServiceStaff.font =kTextFont;
- [self.contentView addSubview:lblServiceStaff];
-
- NSString *serviceStaffStr = [frame.unReceiptListModel serviceStaffName];
-
- if(serviceStaffStr!= nil&&serviceStaffStr.length>0){
- _serviceStaff= [[UILabel alloc] initWithFrame:[frame serviceStaffF]];
- _serviceStaff.backgroundColor = [UIColor clearColor];
- _serviceStaff.textColor = [UIColor blackColor];
- _serviceStaff.text=serviceStaffStr;
- _serviceStaff.textAlignment = NSTextAlignmentLeft;
- _serviceStaff.font =kTextFont;
- [self.contentView addSubview:_serviceStaff];
- }
-
-
-
- UILabel *lblDeliveryFlagTitle= [[UILabel alloc] initWithFrame:[frame deliveryFlagTitleF]];
- lblDeliveryFlagTitle.backgroundColor = [UIColor clearColor];
- lblDeliveryFlagTitle.textColor = LabelGrayTextColor;
- lblDeliveryFlagTitle.text = @"送货回执标识:";
- lblDeliveryFlagTitle.font =kTextFont;
- lblDeliveryFlagTitle.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblDeliveryFlagTitle];
-
- NSString *deliveryFlag = [frame.unReceiptListModel deliveryReceiptFlag];
- NSString *deliveryFlagStr;
- if([deliveryFlag intValue]==0)
- {
- deliveryFlagStr=@"否";
- }
- else{
- deliveryFlagStr=@"是";
- }
-
- UILabel *lblDeliveryFlag= [[UILabel alloc] initWithFrame:[frame deliveryFlagF]];
- lblDeliveryFlag.backgroundColor = [UIColor clearColor];
- lblDeliveryFlag.textColor = [UIColor blackColor]; ;
- lblDeliveryFlag.text =deliveryFlagStr;
- lblDeliveryFlag.font =kTextFont;
- lblDeliveryFlag.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblDeliveryFlag];
-
-
-
- UILabel *lblInstallFlagTitle= [[UILabel alloc] initWithFrame:[frame installFlagTitleF]];
- lblInstallFlagTitle.backgroundColor = [UIColor clearColor];
- lblInstallFlagTitle.textColor = LabelGrayTextColor;
- lblInstallFlagTitle.text = @"安装回执标识:";
- lblInstallFlagTitle.font =kTextFont;
- lblInstallFlagTitle.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblInstallFlagTitle];
-
- NSString *installFlag = [frame.unReceiptListModel installReceiptFlag];
- NSString *installFlagStr;
- if([installFlag intValue]==0)
- {
- installFlagStr=@"否";
- }
- else{
- installFlagStr=@"是";
- }
-
- UILabel *lblInstallFlag= [[UILabel alloc] initWithFrame:[frame installFlagF]];
- lblInstallFlag.backgroundColor = [UIColor clearColor];
- lblInstallFlag.textColor = [UIColor blackColor]; ;
- lblInstallFlag.text =installFlagStr;
- lblInstallFlag.font =kTextFont;
- lblInstallFlag.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview: lblInstallFlag];
-
-
-
- UILabel *lblDispatchStatusTitle= [[UILabel alloc] initWithFrame:[frame dispatchStatusTitleF]];
- lblDispatchStatusTitle.backgroundColor = [UIColor clearColor];
- lblDispatchStatusTitle.textColor = LabelGrayTextColor;
- lblDispatchStatusTitle.text = @"派工类型:";
- lblDispatchStatusTitle.textAlignment = NSTextAlignmentLeft;
- lblDispatchStatusTitle.font =kTextFont;
- [self.contentView addSubview:lblDispatchStatusTitle];
-
- _buttons= [NSMutableArray arrayWithCapacity:3];
-
- _btnDeliveryType=[[RadioBtn alloc] initWithFrame:frame.deliveryTypeF];
- [_buttons addObject:_btnDeliveryType];
- [_btnDeliveryType addTarget:self action:@selector(onRadioButtonValueChanged:) forControlEvents:UIControlEventValueChanged];
-
- [_btnDeliveryType setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
- _btnDeliveryType.tag=1;
- _btnDeliveryType.titleLabel.font = [UIFont boldSystemFontOfSize:17];
- [_btnDeliveryType setImage:[UIImage imageNamed:@"unselect.png"] forState:UIControlStateNormal];
- [_btnDeliveryType setImage:[UIImage imageNamed:@"select.png"] forState:UIControlStateSelected];
- _btnDeliveryType.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
-
- [self.contentView addSubview:_btnDeliveryType];
-
-
- _btnInstallType=[[RadioBtn alloc] initWithFrame:frame.installTypeF];
- [_buttons addObject:_btnInstallType];
- [_btnInstallType addTarget:self action:@selector(onRadioButtonValueChanged:) forControlEvents:UIControlEventValueChanged];
-
- _btnInstallType.tag=2;
-
- [_btnInstallType setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
- _btnInstallType.titleLabel.font = [UIFont boldSystemFontOfSize:17];
- [_btnInstallType setImage:[UIImage imageNamed:@"unselect.png"] forState:UIControlStateNormal];
- [_btnInstallType setImage:[UIImage imageNamed:@"select.png"] forState:UIControlStateSelected];
- _btnInstallType.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
-
- [self.contentView addSubview:_btnInstallType];
-
- _btnDeliveryInstallType=[[RadioBtn alloc] initWithFrame:frame.deliveryInstallTypeF];
- [_buttons addObject:_btnDeliveryInstallType];
- [_btnDeliveryInstallType addTarget:self action:@selector(onRadioButtonValueChanged:) forControlEvents:UIControlEventValueChanged];
-
- _btnDeliveryInstallType.tag=3;
-
- [_btnDeliveryInstallType setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
- _btnDeliveryInstallType.titleLabel.font = [UIFont boldSystemFontOfSize:17];
- [_btnDeliveryInstallType setImage:[UIImage imageNamed:@"unselect.png"] forState:UIControlStateNormal];
- [_btnDeliveryInstallType setImage:[UIImage imageNamed:@"select.png"] forState:UIControlStateSelected];
- _btnDeliveryInstallType.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
-
-
- [self.contentView addSubview:_btnDeliveryInstallType];
-
- [_buttons[0] setGroupButtons:_buttons];
-
-
- UILabel *deliveryLabel =[[UILabel alloc] initWithFrame:[frame deliveryTypeTitleF ]];
- deliveryLabel.tag=1;
-
- deliveryLabel.backgroundColor = [UIColor clearColor];
- deliveryLabel.text = @"配送";
- deliveryLabel.font = kTextFont;
- [self.contentView addSubview:deliveryLabel];
-
- UITapGestureRecognizer *tapRecognizerDelivery= [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onDeliveryRadioValueChanged:)];
-
- deliveryLabel.userInteractionEnabled=YES;
- [deliveryLabel addGestureRecognizer:tapRecognizerDelivery];
-
-
- UILabel *installLabel =[[UILabel alloc] initWithFrame:[frame installTypeTitleF ]];
- installLabel.backgroundColor = [UIColor clearColor];
- installLabel.text = @"安装";
- installLabel.tag=2;
- installLabel.font = kTextFont;
- [self.contentView addSubview:installLabel];
-
- UITapGestureRecognizer *tapRecognizerInstall= [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onInstallRadioValueChanged:)];
-
- [installLabel addGestureRecognizer:tapRecognizerInstall];
-
- UILabel *deliveryInstallLabel =[[UILabel alloc] initWithFrame:[frame deliveryInstallTypeTitleF ]];
- deliveryInstallLabel.backgroundColor = [UIColor clearColor];
- deliveryInstallLabel.text = @"送安一体";
- deliveryInstallLabel.tag=3;
- deliveryInstallLabel.font = kTextFont;
- [self.contentView addSubview:deliveryInstallLabel];
-
- UITapGestureRecognizer *tapRecognizerDeliveryInstall= [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onDeliveryInstallRadioValueChanged:)];
-
-
- [deliveryInstallLabel addGestureRecognizer:tapRecognizerDeliveryInstall];
-
-
- if([frame.unReceiptListModel.requirementType intValue]==1)
- {
-
- if([[frame.unReceiptListModel receiptFlag ]intValue]==1)
- _btnDeliveryType.enabled=YES;
- _btnInstallType.enabled=NO;
- _btnDeliveryInstallType.enabled=NO;
- deliveryLabel.userInteractionEnabled=YES;
- installLabel.userInteractionEnabled=NO;
- deliveryInstallLabel.userInteractionEnabled=NO;
-
- [_buttons[0] setSelected:YES];
- }
-
-
- if([frame.unReceiptListModel.requirementType intValue]==2)
- {
- if([[frame.unReceiptListModel receiptFlag ]intValue]==2)
- {
-
- _btnDeliveryType.userInteractionEnabled=NO;
- _btnInstallType.userInteractionEnabled=YES;
- [_buttons[1] setSelected:YES];
- _btnDeliveryInstallType.userInteractionEnabled=NO;
-
- deliveryLabel.userInteractionEnabled=NO;
- installLabel.userInteractionEnabled=YES;
- deliveryInstallLabel.userInteractionEnabled=NO;
- }
- }
- if([frame.unReceiptListModel.requirementType intValue]==3)
- {
-
-
- if([frame.unReceiptListModel.deliveryReceiptFlag intValue]==0&&[frame.unReceiptListModel.installReceiptFlag intValue]==0)
- {
-
- if([[frame.unReceiptListModel receiptFlag ]intValue]==1)
- {
- _btnDeliveryType.userInteractionEnabled=YES;
- [_buttons[0] setSelected:YES];
- _btnInstallType.userInteractionEnabled=NO;
- _btnDeliveryInstallType.userInteractionEnabled=YES;
- deliveryLabel.userInteractionEnabled=YES;
- installLabel.userInteractionEnabled=NO;
- deliveryInstallLabel.userInteractionEnabled=YES;
- }
-
- if([[frame.unReceiptListModel receiptFlag ]intValue]==3)
- {
-
- _btnDeliveryType.userInteractionEnabled=YES;
- [_buttons[2] setSelected:YES];
- _btnInstallType.userInteractionEnabled=NO;
- _btnDeliveryInstallType.userInteractionEnabled=YES;
-
- deliveryLabel.userInteractionEnabled=YES;
- installLabel.userInteractionEnabled=NO;
- deliveryInstallLabel.userInteractionEnabled=YES;
-
-
- }
-
- }
-
-
- if([frame.unReceiptListModel.deliveryReceiptFlag intValue]==1&&[frame.unReceiptListModel.installReceiptFlag intValue]==0)
- {
- if([[frame.unReceiptListModel receiptFlag ]intValue]==2)
- {
- [_buttons[1] setSelected:YES];
- _btnInstallType.userInteractionEnabled=YES;
- _btnDeliveryType.userInteractionEnabled=NO;
- _btnDeliveryInstallType.userInteractionEnabled=NO;
-
- deliveryLabel.userInteractionEnabled=NO;
- installLabel.userInteractionEnabled=YES;
- deliveryInstallLabel.userInteractionEnabled=NO;
-
-
- }
-
- }
-
-
-
- }
- UIView *middleSeparator=[UIView new];
- middleSeparator.frame=[frame middleSeparatorF];
- [self.contentView addSubview:middleSeparator];
- [middleSeparator setBackgroundColor:LineBackgroundColor];
-
- UIButton *btnNavigate = [UIButton buttonWithType:UIButtonTypeCustom];
- [btnNavigate setTitle:@"导航" forState:UIControlStateNormal];
- [btnNavigate setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- [btnNavigate addTarget:self action:@selector(goNavigate) forControlEvents:UIControlEventTouchUpInside];
- btnNavigate.layer.cornerRadius = 4;
- btnNavigate.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
- btnNavigate.frame =[frame navigationBtnF];
- [self.contentView addSubview:btnNavigate];
-
-
- UIButton *btnSave = [UIButton buttonWithType:UIButtonTypeCustom];
- [btnSave setTitle:@"保存" forState:UIControlStateNormal];
- [btnSave setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- [btnSave addTarget:self action:@selector(goSave) forControlEvents:UIControlEventTouchUpInside];
- btnSave.layer.cornerRadius = 4;
- btnSave.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
- btnSave.frame =[frame saveBtnF];
- [self.contentView addSubview:btnSave];
-
-
-
- }
- /**
- textfield结束编辑回调函数
-
- @param field <#field description#>
- */
- - (void) textFieldDidEndEditing:(UITextField *) field
- {
- [self endEditing:YES];
- NSString *truckNumber=field.text;
- if([self.receiptFlagDelegate respondsToSelector:@selector(updateTruckNumber: truckNumber:)])
- {
- [self.receiptFlagDelegate updateTruckNumber:_position truckNumber:truckNumber];
- }
-
-
- }
- -(void)goSave
- {
- if([self.receiptFlagDelegate respondsToSelector:@selector(saveData:)])
- {
- [self.receiptFlagDelegate saveData:_position];
- }
- }
- -(void)goNavigate
- {
- if([self.receiptFlagDelegate respondsToSelector:@selector(goNavigation:)])
- {
- [self.receiptFlagDelegate goNavigation:_position];
- }
- }
- - (void)onDeliveryRadioValueChanged:(UITapGestureRecognizer *)gesture
- {
- _receiptFlag=@"1";
- [_buttons[0] setSelected:YES];
- if([self.receiptFlagDelegate respondsToSelector:@selector(updateReceiptFlag:receiptFlag:)])
- {
- [self.receiptFlagDelegate updateReceiptFlag:_position receiptFlag:_receiptFlag];
- }
-
- }
- - (void)onInstallRadioValueChanged:(UITapGestureRecognizer *)gesture
- {
- _receiptFlag=@"2";
- [_buttons[1] setSelected:YES];
- if([self.receiptFlagDelegate respondsToSelector:@selector(updateReceiptFlag:receiptFlag:)])
- {
- [self.receiptFlagDelegate updateReceiptFlag:_position receiptFlag:_receiptFlag];
- }
-
- }
- - (void)onDeliveryInstallRadioValueChanged:(UITapGestureRecognizer *)gesture
- {
- _receiptFlag=@"3";
- [_buttons[2] setSelected:YES];
- if([self.receiptFlagDelegate respondsToSelector:@selector(updateReceiptFlag:receiptFlag:)])
- {
- [self.receiptFlagDelegate updateReceiptFlag:_position receiptFlag:_receiptFlag];
- }
-
- }
- -(void) onRadioButtonValueChanged:(RadioBtn*)sender
- {
- // Lets handle ValueChanged event only for selected button, and ignore for deselected
- if(sender.selected) {
- if(sender.tag==1)
- {
- _receiptFlag=@"1";
-
- }
- if(sender.tag==2)
- {
- _receiptFlag=@"2";
-
- }
-
- if(sender.tag==3)
- {
- _receiptFlag=@"3";
-
- }
-
- if([self.receiptFlagDelegate respondsToSelector:@selector(updateReceiptFlag:receiptFlag:)])
- {
- [self.receiptFlagDelegate updateReceiptFlag:_position receiptFlag:_receiptFlag];
- }
-
-
- }
- }
- -(void)dialTelephone{
- if(_telephoneNumber!=nil&&_telephoneNumber.length>0)
- if([self.telephoneDelegate respondsToSelector:@selector(dialTelephone:)])
- {
- [self.telephoneDelegate dialTelephone:_telephoneNumber];
- }
- }
- @end
|