CustomerCurrentAccountSummaryReportVC.m 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971
  1. //
  2. // CustomerCurrentAccountSummaryReportVC.m
  3. // IBOSS
  4. //
  5. // Created by 关宏厚 on 2021/2/24.
  6. // Copyright © 2021 elongtian. All rights reserved.
  7. //
  8. #import "CustomerCurrentAccountSummaryReportVC.h"
  9. #import "DateFormat.h"
  10. @interface CustomerCurrentAccountSummaryReportVC ()
  11. {
  12. UIView *headView;
  13. UIButton *btnAdvance;
  14. UIButton *btnReceivable;
  15. UIButton *btnBalance;
  16. CAShapeLayer *btnAdvanceMaskLayer;
  17. CAShapeLayer *btnBalanceMaskLayer;
  18. UIView *advanceView;
  19. UIView *receivableView;
  20. UIView *balanceTotalView;
  21. UIView *totalTitleView;
  22. UIView *advanceListTitleView;
  23. UIView *advanceListTitleView1;
  24. UIView *advanceListTitleView2;
  25. NSMutableDictionary *_cellHeight;
  26. }
  27. @end
  28. @implementation CustomerCurrentAccountSummaryReportVC
  29. - (void)viewDidLoad {
  30. [super viewDidLoad];
  31. _customerCurrentSummaryList=[[NSMutableArray alloc]init];
  32. _customerCurrentSummaryFilterList=[[NSMutableArray alloc]init];
  33. _cellHeight = [[NSMutableDictionary alloc] init];
  34. _startDate=[DateFormat getCurrentDate];
  35. _endDate=[DateFormat getCurrentDate];
  36. [self initSlideSlip];
  37. [self initUI];
  38. [self loadNavStyle];
  39. _advanceFlag=@"1";
  40. _startDate=[DateFormat getCurrentDate];
  41. _endDate=[DateFormat getCurrentDate];
  42. _isFilterZeroAmount=YES;
  43. [self startLoading];
  44. [self loadData];
  45. }
  46. /**
  47. 抽屉初始化
  48. */
  49. - (void)initSlideSlip{
  50. // 抽屉对象
  51. __weak typeof(self) weakself=self;
  52. self.filterController = [[SideSlipFilterController alloc] initWithSponsor:self resetBlock:^(NSArray *dataList) {
  53. for (SideSlipModel *model in dataList) {
  54. model.selectedItemList = nil;
  55. model.customDict = nil;
  56. }
  57. } commitBlock:^(NSArray *dataList) {
  58. // 查询条件
  59. SideSlipModel *model = dataList[0];
  60. self->_currentSummarySearchModel = [model.customDict objectForKey:CUSTOMER_CURRENT_SUMMARY_SEARCH_MODEL];
  61. self->_channelId=self->_currentSummarySearchModel.channelId;
  62. self->_organizationCode=self->_currentSummarySearchModel.organizationCode;
  63. self->_startDate=self->_currentSummarySearchModel.startDate;
  64. self->_endDate=self->_currentSummarySearchModel.endDate;
  65. self->_customerCode=self->_currentSummarySearchModel.customerCode;
  66. self->_customerName=self->_currentSummarySearchModel.customerName;
  67. self->_customerTelephone=self->_currentSummarySearchModel.customerTelephone;
  68. self->_customerAddress=self->_currentSummarySearchModel.customerAddress;
  69. self->_isFilterZeroAmount=self->_currentSummarySearchModel.isFilterZeroAmount;
  70. if(self->_customerCurrentSummaryList!=nil&&self->_customerCurrentSummaryList.count>0)
  71. {
  72. [self->_customerCurrentSummaryList removeAllObjects];
  73. }
  74. if(self->_customerCurrentSummaryFilterList!=nil&&self->_customerCurrentSummaryFilterList.count>0)
  75. {
  76. [self->_customerCurrentSummaryFilterList removeAllObjects];
  77. [self->_vTableView reloadData];
  78. }
  79. [self startLoading];
  80. [self clearData];
  81. [self loadData];
  82. [weakself.filterController dismiss];
  83. }];
  84. _filterController.animationDuration = AnimationDuration;
  85. _filterController.hasHeadView = YES;
  86. _filterController.sideSlipLeading = 0.1*[UIScreen mainScreen].bounds.size.width;
  87. _filterController.dataList = [self packageDataList];
  88. }
  89. -(void)clearData
  90. {
  91. _lblLastDepositReceived.text=@"0.00";
  92. _lblNextDepositReceived.text=@"0.00";
  93. _lblLastAccountReceivable.text=@"0.00";
  94. _lblSalesAmount.text=@"0.00";
  95. _lblRefundAmount.text=@"0.00";
  96. _lblAdjustAmount.text=@"0.00";
  97. _lblVerificationSum.text=@"0.00";
  98. _lblNextAccountReceivable.text=@"0.00";
  99. _lblBalanceAmount.text=@"0.00";
  100. _lblDepositReceivedEarnest.text=@"0.00";
  101. }
  102. -(void)initUI
  103. {
  104. CGFloat topMargin=10;
  105. headView=[UIView new];
  106. headView.frame=CGRectMake(0, 0,Screen_Width,0);
  107. [headView setBackgroundColor:[UIColor whiteColor]];
  108. [self.view addSubview:headView];
  109. btnAdvance= [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-105-10,topMargin, 70, 25)];
  110. [btnAdvance setTitle:@"预收" forState:UIControlStateNormal];
  111. btnAdvance.tag=1000;
  112. [btnAdvance setTitleColor:[UIColor redColor]
  113. forState:UIControlStateNormal];
  114. btnAdvance.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  115. [btnAdvance addTarget:self action:@selector(selectAmount:) forControlEvents:UIControlEventTouchUpInside];
  116. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:btnAdvance.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  117. CAShapeLayer *maskLayer = [CAShapeLayer layer];
  118. maskLayer.frame = btnAdvance.bounds;
  119. maskLayer.path = maskPath.CGPath;
  120. btnAdvance.layer.mask = maskLayer;
  121. [headView addSubview:btnAdvance];
  122. btnAdvanceMaskLayer = [CAShapeLayer layer];
  123. btnAdvanceMaskLayer.frame = btnAdvance.bounds;
  124. btnAdvanceMaskLayer.path = maskPath.CGPath;
  125. btnAdvanceMaskLayer.fillColor=[UIColor clearColor].CGColor;
  126. btnAdvanceMaskLayer.strokeColor=[UIColor redColor].CGColor;
  127. btnAdvanceMaskLayer.lineWidth=1;
  128. [btnAdvance.layer addSublayer:btnAdvanceMaskLayer];
  129. btnReceivable = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(btnAdvance.frame),topMargin, 70, 25)];
  130. [btnReceivable setTitle:@"应收" forState:UIControlStateNormal];
  131. btnReceivable.layer.cornerRadius=0;
  132. btnReceivable.layer.borderWidth=1;
  133. btnReceivable.tag=1001;
  134. [btnReceivable addTarget:self action:@selector(selectAmount:) forControlEvents:UIControlEventTouchUpInside];
  135. [btnReceivable setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  136. [btnReceivable.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  137. btnReceivable.layer.borderColor=[UIColor lightGrayColor].CGColor;
  138. btnReceivable.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  139. [headView addSubview:btnReceivable];
  140. btnBalance= [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(btnReceivable.frame),topMargin, 70, 25)];
  141. [btnBalance setTitle:@"余额" forState:UIControlStateNormal];
  142. btnBalance.tag=1002;
  143. btnBalance.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  144. [btnBalance addTarget:self action:@selector(selectAmount:) forControlEvents:UIControlEventTouchUpInside];
  145. [btnBalance setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  146. UIBezierPath *maskPath2 = [UIBezierPath bezierPathWithRoundedRect:btnBalance.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  147. CAShapeLayer *maskLayer2 = [CAShapeLayer layer];
  148. maskLayer2.frame = btnBalance.bounds;
  149. maskLayer2.path = maskPath2.CGPath;
  150. btnBalance.layer.mask = maskLayer2;
  151. [headView addSubview:btnBalance];
  152. btnBalanceMaskLayer = [CAShapeLayer layer];
  153. btnBalanceMaskLayer.frame = btnBalance.bounds;
  154. btnBalanceMaskLayer.path = maskPath2.CGPath;
  155. btnBalanceMaskLayer.fillColor=[UIColor clearColor].CGColor;
  156. btnBalanceMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  157. btnBalanceMaskLayer.lineWidth=1;
  158. [btnBalance.layer addSublayer:btnBalanceMaskLayer];
  159. totalTitleView = [[UIView alloc]init];
  160. totalTitleView.frame = CGRectMake(0,CGRectGetMaxY(btnAdvance.frame)+topMargin ,Screen_Width, 45);
  161. [headView addSubview:totalTitleView];
  162. UIView *totalImgView=[UIImageView new];
  163. totalImgView.frame=CGRectMake(10, 10,10 , 25);
  164. [totalImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  165. [totalTitleView addSubview:totalImgView];
  166. UILabel *titleTotal = [[UILabel alloc]init];
  167. titleTotal.frame = CGRectMake(CGRectGetMaxX(totalImgView.frame)+10, 10, 90, 25);
  168. titleTotal.text = @"合计";
  169. titleTotal.textColor = [UIColor blackColor];
  170. titleTotal.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  171. [totalTitleView addSubview:titleTotal];
  172. UIView *separator=[UIView new];
  173. separator.frame=CGRectMake(0,totalTitleView.frame.size.height-1, totalTitleView.frame.size.width, 0.5);
  174. [separator setBackgroundColor:[UIColor lightGrayColor]];
  175. [totalTitleView addSubview:separator ];
  176. int rowHeight=50;
  177. advanceView=[UIView new];
  178. advanceView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame), Screen_Width, 0);
  179. [headView addSubview:advanceView];
  180. UIView *lastDepositReceivedView = [[UIView alloc]init];
  181. lastDepositReceivedView.frame = CGRectMake(0,topMargin,Screen_Width/2, rowHeight);
  182. _lblLastDepositReceived= [[UILabel alloc]init];
  183. _lblLastDepositReceived.frame = CGRectMake(0, 0,lastDepositReceivedView.frame.size.width, 25);
  184. _lblLastDepositReceived.textAlignment=UITextAlignmentCenter;
  185. _lblLastDepositReceived.textColor = [UIColor blackColor];
  186. _lblLastDepositReceived.text=@"0.00";
  187. _lblLastDepositReceived.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  188. [lastDepositReceivedView addSubview:_lblLastDepositReceived];
  189. UILabel *lblTitleLastDepositReceived= [[UILabel alloc]init];
  190. lblTitleLastDepositReceived.frame = CGRectMake(0,CGRectGetMaxY(_lblLastDepositReceived.frame),lastDepositReceivedView.frame.size.width, 25);
  191. lblTitleLastDepositReceived.text = @"预存期初额";
  192. lblTitleLastDepositReceived.textColor = [UIColor blackColor];
  193. lblTitleLastDepositReceived.textAlignment=UITextAlignmentCenter;
  194. lblTitleLastDepositReceived.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  195. [lastDepositReceivedView addSubview:lblTitleLastDepositReceived];
  196. [advanceView addSubview:lastDepositReceivedView];
  197. UIView *middleSeparator=[UIView new];
  198. middleSeparator.frame=CGRectMake(Screen_Width/2,topMargin, 0.5, 50);
  199. middleSeparator.backgroundColor=[UIColor lightGrayColor];
  200. [advanceView addSubview:middleSeparator];
  201. //预存余额
  202. UIView *nextDepositReceivedView = [[UIView alloc]init];
  203. nextDepositReceivedView.frame = CGRectMake(Screen_Width/2,topMargin, Screen_Width/2, rowHeight);
  204. _lblNextDepositReceived = [[UILabel alloc]init];
  205. _lblNextDepositReceived.frame = CGRectMake(0, 0, nextDepositReceivedView.frame.size.width, 25);
  206. _lblNextDepositReceived.textAlignment=UITextAlignmentCenter;
  207. _lblNextDepositReceived.text=@"0.00";
  208. _lblNextDepositReceived.textColor = [UIColor blackColor];
  209. _lblNextDepositReceived.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  210. [nextDepositReceivedView addSubview:_lblNextDepositReceived];
  211. UILabel *lblNextDepositReceivedTitle = [[UILabel alloc]init];
  212. lblNextDepositReceivedTitle.frame = CGRectMake(0,CGRectGetMaxY(_lblNextDepositReceived.frame), nextDepositReceivedView.frame.size.width, 25);
  213. lblNextDepositReceivedTitle.text = @"预存余额";
  214. lblNextDepositReceivedTitle.textAlignment=UITextAlignmentCenter;
  215. lblNextDepositReceivedTitle.textColor = [UIColor blackColor];
  216. lblNextDepositReceivedTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  217. [nextDepositReceivedView addSubview:lblNextDepositReceivedTitle];
  218. [advanceView addSubview:nextDepositReceivedView];
  219. advanceListTitleView = [[UIView alloc]init];
  220. advanceListTitleView.frame = CGRectMake(0,CGRectGetMaxY(lastDepositReceivedView.frame)+topMargin ,Screen_Width, 45);
  221. [advanceView addSubview:advanceListTitleView];
  222. UIView *advanceListImgView=[UIImageView new];
  223. advanceListImgView.frame=CGRectMake(10, 10,10 , 25);
  224. [advanceListImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  225. [advanceListTitleView addSubview:advanceListImgView];
  226. UILabel *titleAdvanceList = [[UILabel alloc]init];
  227. titleAdvanceList.frame = CGRectMake(CGRectGetMaxX(advanceListImgView.frame)+10, 10, 90, 25);
  228. titleAdvanceList.text = @"列表";
  229. titleAdvanceList.textColor = [UIColor blackColor];
  230. titleAdvanceList.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  231. [advanceListTitleView addSubview:titleAdvanceList];
  232. advanceView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame),Screen_Width,CGRectGetMaxY(advanceListTitleView.frame));
  233. headView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetMaxY(advanceView.frame));
  234. advanceView.hidden=NO;
  235. receivableView=[UIView new];
  236. receivableView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame), Screen_Width, 0);
  237. [headView addSubview:receivableView];
  238. UIView *lastAccountReceivableView = [[UIView alloc]init];
  239. lastAccountReceivableView.frame = CGRectMake(0,10,Screen_Width/2, rowHeight);
  240. _lblLastAccountReceivable= [[UILabel alloc]init];
  241. _lblLastAccountReceivable.frame = CGRectMake(0, 0,lastAccountReceivableView.frame.size.width, 25);
  242. _lblLastAccountReceivable.textAlignment=UITextAlignmentCenter;
  243. _lblLastAccountReceivable.textColor = [UIColor blackColor];
  244. _lblLastAccountReceivable.text=@"0.00";
  245. _lblLastAccountReceivable.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  246. [lastAccountReceivableView addSubview:_lblLastAccountReceivable];
  247. UILabel *lblTitleLastAccountReceivable= [[UILabel alloc]init];
  248. lblTitleLastAccountReceivable.frame = CGRectMake(0,CGRectGetMaxY(_lblLastAccountReceivable.frame),lastAccountReceivableView.frame.size.width, 25);
  249. lblTitleLastAccountReceivable.text = @"应收期初额";
  250. lblTitleLastAccountReceivable.textColor = [UIColor blackColor];
  251. lblTitleLastAccountReceivable.textAlignment=UITextAlignmentCenter;
  252. lblTitleLastAccountReceivable.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  253. [lastAccountReceivableView addSubview:lblTitleLastAccountReceivable];
  254. [receivableView addSubview:lastAccountReceivableView];
  255. UIView *refundAmountView = [[UIView alloc]init];
  256. refundAmountView.frame = CGRectMake(0,CGRectGetMaxY(lastAccountReceivableView.frame)+10, Screen_Width/2, rowHeight);
  257. [receivableView addSubview:refundAmountView];
  258. _lblRefundAmount = [[UILabel alloc]init];
  259. _lblRefundAmount.frame = CGRectMake(0, 0,refundAmountView.frame.size.width, 25);
  260. _lblRefundAmount.textAlignment=UITextAlignmentCenter;
  261. _lblRefundAmount.textColor = [UIColor blackColor];
  262. _lblRefundAmount.text=@"0.00";
  263. _lblRefundAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  264. [refundAmountView addSubview:_lblRefundAmount];
  265. UILabel *lblTitleRefundAmount = [[UILabel alloc]init];
  266. lblTitleRefundAmount.frame = CGRectMake(0, CGRectGetMaxY(_lblRefundAmount.frame),refundAmountView.frame.size.width , 25);
  267. lblTitleRefundAmount.text = @"回款额";
  268. lblTitleRefundAmount.textAlignment=UITextAlignmentCenter;
  269. lblTitleRefundAmount.textColor = [UIColor blackColor];
  270. lblTitleRefundAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  271. [refundAmountView addSubview:lblTitleRefundAmount];
  272. UIView *verificationAmountView = [[UIView alloc]init];
  273. verificationAmountView.frame = CGRectMake(0,CGRectGetMaxY(refundAmountView.frame)+10, Screen_Width/2, rowHeight);
  274. [receivableView addSubview:verificationAmountView];
  275. _lblVerificationSum = [[UILabel alloc]init];
  276. _lblVerificationSum.frame = CGRectMake(0, 0,verificationAmountView.frame.size.width, 25);
  277. _lblVerificationSum.textAlignment=UITextAlignmentCenter;
  278. _lblVerificationSum.textColor = [UIColor blackColor];
  279. _lblVerificationSum.text=@"0.00";
  280. _lblVerificationSum.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  281. [verificationAmountView addSubview:_lblVerificationSum];
  282. UILabel *lblTitleVerificationSum = [[UILabel alloc]init];
  283. lblTitleVerificationSum.frame = CGRectMake(0, CGRectGetMaxY(_lblVerificationSum.frame),verificationAmountView.frame.size.width , 25);
  284. lblTitleVerificationSum.text = @"核销额";
  285. lblTitleVerificationSum.textAlignment=UITextAlignmentCenter;
  286. lblTitleVerificationSum.textColor = [UIColor blackColor];
  287. lblTitleVerificationSum.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  288. [verificationAmountView addSubview:lblTitleVerificationSum];
  289. UIView *middleSeparator1=[UIView new];
  290. middleSeparator1.frame=CGRectMake(Screen_Width/2, 10, 0.5, 150);
  291. middleSeparator1.backgroundColor=[UIColor lightGrayColor];
  292. [receivableView addSubview:middleSeparator1];
  293. UIView *salesAmountView = [[UIView alloc]init];
  294. salesAmountView.frame = CGRectMake(Screen_Width/2,10, Screen_Width/2, rowHeight);
  295. _lblSalesAmount = [[UILabel alloc]init];
  296. _lblSalesAmount.frame = CGRectMake(0, 0, salesAmountView.frame.size.width, 25);
  297. _lblSalesAmount.textAlignment=UITextAlignmentCenter;
  298. _lblSalesAmount.text=@"0.00";
  299. _lblSalesAmount.textColor = [UIColor blackColor];
  300. _lblSalesAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  301. [salesAmountView addSubview:_lblSalesAmount];
  302. UILabel *lblSalesAmountTitle = [[UILabel alloc]init];
  303. lblSalesAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(_lblSalesAmount.frame), salesAmountView.frame.size.width, 25);
  304. lblSalesAmountTitle.text = @"销售额";
  305. lblSalesAmountTitle.textAlignment=UITextAlignmentCenter;
  306. lblSalesAmountTitle.textColor = [UIColor blackColor];
  307. lblSalesAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  308. [salesAmountView addSubview:lblSalesAmountTitle];
  309. [receivableView addSubview:salesAmountView];
  310. UIView *adjustAmountView = [[UIView alloc]init];
  311. adjustAmountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(salesAmountView.frame)+10, Screen_Width/2, rowHeight);
  312. _lblAdjustAmount = [[UILabel alloc]init];
  313. _lblAdjustAmount.frame = CGRectMake(0, 0, adjustAmountView.frame.size.width, 25);
  314. _lblAdjustAmount.textAlignment=UITextAlignmentCenter;
  315. _lblAdjustAmount.text=@"0.00";
  316. _lblAdjustAmount.textColor = [UIColor blackColor];
  317. _lblAdjustAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  318. [adjustAmountView addSubview:_lblAdjustAmount];
  319. UILabel *lblAdjustAmountTitle = [[UILabel alloc]init];
  320. lblAdjustAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(_lblAdjustAmount.frame), adjustAmountView.frame.size.width, 25);
  321. lblAdjustAmountTitle.text = @"调账额";
  322. lblAdjustAmountTitle.textAlignment=UITextAlignmentCenter;
  323. lblAdjustAmountTitle.textColor = [UIColor blackColor];
  324. lblAdjustAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  325. [adjustAmountView addSubview:lblAdjustAmountTitle];
  326. [receivableView addSubview:adjustAmountView];
  327. UIView *nextAccountReceivableView = [[UIView alloc]init];
  328. nextAccountReceivableView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(adjustAmountView.frame)+10, Screen_Width/2, rowHeight);
  329. _lblNextAccountReceivable = [[UILabel alloc]init];
  330. _lblNextAccountReceivable.frame = CGRectMake(0, 0, nextAccountReceivableView.frame.size.width, 25);
  331. _lblNextAccountReceivable.textAlignment=UITextAlignmentCenter;
  332. _lblNextAccountReceivable.text=@"0.00";
  333. _lblNextAccountReceivable.textColor = [UIColor blackColor];
  334. _lblNextAccountReceivable.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  335. [nextAccountReceivableView addSubview:_lblNextAccountReceivable];
  336. UILabel *lblNextAccountReceivableTitle = [[UILabel alloc]init];
  337. lblNextAccountReceivableTitle.frame = CGRectMake(0,CGRectGetMaxY(_lblNextAccountReceivable.frame), nextAccountReceivableView.frame.size.width, 25);
  338. lblNextAccountReceivableTitle.text = @"期末应收";
  339. lblNextAccountReceivableTitle.textAlignment=UITextAlignmentCenter;
  340. lblNextAccountReceivableTitle.textColor = [UIColor blackColor];
  341. lblNextAccountReceivableTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  342. [nextAccountReceivableView addSubview:lblNextAccountReceivableTitle];
  343. [receivableView addSubview:nextAccountReceivableView];
  344. advanceListTitleView1 = [[UIView alloc]init];
  345. advanceListTitleView1.frame = CGRectMake(0,CGRectGetMaxY(nextAccountReceivableView.frame)+topMargin ,Screen_Width, 45);
  346. [receivableView addSubview:advanceListTitleView1];
  347. advanceListImgView=[UIImageView new];
  348. advanceListImgView.frame=CGRectMake(10, 10,10 , 25);
  349. [advanceListImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  350. [advanceListTitleView1 addSubview:advanceListImgView];
  351. titleAdvanceList = [[UILabel alloc]init];
  352. titleAdvanceList.frame = CGRectMake(CGRectGetMaxX(advanceListImgView.frame)+10, 10, 90, 25);
  353. titleAdvanceList.text = @"列表";
  354. titleAdvanceList.textColor = [UIColor blackColor];
  355. titleAdvanceList.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  356. [advanceListTitleView1 addSubview:titleAdvanceList];
  357. receivableView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame),Screen_Width,CGRectGetMaxY(advanceListTitleView1.frame));
  358. headView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetMaxY(receivableView.frame));
  359. receivableView.hidden=YES;
  360. balanceTotalView=[UIView new];
  361. balanceTotalView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame), Screen_Width, 0);
  362. [headView addSubview:balanceTotalView];
  363. UIView *balanceView = [[UIView alloc]init];
  364. balanceView.frame = CGRectMake(0,10,Screen_Width/2, rowHeight);
  365. _lblBalanceAmount= [[UILabel alloc]init];
  366. _lblBalanceAmount.frame = CGRectMake(0, 0,balanceView.frame.size.width, 25);
  367. _lblBalanceAmount.textAlignment=UITextAlignmentCenter;
  368. _lblBalanceAmount.textColor = [UIColor blackColor];
  369. _lblBalanceAmount.text=@"0.00";
  370. _lblBalanceAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  371. [balanceView addSubview:_lblBalanceAmount];
  372. UILabel *lblTitleBalanceAmount= [[UILabel alloc]init];
  373. lblTitleBalanceAmount.frame = CGRectMake(0,CGRectGetMaxY(_lblBalanceAmount.frame),balanceView.frame.size.width, 25);
  374. lblTitleBalanceAmount.text = @"余额";
  375. lblTitleBalanceAmount.textColor = [UIColor blackColor];
  376. lblTitleBalanceAmount.textAlignment=UITextAlignmentCenter;
  377. lblTitleBalanceAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  378. [balanceView addSubview:lblTitleBalanceAmount];
  379. [balanceTotalView addSubview:balanceView];
  380. UIView *middleSeparator2=[UIView new];
  381. middleSeparator2.frame=CGRectMake(Screen_Width/2, 10, 0.5, 50);
  382. middleSeparator2.backgroundColor=[UIColor lightGrayColor];
  383. [balanceTotalView addSubview:middleSeparator2];
  384. // //未用定金
  385. UIView *depositReceivedEarnestView = [[UIView alloc]init];
  386. depositReceivedEarnestView.frame = CGRectMake(Screen_Width/2,10, Screen_Width/2, rowHeight);
  387. _lblDepositReceivedEarnest = [[UILabel alloc]init];
  388. _lblDepositReceivedEarnest.frame = CGRectMake(0, 0, depositReceivedEarnestView.frame.size.width, 25);
  389. _lblDepositReceivedEarnest.textAlignment=UITextAlignmentCenter;
  390. _lblDepositReceivedEarnest.text=@"0.00";
  391. _lblDepositReceivedEarnest.textColor = [UIColor blackColor];
  392. _lblDepositReceivedEarnest.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  393. [depositReceivedEarnestView addSubview:_lblDepositReceivedEarnest];
  394. UILabel *lblDepositReceivedEarnestTitle = [[UILabel alloc]init];
  395. lblDepositReceivedEarnestTitle.frame = CGRectMake(0,CGRectGetMaxY(_lblDepositReceivedEarnest.frame), depositReceivedEarnestView.frame.size.width, 25);
  396. lblDepositReceivedEarnestTitle.text = @"未用定金";
  397. lblDepositReceivedEarnestTitle.textAlignment=UITextAlignmentCenter;
  398. lblDepositReceivedEarnestTitle.textColor = [UIColor blackColor];
  399. lblDepositReceivedEarnestTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize16];
  400. [depositReceivedEarnestView addSubview:lblDepositReceivedEarnestTitle];
  401. [balanceTotalView addSubview:depositReceivedEarnestView];
  402. advanceListTitleView2 = [[UIView alloc]init];
  403. advanceListTitleView2.frame = CGRectMake(0,CGRectGetMaxY(depositReceivedEarnestView.frame)+topMargin ,Screen_Width, 45);
  404. [balanceTotalView addSubview:advanceListTitleView2];
  405. advanceListImgView=[UIImageView new];
  406. advanceListImgView.frame=CGRectMake(10, 10,10 , 25);
  407. [advanceListImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  408. [advanceListTitleView2 addSubview:advanceListImgView];
  409. titleAdvanceList = [[UILabel alloc]init];
  410. titleAdvanceList.frame = CGRectMake(CGRectGetMaxX(advanceListImgView.frame)+10, 10, 90, 25);
  411. titleAdvanceList.text = @"列表";
  412. titleAdvanceList.textColor = [UIColor blackColor];
  413. titleAdvanceList.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  414. [advanceListTitleView2 addSubview:titleAdvanceList];
  415. balanceTotalView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame),Screen_Width,CGRectGetMaxY(advanceListTitleView2.frame));
  416. headView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetMaxY(balanceTotalView.frame));
  417. balanceTotalView.hidden=YES;
  418. _vTableView=[[UITableView alloc]init];
  419. _vTableView.frame=CGRectZero;
  420. _vTableView.separatorStyle=UITableViewCellSeparatorStyleNone;
  421. _vTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
  422. _vTableView.dataSource=self;
  423. _vTableView.delegate = self;
  424. [self.view addSubview:_vTableView];
  425. }
  426. -(void)selectAmount:(UIButton*)sender
  427. {
  428. [self changeButtonColor];
  429. if(_customerCurrentSummaryFilterList!=nil&&_customerCurrentSummaryFilterList.count>0)
  430. {
  431. [_customerCurrentSummaryFilterList removeAllObjects];
  432. [_vTableView reloadData];
  433. }
  434. NSArray *customerCurrentSummaryFilterTempList= [_customerCurrentSummaryList subarrayWithRange:NSMakeRange(0, _customerCurrentSummaryList.count)];
  435. [_customerCurrentSummaryFilterList removeAllObjects];
  436. [_customerCurrentSummaryFilterList addObjectsFromArray:customerCurrentSummaryFilterTempList];
  437. if(sender.tag==1000)
  438. {
  439. btnAdvanceMaskLayer.strokeColor=[UIColor redColor].CGColor;
  440. btnAdvance.layer.borderColor=[UIColor redColor].CGColor;
  441. [btnAdvance setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  442. _advanceFlag=@"1";
  443. advanceView.hidden=NO;
  444. receivableView.hidden=YES;
  445. balanceTotalView.hidden=YES;
  446. advanceView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame),Screen_Width,CGRectGetMaxY(advanceListTitleView.frame));
  447. headView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetMaxY(advanceView.frame));
  448. _vTableView.frame=CGRectMake(0,CGRectGetMaxY(headView.frame)+5, self.view.frame.size.width, self.view.frame.size.height-CGRectGetMaxY(headView.frame));
  449. [_vTableView reloadData];
  450. }
  451. if(sender.tag==1001)
  452. {
  453. _advanceFlag=@"2";
  454. btnReceivable.layer.borderColor=[UIColor redColor].CGColor;
  455. [btnReceivable setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  456. advanceView.hidden=YES;
  457. receivableView.hidden=NO;
  458. balanceTotalView.hidden=YES;
  459. receivableView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame),Screen_Width,CGRectGetMaxY(advanceListTitleView1.frame));
  460. headView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetMaxY(receivableView.frame));
  461. _vTableView.frame=CGRectMake(0,CGRectGetMaxY(headView.frame)+5, self.view.frame.size.width, self.view.frame.size.height-CGRectGetMaxY(headView.frame));
  462. [_vTableView reloadData];
  463. }
  464. if(sender.tag==1002)
  465. {
  466. _advanceFlag=@"3";
  467. btnBalanceMaskLayer.strokeColor=[UIColor redColor].CGColor;
  468. btnBalance.layer.borderColor=[UIColor redColor].CGColor;
  469. [btnBalance setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  470. advanceView.hidden=YES;
  471. receivableView.hidden=YES;
  472. balanceTotalView.hidden=NO;
  473. balanceTotalView.frame=CGRectMake(0, CGRectGetMaxY(totalTitleView.frame),Screen_Width,CGRectGetMaxY(advanceListTitleView2.frame));
  474. headView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetMaxY(balanceTotalView.frame));
  475. _vTableView.frame=CGRectMake(0,CGRectGetMaxY(headView.frame)+5, self.view.frame.size.width, self.view.frame.size.height-CGRectGetMaxY(headView.frame));
  476. [_vTableView reloadData];
  477. }
  478. }
  479. -(void)changeButtonColor
  480. {
  481. btnAdvanceMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  482. btnAdvance.layer.borderColor=[UIColor lightGrayColor].CGColor;
  483. btnReceivable.layer.borderColor=[UIColor lightGrayColor].CGColor;
  484. btnBalanceMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  485. btnBalance.layer.borderColor=[UIColor lightGrayColor].CGColor;
  486. [btnAdvance setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  487. [btnReceivable setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  488. [btnBalance setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  489. }
  490. /**
  491. 导航按钮样式
  492. */
  493. - (void)loadNavStyle {
  494. self.navigationItem.title = @"客户往来账汇总表";
  495. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  496. [button setImage:[UIImage imageNamed:@"icon_back"] forState:UIControlStateNormal];
  497. [button addTarget:self action:@selector(goBack)
  498. forControlEvents:UIControlEventTouchUpInside];
  499. button.frame = CGRectMake(0, 0,45,22);
  500. UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  501. self.navigationItem.leftBarButtonItem = menuButton;
  502. // 右边
  503. UIView *v = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 42, 12)];
  504. UIButton *btnfilter = [UIButton buttonWithType:UIButtonTypeCustom];
  505. [btnfilter addTarget:self action:@selector(search)
  506. forControlEvents:UIControlEventTouchUpInside];
  507. btnfilter.frame = CGRectMake(0, 0,16, 16);
  508. [btnfilter setTitleColor:NavBarItemColor forState:UIControlStateNormal];
  509. [btnfilter setBackgroundImage:[UIImage imageNamed:@"icon_filter_white"]
  510. forState:UIControlStateNormal];
  511. [v addSubview:btnfilter];
  512. UIButton *filterLbl = [[UIButton alloc]init];
  513. filterLbl.frame=CGRectMake(CGRectGetMaxX(btnfilter.frame)+3,0,28, 16);
  514. [filterLbl setTitle:@"筛选" forState:UIControlStateNormal];
  515. [filterLbl setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  516. filterLbl.titleLabel.font = [UIFont systemFontOfSize:ButtonFontOfSize];
  517. [filterLbl addTarget:self action:@selector(search)
  518. forControlEvents:UIControlEventTouchUpInside];
  519. [v addSubview:filterLbl];
  520. UIBarButtonItem *menubtnAdd = [[UIBarButtonItem alloc] initWithCustomView:v];
  521. self.navigationItem.rightBarButtonItem = menubtnAdd;
  522. }
  523. -(void)search
  524. {
  525. [_filterController show];
  526. }
  527. /**
  528. 数据源
  529. @return <#return value description#>
  530. */
  531. - (NSArray *)packageDataList {
  532. NSMutableArray *dataArray = [NSMutableArray array];
  533. SideSlipModel *model = [[SideSlipModel alloc] init];
  534. model.containerCellClass = @"CustomerCurrentAccountSummarySearchCell";
  535. model.regionTitle = @"查询条件";
  536. [dataArray addObject:model];
  537. return [dataArray mutableCopy];
  538. }
  539. -(void)loadData
  540. {
  541. NSString *urlStr = ServerURL;
  542. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  543. [dict setObject:@"GetCustomerSummary" forKey:@"Action"];
  544. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  545. [dict setObject:kkUserCode forKey:@"UserCode"];
  546. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  547. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  548. [dict setObject:@"0" forKey:@"CustomerID"];
  549. [dict setObject:_customerCode forKeyedSubscript:@"CustomerCode"];
  550. [dict setObject:_customerName forKeyedSubscript:@"CustomerName"];
  551. [dict setObject:_startDate forKeyedSubscript:@"AccountDateFrom"];
  552. [dict setObject:_endDate forKeyedSubscript:@"AccountDateTo"];
  553. [dict setObject:_customerTelephone forKeyedSubscript:@"Telephone"];
  554. [dict setObject:_customerAddress forKeyedSubscript:@"Address"];
  555. [dict setObject:_channelId forKeyedSubscript:@"ChannelID"];
  556. [dict setObject:_isFilterZeroAmount?@ "1":@"0" forKeyedSubscript:@"FilterZero"];
  557. [dict setObject:_organizationCode forKeyedSubscript:@"OrganizationCode"];
  558. _downManager = [[ASIDownManager alloc] init];
  559. _downManager.delegate = self;
  560. _downManager.onRequestSuccess = @selector(onDataLoadFinish:);
  561. _downManager.onRequestFail = @selector(onDataLoadFail:);
  562. [_downManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  563. }
  564. -(void)onDataLoadFinish:(ASIDownManager*)sender
  565. {
  566. // 服务器返回数据
  567. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  568. [self stopLoading];
  569. // 服务器返回数据状态值
  570. int iStatus = resultModel.status;
  571. // 服务器返回数据消息
  572. NSString *message = resultModel.message;
  573. if (iStatus == 0)
  574. {
  575. NSDictionary *dic=(NSDictionary*)resultModel.result;
  576. NSArray *resultArray= [dic objectForKey:@"Table"];
  577. if(resultArray!=nil&&resultArray.count>0)
  578. {
  579. double totalLastDepositReceived=0;
  580. double totalNextDepositReceived=0;
  581. double totalLastAccountReceivable=0;
  582. double totalRefundAmount=0;
  583. double totalVerificationSum=0;
  584. double totalSalesAmount=0;
  585. double totalAdjustAmount=0;
  586. double totalNextAccountReceivable =0;
  587. double totalBalance=0;
  588. double totalDepositReceivedEarnest = 0.0;
  589. for(int i=0;i<resultArray.count;i++)
  590. {
  591. NSDictionary *resultDic=[resultArray objectAtIndex:i];
  592. CustomerCurrentSummaryListModel *summaryListModel=[CustomerCurrentSummaryListModel new];
  593. double adjustAmount=[[resultDic objectForKey:@"AdjustAmount"]doubleValue];
  594. totalAdjustAmount+=adjustAmount;
  595. double depositReceived=[[resultDic objectForKey:@"DepositReceived"]doubleValue];
  596. totalRefundAmount+=depositReceived;
  597. double depositReceivedEarnest=[[resultDic objectForKey:@"DepositReceivedEarnest"]doubleValue];
  598. totalDepositReceivedEarnest+=depositReceivedEarnest;
  599. double lastAccountReceivable=[[resultDic objectForKey:@"LastAccountReceivable"]doubleValue];
  600. totalLastAccountReceivable+=lastAccountReceivable;
  601. double lastDepositReceived=[[resultDic objectForKey:@"LastDepositReceived"]doubleValue];
  602. totalLastDepositReceived+=lastDepositReceived;
  603. double nextAccountReceivable=[[resultDic objectForKey:@"NextAccountReceivable"]doubleValue];
  604. totalNextAccountReceivable+=nextAccountReceivable;
  605. double nextDepositReceived=[[resultDic objectForKey:@"NextDepositReceived"]doubleValue];
  606. totalNextDepositReceived+=nextDepositReceived;
  607. double receivableAmount =[[resultDic objectForKey:@"ReceivableAmount"]doubleValue];
  608. double salesAmount =[[resultDic objectForKey:@"SalesAmount"]doubleValue];
  609. totalSalesAmount+=salesAmount;
  610. double verificationSum =[[resultDic objectForKey:@"VerificationSum"]doubleValue];
  611. totalVerificationSum+=verificationSum;
  612. double balanceAmount=nextAccountReceivable-nextDepositReceived;
  613. totalBalance+=balanceAmount;
  614. [summaryListModel setAddress:[resultDic objectForKey:@"Address"]];
  615. [summaryListModel setCustomerCode:[resultDic objectForKey:@"CustomerCode"]];
  616. [summaryListModel setBalanceAmount:[NSString stringWithFormat:@"%.2f",balanceAmount]];
  617. [summaryListModel setCustomerName:[resultDic objectForKey:@"CustomerName"]];
  618. [summaryListModel setTelephone:[resultDic objectForKey:@"Telephone"]];
  619. [summaryListModel setAdjustAmount:[NSString stringWithFormat:@"%.2f",adjustAmount]];
  620. [summaryListModel setDepositReceived:[NSString stringWithFormat:@"%.2f",depositReceived]];
  621. [summaryListModel setDepositReceivedEarnest:[NSString stringWithFormat:@"%.2f",depositReceivedEarnest]];
  622. [summaryListModel setLastAccountReceivable:[NSString stringWithFormat:@"%.2f",lastAccountReceivable]];
  623. [summaryListModel setLastDepositReceived:[NSString stringWithFormat:@"%.2f",lastDepositReceived]];
  624. [summaryListModel setNextAccountReceivable:[NSString stringWithFormat:@"%.2f",nextAccountReceivable]];
  625. [summaryListModel setNextDepositReceived:[NSString stringWithFormat:@"%.2f",nextDepositReceived]];
  626. [summaryListModel setReceivableAmount:[NSString stringWithFormat:@"%.2f",receivableAmount]];
  627. [summaryListModel setSalesAmount:[NSString stringWithFormat:@"%.2f",salesAmount]];
  628. [summaryListModel setVerificationSum:[NSString stringWithFormat:@"%.2f",verificationSum]];
  629. [_customerCurrentSummaryList addObject:summaryListModel];
  630. [_customerCurrentSummaryFilterList addObject:summaryListModel];
  631. }
  632. _vTableView.frame=CGRectMake(0,CGRectGetMaxY(headView.frame)+5, self.view.frame.size.width, self.view.frame.size.height-CGRectGetMaxY(headView.frame));
  633. [_vTableView reloadData];
  634. _lblLastDepositReceived.text=[NSString stringWithFormat:@"%.2f",totalLastDepositReceived];
  635. _lblNextDepositReceived.text=[NSString stringWithFormat:@"%.2f",totalNextDepositReceived];
  636. _lblLastAccountReceivable.text=[NSString stringWithFormat:@"%.2f",totalLastAccountReceivable];
  637. _lblRefundAmount.text=[NSString stringWithFormat:@"%.2f",totalRefundAmount];
  638. _lblVerificationSum.text=[NSString stringWithFormat:@"%.2f",totalVerificationSum];
  639. _lblSalesAmount.text=[NSString stringWithFormat:@"%.2f",totalSalesAmount];
  640. _lblAdjustAmount.text=[NSString stringWithFormat:@"%.2f",totalAdjustAmount];
  641. _lblNextAccountReceivable.text=[NSString stringWithFormat:@"%.2f",totalNextAccountReceivable];
  642. _lblBalanceAmount.text=[NSString stringWithFormat:@"%.2f",totalBalance];
  643. _lblDepositReceivedEarnest.text=[NSString stringWithFormat:@"%.2f",totalDepositReceivedEarnest];
  644. }
  645. else{
  646. [self showAlertViewText:@"无数据"];
  647. }
  648. }
  649. else if(iStatus == ActionResultStatusAuthError
  650. ||iStatus == ActionResultStatusNoLogin
  651. ||iStatus == ActionResultStatusLogined||iStatus==ActionResultSessionOverdue){
  652. [self showReLoginDialog:message];
  653. }
  654. else{
  655. [self showAlertViewText:message];
  656. }
  657. }
  658. -(void)onDataLoadFail:(ASIDownManager*)sender
  659. {
  660. [self stopLoading];
  661. [self showAlertViewText:@"网络异常"];
  662. }
  663. /**
  664. tableview的行数
  665. @param tableView <#tableView description#>
  666. @param section <#section description#>
  667. @return <#return value description#>
  668. */
  669. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  670. {
  671. return _customerCurrentSummaryFilterList.count;
  672. }
  673. /**
  674. tableview的分区数
  675. @param tableView <#tableView description#>
  676. @return <#return value description#>
  677. */
  678. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  679. return 1;
  680. }
  681. /**
  682. 获取tableview cell
  683. @param tableView <#tableView description#>
  684. @param indexPath <#indexPath description#>
  685. @return <#return value description#>
  686. */
  687. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  688. {
  689. static NSString *cellIdentifier = @"CurrentSummaryCellId";
  690. CustomerCurrentListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
  691. if (cell == nil) {
  692. cell = [[CustomerCurrentListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
  693. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  694. }
  695. else
  696. //当页面拉动的时候 当cell存在并且最后一个存在 把它进行删除就出来一个独特的cell我们在进行数据配置即可避免
  697. {
  698. while ([cell.contentView.subviews lastObject] != nil) {
  699. [(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
  700. }
  701. }
  702. NSUInteger row = [indexPath row];
  703. CustomerCurrentSummaryListModel *summaryListModel = [_customerCurrentSummaryFilterList objectAtIndex:row];
  704. [cell setCustomerCurrentListCell:summaryListModel advanceFlag:_advanceFlag];
  705. _cellHeight[@(indexPath.row)] = @(cell.cellHeight);
  706. return cell;
  707. }
  708. /**
  709. 预防高度
  710. @param tableView <#tableView description#>
  711. @param indexPath <#indexPath description#>
  712. @return <#return value description#>
  713. */
  714. -(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  715. return 250;
  716. }
  717. /**
  718. tableview的高度
  719. @param tableView <#tableView description#>
  720. @param indexPath <#indexPath description#>
  721. @return <#return value description#>
  722. */
  723. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  724. return [_cellHeight[@(indexPath.row)] floatValue];
  725. }
  726. @end