SingleProfitDetailViewController.m 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. //
  2. // SingleProfitDetailViewController.m
  3. // IBOSSmini
  4. //
  5. // Created by apple on 2017/5/18.
  6. // Copyright © 2017年 elongtian. All rights reserved.
  7. //
  8. #import "SingleProfitDetailViewController.h"
  9. @interface SingleProfitDetailViewController (){
  10. UIScrollView *_scrollView;
  11. }
  12. @end
  13. @implementation SingleProfitDetailViewController
  14. /**
  15. viewDidLoad函数
  16. */
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. [self showTitle:@""];
  20. [self initUI];
  21. }
  22. /**
  23. 安全区视图发生变化
  24. */
  25. -(void)viewSafeAreaInsetsDidChange{
  26. _scrollView.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. _scrollView=[UIScrollView new];
  51. _scrollView.frame=self.view.bounds;
  52. [self.view addSubview:_scrollView];
  53. UIView *vTitle = [UIView new];
  54. [_scrollView addSubview:vTitle];
  55. vTitle.backgroundColor = [UIColor whiteColor];
  56. //==================
  57. UIView *vNo = [UIView new];
  58. vNo.frame=CGRectMake(0, CGRectGetMaxY(vTitle.frame), Screen_Width, heightRow);
  59. [vTitle addSubview:vNo];
  60. UILabel *lblNo=[UILabel new];
  61. lblNo.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  62. lblNo.text=@"业务单号:";
  63. lblNo.textColor = [UIColor blackColor];
  64. lblNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  65. [vNo addSubview:lblNo];
  66. UILabel *lblNoValue = [UILabel new];
  67. lblNoValue.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  68. lblNoValue.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  69. lblNoValue.text = self.sInvoiceNo;
  70. [vNo addSubview:lblNoValue];
  71. //==================
  72. UIView *vinvoiceType = [UIView new];
  73. vinvoiceType.frame=CGRectMake(0, CGRectGetMaxY(vNo.frame), Screen_Width, heightRow);
  74. [vTitle addSubview:vinvoiceType];
  75. UILabel *lblinvoiceType=[UILabel new];
  76. lblinvoiceType.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  77. lblinvoiceType.text=@"业务类型:";
  78. lblinvoiceType.textColor = [UIColor blackColor];
  79. lblinvoiceType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  80. [vinvoiceType addSubview:lblinvoiceType];
  81. UILabel *invoiceType = [UILabel new];
  82. invoiceType.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  83. invoiceType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  84. invoiceType.text = self.sInvoiceType;
  85. [vinvoiceType addSubview:invoiceType];
  86. //==================
  87. UIView *vorganizationCode = [UIView new];
  88. vorganizationCode.frame=CGRectMake(0, CGRectGetMaxY(vinvoiceType.frame), Screen_Width, heightRow);
  89. [vTitle addSubview:vorganizationCode];
  90. UILabel *lblorganizationCode=[UILabel new];
  91. lblorganizationCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  92. lblorganizationCode.text=@"部门编码:";
  93. lblorganizationCode.textColor = [UIColor blackColor];
  94. lblorganizationCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  95. [vorganizationCode addSubview:lblorganizationCode];
  96. UILabel *organizationCode = [UILabel new];
  97. organizationCode.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  98. organizationCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  99. organizationCode.text = self.sOrganizationCode;
  100. [vorganizationCode addSubview:organizationCode];
  101. // ==================
  102. UIView *vorganizationName = [UIView new];
  103. vorganizationName.frame=CGRectMake(0, CGRectGetMaxY(vorganizationCode.frame), Screen_Width, heightRow);
  104. [vTitle addSubview:vorganizationName];
  105. UILabel *lblorganizationName=[UILabel new];
  106. lblorganizationName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  107. lblorganizationName.text=@"部门名称:";
  108. lblorganizationName.textColor = [UIColor blackColor];
  109. lblorganizationName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  110. [vorganizationName addSubview:lblorganizationName];
  111. UILabel *organizationName = [UILabel new];
  112. organizationName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  113. organizationName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  114. organizationName.text = self.sOrganizationName;
  115. [vorganizationName addSubview:organizationName];
  116. // ==================
  117. UIView *vaccountDate = [UIView new];
  118. vaccountDate.frame=CGRectMake(0, CGRectGetMaxY(vorganizationName.frame), Screen_Width, heightRow);
  119. [vTitle addSubview:vaccountDate];
  120. UILabel *lblaccountDate=[UILabel new];
  121. lblaccountDate.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  122. lblaccountDate.text=@"账务日期:";
  123. lblaccountDate.textColor = [UIColor blackColor];
  124. lblaccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  125. [vaccountDate addSubview:lblaccountDate];
  126. UILabel *accountDate = [UILabel new];
  127. accountDate.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  128. accountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  129. accountDate.text = self.sAccountDate;
  130. [vaccountDate addSubview:accountDate];
  131. // ==================
  132. UIView *vcustomerCode = [UIView new];
  133. vcustomerCode.frame=CGRectMake(0, CGRectGetMaxY(vaccountDate.frame), Screen_Width, heightRow);
  134. [vTitle addSubview:vcustomerCode];
  135. UILabel *lblcustomerCode=[UILabel new];
  136. lblcustomerCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  137. lblcustomerCode.text=@"客户编码:";
  138. lblcustomerCode.textColor = [UIColor blackColor];
  139. lblcustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  140. [vcustomerCode addSubview:lblcustomerCode];
  141. UILabel *customerCode = [UILabel new];
  142. customerCode.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  143. customerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  144. customerCode.text = self.sCustomerCode;
  145. [vcustomerCode addSubview:customerCode];
  146. //==================
  147. UIView *vcustomerName = [UIView new];
  148. vcustomerName.frame=CGRectMake(0, CGRectGetMaxY(vcustomerCode.frame), Screen_Width, heightRow);
  149. [vTitle addSubview:vcustomerName];
  150. UILabel *lblcustomerName=[UILabel new];
  151. lblcustomerName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  152. lblcustomerName.text=@"客户名称:";
  153. lblcustomerName.textColor = [UIColor blackColor];
  154. lblcustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  155. [vcustomerName addSubview:lblcustomerName];
  156. UILabel *customerName = [UILabel new];
  157. customerName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  158. customerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  159. customerName.text = self.sCustomerName;
  160. [vcustomerName addSubview:customerName];
  161. //==================
  162. UIView *vwstaffName = [UIView new];
  163. vwstaffName.frame=CGRectMake(0, CGRectGetMaxY(vcustomerName.frame), Screen_Width, heightRow);
  164. [vTitle addSubview:vwstaffName];
  165. UILabel *lblstaffName=[UILabel new];
  166. lblstaffName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  167. lblstaffName.text=@"业 务 员:";
  168. lblstaffName.textColor = [UIColor blackColor];
  169. lblstaffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  170. [vwstaffName addSubview:lblstaffName];
  171. UILabel *staffName = [UILabel new];
  172. staffName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  173. staffName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  174. staffName.text = self.sStaffName;
  175. [vwstaffName addSubview:staffName];
  176. //==================
  177. UIView *vtelephone = [UIView new];
  178. vtelephone.frame=CGRectMake(0, CGRectGetMaxY(vwstaffName.frame), Screen_Width, heightRow);
  179. [vTitle addSubview:vtelephone];
  180. UILabel *lbltelephone=[UILabel new];
  181. lbltelephone.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  182. lbltelephone.text=@"联系电话:";
  183. lbltelephone.textColor = [UIColor blackColor];
  184. lbltelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  185. [vtelephone addSubview:lbltelephone];
  186. UILabel *positionNumber = [UILabel new];
  187. positionNumber.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  188. positionNumber.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  189. positionNumber.text = self.sTelephone;
  190. [vtelephone addSubview:positionNumber];
  191. //==================
  192. UIView *vcustomerTypeName = [UIView new];
  193. vcustomerTypeName.frame=CGRectMake(0, CGRectGetMaxY(vtelephone.frame), Screen_Width, heightRow);
  194. [vTitle addSubview:vcustomerTypeName];
  195. UILabel *lblcustomerTypeName=[UILabel new];
  196. lblcustomerTypeName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  197. lblcustomerTypeName.text=@"客户性质:";
  198. lblcustomerTypeName.textColor = [UIColor blackColor];
  199. lblcustomerTypeName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  200. [vcustomerTypeName addSubview:lblcustomerTypeName];
  201. UILabel *customerTypeName = [UILabel new];
  202. customerTypeName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  203. customerTypeName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  204. customerTypeName.text = self.sCustomerTypeName;
  205. [vcustomerTypeName addSubview:customerTypeName];
  206. //==================
  207. UIView *vcustomerAddress = [UIView new];
  208. vcustomerAddress.frame=CGRectMake(0, CGRectGetMaxY(vcustomerTypeName.frame), Screen_Width, heightRow);
  209. [vTitle addSubview:vcustomerAddress];
  210. UILabel *lblcustomerAddress=[UILabel new];
  211. lblcustomerAddress.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  212. lblcustomerAddress.text=@"客户地址:";
  213. lblcustomerAddress.textColor = [UIColor blackColor];
  214. lblcustomerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  215. [vcustomerAddress addSubview:lblcustomerAddress];
  216. UILabel *customerAddress = [UILabel new];
  217. customerAddress.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  218. customerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  219. customerAddress.text = self.sCustomerAddress;
  220. [vcustomerAddress addSubview:customerAddress];
  221. //==================
  222. UIView *vchannelName = [UIView new];
  223. vchannelName.frame=CGRectMake(0, CGRectGetMaxY(vcustomerAddress.frame), Screen_Width, heightRow);
  224. [vTitle addSubview:vchannelName];
  225. UILabel *lblchannelName=[UILabel new];
  226. lblchannelName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  227. lblchannelName.text=@"客户渠道:";
  228. lblchannelName.textColor = [UIColor blackColor];
  229. lblchannelName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  230. [vchannelName addSubview:lblchannelName];
  231. UILabel *channelName = [UILabel new];
  232. channelName.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  233. channelName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  234. channelName.text = self.sChannelName;
  235. [vchannelName addSubview:channelName];
  236. //
  237. //==================
  238. UIView *vincomeAmount = [UIView new];
  239. vincomeAmount.frame=CGRectMake(0, CGRectGetMaxY(vchannelName.frame), Screen_Width, heightRow);
  240. [vTitle addSubview:vincomeAmount];
  241. UILabel *lblincomeAmount=[UILabel new];
  242. lblincomeAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  243. lblincomeAmount.text=@"收 入:";
  244. lblincomeAmount.textColor = [UIColor blackColor];
  245. lblincomeAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  246. [vincomeAmount addSubview:lblincomeAmount];
  247. UILabel *incomeAmount = [UILabel new];
  248. incomeAmount.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  249. incomeAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  250. incomeAmount.text = self.sIncomeAmount;
  251. [vincomeAmount addSubview:incomeAmount];
  252. //==================
  253. UIView *vcostAmount = [UIView new];
  254. vcostAmount.frame=CGRectMake(0, CGRectGetMaxY(vincomeAmount.frame), Screen_Width, heightRow);
  255. [vTitle addSubview:vcostAmount];
  256. UILabel *lblcostAmount=[UILabel new];
  257. lblcostAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  258. lblcostAmount.text=@"成 本:";
  259. lblcostAmount.textColor = [UIColor blackColor];
  260. lblcostAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  261. [vcostAmount addSubview:lblcostAmount];
  262. UILabel *costAmount = [UILabel new];
  263. costAmount.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  264. costAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  265. costAmount.text = self.sCostAmount;
  266. [vcostAmount addSubview:costAmount];
  267. UIView *vmargin = [UIView new];
  268. vmargin.frame=CGRectMake(0, CGRectGetMaxY(vcostAmount.frame), Screen_Width, heightRow);
  269. [vTitle addSubview:vmargin];
  270. UILabel *lblmarginAmount=[UILabel new];
  271. lblmarginAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  272. lblmarginAmount.text=@"毛 利:";
  273. lblmarginAmount.textColor = [UIColor blackColor];
  274. lblmarginAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  275. [vmargin addSubview:lblmarginAmount];
  276. UILabel *marginAmount = [UILabel new];
  277. marginAmount.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  278. marginAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  279. marginAmount.text = self.sMarginAmount;
  280. [vmargin addSubview:marginAmount];
  281. UIView *vCustomerAmount = [UIView new];
  282. vCustomerAmount.frame=CGRectMake(0, CGRectGetMaxY(vmargin.frame), Screen_Width, heightRow);
  283. [vTitle addSubview:vCustomerAmount];
  284. UILabel *lblcustomerAmount=[UILabel new];
  285. lblcustomerAmount.frame=CGRectMake(lblx, lbly, 100, lblheight);
  286. lblcustomerAmount.text=@"中间客户业绩:";
  287. lblcustomerAmount.textColor = [UIColor blackColor];
  288. lblcustomerAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  289. [vCustomerAmount addSubview:lblcustomerAmount];
  290. UILabel *customerAmount = [UILabel new];
  291. customerAmount.frame=CGRectMake(110, valuey, Screen_Width - 110 - lblx, valueheight);
  292. customerAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  293. customerAmount.text = self.sCustomerAmount;
  294. [vCustomerAmount addSubview:customerAmount];
  295. UIView *vservice = [UIView new];
  296. vservice.frame=CGRectMake(0, CGRectGetMaxY(vCustomerAmount.frame), Screen_Width, heightRow);
  297. [vTitle addSubview:vservice];
  298. UILabel *lblservice=[UILabel new];
  299. lblservice.frame=CGRectMake(lblx, lbly, 100, lblheight);
  300. lblservice.text=@"服务人员业绩:";
  301. lblservice.textColor = [UIColor blackColor];
  302. lblservice.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  303. [vservice addSubview:lblservice];
  304. UILabel *service = [UILabel new];
  305. service.frame=CGRectMake(110, valuey, Screen_Width - 110 - lblx, valueheight);
  306. service.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  307. service.text = self.sServiceAmount;
  308. [vservice addSubview:service];
  309. UIView *vfees = [UIView new];
  310. vfees.frame=CGRectMake(0, CGRectGetMaxY(vservice.frame), Screen_Width, heightRow);
  311. [vTitle addSubview:vfees];
  312. UILabel *lblfees=[UILabel new];
  313. lblfees.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  314. lblfees.text=@"费 用:";
  315. lblfees.textColor = [UIColor blackColor];
  316. lblfees.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  317. [vfees addSubview:lblfees];
  318. UILabel *fees = [UILabel new];
  319. fees.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  320. fees.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  321. fees.text = self.sFeesAmount;
  322. [vfees addSubview:fees];
  323. UIView *vprofit = [UIView new];
  324. vprofit.frame=CGRectMake(0, CGRectGetMaxY(vfees.frame), Screen_Width, heightRow);
  325. [vTitle addSubview:vprofit];
  326. UILabel *lblprofit=[UILabel new];
  327. lblprofit.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  328. lblprofit.text=@"利 润:";
  329. lblprofit.textColor = [UIColor blackColor];
  330. lblprofit.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  331. [vprofit addSubview:lblprofit];
  332. UILabel *profit = [UILabel new];
  333. profit.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  334. profit.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  335. profit.text = self.sProfitAmount;
  336. [vprofit addSubview:profit];
  337. UIView *vremarks = [UIView new];
  338. vremarks.frame=CGRectMake(0, CGRectGetMaxY(vprofit.frame), Screen_Width, heightRow);
  339. [vTitle addSubview:vremarks];
  340. UILabel *lblremarks=[UILabel new];
  341. lblremarks.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  342. lblremarks.text=@"备 注:";
  343. lblremarks.textColor = [UIColor blackColor];
  344. lblremarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  345. [vremarks addSubview:lblremarks];
  346. UILabel *remarks = [UILabel new];
  347. remarks.frame=CGRectMake(valuex, valuey, Screen_Width - valuex - lblx, valueheight);
  348. remarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  349. remarks.text = self.sRemarks;
  350. [vremarks addSubview:remarks];
  351. vTitle.frame=CGRectMake(10, 10, Screen_Width-20, CGRectGetMaxY(vremarks.frame) );
  352. vTitle.layer.cornerRadius = CornerRadius;
  353. _scrollView.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vTitle.frame)+rectStatusHeight+rectNavHeight);
  354. }
  355. @end