| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- //
- // SalesSlipListCell.m
- // IBOSSmini
- //
- // Created by ssl on 2018/1/26.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "SalesSlipListCell.h"
- #import "NSString+Tools.h"
- #define orderTextFont [UIFont systemFontOfSize:13]
- @implementation SalesSlipListCell
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-
- return self;
- }
- - (void)setSalesOrder:(SalesSlipListModel *)salesOrderModel{
- _salesOrder=salesOrderModel;
- if (_salesOrder==nil) {
- return;
- }
-
- CGFloat heightLine = 1;
- CGFloat heightRow = 40;
- CGFloat lblx = 20;
- CGFloat lbly = 8;
- CGFloat lblwidth = 70;
- CGFloat lblheight = 25;
- CGFloat btnwidth = 50;
- CGFloat valuey = 8;
- CGFloat valueheight = 25;
- NSDictionary *orderDict = @{NSFontAttributeName:orderTextFont};
-
- UIView *vOrderNo = [UIView new];
- vOrderNo.frame=CGRectMake(0, valuey, Screen_Width, heightRow);
- [self.contentView addSubview:vOrderNo];
-
- _orderNoLbl = [UILabel new];
- _orderNoLbl.frame=CGRectMake(lblx, valuey, Screen_Width- lblx - 45, valueheight);
- _orderNoLbl.textColor = [UIColor grayColor];
- _orderNoLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vOrderNo addSubview:_orderNoLbl];
- _orderNoLbl.text = _salesOrder.SalesNo;
-
- _orderStatusLbl = [UILabel new];
- _orderStatusLbl.frame=CGRectMake(Screen_Width-55 ,valuey, 45, valueheight);
- _orderStatusLbl.textAlignment = NSTextAlignmentRight;
- _orderStatusLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vOrderNo addSubview:_orderStatusLbl];
- NSString *invoiceStatusName= _salesOrder.invoiceStatusName;
- if([invoiceStatusName isEqualToString:@"冲正"]){
- _orderStatusLbl.textColor = [UIColor redColor];
- }
- else{
- _orderStatusLbl.textColor = [UIColor blackColor];
- }
- _orderStatusLbl.text=invoiceStatusName;
- //分割线
- _topSeparatorView= [UIView new];
- _topSeparatorView.frame = CGRectMake(0, CGRectGetMaxY(vOrderNo.frame), Screen_Width, heightLine);
-
- [self.contentView addSubview:_topSeparatorView];
- UIButton *btnLine = [UIButton buttonWithType:UIButtonTypeCustom];
- [btnLine setBackgroundImage:[UIImage imageNamed:@"dash"] forState:UIControlStateNormal];
- btnLine.frame = CGRectMake(0 ,0 , Screen_Width, heightLine);
- [_topSeparatorView addSubview:btnLine];
-
- //客户名称
- UIView *vCustomerName = [UIView new];
- vCustomerName.frame=CGRectMake(0, CGRectGetMaxY(_topSeparatorView.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vCustomerName];
- UILabel *customerNameTitleLbl=[UILabel new];
- customerNameTitleLbl.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- customerNameTitleLbl.text=@"客户名称:";
- customerNameTitleLbl.textColor = [UIColor blackColor];
- customerNameTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerName addSubview:customerNameTitleLbl];
- _customerNameLbl = [UILabel new];
- _customerNameLbl.frame=CGRectMake(CGRectGetMaxX(customerNameTitleLbl.frame), valuey, Screen_Width/2 -CGRectGetMaxX(customerNameTitleLbl.frame), valueheight);
- _customerNameLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerName addSubview:_customerNameLbl];
- _customerNameLbl.text = _salesOrder.customerName;
-
- //电话
- UIView *vCustomerTelephone = [UIView new];
- vCustomerTelephone.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(_topSeparatorView.frame), Screen_Width / 2, heightRow);
- [self.contentView addSubview: vCustomerTelephone];
- UILabel *customerTelephoneTitleLbl=[UILabel new];
- customerTelephoneTitleLbl.frame=CGRectMake(5, lbly, lblwidth, lblheight);
- customerTelephoneTitleLbl.text=@"客户电话:";
- customerTelephoneTitleLbl.textColor = [UIColor blackColor];
- customerTelephoneTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerTelephone addSubview:customerTelephoneTitleLbl];
- _customerTelephoneLbl= [UILabel new];
- _customerTelephoneLbl.frame=CGRectMake(CGRectGetMaxX(customerTelephoneTitleLbl.frame), valuey, Screen_Width/2-CGRectGetMaxX(customerTelephoneTitleLbl.frame) , valueheight);
- _customerTelephoneLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerTelephone addSubview:_customerTelephoneLbl];
-
- _customerTelephoneLbl.text = _salesOrder.telephone;
-
- //客户编码
- UIView *vCustomerCode = [UIView new];
- vCustomerCode.frame=CGRectMake(0, CGRectGetMaxY(vCustomerName.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vCustomerCode];
- UILabel *customerCodeTitleLbl=[UILabel new];
- customerCodeTitleLbl.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- customerCodeTitleLbl.text=@"客户编码:";
- customerCodeTitleLbl.textColor = [UIColor blackColor];
- customerCodeTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerCode addSubview:customerCodeTitleLbl];
- _customerCodeLbl = [UILabel new];
- _customerCodeLbl.frame=CGRectMake(CGRectGetMaxX(customerCodeTitleLbl.frame), valuey, Screen_Width/2 -CGRectGetMaxX(customerCodeTitleLbl.frame), valueheight);
- _customerCodeLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerCode addSubview:_customerCodeLbl];
- _customerCodeLbl.text = _salesOrder.customerCode;
-
-
- //业务员
- UIView *vStaffName = [UIView new];
- vStaffName.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(vCustomerName.frame), Screen_Width / 2, heightRow);
- [self.contentView addSubview: vStaffName];
-
- UILabel *staffNameTitleLbl=[UILabel new];
- staffNameTitleLbl.frame=CGRectMake(5, lbly, lblwidth, lblheight);
- staffNameTitleLbl.text=@"业 务 员:";
- staffNameTitleLbl.textColor = [UIColor blackColor];
- staffNameTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaffName addSubview:staffNameTitleLbl];
- _staffLbl= [UILabel new];
- _staffLbl.frame=CGRectMake(CGRectGetMaxX(staffNameTitleLbl.frame), valuey, Screen_Width/2-CGRectGetMaxX(staffNameTitleLbl.frame) , valueheight);
- _staffLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vStaffName addSubview:_staffLbl];
- _staffLbl.text = _salesOrder.staffName;
-
- //业务部门
- UIView *vDepartment = [UIView new];
- vDepartment.frame=CGRectMake(0, CGRectGetMaxY(vCustomerCode.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vDepartment];
-
- UILabel *departmentTitleLbl=[UILabel new];
- departmentTitleLbl.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- departmentTitleLbl.text=@"业务部门:";
- departmentTitleLbl.textColor = [UIColor blackColor];
- departmentTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vDepartment addSubview:departmentTitleLbl];
- _departmentLbl = [UILabel new];
- _departmentLbl.frame=CGRectMake(CGRectGetMaxX(departmentTitleLbl.frame), valuey, Screen_Width/2 -CGRectGetMaxX(departmentTitleLbl.frame), valueheight);
- _departmentLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vDepartment addSubview:departmentTitleLbl];
- _departmentLbl.text = _salesOrder.organizationName;
- [vDepartment addSubview:_departmentLbl];
-
- //创建人
- UIView *vCreator = [UIView new];
- vCreator.frame=CGRectMake(0, CGRectGetMaxY(vDepartment.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vCreator];
-
- UILabel *creatorTitleLbl=[UILabel new];
- creatorTitleLbl.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- creatorTitleLbl.text=@"创 建 人:";
- creatorTitleLbl.textColor = [UIColor blackColor];
- creatorTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCreator addSubview:creatorTitleLbl];
- _creatorLbl = [UILabel new];
- _creatorLbl.frame=CGRectMake(CGRectGetMaxX(creatorTitleLbl.frame), valuey, Screen_Width/2 -CGRectGetMaxX(creatorTitleLbl.frame), valueheight);
- _creatorLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCreator addSubview:_creatorLbl];
- _creatorLbl.text = _salesOrder.createUser;
-
- //账务日期
- UIView *vAccountDate = [UIView new];
- vAccountDate.frame=CGRectMake(Screen_Width / 2, CGRectGetMaxY(vDepartment.frame), Screen_Width / 2, heightRow);
- [self.contentView addSubview: vAccountDate];
-
- UILabel *accountDateTitleLbl=[UILabel new];
- accountDateTitleLbl.frame=CGRectMake(5, lbly, lblwidth, lblheight);
- accountDateTitleLbl.text=@"账务日期:";
- accountDateTitleLbl.textColor = [UIColor blackColor];
- accountDateTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vAccountDate addSubview:accountDateTitleLbl];
- _accountDateLbl= [UILabel new];
- _accountDateLbl.frame=CGRectMake(CGRectGetMaxX(accountDateTitleLbl.frame), valuey, Screen_Width/2-CGRectGetMaxX(accountDateTitleLbl.frame) , valueheight);
- _accountDateLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vAccountDate addSubview:_accountDateLbl];
- _accountDateLbl.text = _salesOrder.accountDate;
-
- //客户地址
- UIView *vCustomerAddress = [UIView new];
- vCustomerAddress.frame=CGRectMake(0, CGRectGetMaxY(vCreator.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vCustomerAddress];
-
- UILabel *customerAddressTitleLbl=[UILabel new];
- customerAddressTitleLbl.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
- customerAddressTitleLbl.text=@"客户地址:";
- customerAddressTitleLbl.textColor = [UIColor blackColor];
- customerAddressTitleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerAddress addSubview:customerAddressTitleLbl];
- _customerAddressLbl = [UILabel new];
- _customerAddressLbl.frame=CGRectMake(CGRectGetMaxX(customerAddressTitleLbl.frame), valuey, Screen_Width -CGRectGetMaxX(customerAddressTitleLbl.frame), valueheight);
- _customerAddressLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- [vCustomerAddress addSubview:_customerAddressLbl];
- _customerAddressLbl.text = _salesOrder.address;
-
- //分割线
- _middleSeparatorView = [UIView new];
- _middleSeparatorView.frame = CGRectMake(0, CGRectGetMaxY(vCustomerAddress.frame), Screen_Width, heightLine);
- _middleSeparatorView.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:_middleSeparatorView];
-
- //金额
- UIView *vGoodsAmount = [UIView new];
- vGoodsAmount.frame=CGRectMake(0, CGRectGetMaxY(_middleSeparatorView.frame), Screen_Width, heightRow);
- [self.contentView addSubview:vGoodsAmount];
- _goodsAmountLbl=[UILabel new];
-
- NSString *goodsAmount= _salesOrder.goodsAmount;
- goodsAmount= [NSString stringWithFormat:@"%@%@",@"货物总额:¥",goodsAmount];
- CGRect goodsAmountFrame = [goodsAmount textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
- goodsAmountFrame.origin.x =Screen_Width-goodsAmountFrame.size.width-10;
- goodsAmountFrame.origin.y = valuey;
-
- _goodsAmountLbl.frame=goodsAmountFrame;
- _goodsAmountLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _goodsAmountLbl.textColor = [UIColor redColor];
- _goodsAmountLbl.text= goodsAmount;
- [vGoodsAmount addSubview:_goodsAmountLbl];
-
- _earnestAmountLbl=[UILabel new];
- NSString *earnestAmount=_salesOrder.amountCollected;
- earnestAmount=[NSString stringWithFormat:@"%@%@",@"收款:¥",earnestAmount];
- CGRect earnestAmountFrame = [earnestAmount textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
- earnestAmountFrame.origin.x =Screen_Width-goodsAmountFrame.size.width-earnestAmountFrame.size.width-10-5;
- earnestAmountFrame.origin.y = valuey;
-
- _earnestAmountLbl.frame=earnestAmountFrame;
- _earnestAmountLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _earnestAmountLbl.textColor = [UIColor redColor];
- _earnestAmountLbl.text=earnestAmount;
- [vGoodsAmount addSubview:_earnestAmountLbl];
-
- _goodsCountLbl=[UILabel new];
- NSString *goodsCount=_salesOrder.goodsCount;
- goodsCount= [NSString stringWithFormat:@"%@%@%@",@"共",goodsCount,@"件商品"];
- CGRect goodsCountFrame = [goodsCount textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
- goodsCountFrame.origin.x =Screen_Width-goodsAmountFrame.size.width- earnestAmountFrame.size.width-goodsCountFrame.size.width-10-10;
- goodsCountFrame.origin.y = valuey;
-
- _goodsCountLbl.frame=goodsCountFrame;
- _goodsCountLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
- _goodsCountLbl.textColor = [UIColor redColor];
- _goodsCountLbl.text=goodsCount;
- [vGoodsAmount addSubview:_goodsCountLbl];
-
-
- // //客户地址
- UIView *vOperation = [UIView new];
- vOperation.frame=CGRectMake(0, CGRectGetMaxY(vGoodsAmount.frame), Screen_Width, 25);
- [self.contentView addSubview:vOperation];
- _digitalInvoiceBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- [_digitalInvoiceBtn setTitle:@"电子单据" forState:UIControlStateNormal];
- [_digitalInvoiceBtn setBackgroundColor:[UIColor whiteColor]];
- [_digitalInvoiceBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- _digitalInvoiceBtn.layer.cornerRadius = 10;
- _digitalInvoiceBtn.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
- [_digitalInvoiceBtn addTarget:self action:@selector(btnGoDigitalInvoice) forControlEvents:UIControlEventTouchUpInside];
- _digitalInvoiceBtn.layer.borderWidth = 1.0f;//设置边框颜色
- _digitalInvoiceBtn.frame = CGRectMake(Screen_Width-70-5 ,0 , 70, valueheight);
- [vOperation addSubview:_digitalInvoiceBtn];
-
-
- _editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- [_editBtn setTitle:@"编辑" forState:UIControlStateNormal];
- [_editBtn setBackgroundColor:[UIColor whiteColor]];
- _editBtn.layer.cornerRadius = 10;
- _editBtn.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
- [_editBtn addTarget:self action:@selector(btnGoEdit) forControlEvents:UIControlEventTouchUpInside];
- _editBtn.layer.borderWidth = 1.0f;//设置边框颜色
- _editBtn.frame = CGRectMake(Screen_Width-btnwidth-70-5*2 ,0 , btnwidth, valueheight);
- [vOperation addSubview:_editBtn];
-
- _correctBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- [_correctBtn setTitle:@"冲正" forState:UIControlStateNormal];
- [_correctBtn setBackgroundColor:[UIColor whiteColor]];
- _correctBtn.layer.cornerRadius = 10;
- _correctBtn.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
- _correctBtn.layer.borderWidth = 1.0f;//设置边框颜色
- _correctBtn.frame = CGRectMake(Screen_Width-2*btnwidth-70-5*3 ,0 , btnwidth, valueheight);
- [_correctBtn addTarget:self action:@selector(btnGoCorrect) forControlEvents:UIControlEventTouchUpInside];
- [vOperation addSubview:_correctBtn];
- _goodsDetailBtn=[UIButton buttonWithType:UIButtonTypeCustom];
- [_goodsDetailBtn setTitle:@"商品详细" forState:UIControlStateNormal];
- [_goodsDetailBtn setBackgroundColor:[UIColor whiteColor]];
- _goodsDetailBtn.layer.cornerRadius = 10;
- _goodsDetailBtn.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
- _goodsDetailBtn.layer.borderWidth = 1.0f;//设置边框颜色
- _goodsDetailBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_goodsDetailBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- _goodsDetailBtn.frame = CGRectMake(Screen_Width-2*btnwidth-70*2-5*4 ,0 , 70, valueheight);
- [_goodsDetailBtn addTarget:self action:@selector(btnGoDetail) forControlEvents:UIControlEventTouchUpInside];
- [vOperation addSubview:_goodsDetailBtn];
-
- _receivablesBtn=[UIButton buttonWithType:UIButtonTypeCustom];
- [_receivablesBtn setTitle:@"收款" forState:UIControlStateNormal];
- [_receivablesBtn setBackgroundColor:[UIColor whiteColor]];
- _receivablesBtn.layer.cornerRadius = 10;
- _receivablesBtn.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
- _receivablesBtn.layer.borderWidth = 1.0f;//设置边框颜色
- _receivablesBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_receivablesBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- _receivablesBtn.frame = CGRectMake(Screen_Width-3*btnwidth-70*2-5*5 ,0 , 50, valueheight);
- [_receivablesBtn addTarget:self action:@selector(btnGoReceivables) forControlEvents:UIControlEventTouchUpInside];
- [vOperation addSubview:_receivablesBtn];
-
- NSString *finalReceivables= _salesOrder.finalReceivables;
-
- if([finalReceivables doubleValue]==0){
- _receivablesBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
- [_receivablesBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
- [_receivablesBtn setEnabled:NO];
- }
- else{
- _receivablesBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_receivablesBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_receivablesBtn setEnabled:YES];
- }
- _bottomSeparatorView = [UIView new];
- _bottomSeparatorView.frame=CGRectMake(0, CGRectGetMaxY(vOperation.frame)+15, Screen_Width, 10);
- _bottomSeparatorView.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:_bottomSeparatorView];
-
-
-
- NSInteger status= _salesOrder.status;
- switch (status) {
- case 4:
- _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_editBtn setEnabled:YES];
- _correctBtn.layer.borderColor = [UIColor redColor].CGColor;
- [_correctBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- [_correctBtn setEnabled:YES];
- break;
- case 5:
- _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_editBtn setEnabled:YES];
- _correctBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
- [_correctBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
- [_correctBtn setEnabled:NO];
- break;
- case 7:
-
- _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_editBtn setEnabled:YES];
-
- if(salesOrderModel.salesDetailType == 1){
- _correctBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
- [_correctBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
- [_correctBtn setEnabled:NO];
- }else{
- _correctBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_correctBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- [_correctBtn setEnabled:YES];
- }
-
-
- break;
- case 10:
- _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_editBtn setEnabled:YES];
- _correctBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
- [_correctBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
- [_correctBtn setEnabled:NO];
- _receivablesBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
- [_receivablesBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
- [_receivablesBtn setEnabled:NO];
- break;
- case 11:
- _digitalInvoiceBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
- [_digitalInvoiceBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
- [_digitalInvoiceBtn setEnabled:NO];
-
- _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
- [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_editBtn setEnabled:YES];
- _correctBtn.layer.borderColor = [UIColor redColor].CGColor;
- [_correctBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- [_correctBtn setEnabled:YES];
- break;
- default:
- _editBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
- [_editBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
- [_editBtn setEnabled:NO];
- break;
- }
-
-
- }
- - (void)btnGoCorrect{
- __weak typeof(self) weakself=self;
- if ([weakself.delegate respondsToSelector:@selector(goCorrect:)]){
-
- [weakself.delegate performSelector:@selector(goCorrect:) withObject:weakself];
- }
- }
- -(void)btnGoDigitalInvoice{
- __weak typeof(self) weakself=self;
- if ([weakself.delegate respondsToSelector:@selector(goElectronicInvoice:)]){
- [weakself.delegate goElectronicInvoice:_cellIndex];
- }
- }
- - (void)btnGoDetail{
- __weak typeof(self) weakself=self;
- if ([weakself.delegate respondsToSelector:@selector(goDetail:)]){
- [weakself.delegate performSelector:@selector(goDetail:) withObject:_salesOrder];
- }
- }
- - (void)btnGoEdit{
- __weak typeof(self) weakself=self;
- if ([weakself.delegate respondsToSelector:@selector(goEdit:)]){
- [weakself.delegate performSelector:@selector(goEdit:) withObject:_salesOrder];
- }
- }
- -(void)btnGoReceivables{
- __weak typeof(self) weakself=self;
- if ([weakself.delegate respondsToSelector:@selector(goReceivables:)]){
- [weakself.delegate goReceivables:_salesOrder];
- }
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
-
-
- }
- @end
|