CustomerBalanceDetailViewController.m 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. //
  2. // CustomerBalanceDetailViewController.m
  3. // IBOSS
  4. //
  5. // Created by apple on 2017/5/24.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:客户往来余额详细控制器
  9. //
  10. #import "CustomerBalanceDetailViewController.h"
  11. @interface CustomerBalanceDetailViewController ()
  12. @end
  13. @implementation CustomerBalanceDetailViewController
  14. /**
  15. viewDidLoad函数
  16. */
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. [self showTitle:@""];
  20. [self initUI];
  21. }
  22. /**
  23. 安全区视图发生变化
  24. */
  25. -(void)viewSafeAreaInsetsDidChange{
  26. _scroll.frame = self.view.safeAreaLayoutGuide.layoutFrame;
  27. [super viewSafeAreaInsetsDidChange];
  28. }
  29. /**
  30. didReceiveMemoryWarning函数
  31. */
  32. - (void)didReceiveMemoryWarning {
  33. [super didReceiveMemoryWarning];
  34. }
  35. #pragma mark - 私有函数
  36. /**
  37. 初始化ui
  38. */
  39. - (void)initUI { ;
  40. self.navigationItem.title = @"客户往来余额表详细";
  41. self.view.backgroundColor = LineBackgroundColor;
  42. CGFloat heightRow = 30;
  43. CGFloat lblx = 10;
  44. CGFloat lbly = 3;
  45. CGFloat lblwidth = 70;
  46. CGFloat lblheight = 25;
  47. CGFloat valuex = 80;
  48. CGFloat valuey = 3;
  49. CGFloat valueheight = 25;
  50. _scroll = [UIScrollView new];
  51. _scroll.frame=self.view.bounds;
  52. [self.view addSubview:_scroll];
  53. UIView *vTitle = [UIView new];
  54. [_scroll addSubview:vTitle];
  55. vTitle.backgroundColor = [UIColor whiteColor];
  56. UIView *vcustomerName = [UIView new];
  57. vcustomerName.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame), Screen_Width, heightRow);
  58. [vTitle addSubview:vcustomerName];
  59. UILabel *lblcustomerName = [UILabel new];
  60. lblcustomerName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  61. lblcustomerName.text = @"客户名称:";
  62. lblcustomerName.textColor = [UIColor blackColor];
  63. lblcustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  64. [vcustomerName addSubview:lblcustomerName];
  65. UILabel *customerName = [UILabel new];
  66. customerName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  67. customerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  68. customerName.text = self.sCustomerName;
  69. [vcustomerName addSubview:customerName];
  70. UIView *vchannelName = [UIView new];
  71. vchannelName.frame=CGRectMake(0, CGRectGetMaxY(vcustomerName.frame), Screen_Width, heightRow);
  72. [vTitle addSubview:vchannelName];
  73. UILabel *lblname = [UILabel new];
  74. lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  75. lblname.text = @"渠道名称:";
  76. lblname.textColor = [UIColor blackColor];
  77. lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  78. [vchannelName addSubview:lblname];
  79. UILabel *lblValue = [UILabel new];
  80. lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  81. lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  82. lblValue.text = self.sChannelName;
  83. [vchannelName addSubview:lblValue];
  84. UIView *vdictionaryValue = [UIView new];
  85. vdictionaryValue.frame=CGRectMake(0, CGRectGetMaxY(vchannelName.frame), Screen_Width, heightRow);
  86. [vTitle addSubview:vdictionaryValue];
  87. lblname = [UILabel new];
  88. lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  89. lblname.text = @"客户性质:";
  90. lblname.textColor = [UIColor blackColor];
  91. lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  92. [vdictionaryValue addSubview:lblname];
  93. lblValue = [UILabel new];
  94. lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  95. lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  96. lblValue.text = self.sDictionaryValue;
  97. [vdictionaryValue addSubview:lblValue];
  98. UIView *vaccountOrganizationName = [UIView new];
  99. vaccountOrganizationName.frame=CGRectMake(0, CGRectGetMaxY(vdictionaryValue.frame), Screen_Width, heightRow);
  100. [vTitle addSubview:vaccountOrganizationName];
  101. lblname = [UILabel new];
  102. lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  103. lblname.text = @"核算机构:";
  104. lblname.textColor = [UIColor blackColor];
  105. lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  106. [vaccountOrganizationName addSubview:lblname];
  107. lblValue = [UILabel new];
  108. lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  109. lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  110. lblValue.text = self.sAccountOrganizationName;
  111. [vaccountOrganizationName addSubview:lblValue];
  112. UIView *vorganizationName = [UIView new];
  113. vorganizationName.frame=CGRectMake(0, CGRectGetMaxY(vaccountOrganizationName.frame), Screen_Width, heightRow);
  114. [vTitle addSubview:vorganizationName];
  115. UILabel *lblorganizationName = [UILabel new];
  116. lblorganizationName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  117. lblorganizationName.text = @"组织机构:";
  118. lblorganizationName.textColor = [UIColor blackColor];
  119. lblorganizationName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  120. [vorganizationName addSubview:lblorganizationName];
  121. UILabel *organizationName = [UILabel new];
  122. organizationName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  123. organizationName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  124. organizationName.text = self.sOrganizationName;
  125. [vorganizationName addSubview:organizationName];
  126. // —————————
  127. UIView *vwstaffName = [UIView new];
  128. vwstaffName.frame=CGRectMake(0, CGRectGetMaxY(vorganizationName.frame), Screen_Width, heightRow);
  129. [vTitle addSubview:vwstaffName];
  130. UILabel *lblstaffName = [UILabel new];
  131. lblstaffName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  132. lblstaffName.text = @"业 务 员:";
  133. lblstaffName.textColor = [UIColor blackColor];
  134. lblstaffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  135. [vwstaffName addSubview:lblstaffName];
  136. UILabel *staffName = [UILabel new];
  137. staffName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  138. staffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  139. staffName.text = self.sStaffName;
  140. [vwstaffName addSubview:staffName];
  141. UIView *vSecondaryStaffName = [UIView new];
  142. vSecondaryStaffName.frame=CGRectMake(0, CGRectGetMaxY(vwstaffName.frame), Screen_Width, heightRow);
  143. [vTitle addSubview:vSecondaryStaffName];
  144. UILabel *lblSecondaryStaffName = [UILabel new];
  145. lblSecondaryStaffName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  146. lblSecondaryStaffName.text = @"从业务员:";
  147. lblSecondaryStaffName.textColor = [UIColor blackColor];
  148. lblSecondaryStaffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  149. [vSecondaryStaffName addSubview:lblSecondaryStaffName];
  150. UILabel *secondaryStaffName = [UILabel new];
  151. secondaryStaffName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  152. secondaryStaffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  153. secondaryStaffName.text = self.sSecondaryStaffName;
  154. [vSecondaryStaffName addSubview:secondaryStaffName];
  155. // —————————
  156. UIView *vdistrictName = [UIView new];
  157. vdistrictName.frame=CGRectMake(0, CGRectGetMaxY(vSecondaryStaffName.frame), Screen_Width, heightRow);
  158. [vTitle addSubview:vdistrictName];
  159. lblname = [UILabel new];
  160. lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  161. lblname.text = @"客户区域:";
  162. lblname.textColor = [UIColor blackColor];
  163. lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  164. [vdistrictName addSubview:lblname];
  165. lblValue = [UILabel new];
  166. lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  167. lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  168. lblValue.text = self.sDistrictName;
  169. [vdistrictName addSubview:lblValue];
  170. // —————————
  171. UIView *vcreditLine = [UIView new];
  172. vcreditLine.frame=CGRectMake(0, CGRectGetMaxY(vdistrictName.frame), Screen_Width, heightRow);
  173. [vTitle addSubview:vcreditLine];
  174. lblname = [UILabel new];
  175. lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  176. lblname.text = @"信用额度:";
  177. lblname.textColor = [UIColor blackColor];
  178. lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  179. [vcreditLine addSubview:lblname];
  180. lblValue = [UILabel new];
  181. lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  182. lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  183. lblValue.text = self.sCreditLine;
  184. [vcreditLine addSubview:lblValue];
  185. // —————————
  186. UIView *vtelephone = [UIView new];
  187. vtelephone.frame=CGRectMake(0, CGRectGetMaxY(vcreditLine.frame), Screen_Width, heightRow);
  188. [vTitle addSubview:vtelephone];
  189. UILabel *lbltelephone = [UILabel new];
  190. lbltelephone.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  191. lbltelephone.text = @"客户电话:";
  192. lbltelephone.textColor = [UIColor blackColor];
  193. lbltelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  194. [vtelephone addSubview:lbltelephone];
  195. UILabel *positionNumber = [UILabel new];
  196. positionNumber.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  197. positionNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  198. positionNumber.text = self.sTelephone;
  199. [vtelephone addSubview:positionNumber];
  200. // —————————
  201. UIView *vcustomerAddress = [UIView new];
  202. vcustomerAddress.frame=CGRectMake(0, CGRectGetMaxY(vtelephone.frame), Screen_Width, heightRow);
  203. [vTitle addSubview:vcustomerAddress];
  204. UILabel *lblcustomerAddress = [UILabel new];
  205. lblcustomerAddress.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  206. lblcustomerAddress.text = @"客户地址:";
  207. lblcustomerAddress.textColor = [UIColor blackColor];
  208. lblcustomerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  209. [vcustomerAddress addSubview:lblcustomerAddress];
  210. UILabel *customerAddress = [UILabel new];
  211. customerAddress.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx-8, valueheight);
  212. customerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  213. customerAddress.text = self.sAddress;
  214. [vcustomerAddress addSubview:customerAddress];
  215. // —————————
  216. UIView *vdepositReceived = [UIView new];
  217. vdepositReceived.frame=CGRectMake(0, CGRectGetMaxY(vcustomerAddress.frame), Screen_Width, heightRow);
  218. [vTitle addSubview:vdepositReceived];
  219. lblname = [UILabel new];
  220. lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  221. lblname.text = @"预 收 款:";
  222. lblname.textColor = [UIColor blackColor];
  223. lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  224. [vdepositReceived addSubview:lblname];
  225. lblValue = [UILabel new];
  226. lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  227. lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  228. lblValue.text = [Util positiveFormat:self.sDepositReceived];
  229. [vdepositReceived addSubview:lblValue];
  230. UIView *vamountReceivable = [UIView new];
  231. vamountReceivable.frame=CGRectMake(0, CGRectGetMaxY(vdepositReceived.frame), Screen_Width, heightRow);
  232. [vTitle addSubview:vamountReceivable];
  233. lblname = [UILabel new];
  234. lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  235. lblname.text = @"应 收 款:";
  236. lblname.textColor = [UIColor blackColor];
  237. lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  238. [vamountReceivable addSubview:lblname];
  239. lblValue = [UILabel new];
  240. lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  241. lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  242. lblValue.text = [Util positiveFormat:self.sAmountReceivable];
  243. [vamountReceivable addSubview:lblValue];
  244. UIView *vearnest = [UIView new];
  245. vearnest.frame=CGRectMake(0, CGRectGetMaxY(vamountReceivable.frame), Screen_Width, heightRow);
  246. [vTitle addSubview:vearnest];
  247. lblname = [UILabel new];
  248. lblname.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  249. lblname.text = @"定 金:";
  250. lblname.textColor = [UIColor blackColor];
  251. lblname.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  252. [vearnest addSubview:lblname];
  253. lblValue = [UILabel new];
  254. lblValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  255. lblValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  256. lblValue.text = [Util positiveFormat:self.sEarnest];
  257. [vearnest addSubview:lblValue];
  258. // 重新设置frame
  259. vTitle.frame=CGRectMake(10, 10, Screen_Width-20, CGRectGetMaxY(vearnest.frame) );
  260. vTitle.layer.cornerRadius = CornerRadius;
  261. _scroll.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vTitle.frame)+rectStatusHeight+rectNavHeight);
  262. }
  263. @end