CustomerSearchDetailVC.m 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  1. //
  2. // CustomerSearchDetailVC.m
  3. // IBOSS
  4. //
  5. // Created by guan hong hou on 17/7/1.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:客户报备详细控制器
  9. //
  10. #import "CustomerSearchDetailVC.h"
  11. #import "JSONKit.h"
  12. #import "NewCustomerViewController.h"
  13. #import "DKTextAlignmentFillLabel.h"
  14. #import "CustomerNameCell.h"
  15. #import "ContactsCell.h"
  16. #import "ContactsTelephoneCell.h"
  17. #import "AddressCell.h"
  18. #import "CustomerStatusCell.h"
  19. #import "CustomerClassCell.h"
  20. #import "ValueFlagCell.h"
  21. #import "DetailAddressCell.h"
  22. @interface CustomerSearchDetailVC()<CustomerReportBrowseProtocol>
  23. {
  24. // 客户名称cell
  25. CustomerNameCell *_customerNameCell;
  26. // 联系人cell
  27. ContactsCell *_contactsCell;
  28. // 地址cell
  29. AddressCell *_addressCell;
  30. DetailAddressCell *_detailAddressCell;
  31. BuildingCell *_buildingCell;
  32. }
  33. @end
  34. @implementation CustomerSearchDetailVC
  35. /**
  36. UITableView对象
  37. */
  38. @synthesize vCustomTableView;
  39. #pragma -mark - 公共事件
  40. /**
  41. viewDidLoad事件
  42. */
  43. - (void)viewDidLoad
  44. {
  45. [super viewDidLoad];
  46. _customerReportDetail = [[ParseCustomerReportDetail alloc]init];
  47. _dataList = [[NSDictionary alloc]init];
  48. vCustomTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height)];
  49. vCustomTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
  50. vCustomTableView.separatorStyle=UITableViewCellSeparatorStyleNone;
  51. vCustomTableView.backgroundColor = [UIColor whiteColor];
  52. vCustomTableView.estimatedRowHeight = 42;
  53. vCustomTableView.rowHeight = UITableViewAutomaticDimension;
  54. vCustomTableView.delegate = self;
  55. vCustomTableView.dataSource=self;
  56. [self.view addSubview:vCustomTableView];
  57. [self initUI];
  58. [self initData];
  59. }
  60. /**
  61. 安全区视图发生变化
  62. */
  63. -(void)viewSafeAreaInsetsDidChange{
  64. [self.view setBackgroundColor:[UIColor whiteColor]];
  65. vCustomTableView.frame = self.view.safeAreaLayoutGuide.layoutFrame;
  66. [super viewSafeAreaInsetsDidChange];
  67. }
  68. /**
  69. didReceiveMemoryWarning事件
  70. */
  71. - (void)didReceiveMemoryWarning
  72. {
  73. [super didReceiveMemoryWarning];
  74. }
  75. /**
  76. dealloc事件
  77. */
  78. - (void)dealloc{
  79. _customerReportDetail = nil;
  80. _dataList = nil;
  81. vCustomTableView = nil;
  82. _infocell = nil;
  83. _achievementInfoCell = nil;
  84. _decorationInfoCell = nil;
  85. _privacyInfoCell = nil;
  86. _imageCell = nil;
  87. _imageAttachmentCell=nil;
  88. _followInfoCell = nil;
  89. }
  90. #pragma -mark - 私有函数
  91. /**
  92. 返回
  93. */
  94. - (void)goBack
  95. {
  96. [self.navigationController popViewControllerAnimated:YES];
  97. }
  98. /**
  99. 初始化ui
  100. */
  101. - (void)initUI{
  102. self.navigationItem.title = @"客户报备明细";
  103. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  104. [button setImage:[UIImage imageNamed:@"icon_back"] forState:UIControlStateNormal];
  105. [button addTarget:self action:@selector(goBack)
  106. forControlEvents:UIControlEventTouchUpInside];
  107. button.frame = CGRectMake(0, 0,45,22);
  108. UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  109. self.navigationItem.leftBarButtonItem = menuButton;
  110. UIButton *btnRight = [UIButton buttonWithType:UIButtonTypeCustom];
  111. [btnRight setTitle:@"编辑" forState:UIControlStateNormal];
  112. btnRight.titleLabel.font = [UIFont systemFontOfSize:ButtonFontOfSize];
  113. [btnRight addTarget:self action:@selector(goEdit)
  114. forControlEvents:UIControlEventTouchUpInside];
  115. btnRight.frame = CGRectMake(0, 0, 35, 12);
  116. if (self.flagCustomerAndFollow) {
  117. UIBarButtonItem *menuRightButton = [[UIBarButtonItem alloc] initWithCustomView:btnRight];
  118. self.navigationItem.rightBarButtonItem = menuRightButton;
  119. }
  120. }
  121. /**
  122. 编辑按钮
  123. */
  124. - (void)goEdit{
  125. self.hidesBottomBarWhenPushed=YES;
  126. NewCustomerViewController *vc = [[NewCustomerViewController alloc] init];
  127. vc.sFilingId = self.filingId;
  128. vc.telephoneFlag=_telephoneFlag;
  129. vc.refreshDelegate = self;
  130. [self.navigationController pushViewController:vc animated:YES];
  131. }
  132. /**
  133. 初始化数据
  134. */
  135. - (void)initData{
  136. [self startLoading];
  137. NSString *urlStr = ServerURL;
  138. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  139. [dict setObject:@"GetCustomersFilingDetailIphone" forKey:@"Action"];
  140. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  141. [dict setObject:kkUserCode forKey:@"UserCode"];
  142. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  143. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  144. [dict setObject:_filingId forKey:@"FilingID"];
  145. self.downManager = [[ASIDownManager alloc] init];
  146. NSString *JsonArr= [self.downManager syncPostHttpRequestUrl:urlStr dic:dict path:nil filename:nil fileType:nil];
  147. // 取消进度条
  148. [self cancel];
  149. if([JsonArr length] != 0){
  150. // 服务器返回数据
  151. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:JsonArr];
  152. // 服务器返回数据状态值
  153. int iStatus = resultModel.status;
  154. // 服务器返回数据消息
  155. NSString *message = resultModel.message;
  156. // 服务器返回数据状态值正确
  157. if (iStatus == 0) {
  158. // 服务器返回数据结果
  159. NSDictionary *infodic = (NSDictionary *)resultModel.result;
  160. if(infodic != nil)
  161. {
  162. [_customerReportDetail ParseCustomerInfoDetailArr: infodic];
  163. [vCustomTableView reloadData];
  164. }
  165. }
  166. else if(iStatus == ActionResultStatusAuthError
  167. ||iStatus == ActionResultStatusNoLogin
  168. ||iStatus == ActionResultStatusLogined||iStatus==ActionResultSessionOverdue){
  169. [self showReLoginDialog:message];
  170. }
  171. else {
  172. [self showAlertViewText:message];
  173. }
  174. }
  175. }
  176. /**
  177. 进度条隐藏
  178. */
  179. - (void)cancel {
  180. [self stopLoading];
  181. }
  182. #pragma -mark - 回调函数
  183. - (void)refreshData{
  184. _imageCell = nil;
  185. _imageAttachmentCell=nil;
  186. [self initData];
  187. }
  188. /**
  189. cell回调函数
  190. @param text <#text description#>
  191. */
  192. - (void)showAlertView:(NSString *)text{
  193. [self showAlertViewText:text];
  194. }
  195. /**
  196. cell回调函数
  197. @param message <#message description#>
  198. */
  199. - (void)showReLoginAlertView:(NSString *)message{
  200. [self showReLoginDialog:message];
  201. }
  202. #pragma -mark - tableView回调
  203. /**
  204. Section
  205. @param tableView <#tableView description#>
  206. @return <#return value description#>
  207. */
  208. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  209. return 1;
  210. }
  211. /**
  212. 行数
  213. @param tableView <#tableView description#>
  214. @param section <#section description#>
  215. @return <#return value description#>
  216. */
  217. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  218. int rowCount=0;
  219. if([kkAppName isEqualToString:@""])
  220. {
  221. rowCount=17;
  222. }
  223. else if([kkAppName isEqualToString:@"顺城"]){
  224. rowCount=16;
  225. }
  226. return rowCount;
  227. }
  228. /**
  229. 估计高度
  230. @param tableView <#tableView description#>
  231. @param indexPath <#indexPath description#>
  232. @return <#return value description#>
  233. */
  234. - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  235. return 53;
  236. }
  237. /**
  238. cell的高度
  239. @param tableView <#tableView description#>
  240. @param indexPath <#indexPath description#>
  241. @return <#return value description#>
  242. */
  243. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  244. {
  245. int row = (int)indexPath.row;
  246. _customerInfoDetail = [[_customerReportDetail customerInfoDetailArr] objectAtIndex:0];
  247. if(row==0)
  248. {
  249. // 客户名称
  250. if( _customerNameCell != nil){
  251. return _customerNameCell.height;
  252. }else{
  253. return 31;
  254. }
  255. }
  256. if(row==1)
  257. {
  258. // 联系人
  259. if( _contactsCell != nil){
  260. return _contactsCell.height;
  261. }else{
  262. return 31;
  263. }
  264. }
  265. if(row==3)
  266. {
  267. // 地址
  268. if( _addressCell != nil){
  269. return _addressCell.height;
  270. }else{
  271. return 31;
  272. }
  273. }
  274. if(row==4)
  275. {
  276. if(_customerInfoDetail.isCommunityFlag==0)
  277. {
  278. if(_detailAddressCell!=nil){
  279. return _detailAddressCell.height;
  280. }
  281. else{
  282. return 31;
  283. }
  284. }
  285. else
  286. {
  287. if(_buildingCell!=nil)
  288. {
  289. return _buildingCell.height;
  290. }
  291. else{
  292. return 31;
  293. }
  294. }
  295. }
  296. if(row==2||row==5||row==6||row==7||row==8)
  297. {
  298. return 31;
  299. }
  300. if(row==9)
  301. {
  302. return 40;
  303. }
  304. if(row==10)
  305. {
  306. // 基本信息
  307. if( _infocell != nil){
  308. if([_infocell.isOpen isEqualToString: @"1"])
  309. {
  310. return _infocell.height ;
  311. }
  312. else
  313. {
  314. return 50;
  315. }
  316. }
  317. }
  318. if(row==11)
  319. {
  320. // 业绩信息
  321. if(_achievementInfoCell != nil){
  322. if([_achievementInfoCell.isOpen isEqualToString: @"1"])
  323. {
  324. return _achievementInfoCell.height ;
  325. }
  326. else
  327. {
  328. return 50;
  329. }
  330. }
  331. }
  332. if(row==12){
  333. // 装修信息
  334. if(_decorationInfoCell != nil){
  335. if([_decorationInfoCell.isOpen isEqualToString: @"1"])
  336. {
  337. return _decorationInfoCell.height;
  338. }
  339. else
  340. {
  341. return 50;
  342. }
  343. }
  344. }
  345. if(row==13)
  346. {
  347. // 私密信息
  348. if(_privacyInfoCell != nil){
  349. if([_privacyInfoCell.isOpen isEqualToString: @"1"])
  350. {
  351. return _privacyInfoCell.height;
  352. }
  353. else
  354. {
  355. return 50;
  356. }
  357. }
  358. }
  359. if(row==14)
  360. {
  361. // 图片
  362. _customerInfoDetail = [[_customerReportDetail customerInfoDetailArr] objectAtIndex:0];
  363. NSMutableArray *imgArray = [_customerInfoDetail imageDisplayArr];
  364. if([_imageCell.isOpen isEqualToString: @"1"])
  365. {
  366. if(imgArray != nil&&[imgArray count]>0){
  367. CGFloat height;
  368. height= [_customerInfoDetail getPhotoFrame:imgArray].size.height;
  369. return height + 53;
  370. }
  371. else{
  372. return 53;
  373. }
  374. }
  375. else
  376. {
  377. return 53;
  378. }
  379. }
  380. if([kkAppName isEqualToString:@""])
  381. {
  382. if(row==15)
  383. {
  384. // 图片
  385. _customerInfoDetail = [[_customerReportDetail customerInfoDetailArr] objectAtIndex:0];
  386. NSMutableArray *imgArray = [_customerInfoDetail imageAttachmentDisplayArr];
  387. if([_imageAttachmentCell.isOpen isEqualToString: @"1"])
  388. {
  389. if(imgArray != nil&&[imgArray count]>0){
  390. CGFloat height;
  391. height= [_customerInfoDetail getPhotoFrame:imgArray].size.height;
  392. return height + 53;
  393. }
  394. else{
  395. return 53;
  396. }
  397. }
  398. else
  399. {
  400. return 53;
  401. }
  402. }
  403. if(row==16)
  404. {
  405. // 跟进
  406. if(_followInfoCell != nil){
  407. if([_followInfoCell.isOpen isEqualToString: @"1"]){
  408. int infocellHeight= [_followInfoCell subviewHeight]+54;
  409. return infocellHeight+53;
  410. }
  411. else{
  412. return 53;
  413. }
  414. }
  415. }
  416. }
  417. if([kkAppName isEqualToString:@"顺城"])
  418. {
  419. if(row==15)
  420. {
  421. // 跟进
  422. if(_followInfoCell != nil){
  423. if([_followInfoCell.isOpen isEqualToString: @"1"]){
  424. int infocellHeight= [_followInfoCell subviewHeight]+54;
  425. return infocellHeight+53;
  426. }
  427. else{
  428. return 53;
  429. }
  430. }
  431. }
  432. }
  433. return 0;
  434. }
  435. /**
  436. 单元格
  437. @param tableView <#tableView description#>
  438. @param indexPath <#indexPath description#>
  439. @return <#return value description#>
  440. */
  441. - (UITableViewCell *)tableView:(UITableView *)tableView
  442. cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  443. if (_customerReportDetail == nil ||
  444. [_customerReportDetail customerInfoDetailArr] == nil
  445. || [[_customerReportDetail customerInfoDetailArr] count] == 0) {
  446. return [[UITableViewCell alloc] init];
  447. }
  448. int row = (int)indexPath.row;
  449. _customerInfoDetail = [[_customerReportDetail customerInfoDetailArr] objectAtIndex:0];
  450. if(row==7){
  451. // 有效标识
  452. ValueFlagCell *valueflagcell = [[ValueFlagCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell0"];
  453. valueflagcell.selectionStyle=UITableViewCellSelectionStyleNone;
  454. [valueflagcell setflagName:[_customerInfoDetail valueFlag]];
  455. return valueflagcell;
  456. }
  457. if(row==8)
  458. {
  459. AuditStatusCell *auditStatusCell=[[AuditStatusCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell20"];
  460. auditStatusCell.selectionStyle=UITableViewCellSelectionStyleNone;
  461. [auditStatusCell setAuditStatusName:[_customerInfoDetail auditStatus]];
  462. return auditStatusCell;
  463. }
  464. if(row==9)
  465. {
  466. // 成交状态
  467. TurnoverStatusCell *cell = [[TurnoverStatusCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell13"];
  468. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  469. [cell setstatusName:[_customerInfoDetail turnoverStatus]];
  470. return cell;
  471. }
  472. if(row==0)
  473. {
  474. // 客户名称
  475. _customerNameCell = [[CustomerNameCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell1"];
  476. _customerNameCell.selectionStyle=UITableViewCellSelectionStyleNone;
  477. [_customerNameCell setCustomerName:[_customerInfoDetail customerName]];
  478. return _customerNameCell;
  479. }
  480. if(row==1)
  481. {
  482. // 联系人
  483. _contactsCell = [[ContactsCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell2"];
  484. _contactsCell.selectionStyle=UITableViewCellSelectionStyleNone;
  485. [_contactsCell setContactsName:[_customerInfoDetail contacts]];
  486. return _contactsCell;
  487. }
  488. if(row==2)
  489. {
  490. // 联系电话
  491. ContactsTelephoneCell *contactsTelephoneCell = [[ContactsTelephoneCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell3"];
  492. contactsTelephoneCell.selectionStyle=UITableViewCellSelectionStyleNone;
  493. [contactsTelephoneCell setContactsTelephone:[_customerInfoDetail telephone] telephoneFlag:_telephoneFlag] ;
  494. return contactsTelephoneCell;
  495. }
  496. if(row==3)
  497. {
  498. // 地址
  499. _addressCell = [[AddressCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell4"];
  500. _addressCell.selectionStyle=UITableViewCellSelectionStyleNone;
  501. [_addressCell setAddress:[_customerInfoDetail address]];
  502. return _addressCell;
  503. }
  504. if(row==4)
  505. {
  506. NSInteger isCommunityFlag= _customerInfoDetail.isCommunityFlag;
  507. // 地址
  508. if(isCommunityFlag==0)
  509. {
  510. _detailAddressCell = [[DetailAddressCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell4"];
  511. _detailAddressCell.selectionStyle=UITableViewCellSelectionStyleNone;
  512. [_detailAddressCell setDetailAddress:[_customerInfoDetail detailAddress]];
  513. return _detailAddressCell;
  514. }
  515. else
  516. {
  517. _buildingCell=[[BuildingCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell4"];
  518. _buildingCell.selectionStyle=UITableViewCellSelectionStyleNone;
  519. NSString *detailAddress=[NSString stringWithFormat:@"%@%@%@%@%@%@%@%@%@%@%@",_customerInfoDetail.ban,@"栋",@" ",_customerInfoDetail.unit,@"单元/梯",@" ",_customerInfoDetail.floor,@"楼",@" ",_customerInfoDetail.roomNumber,@"号"];
  520. [_buildingCell setBuilding:detailAddress];
  521. return _buildingCell;
  522. }
  523. }
  524. if(row==5)
  525. {
  526. // 客户状态
  527. CustomerStatusCell *statusCell = [[CustomerStatusCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell5"];
  528. statusCell.selectionStyle=UITableViewCellSelectionStyleNone;
  529. [statusCell setCustomerStatus:[_customerInfoDetail status]];
  530. return statusCell;
  531. }
  532. if(row==6)
  533. {
  534. // 客户级别
  535. CustomerClassCell *customerClassCell = [[CustomerClassCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell6"];
  536. customerClassCell.selectionStyle=UITableViewCellSelectionStyleNone;
  537. [customerClassCell setCustomerClass:[_customerInfoDetail customerClass]];
  538. return customerClassCell;
  539. }
  540. if(row==10)
  541. {
  542. // 基本信息
  543. static NSString *cellIdentifier = @"cell7";
  544. _infocell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
  545. if (!_infocell) {
  546. _infocell = [[BasicInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
  547. _infocell.selectionStyle=UITableViewCellSelectionStyleNone;
  548. }
  549. else
  550. //当页面拉动的时候 当cell存在并且最后一个存在 把它进行删除就出来一个独特的cell我们在进行数据配置即可避免
  551. {
  552. while ([_infocell.contentView.subviews lastObject] != nil) {
  553. [(UIView *)[_infocell.contentView.subviews lastObject] removeFromSuperview];
  554. }
  555. }
  556. _basicInfo = [[BasicInfo alloc]init];
  557. _basicInfo.channelName = [_customerInfoDetail channelName];
  558. _basicInfo.customerProperty = [_customerInfoDetail customerProperty];
  559. _basicInfo.otherContacts = [_customerInfoDetail otherContacts];
  560. _basicInfo.customerArea = [_customerInfoDetail customerArea];
  561. _basicInfo.remark = [_customerInfoDetail remark];
  562. [_infocell setBasicInfo:_basicInfo];
  563. _infocell.delegate=self;
  564. return _infocell;
  565. }
  566. if(row==11)
  567. {
  568. // 业绩信息
  569. static NSString *CellIdentifier = @"cell8";
  570. _achievementInfoCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  571. if (!_achievementInfoCell) {
  572. _achievementInfoCell = [[AchievementInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
  573. _achievementInfoCell.selectionStyle=UITableViewCellSelectionStyleNone;
  574. }
  575. else
  576. //当页面拉动的时候 当cell存在并且最后一个存在 把它进行删除就出来一个独特的cell我们在进行数据配置即可避免
  577. {
  578. while ([_achievementInfoCell.contentView.subviews lastObject] != nil) {
  579. [(UIView *)[_achievementInfoCell.contentView.subviews lastObject] removeFromSuperview];
  580. }
  581. }
  582. _achievementInfo = [[AchievementInfo alloc] init];
  583. _achievementInfo.organizationName = [_customerInfoDetail organizationName];
  584. _achievementInfo.depositAmount=[_customerInfoDetail depositAmount];
  585. _achievementInfo.userName=[_customerInfoDetail userName];
  586. _achievementInfo.salesman = [_customerInfoDetail salesman];
  587. _achievementInfo.intermediateCustomer = [_customerInfoDetail intermediateCustomer];
  588. _achievementInfo.intermediateCustomerStaff = [_customerInfoDetail intermediateCustomerStaff];
  589. _achievementInfo.estimateDealDate = [_customerInfoDetail estimateDealDate];
  590. _achievementInfo.estimateTransactionAmount = [_customerInfoDetail estimateTransactionAmount];
  591. _achievementInfo.relatedAmount = [_customerInfoDetail relatedAmount];
  592. _achievementInfo.discussionResult = [_customerInfoDetail discussionResult];
  593. [_achievementInfoCell setAchievementInfo:_achievementInfo];
  594. _achievementInfoCell.delegate=self;
  595. return _achievementInfoCell;
  596. }
  597. if(row==12)
  598. {
  599. // 装修信息
  600. static NSString *CellIdentifier = @"cell9";
  601. _decorationInfoCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  602. if (!_decorationInfoCell) {
  603. _decorationInfoCell = [[DecorationInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
  604. _decorationInfoCell.selectionStyle=UITableViewCellSelectionStyleNone;
  605. }
  606. else
  607. //当页面拉动的时候 当cell存在并且最后一个存在 把它进行删除就出来一个独特的cell我们在进行数据配置即可避免
  608. {
  609. while ([_decorationInfoCell.contentView.subviews lastObject] != nil) {
  610. [(UIView *)[_decorationInfoCell.contentView.subviews lastObject] removeFromSuperview];
  611. }
  612. }
  613. _decorationInfo = [[DecorationInfo alloc]init];
  614. _decorationInfo.area = [_customerInfoDetail area];
  615. _decorationInfo.decorationProcess = [_customerInfoDetail decorationProcess];
  616. _decorationInfo.furnitureColor = [_customerInfoDetail furnitureColor];
  617. _decorationInfo.household = [_customerInfoDetail household];
  618. _decorationInfo.decorationCompany = [_customerInfoDetail decorationCompany];
  619. _decorationInfo.productDisplay = [_customerInfoDetail productDisplay];
  620. _decorationInfo.estimatedStartDate = [_customerInfoDetail estimatedStartDate];
  621. [_decorationInfoCell setDecorationInfo:_decorationInfo];
  622. _decorationInfoCell.delegate=self;
  623. return _decorationInfoCell;;
  624. }
  625. if(row==13)
  626. {
  627. // 私密信息
  628. static NSString *CellIdentifier = @"cell10";
  629. _privacyInfoCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  630. if (!_privacyInfoCell) {
  631. _privacyInfoCell = [[PrivacyInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
  632. _privacyInfoCell.selectionStyle=UITableViewCellSelectionStyleNone;
  633. }
  634. else
  635. // 当页面拉动的时候 当cell存在并且最后一个存在 把它进行删除就出来一个独特的cell我们在进行数据配置即可避免
  636. {
  637. while ([_privacyInfoCell.contentView.subviews lastObject] != nil) {
  638. [(UIView *)[_privacyInfoCell.contentView.subviews lastObject] removeFromSuperview];
  639. }
  640. }
  641. _privacyInfo = [[PrivacyInfo alloc]init];
  642. _privacyInfo.birthday = [_customerInfoDetail birthday];
  643. _privacyInfo.gender = [_customerInfoDetail gender];
  644. _privacyInfo.occupation = [_customerInfoDetail occupation];
  645. _privacyInfo.hobby = [_customerInfoDetail hobby];
  646. _privacyInfo.loveStyle = [_customerInfoDetail loveStyle];
  647. _privacyInfo.phisicalCharacteristics = [_customerInfoDetail physicalCharacteristics];
  648. _privacyInfo.educational = [_customerInfoDetail educational];
  649. _privacyInfo.focusPeople = [_customerInfoDetail focusPeople];
  650. [_privacyInfoCell setPrivacyInfo:_privacyInfo];
  651. _privacyInfoCell.delegate=self;
  652. return _privacyInfoCell;
  653. }
  654. if(row==14){
  655. // 图片
  656. if(!_imageCell){
  657. _imageCell = [[ImageCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell11"];
  658. _imageCell.selectionStyle=UITableViewCellSelectionStyleNone;
  659. [_imageCell setImageInfo:_customerInfoDetail ];
  660. }
  661. _imageCell.delegate=self;
  662. return _imageCell;
  663. }
  664. if([kkAppName isEqualToString:@""])
  665. {
  666. if(row==15)
  667. {
  668. // 图片
  669. if(!_imageAttachmentCell){
  670. _imageAttachmentCell = [[ImageAttachmentCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell13"];
  671. _imageAttachmentCell.selectionStyle=UITableViewCellSelectionStyleNone;
  672. [_imageAttachmentCell setImageInfo:_customerInfoDetail];
  673. }
  674. _imageAttachmentCell.delegate=self;
  675. return _imageAttachmentCell;
  676. }
  677. if(row==16)
  678. {
  679. // 跟进信息
  680. if(!_followInfoCell){
  681. _followInfoCell = [[FollowInfoCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell12"];
  682. _followInfoCell.selectionStyle=UITableViewCellSelectionStyleNone;
  683. [_followInfoCell setFollowInfo:_filingId];
  684. _followInfoCell.delegate=self;
  685. _followInfoCell.alertDelegate = self;
  686. }
  687. return _followInfoCell;
  688. }
  689. }
  690. if([kkAppName isEqualToString:@"顺城"])
  691. {
  692. if(row==15)
  693. {
  694. // 跟进信息
  695. if(!_followInfoCell){
  696. _followInfoCell = [[FollowInfoCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell12"];
  697. _followInfoCell.selectionStyle=UITableViewCellSelectionStyleNone;
  698. [_followInfoCell setFollowInfo:_filingId];
  699. _followInfoCell.delegate=self;
  700. _followInfoCell.alertDelegate = self;
  701. }
  702. return _followInfoCell;
  703. }
  704. }
  705. return [[UITableViewCell alloc] init];
  706. }
  707. /**
  708. 单元格点击
  709. @param tableView <#tableView description#>
  710. @param indexPath <#indexPath description#>
  711. */
  712. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  713. }
  714. /**
  715. 单元格颜色
  716. @param tableView <#tableView description#>
  717. @param cell <#cell description#>
  718. @param indexPath <#indexPath description#>
  719. */
  720. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  721. {
  722. cell.backgroundColor = [UIColor whiteColor];
  723. }
  724. /**
  725. 刷新数据源
  726. */
  727. - (void)refreshTableView
  728. {
  729. [vCustomTableView reloadData];
  730. }
  731. @end