| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- //
- // CustomerTraceListSearchCell.m
- // IBOSS
- //
- // Created by 关宏厚 on 2019/4/10.
- // Copyright © 2019 elongtian. All rights reserved.
- //
- #import "CustomerTraceListSearchCell.h"
- @implementation CustomerTraceListSearchCell
- - (void)awakeFromNib {
- [super awakeFromNib];
-
- }
- /**
- 单元格高度
- @return <#return value description#>
- */
- - (CGFloat)cellHeight {
- return 443.5f;
- }
- /**
- 加载tableviewcell
- @param indexPath <#indexPath description#>
- @return <#return value description#>
- */
- + (instancetype)createCellWithIndexPath:(NSIndexPath *)indexPath {
- CustomerTraceListSearchCell *cell = [[NSBundle mainBundle] loadNibNamed:@"CustomerTraceListSearchCell" owner:nil options:nil][0];
-
- return cell;
- }
- /**
- 更新model
- 关宏厚2017-7-6
- @param model <#model description#>
- @param indexPath <#indexPath description#>
- */
- - (void)updateCellWithModel:(SideSlipModel *__autoreleasing *)model indexPath:(NSIndexPath *)indexPath{
- self.regionModel = *model;
- NSString *estimateSalesAmountStartDateValue = [DateFormat getDateBefore:31];
- NSString *estimateSalesAmountEndDate = [DateFormat getCurrentDate];
- [_btnEstimateSalesAmountStartDate setTitle:estimateSalesAmountStartDateValue forState:UIControlStateNormal];
- _sEstimateSalesAmountStartDate= _btnEstimateSalesAmountStartDate.titleLabel.text;
- [_btnEstimateSalesAmountEndDate setTitle:estimateSalesAmountEndDate forState:UIControlStateNormal];
- _sEstimateSalesAmountEndDate =_btnEstimateSalesAmountEndDate.titleLabel.text;
-
- NSString *accountStartDateValue = [DateFormat getDateBefore:31];
- NSString *accountEndDateValue = [DateFormat getCurrentDate];
-
- [_btnAccountStartDate setTitle:accountStartDateValue forState:UIControlStateNormal];
- _sAccountStartDate= _btnAccountStartDate.titleLabel.text;
- [_btnAccountEndDate setTitle:accountEndDateValue forState:UIControlStateNormal];
- _sAccountEndDate =_btnAccountEndDate.titleLabel.text;
- [self updateModel];
-
-
- }
- /**
- Identifier
- @return <#return value description#>
- */
- + (NSString *)cellReuseIdentifier {
-
- return @"CustomerTraceListSearchCell";
- }
- /**
- 重置按钮 事件
- */
- - (void)resetData {
-
- [_btnDepartment setTitle:@"请选择业务部门" forState:UIControlStateNormal];
- _organizationCode = @"";
- [_btnEstimateSalesAmountStartDate setTitle:@"请选择预估销售金额创建开始日期" forState:UIControlStateNormal];
- _sEstimateSalesAmountStartDate = @"";
- [_btnEstimateSalesAmountEndDate setTitle:@"请选择预估销售金额创建结束日期" forState:UIControlStateNormal];
- _sEstimateSalesAmountEndDate = @"";
- [_btnAccountStartDate setTitle:@"请选择账务开始日期" forState:UIControlStateNormal];
- _sAccountStartDate = @"";
- [_btnAccountEndDate setTitle:@"请选择账务结束日期" forState:UIControlStateNormal];
- _sAccountEndDate=@"";
- }
- /**
- 业务部门
-
- @param Amodel <#Amodel description#>
- @param cr <#cr description#>
- */
- - (void)achiementData:(AchiementDepartmentInfoModel *)Amodel CustomerReport:(CustomerReport)cr{
- //返回值
- if(cr == ReportAchiementDepartmt){
- _organizationCode=Amodel.organizationCode;
- [self.btnDepartment setTitle:Amodel.organizationName forState:UIControlStateNormal];
- }
-
- [self updateModel];
- }
- /**
- 更新model
- */
- - (void)updateModel{
- CustomerTraceListSearchModel *model = [[CustomerTraceListSearchModel alloc] init];
- model.organizationCode = _organizationCode;
- model.estimateSalesAmountStartDate = _sEstimateSalesAmountStartDate;
- model.estimateSalesAmountEndDate = _sEstimateSalesAmountEndDate;
- model.accountStartDate =_sAccountStartDate;
- model.accountEndDate = _sAccountEndDate;
-
- NSMutableDictionary *mutDict = [NSMutableDictionary dictionaryWithDictionary:_regionModel.customDict];
- [mutDict setValue:model forKey:CUSTOMER_TRACE_LIST_SEARCH_MODEL];
- _regionModel.customDict = [mutDict copy];
- }
- - (IBAction)clickDepartmentAction:(id)sender {
- CustomerAchievementTextVC *tc = [[CustomerAchievementTextVC alloc ]init];
- tc.cDelegate = self;
- tc.flag = YES;
- tc.isPresentViewFlag = YES;
- tc.showDialogViewTag=ReportAchiementDepartmt;
- if ([self.delegate respondsToSelector:@selector(sideSlipTableViewCellNeedsDismissViewController:animated:)]) {
- [self.delegate sideSlipTableViewCellNeedsDismissViewController:tc animated:YES];
- }
- }
- - (IBAction)clickEstimateSalesAmountStartDate:(id)sender {
- __weak typeof(self) weakself=self;
- _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
- [_dealDatePicker configureSelectionBlock:^(NSString *date){
- self->_tempEstimateSalesAmountStartDate=date;
- } andCompletionBlock:^(void){
- weakself.sEstimateSalesAmountStartDate = self->_tempEstimateSalesAmountStartDate;
- [weakself.btnEstimateSalesAmountStartDate setTitle: weakself.sEstimateSalesAmountStartDate forState:UIControlStateNormal];
- [self updateModel];
- } andCancelBlock:^(void){
-
- }];
- [_dealDatePicker show];
- }
- - (IBAction)clickEstimateSalesAmountEndDate:(id)sender {
- __weak typeof(self) weakself=self;
- _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
- [_dealDatePicker configureSelectionBlock:^(NSString *date){
- self->_tempEstimateSalesAmountEndDate=date;
- } andCompletionBlock:^(void){
- weakself.sEstimateSalesAmountEndDate = self->_tempEstimateSalesAmountEndDate;
- [weakself.btnEstimateSalesAmountEndDate setTitle:weakself. sEstimateSalesAmountEndDate forState:UIControlStateNormal];
- [self updateModel];
- } andCancelBlock:^(void){
-
- }];
- [_dealDatePicker show];
-
- }
- - (IBAction)clickAccountStartDateAction:(id)sender {
- __weak typeof(self) weakself=self;
- _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
- [_dealDatePicker configureSelectionBlock:^(NSString *date){
- self->_tempAccountStartDate=date;
- } andCompletionBlock:^(void){
- weakself.sAccountStartDate = self->_tempAccountStartDate;
- [weakself.btnAccountStartDate setTitle: weakself.sAccountStartDate forState:UIControlStateNormal];
- [self updateModel];
- } andCancelBlock:^(void){
-
- }];
- [_dealDatePicker show];
- }
- - (IBAction)clickAccountEndDateAction:(id)sender {
- __weak typeof(self) weakself=self;
- _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
- [_dealDatePicker configureSelectionBlock:^(NSString *date){
- self->_tempAccountEndDate=date;
- } andCompletionBlock:^(void){
- weakself.sAccountEndDate = self->_tempAccountEndDate;
- [weakself.btnAccountEndDate setTitle:weakself.sAccountEndDate forState:UIControlStateNormal];
- [self updateModel];
- } andCancelBlock:^(void){
-
- }];
- [_dealDatePicker show];
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- }
- @end
|