| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- //
- // DailyReconciliationSearchCell.m
- // IBOSS
- //
- // Created by 关宏厚 on 2020/9/30.
- // Copyright © 2020 elongtian. All rights reserved.
- //
- #import "DailyReconciliationSearchCell.h"
- #import "DateFormat.h"
- @implementation DailyReconciliationSearchCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- }
- - (IBAction)clickStartDateAction:(id)sender {
-
- __weak typeof(self) weakself=self;
- _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
- [_dealDatePicker configureSelectionBlock:^(NSString *date){
- self->_tempStartDate=date;
- } andCompletionBlock:^(void){
- weakself.startDate = self->_tempStartDate;
- [weakself.btnStartDate setTitle:weakself.startDate forState:UIControlStateNormal];
- [self updateModel];
- } andCancelBlock:^(void){
-
- }];
- [_dealDatePicker show];
- }
- - (IBAction)clickEndDateAction:(id)sender {
-
- __weak typeof(self) weakself=self;
- _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
- [_dealDatePicker configureSelectionBlock:^(NSString *date){
- self->_tempEndDate=date;
- } andCompletionBlock:^(void){
- weakself.endDate = self->_tempEndDate;
- [weakself.btnEndDate setTitle:weakself.endDate forState:UIControlStateNormal];
- [self updateModel];
- } andCancelBlock:^(void){
-
- }];
- [_dealDatePicker show];
- }
- /**
- 高度
-
- @return <#return value description#>
- */
- - (CGFloat)cellHeight {
- return 186.0f;
- }
- /**
- cell
-
- @param indexPath <#indexPath description#>
- @return <#return value description#>
- */
- + (instancetype)createCellWithIndexPath:(NSIndexPath *)indexPath {
- DailyReconciliationSearchCell *cell = [[NSBundle mainBundle] loadNibNamed:@"DailyReconciliationSearchCell" owner:nil options:nil][0];
-
- return cell;
- }
- /**
- 重置按钮 事件
- */
- - (void)resetData {
- [_btnStartDate setTitle:@"请选择账务开始日期" forState:UIControlStateNormal];
- _startDate = @"";
- [_btnEndDate setTitle:@"请选择账务结束日期" forState:UIControlStateNormal];
- _endDate = @"";
- }
- /**
- Identifier
-
- @return <#return value description#>
- */
- + (NSString *)cellReuseIdentifier {
-
- return @"DailyReconciliationSearchCell";
- }
- /**
- 更新model
-
- @param model <#model description#>
- @param indexPath <#indexPath description#>
- */
- - (void)updateCellWithModel:(SideSlipModel *__autoreleasing *)model indexPath:(NSIndexPath *)indexPath{
- _startDate= [DateFormat getCurrentDate];
- _endDate= [DateFormat getCurrentDate];
- [_btnStartDate setTitle:_startDate forState:UIControlStateNormal];
- [_btnEndDate setTitle:_endDate forState:UIControlStateNormal];
-
- self.regionModel = *model;
- [self updateModel];
-
- }
- /**
- 更新model
- */
- - (void)updateModel{
- DailyReconciliationSearchModel *model = [[DailyReconciliationSearchModel alloc] init];
-
- model.startDate=_startDate;
- model.endDate=_endDate;
- NSMutableDictionary *mutDict = [NSMutableDictionary dictionaryWithDictionary:_regionModel.customDict];
- [mutDict setValue:model forKey:DAILY_RECONCILIATION_SEARCH_RANGE_MODEL];
- _regionModel.customDict = [mutDict copy];
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- }
- @end
|