OtherInStorageDetailVC.m 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. //
  2. // OtherInStorageDetailVC.m
  3. // IBOSSmini
  4. //
  5. // Created by guan hong hou on 2018/4/24.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "OtherInStorageDetailVC.h"
  9. @interface OtherInStorageDetailVC (){
  10. UIScrollView *_scrollView;
  11. }
  12. @end
  13. @implementation OtherInStorageDetailVC
  14. #pragma mark 公共函数
  15. /**
  16. 视图加载完成函数
  17. */
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. [self loadNavStyle];
  21. [self initUI];
  22. }
  23. /**
  24. 修改:2017-9-25
  25. 适配机型
  26. 安全区视图发生变化
  27. */
  28. -(void)viewSafeAreaInsetsDidChange{
  29. _scrollView.frame = CGRectMake(0, 0,Screen_Width, self.view.safeAreaLayoutGuide.layoutFrame.size.height);
  30. [super viewSafeAreaInsetsDidChange];
  31. }
  32. /**
  33. 内存警告函数
  34. */
  35. - (void)didReceiveMemoryWarning {
  36. [super didReceiveMemoryWarning];
  37. }
  38. #pragma mark 私有函数
  39. /**
  40. 导航按钮样式
  41. */
  42. -(void)loadNavStyle
  43. {
  44. self.navigationItem.title=@"其他入库信息";
  45. //返回
  46. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  47. [button setBackgroundImage:[UIImage imageNamed:@"icon_back"]
  48. forState:UIControlStateNormal];
  49. [button addTarget:self action:@selector(goBack)
  50. forControlEvents:UIControlEventTouchUpInside];
  51. button.frame = CGRectMake(0, 0, 15, 18);
  52. UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  53. self.navigationItem.leftBarButtonItem = menuButton;
  54. }
  55. /**
  56. 返回函数
  57. */
  58. - (void)goBack
  59. {
  60. [self.navigationController popViewControllerAnimated:YES];
  61. }
  62. /**
  63. 初始化UI
  64. */
  65. -(void)initUI{
  66. [self.view setBackgroundColor:[UIColor whiteColor]];
  67. CGFloat heightRow = 40;
  68. CGFloat lblx = 10;
  69. CGFloat lbly = 8;
  70. CGFloat lblwidth = 80;
  71. CGFloat lblheight = 25;
  72. CGFloat heightLine = 1;
  73. CGFloat valuey = 8;
  74. CGFloat valueheight = 25;
  75. _scrollView=[UIScrollView new];
  76. _scrollView.frame=self.view.bounds;
  77. [self.view addSubview:_scrollView];
  78. UIView *vBody = [UIView new];
  79. [_scrollView addSubview:vBody];
  80. UIView *topSeparatorView= [UIView new];
  81. topSeparatorView.frame = CGRectMake(0, 0, Screen_Width, 10);
  82. topSeparatorView.backgroundColor=LineBackgroundColor;
  83. [vBody addSubview:topSeparatorView];
  84. UIView *vInStorageNo = [UIView new];
  85. vInStorageNo.frame=CGRectMake(0,CGRectGetMaxY(topSeparatorView.frame), Screen_Width, heightRow);
  86. [vBody addSubview:vInStorageNo];
  87. NSDictionary *inStorageDict = @{NSFontAttributeName: [UIFont systemFontOfSize: LabelAndTextFontOfSize]};
  88. NSString *inStorageNoTitle=@"入库单号:";
  89. CGRect inStorageNoTitleFrame = [inStorageNoTitle textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:inStorageDict];
  90. inStorageNoTitleFrame.origin.x =lblx;
  91. inStorageNoTitleFrame.origin.y = 12;
  92. UILabel *lblTitleInStorageNo=[UILabel new];
  93. lblTitleInStorageNo.frame=inStorageNoTitleFrame;
  94. lblTitleInStorageNo.textColor = [UIColor redColor];
  95. lblTitleInStorageNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  96. [vInStorageNo addSubview:lblTitleInStorageNo];
  97. lblTitleInStorageNo.text=inStorageNoTitle;
  98. NSString *inStorageNo= _otherInStorageListModel.enterNo;
  99. CGRect inStorageNoFrame = [inStorageNo textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:inStorageDict];
  100. inStorageNoFrame.origin.x =Screen_Width-inStorageNoFrame.size.width-10;
  101. inStorageNoFrame.origin.y = 12;
  102. UILabel *lblInStorageNo = [UILabel new];
  103. lblInStorageNo.frame=inStorageNoFrame;
  104. lblInStorageNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  105. lblInStorageNo.text = inStorageNo;
  106. [vInStorageNo addSubview:lblInStorageNo];
  107. UIView *topSeparatorView1= [UIView new];
  108. topSeparatorView1.frame = CGRectMake(0, CGRectGetMaxY(vInStorageNo.frame), Screen_Width, heightLine);
  109. topSeparatorView1.backgroundColor=LineBackgroundColor;
  110. [vBody addSubview:topSeparatorView1];
  111. UIView *vInStorageType = [UIView new];
  112. vInStorageType.frame=CGRectMake(0,CGRectGetMaxY(topSeparatorView1.frame), Screen_Width, heightRow);
  113. [vBody addSubview:vInStorageType];
  114. UILabel *lblTitleInStorageType=[UILabel new];
  115. lblTitleInStorageType.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  116. lblTitleInStorageType.text=@"入库类型:";
  117. lblTitleInStorageType.textColor = [UIColor blackColor];
  118. lblTitleInStorageType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  119. [vInStorageType addSubview:lblTitleInStorageType];
  120. UILabel *lblInStorageType = [UILabel new];
  121. lblInStorageType.frame=CGRectMake(CGRectGetMaxX(lblTitleInStorageType.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleInStorageType.frame)-10, valueheight);
  122. lblInStorageType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  123. lblInStorageType.text = _otherInStorageListModel.inventoryEnterTypeName;
  124. [vInStorageType addSubview:lblInStorageType];
  125. [vBody addSubview:vInStorageType];
  126. UIView *vInvoiceStatus = [UIView new];
  127. vInvoiceStatus.frame=CGRectMake(0,CGRectGetMaxY(vInStorageType.frame), Screen_Width, heightRow);
  128. [vBody addSubview:vInvoiceStatus];
  129. UILabel *lblTitleInvoiceStatus=[UILabel new];
  130. lblTitleInvoiceStatus.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  131. lblTitleInvoiceStatus.text=@"单据状态:";
  132. lblTitleInvoiceStatus.textColor = [UIColor blackColor];
  133. lblTitleInvoiceStatus.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  134. [vInvoiceStatus addSubview:lblTitleInvoiceStatus];
  135. UILabel *lblInvoiceStatus = [UILabel new];
  136. lblInvoiceStatus.frame=CGRectMake(CGRectGetMaxX(lblTitleInvoiceStatus.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleInvoiceStatus.frame)-10, valueheight);
  137. lblInvoiceStatus.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  138. lblInvoiceStatus.text = _otherInStorageListModel.invoiceStatusName;
  139. [vInvoiceStatus addSubview:lblInvoiceStatus];
  140. [vBody addSubview:vInvoiceStatus];
  141. UIView *vAccountDate = [UIView new];
  142. vAccountDate.frame=CGRectMake(0,CGRectGetMaxY(vInvoiceStatus.frame), Screen_Width, heightRow);
  143. [vBody addSubview:vAccountDate];
  144. UILabel *lblTitleAccountDate=[UILabel new];
  145. lblTitleAccountDate.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  146. lblTitleAccountDate.text=@"账务日期:";
  147. lblTitleAccountDate.textColor = [UIColor blackColor];
  148. lblTitleAccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  149. [vAccountDate addSubview:lblTitleAccountDate];
  150. UILabel *lblAccountDate = [UILabel new];
  151. lblAccountDate.frame=CGRectMake(CGRectGetMaxX(lblTitleAccountDate.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleAccountDate.frame)-10, valueheight);
  152. lblAccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  153. lblAccountDate.text = _otherInStorageListModel.accountDate;
  154. [vAccountDate addSubview:lblAccountDate];
  155. [vBody addSubview:vAccountDate];
  156. UIView *vBusinessDepartment = [UIView new];
  157. vBusinessDepartment.frame=CGRectMake(0,CGRectGetMaxY(vAccountDate.frame), Screen_Width, heightRow);
  158. [vBody addSubview:vBusinessDepartment];
  159. UILabel *lblTitleBusinessDepartment=[UILabel new];
  160. lblTitleBusinessDepartment.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  161. lblTitleBusinessDepartment.text=@"业务部门:";
  162. lblTitleBusinessDepartment.textColor = [UIColor blackColor];
  163. lblTitleBusinessDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  164. [vBusinessDepartment addSubview:lblTitleBusinessDepartment];
  165. UILabel *lblBusinessDepartment = [UILabel new];
  166. lblBusinessDepartment.frame=CGRectMake(CGRectGetMaxX(lblTitleBusinessDepartment.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleBusinessDepartment.frame)-10, valueheight);
  167. lblBusinessDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  168. lblBusinessDepartment.text = _otherInStorageListModel.organizationName;
  169. [vBusinessDepartment addSubview:lblBusinessDepartment];
  170. UIView *vStaff = [UIView new];
  171. vStaff.frame=CGRectMake(0,CGRectGetMaxY(vBusinessDepartment.frame), Screen_Width, heightRow);
  172. [vBody addSubview:vStaff];
  173. UILabel *lblTitleStaff=[UILabel new];
  174. lblTitleStaff.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  175. lblTitleStaff.text=@"业 务 员:";
  176. lblTitleStaff.textColor = [UIColor blackColor];
  177. lblTitleStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  178. [vStaff addSubview:lblTitleStaff];
  179. UILabel *lblStaff = [UILabel new];
  180. lblStaff.frame=CGRectMake(CGRectGetMaxX(lblTitleStaff.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleStaff.frame)-10, valueheight);
  181. lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  182. lblStaff.text = _otherInStorageListModel.staffName;
  183. [vStaff addSubview:lblStaff];
  184. UIView *vCustomerCode= [UIView new];
  185. vCustomerCode.frame=CGRectMake(0,CGRectGetMaxY(vStaff.frame), Screen_Width, heightRow);
  186. [vBody addSubview:vCustomerCode];
  187. UILabel *lblTitleCustomerCode=[UILabel new];
  188. lblTitleCustomerCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  189. lblTitleCustomerCode.text=@"客户编码:";
  190. lblTitleCustomerCode.textColor = [UIColor blackColor];
  191. lblTitleCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  192. [vCustomerCode addSubview:lblTitleCustomerCode];
  193. UILabel *lblCustomerCode = [UILabel new];
  194. lblCustomerCode.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCustomerCode.frame)-10, valueheight);
  195. lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  196. lblCustomerCode.text = _otherInStorageListModel.customerCode;
  197. [vCustomerCode addSubview:lblCustomerCode];
  198. UIView *vCustomerName= [UIView new];
  199. vCustomerName.frame=CGRectMake(0,CGRectGetMaxY(vCustomerCode.frame), Screen_Width, heightRow);
  200. [vBody addSubview:vCustomerName];
  201. UILabel *lblTitleCustomerName=[UILabel new];
  202. lblTitleCustomerName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  203. lblTitleCustomerName.text=@"客户名称:";
  204. lblTitleCustomerName.textColor = [UIColor blackColor];
  205. lblTitleCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  206. [vCustomerName addSubview:lblTitleCustomerName];
  207. UILabel *lblCustomerName = [UILabel new];
  208. lblCustomerName.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerName.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCustomerName.frame)-10, valueheight);
  209. lblCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  210. lblCustomerName.text = _otherInStorageListModel.customerName;
  211. [vCustomerName addSubview:lblCustomerName];
  212. UIView *vDriver= [UIView new];
  213. vDriver.frame=CGRectMake(0,CGRectGetMaxY(vCustomerName.frame), Screen_Width, heightRow);
  214. [vBody addSubview:vDriver];
  215. UILabel *lblTitleDriver=[UILabel new];
  216. lblTitleDriver.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  217. lblTitleDriver.text=@"运输司机:";
  218. lblTitleDriver.textColor = [UIColor blackColor];
  219. lblTitleDriver.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  220. [vDriver addSubview:lblTitleDriver];
  221. UILabel *lblDriver = [UILabel new];
  222. lblDriver.frame=CGRectMake(CGRectGetMaxX(lblTitleDriver.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleDriver.frame)-10, valueheight);
  223. lblDriver.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  224. lblDriver.text = _otherInStorageListModel.driverName;
  225. [vDriver addSubview:lblDriver];
  226. UIView *vDockerName= [UIView new];
  227. vDockerName.frame=CGRectMake(0,CGRectGetMaxY(vDriver.frame), Screen_Width, heightRow);
  228. [vBody addSubview:vDockerName];
  229. UILabel *lblTitleDockerName=[UILabel new];
  230. lblTitleDockerName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  231. lblTitleDockerName.text=@"装卸工人:";
  232. lblTitleDockerName.textColor = [UIColor blackColor];
  233. lblTitleDockerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  234. [vDockerName addSubview:lblTitleDockerName];
  235. UILabel *lblDockerName = [UILabel new];
  236. lblDockerName.frame=CGRectMake(CGRectGetMaxX(lblTitleDockerName.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleDockerName.frame)-10, valueheight);
  237. lblDockerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  238. lblDockerName.text = _otherInStorageListModel.dockerName;
  239. [vDockerName addSubview:lblDockerName];
  240. UIView *vSupplier= [UIView new];
  241. vSupplier.frame=CGRectMake(0,CGRectGetMaxY(vDockerName.frame), Screen_Width, heightRow);
  242. [vBody addSubview:vSupplier];
  243. UILabel *lblTitleSupplier=[UILabel new];
  244. lblTitleSupplier.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  245. lblTitleSupplier.text=@"供应商:";
  246. lblTitleSupplier.textColor = [UIColor blackColor];
  247. lblTitleSupplier.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  248. [vSupplier addSubview:lblTitleSupplier];
  249. UILabel *lblSupplier = [UILabel new];
  250. lblSupplier.frame=CGRectMake(CGRectGetMaxX(lblTitleSupplier.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleSupplier.frame)-10, valueheight);
  251. lblSupplier.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  252. lblSupplier.text = _otherInStorageListModel.supplierName;
  253. [vSupplier addSubview:lblSupplier];
  254. UIView *vCorrectNo= [UIView new];
  255. vCorrectNo.frame=CGRectMake(0,CGRectGetMaxY(vSupplier.frame), Screen_Width, heightRow);
  256. [vBody addSubview:vCorrectNo];
  257. UILabel *lblTitleCorrectNo=[UILabel new];
  258. lblTitleCorrectNo.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  259. lblTitleCorrectNo.text=@"冲正单号:";
  260. lblTitleCorrectNo.textColor = [UIColor blackColor];
  261. lblTitleCorrectNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  262. [vCorrectNo addSubview:lblTitleCorrectNo];
  263. UILabel *lblCorrectNo = [UILabel new];
  264. lblCorrectNo.frame=CGRectMake(CGRectGetMaxX(lblTitleCorrectNo.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCorrectNo.frame)-10, valueheight);
  265. lblCorrectNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  266. lblCorrectNo.text = _otherInStorageListModel.reversedEnterNo;
  267. [vCorrectNo addSubview:lblCorrectNo];
  268. UIView *vCreater= [UIView new];
  269. vCreater.frame=CGRectMake(0,CGRectGetMaxY(vCorrectNo.frame), Screen_Width, heightRow);
  270. [vBody addSubview:vCreater];
  271. UILabel *lblTitleCreater=[UILabel new];
  272. lblTitleCreater.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  273. lblTitleCreater.text=@"创建者:";
  274. lblTitleCreater.textColor = [UIColor blackColor];
  275. lblTitleCreater.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  276. [vCreater addSubview:lblTitleCreater];
  277. UILabel *lblCreater = [UILabel new];
  278. lblCreater.frame=CGRectMake(CGRectGetMaxX(lblTitleCreater.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCreater.frame)-10, valueheight);
  279. lblCreater.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  280. lblCreater.text = _otherInStorageListModel.createUserName;
  281. [vCreater addSubview:lblCreater];
  282. UIView *vRemarks= [UIView new];
  283. vRemarks.frame=CGRectMake(0,CGRectGetMaxY(vCreater.frame), Screen_Width, heightRow);
  284. [vBody addSubview:vRemarks];
  285. UILabel *lblTitleRemarks=[UILabel new];
  286. lblTitleRemarks.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  287. lblTitleRemarks.text=@"备注:";
  288. lblTitleRemarks.textColor = [UIColor blackColor];
  289. lblTitleRemarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  290. [vRemarks addSubview:lblTitleRemarks];
  291. UILabel *lblRemarks = [UILabel new];
  292. lblRemarks.frame=CGRectMake(CGRectGetMaxX(lblTitleRemarks.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleRemarks.frame)-10, valueheight);
  293. lblRemarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  294. lblRemarks.text = _otherInStorageListModel.remarks;
  295. [vRemarks addSubview:lblRemarks];
  296. vBody.frame=CGRectMake(0,0, Screen_Width,CGRectGetMaxY(vRemarks.frame));
  297. _scrollView.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vBody.frame)+rectStatusHeight+rectNavHeight);
  298. }
  299. @end