SalesOrderInfoVC.m 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. //
  2. // SalesOrderGoodsDetailVC.m
  3. // IBOSSmini
  4. //
  5. // Created by guan hong hou on 2018/2/26.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "SalesOrderInfoVC.h"
  9. @interface SalesOrderInfoVC (){
  10. UIScrollView *_scrollView;
  11. UIView *_bottomView;
  12. }
  13. @end
  14. @implementation SalesOrderInfoVC
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. [self loadNavStyle];
  18. [self initUI];
  19. }
  20. /**
  21. 导航按钮样式
  22. */
  23. -(void)loadNavStyle
  24. {
  25. self.navigationItem.title=@"销售订单信息";
  26. //返回
  27. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  28. [button setBackgroundImage:[UIImage imageNamed:@"icon_back"]
  29. forState:UIControlStateNormal];
  30. [button addTarget:self action:@selector(goBack)
  31. forControlEvents:UIControlEventTouchUpInside];
  32. button.frame = CGRectMake(0, 0, 15, 18);
  33. UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  34. self.navigationItem.leftBarButtonItem = menuButton;
  35. }
  36. -(void)initUI{
  37. [self.view setBackgroundColor:[UIColor whiteColor]];
  38. CGFloat heightRow = 40;
  39. CGFloat lblx = 10;
  40. CGFloat lbly = 8;
  41. CGFloat lblwidth = 80;
  42. CGFloat lblheight = 25;
  43. CGFloat heightLine = 1;
  44. CGFloat btnwidth = 50;
  45. CGFloat valuey = 8;
  46. CGFloat valueheight = 25;
  47. NSDictionary *orderDict = @{NSFontAttributeName:orderTextFont};
  48. _scrollView=[UIScrollView new];
  49. _scrollView.frame=CGRectMake(0,0, Screen_Width, Screen_Height - rectStatusHeight-rectNavHeight-80);
  50. [self.view addSubview:_scrollView];
  51. UIView *vBody = [UIView new];
  52. [_scrollView addSubview:vBody];
  53. UIView *vOrderNo = [UIView new];
  54. vOrderNo.frame=CGRectMake(0,0, Screen_Width, heightRow);
  55. [vBody addSubview:vOrderNo];
  56. UILabel *lblTitleOrderNo=[UILabel new];
  57. lblTitleOrderNo.frame=CGRectMake(lblx,10, lblwidth, lblheight);
  58. lblTitleOrderNo.text=@"销售订单";
  59. lblTitleOrderNo.textColor = [UIColor redColor];
  60. lblTitleOrderNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  61. [vOrderNo addSubview:lblTitleOrderNo];
  62. NSString *orderNo=_salesOrderModel.orderNo;
  63. if(orderNo!=nil&&orderNo.length>0){
  64. UILabel *lblOrderNo = [UILabel new];
  65. CGRect orderNoFrame = [orderNo textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
  66. orderNoFrame.origin.x =Screen_Width-orderNoFrame.size.width-10;
  67. orderNoFrame.origin.y =10;
  68. lblOrderNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  69. lblOrderNo.frame=orderNoFrame;
  70. lblOrderNo.text =orderNo;
  71. [vOrderNo addSubview:lblOrderNo];
  72. }
  73. UIView *topSeparatorView= [UIView new];
  74. topSeparatorView.frame = CGRectMake(0, CGRectGetMaxY(vOrderNo.frame), Screen_Width, heightLine);
  75. [topSeparatorView setBackgroundColor:LineBackgroundColor];
  76. [vBody addSubview:topSeparatorView];
  77. //业务类型
  78. UIView *vBusinessType = [UIView new];
  79. vBusinessType.frame=CGRectMake(0,CGRectGetMaxY(topSeparatorView.frame), Screen_Width, heightRow);
  80. [vBody addSubview:vBusinessType];
  81. UILabel *lblTitleBusinessType=[UILabel new];
  82. lblTitleBusinessType.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  83. lblTitleBusinessType.text=@"业务类型:";
  84. lblTitleBusinessType.textColor = [UIColor blackColor];
  85. lblTitleBusinessType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  86. [vBusinessType addSubview:lblTitleBusinessType];
  87. UILabel *lblBusinessType = [UILabel new];
  88. lblBusinessType.frame=CGRectMake(CGRectGetMaxX(lblTitleBusinessType.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleBusinessType.frame)-10, valueheight);
  89. lblBusinessType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  90. lblBusinessType.text =_salesOrderModel.orderTypeName;
  91. [vBusinessType addSubview:lblBusinessType];
  92. //单据状态
  93. UIView *vInvoiceStatus = [UIView new];
  94. vInvoiceStatus.frame=CGRectMake(0,CGRectGetMaxY(vBusinessType.frame), Screen_Width, heightRow);
  95. [vBody addSubview:vInvoiceStatus];
  96. UILabel *lblTitleInvoiceStatus=[UILabel new];
  97. lblTitleInvoiceStatus.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  98. lblTitleInvoiceStatus.text=@"单据状态:";
  99. lblTitleInvoiceStatus.textColor = [UIColor blackColor];
  100. lblTitleInvoiceStatus.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  101. [vInvoiceStatus addSubview:lblTitleInvoiceStatus];
  102. UILabel *lblInvoiceStatus = [UILabel new];
  103. lblInvoiceStatus.frame=CGRectMake(CGRectGetMaxX(lblTitleInvoiceStatus.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleInvoiceStatus.frame)-10, valueheight);
  104. lblInvoiceStatus.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  105. lblInvoiceStatus.text =_salesOrderModel.invoiceStatusName;
  106. [vInvoiceStatus addSubview:lblInvoiceStatus];
  107. //账务日期
  108. UIView *vAccountDate = [UIView new];
  109. vAccountDate.frame=CGRectMake(0,CGRectGetMaxY(vInvoiceStatus.frame), Screen_Width, heightRow);
  110. [vBody addSubview:vAccountDate];
  111. UILabel *lblTitleAccountDate=[UILabel new];
  112. lblTitleAccountDate.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  113. lblTitleAccountDate.text=@"账务日期:";
  114. lblTitleAccountDate.textColor = [UIColor blackColor];
  115. lblTitleAccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  116. [vAccountDate addSubview:lblTitleAccountDate];
  117. UILabel *lblAccountDate = [UILabel new];
  118. lblAccountDate.frame=CGRectMake(CGRectGetMaxX(lblTitleAccountDate.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleAccountDate.frame)-10, valueheight);
  119. lblAccountDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  120. lblAccountDate.text =_salesOrderModel.accountDate;
  121. [vAccountDate addSubview:lblAccountDate];
  122. //业务部门
  123. UIView *vOrganizationName= [UIView new];
  124. vOrganizationName.frame=CGRectMake(0,CGRectGetMaxY(vAccountDate.frame), Screen_Width, heightRow);
  125. [vBody addSubview:vOrganizationName];
  126. UILabel *lblTitleOrganizationName=[UILabel new];
  127. lblTitleOrganizationName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  128. lblTitleOrganizationName.text=@"业务部门:";
  129. lblTitleOrganizationName.textColor = [UIColor blackColor];
  130. lblTitleOrganizationName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  131. [vOrganizationName addSubview:lblTitleOrganizationName];
  132. UILabel *lblOrganizationName = [UILabel new];
  133. lblOrganizationName.frame=CGRectMake(CGRectGetMaxX(lblTitleOrganizationName.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleOrganizationName.frame)-10, valueheight);
  134. lblOrganizationName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  135. lblOrganizationName.text =_salesOrderModel.organizationName;
  136. [vOrganizationName addSubview:lblOrganizationName];
  137. //业务员
  138. UIView *vStaff= [UIView new];
  139. vStaff.frame=CGRectMake(0,CGRectGetMaxY(vOrganizationName.frame), Screen_Width, heightRow);
  140. [vBody addSubview:vStaff];
  141. UILabel *lblTitleStaff=[UILabel new];
  142. lblTitleStaff.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  143. lblTitleStaff.text=@"业 务 员:";
  144. lblTitleStaff.textColor = [UIColor blackColor];
  145. lblTitleStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  146. [vStaff addSubview:lblTitleStaff];
  147. UILabel *lblStaff = [UILabel new];
  148. lblStaff.frame=CGRectMake(CGRectGetMaxX(lblTitleStaff.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleStaff.frame)-10, valueheight);
  149. lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  150. lblStaff.text =_salesOrderModel.staffName;
  151. [vStaff addSubview:lblStaff];
  152. //客户电话
  153. UIView *vTelephone= [UIView new];
  154. vTelephone.frame=CGRectMake(0,CGRectGetMaxY(vStaff.frame), Screen_Width, heightRow);
  155. [vBody addSubview:vTelephone];
  156. UILabel *lblTitleTelephone=[UILabel new];
  157. lblTitleTelephone.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  158. lblTitleTelephone.text=@"客户电话:";
  159. lblTitleTelephone.textColor = [UIColor blackColor];
  160. lblTitleTelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  161. [vTelephone addSubview:lblTitleTelephone];
  162. UILabel *lblTelephone = [UILabel new];
  163. lblTelephone.frame=CGRectMake(CGRectGetMaxX(lblTitleTelephone.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleTelephone.frame)-10, valueheight);
  164. lblTelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  165. lblTelephone.text =_salesOrderModel.telephone;
  166. [vTelephone addSubview:lblTelephone];
  167. //客户编码
  168. UIView *vCustomerCode= [UIView new];
  169. vCustomerCode.frame=CGRectMake(0,CGRectGetMaxY(vTelephone.frame), Screen_Width, heightRow);
  170. [vBody addSubview:vCustomerCode];
  171. UILabel *lblTitleCustomerCode=[UILabel new];
  172. lblTitleCustomerCode.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  173. lblTitleCustomerCode.text=@"客户编码:";
  174. lblTitleCustomerCode.textColor = [UIColor blackColor];
  175. lblTitleCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  176. [vCustomerCode addSubview:lblTitleCustomerCode];
  177. UILabel *lblCustomerCode = [UILabel new];
  178. lblCustomerCode.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCustomerCode.frame)-10, valueheight);
  179. lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  180. lblCustomerCode.text =_salesOrderModel.customerCode;
  181. [vCustomerCode addSubview:lblCustomerCode];
  182. //客户名称
  183. UIView *vCustomerName= [UIView new];
  184. vCustomerName.frame=CGRectMake(0,CGRectGetMaxY(vCustomerCode.frame), Screen_Width, heightRow);
  185. [vBody addSubview:vCustomerName];
  186. UILabel *lblTitleCustomerName=[UILabel new];
  187. lblTitleCustomerName.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  188. lblTitleCustomerName.text=@"客户名称:";
  189. lblTitleCustomerName.textColor = [UIColor blackColor];
  190. lblTitleCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  191. [vCustomerName addSubview:lblTitleCustomerName];
  192. UILabel *lblCustomerName = [UILabel new];
  193. lblCustomerName.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerName.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCustomerName.frame)-10, valueheight);
  194. lblCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  195. lblCustomerName.text =_salesOrderModel.customerName;
  196. [vCustomerName addSubview:lblCustomerName];
  197. //联系人
  198. UIView *vContacts= [UIView new];
  199. vContacts.frame=CGRectMake(0,CGRectGetMaxY(vCustomerName.frame), Screen_Width, heightRow);
  200. [vBody addSubview:vContacts];
  201. UILabel *lblTitleContacts=[UILabel new];
  202. lblTitleContacts.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  203. lblTitleContacts.text=@"联 系 人:";
  204. lblTitleContacts.textColor = [UIColor blackColor];
  205. lblTitleContacts.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  206. [vContacts addSubview:lblTitleContacts];
  207. UILabel *lblContacts = [UILabel new];
  208. lblContacts.frame=CGRectMake(CGRectGetMaxX(lblTitleContacts.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleContacts.frame)-10, valueheight);
  209. lblContacts.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  210. lblContacts.text =_salesOrderModel.contacts;
  211. [vContacts addSubview:lblContacts];
  212. //联系方式
  213. UIView *vContactsWay= [UIView new];
  214. vContactsWay.frame=CGRectMake(0,CGRectGetMaxY(vContacts.frame), Screen_Width, heightRow);
  215. [vBody addSubview:vContactsWay];
  216. UILabel *lblTitleContactsWay=[UILabel new];
  217. lblTitleContactsWay.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  218. lblTitleContactsWay.text=@"联系方式:";
  219. lblTitleContactsWay.textColor = [UIColor blackColor];
  220. lblTitleContactsWay.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  221. [vContactsWay addSubview:lblTitleContactsWay];
  222. UILabel *lblContactsWay = [UILabel new];
  223. lblContactsWay.frame=CGRectMake(CGRectGetMaxX(lblTitleContactsWay.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleContactsWay.frame)-10, valueheight);
  224. lblContactsWay.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  225. lblContactsWay.text =_salesOrderModel.otherContact;
  226. [vContactsWay addSubview:lblContactsWay];
  227. //合同号
  228. UIView *vContractNo= [UIView new];
  229. vContractNo.frame=CGRectMake(0,CGRectGetMaxY(vContactsWay.frame), Screen_Width, heightRow);
  230. [vBody addSubview:vContractNo];
  231. UILabel *lblTitleContractNo=[UILabel new];
  232. lblTitleContractNo.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  233. lblTitleContractNo.text=@"合 同 号:";
  234. lblTitleContractNo.textColor = [UIColor blackColor];
  235. lblTitleContractNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  236. [vContractNo addSubview:lblTitleContractNo];
  237. UILabel *lblContractNo = [UILabel new];
  238. lblContractNo.frame=CGRectMake(CGRectGetMaxX(lblTitleContractNo.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleContractNo.frame)-10, valueheight);
  239. lblContractNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  240. lblContractNo.text =_salesOrderModel.contractNumber;
  241. [vContractNo addSubview:lblContractNo];
  242. //中间客户
  243. UIView *vIntermediateCustomer= [UIView new];
  244. vIntermediateCustomer.frame=CGRectMake(0,CGRectGetMaxY(vContractNo.frame), Screen_Width, heightRow);
  245. [vBody addSubview:vIntermediateCustomer];
  246. UILabel *lblTitleIntermediateCustomer=[UILabel new];
  247. lblTitleIntermediateCustomer.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  248. lblTitleIntermediateCustomer.text=@"中间客户:";
  249. lblTitleIntermediateCustomer.textColor = [UIColor blackColor];
  250. lblTitleIntermediateCustomer.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  251. [vIntermediateCustomer addSubview:lblTitleIntermediateCustomer];
  252. UILabel *lblIntermediateCustomer = [UILabel new];
  253. lblIntermediateCustomer.frame=CGRectMake(CGRectGetMaxX(lblTitleIntermediateCustomer.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleIntermediateCustomer.frame)-10, valueheight);
  254. lblIntermediateCustomer.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  255. lblIntermediateCustomer.text =_salesOrderModel.intermediateCustomersName;
  256. [vIntermediateCustomer addSubview:lblIntermediateCustomer];
  257. //客户性质
  258. UIView *vCustomerType= [UIView new];
  259. vCustomerType.frame=CGRectMake(0,CGRectGetMaxY(vIntermediateCustomer.frame), Screen_Width, heightRow);
  260. [vBody addSubview:vCustomerType];
  261. UILabel *lblTitleCustomerType=[UILabel new];
  262. lblTitleCustomerType.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  263. lblTitleCustomerType.text=@"客户性质:";
  264. lblTitleCustomerType.textColor = [UIColor blackColor];
  265. lblTitleCustomerType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  266. [vCustomerType addSubview:lblTitleCustomerType];
  267. UILabel *lblCustomerType = [UILabel new];
  268. lblCustomerType.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerType.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCustomerType.frame)-10, valueheight);
  269. lblCustomerType.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  270. lblCustomerType.text =_salesOrderModel.customerTypeName;
  271. [vCustomerType addSubview:lblCustomerType];
  272. //客户地址
  273. UIView *vCustomerAddress= [UIView new];
  274. vCustomerAddress.frame=CGRectMake(0,CGRectGetMaxY(vCustomerType.frame), Screen_Width, heightRow);
  275. [vBody addSubview:vCustomerAddress];
  276. UILabel *lblTitleCustomerAddress=[UILabel new];
  277. lblTitleCustomerAddress.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  278. lblTitleCustomerAddress.text=@"客户地址:";
  279. lblTitleCustomerAddress.textColor = [UIColor blackColor];
  280. lblTitleCustomerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  281. [vCustomerAddress addSubview:lblTitleCustomerAddress];
  282. UILabel *lblCustomerAddress = [UILabel new];
  283. lblCustomerAddress.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerAddress.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCustomerAddress.frame)-10, valueheight);
  284. lblCustomerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  285. lblCustomerAddress.text =_salesOrderModel.address;
  286. [vCustomerAddress addSubview:lblCustomerAddress];
  287. //渠道
  288. UIView *vChannel= [UIView new];
  289. vChannel.frame=CGRectMake(0,CGRectGetMaxY(vCustomerAddress.frame), Screen_Width, heightRow);
  290. [vBody addSubview:vChannel];
  291. UILabel *lblTitleChannel=[UILabel new];
  292. lblTitleChannel.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  293. lblTitleChannel.text=@"渠 道:";
  294. lblTitleChannel.textColor = [UIColor blackColor];
  295. lblTitleChannel.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  296. [vChannel addSubview:lblTitleChannel];
  297. UILabel *lblChannel = [UILabel new];
  298. lblChannel.frame=CGRectMake(CGRectGetMaxX(lblTitleChannel.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleChannel.frame)-10, valueheight);
  299. lblChannel.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  300. lblChannel.text =_salesOrderModel.channelName;
  301. [vChannel addSubview:lblChannel];
  302. UIView *middleSeparatorView1= [UIView new];
  303. middleSeparatorView1.frame = CGRectMake(0, CGRectGetMaxY(vChannel.frame), Screen_Width, heightLine);
  304. [middleSeparatorView1 setBackgroundColor:LineBackgroundColor];
  305. [vBody addSubview:middleSeparatorView1];
  306. //金额信息
  307. UIView *vAmountInfo= [UIView new];
  308. vAmountInfo.frame=CGRectMake(0,CGRectGetMaxY(middleSeparatorView1.frame), Screen_Width, heightRow);
  309. [vBody addSubview:vAmountInfo];
  310. UILabel *lblTitleAmountInfo=[UILabel new];
  311. lblTitleAmountInfo.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  312. lblTitleAmountInfo.text=@"金额信息";
  313. lblTitleAmountInfo.textColor = [UIColor redColor];
  314. lblTitleAmountInfo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  315. [vAmountInfo addSubview:lblTitleAmountInfo];
  316. UILabel *lblGoodsAmount = [UILabel new];
  317. NSString *goodsAmount=_salesOrderModel.goodsAmount;
  318. CGRect goodsAmountFrame;
  319. goodsAmountFrame = [goodsAmount textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
  320. goodsAmountFrame.origin.x =Screen_Width-goodsAmountFrame.size.width-10;
  321. goodsAmountFrame.origin.y =lbly;
  322. lblGoodsAmount.frame=goodsAmountFrame;
  323. lblGoodsAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  324. lblGoodsAmount.text =goodsAmount;
  325. [vAmountInfo addSubview:lblGoodsAmount];
  326. NSString *titleGoodsAmount=@"货物总额:";
  327. CGRect titleGoodsAmountFrame = [titleGoodsAmount textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
  328. titleGoodsAmountFrame.origin.x =Screen_Width-goodsAmountFrame.size.width-12-titleGoodsAmountFrame.size.width;
  329. titleGoodsAmountFrame.origin.y =lbly;
  330. UILabel *lblTitleGoodsAmount = [UILabel new];
  331. lblTitleGoodsAmount.frame=titleGoodsAmountFrame;
  332. lblTitleGoodsAmount.text=titleGoodsAmount;
  333. lblTitleGoodsAmount.textColor = [UIColor blackColor];
  334. lblTitleGoodsAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  335. [vAmountInfo addSubview:lblTitleGoodsAmount];
  336. UIView *middleSeparatorView2= [UIView new];
  337. middleSeparatorView2.frame = CGRectMake(0, CGRectGetMaxY(vAmountInfo.frame), Screen_Width, heightLine);
  338. [middleSeparatorView2 setBackgroundColor:LineBackgroundColor];
  339. [vBody addSubview:middleSeparatorView2];
  340. //转销售金额
  341. UIView *vToSalesAmount= [UIView new];
  342. vToSalesAmount.frame=CGRectMake(0,CGRectGetMaxY(middleSeparatorView2.frame), Screen_Width, heightRow);
  343. [vBody addSubview:vToSalesAmount];
  344. UILabel *lblTitleToSalesAmount=[UILabel new];
  345. lblTitleToSalesAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  346. lblTitleToSalesAmount.text=@"转销售金额:";
  347. lblTitleToSalesAmount.textColor = [UIColor blackColor];
  348. lblTitleToSalesAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  349. [vToSalesAmount addSubview:lblTitleToSalesAmount];
  350. UILabel *lblToSalesAmount = [UILabel new];
  351. lblToSalesAmount.frame=CGRectMake(CGRectGetMaxX(lblTitleToSalesAmount.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleToSalesAmount.frame)-10, valueheight);
  352. lblToSalesAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  353. lblToSalesAmount.text =_salesOrderModel.toSalesAmount;
  354. [vToSalesAmount addSubview:lblToSalesAmount];
  355. //货物金额
  356. UIView *vGoodsAmount= [UIView new];
  357. vGoodsAmount.frame=CGRectMake(0,CGRectGetMaxY(vToSalesAmount.frame), Screen_Width, heightRow);
  358. [vBody addSubview:vGoodsAmount];
  359. UILabel *lblTitleGoodsAmountInfo=[UILabel new];
  360. lblTitleGoodsAmountInfo.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  361. lblTitleGoodsAmountInfo.text=@"合计金额:";
  362. lblTitleGoodsAmountInfo.textColor = [UIColor blackColor];
  363. lblTitleGoodsAmountInfo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  364. [vGoodsAmount addSubview:lblTitleGoodsAmountInfo];
  365. UILabel *lblGoodsAmountInfo = [UILabel new];
  366. lblGoodsAmountInfo.frame=CGRectMake(CGRectGetMaxX(lblTitleGoodsAmountInfo.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleGoodsAmountInfo.frame)-10, valueheight);
  367. lblGoodsAmountInfo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  368. lblGoodsAmountInfo.text =_salesOrderModel.goodsAmount;
  369. [vGoodsAmount addSubview:lblGoodsAmountInfo];
  370. //标价总额
  371. UIView *vMarkPriceAmount= [UIView new];
  372. vMarkPriceAmount.frame=CGRectMake(0,CGRectGetMaxY(vGoodsAmount.frame), Screen_Width, heightRow);
  373. [vBody addSubview:vMarkPriceAmount];
  374. UILabel *lblTitleMarkPriceAmount=[UILabel new];
  375. lblTitleMarkPriceAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  376. lblTitleMarkPriceAmount.text=@"标价总额:";
  377. lblTitleMarkPriceAmount.textColor = [UIColor blackColor];
  378. lblTitleMarkPriceAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  379. [vMarkPriceAmount addSubview:lblTitleMarkPriceAmount];
  380. UILabel *lblMarkPriceAmount = [UILabel new];
  381. lblMarkPriceAmount.frame=CGRectMake(CGRectGetMaxX(lblTitleMarkPriceAmount.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleMarkPriceAmount.frame)-10, valueheight);
  382. lblMarkPriceAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  383. lblMarkPriceAmount.text =_salesOrderModel.markedPriceAmount;
  384. [vMarkPriceAmount addSubview:lblMarkPriceAmount];
  385. //舍零总额
  386. UIView *vRoundAmount= [UIView new];
  387. vRoundAmount.frame=CGRectMake(0,CGRectGetMaxY(vMarkPriceAmount.frame), Screen_Width, heightRow);
  388. [vBody addSubview:vRoundAmount];
  389. UILabel *lblTitleRoundAmount=[UILabel new];
  390. lblTitleRoundAmount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  391. lblTitleRoundAmount.text=@"舍零总额:";
  392. lblTitleRoundAmount.textColor = [UIColor blackColor];
  393. lblTitleRoundAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  394. [vRoundAmount addSubview:lblTitleRoundAmount];
  395. UILabel *lblRoundAmount = [UILabel new];
  396. lblRoundAmount.frame=CGRectMake(CGRectGetMaxX(lblTitleRoundAmount.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleRoundAmount.frame)-10, valueheight);
  397. lblRoundAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  398. lblRoundAmount.text =_salesOrderModel.discountAmount;
  399. [vRoundAmount addSubview:lblRoundAmount];
  400. //整单折扣
  401. UIView *vFullDiscount= [UIView new];
  402. vFullDiscount.frame=CGRectMake(0,CGRectGetMaxY(vRoundAmount.frame), Screen_Width, heightRow);
  403. [vBody addSubview:vFullDiscount];
  404. UILabel *lblTitleFullDiscount=[UILabel new];
  405. lblTitleFullDiscount.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  406. lblTitleFullDiscount.text=@"整单折扣:";
  407. lblTitleFullDiscount.textColor = [UIColor blackColor];
  408. lblTitleFullDiscount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  409. [vFullDiscount addSubview:lblTitleFullDiscount];
  410. UILabel *lblFullDiscount = [UILabel new];
  411. lblFullDiscount.frame=CGRectMake(CGRectGetMaxX(lblTitleFullDiscount.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleFullDiscount.frame)-10, valueheight);
  412. lblFullDiscount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  413. lblFullDiscount.text =_salesOrderModel.discount;
  414. [vFullDiscount addSubview:lblFullDiscount];
  415. //剩余定金
  416. UIView *vRemainderEarnest= [UIView new];
  417. vRemainderEarnest.frame=CGRectMake(0,CGRectGetMaxY(vFullDiscount.frame), Screen_Width, heightRow);
  418. [vBody addSubview:vRemainderEarnest];
  419. UILabel *lblTitleRemainderEarnest=[UILabel new];
  420. lblTitleRemainderEarnest.frame=CGRectMake(lblx, lbly, lblwidth, lblheight);
  421. lblTitleRemainderEarnest.text=@"剩余定金:";
  422. lblTitleRemainderEarnest.textColor = [UIColor blackColor];
  423. lblTitleRemainderEarnest.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  424. [vRemainderEarnest addSubview:lblTitleRemainderEarnest];
  425. UILabel *lblRemainderEarnest = [UILabel new];
  426. lblRemainderEarnest.frame=CGRectMake(CGRectGetMaxX(lblTitleRemainderEarnest.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleRemainderEarnest.frame)-10, valueheight);
  427. lblRemainderEarnest.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  428. lblRemainderEarnest.text =_salesOrderModel.earnestAmount;
  429. [vRemainderEarnest addSubview:lblRemainderEarnest];
  430. //剩余定金比率
  431. UIView *vRemainderEarnestRate= [UIView new];
  432. vRemainderEarnestRate.frame=CGRectMake(0,CGRectGetMaxY(vRemainderEarnest.frame), Screen_Width, heightRow);
  433. [vBody addSubview:vRemainderEarnestRate];
  434. UILabel *lblTitleRemainderEarnestRate=[UILabel new];
  435. lblTitleRemainderEarnestRate.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  436. lblTitleRemainderEarnestRate.text=@"剩余定金比率:";
  437. lblTitleRemainderEarnestRate.textColor = [UIColor blackColor];
  438. lblTitleRemainderEarnestRate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  439. [vRemainderEarnestRate addSubview:lblTitleRemainderEarnestRate];
  440. UILabel *lblRemainderEarnestRate = [UILabel new];
  441. lblRemainderEarnestRate.frame=CGRectMake(CGRectGetMaxX(lblTitleRemainderEarnestRate.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleRemainderEarnestRate.frame)-10, valueheight);
  442. lblRemainderEarnestRate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  443. lblRemainderEarnestRate.text =_salesOrderModel.earnestRate;
  444. [vRemainderEarnestRate addSubview:lblRemainderEarnestRate];
  445. //总定金
  446. UIView *vTotalEarnest= [UIView new];
  447. vTotalEarnest.frame=CGRectMake(0,CGRectGetMaxY(vRemainderEarnestRate.frame), Screen_Width, heightRow);
  448. [vBody addSubview:vTotalEarnest];
  449. UILabel *lblTitleTotalEarnest=[UILabel new];
  450. lblTitleTotalEarnest.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  451. lblTitleTotalEarnest.text=@"总 定 金:";
  452. lblTitleTotalEarnest.textColor = [UIColor blackColor];
  453. lblTitleTotalEarnest.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  454. [vTotalEarnest addSubview:lblTitleTotalEarnest];
  455. UILabel *lblTotalEarnest= [UILabel new];
  456. lblTotalEarnest.frame=CGRectMake(CGRectGetMaxX(lblTitleTotalEarnest.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleTotalEarnest.frame)-10, valueheight);
  457. lblTotalEarnest.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  458. lblTotalEarnest.text =_salesOrderModel.totalEarnestAmount;
  459. [vTotalEarnest addSubview:lblTotalEarnest];
  460. //总定金比率
  461. UIView *vTotalEarnestRate= [UIView new];
  462. vTotalEarnestRate.frame=CGRectMake(0,CGRectGetMaxY(vTotalEarnest.frame), Screen_Width, heightRow);
  463. [vBody addSubview:vTotalEarnestRate];
  464. UILabel *lblTitleTotalEarnestRate=[UILabel new];
  465. lblTitleTotalEarnestRate.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  466. lblTitleTotalEarnestRate.text=@"总定金比率:";
  467. lblTitleTotalEarnestRate.textColor = [UIColor blackColor];
  468. lblTitleTotalEarnestRate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  469. [vTotalEarnestRate addSubview:lblTitleTotalEarnestRate];
  470. UILabel *lblTotalEarnestRate= [UILabel new];
  471. lblTotalEarnestRate.frame=CGRectMake(CGRectGetMaxX(lblTitleTotalEarnestRate.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleTotalEarnestRate.frame)-10, valueheight);
  472. lblTotalEarnestRate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  473. lblTotalEarnestRate.text =_salesOrderModel.totalEarnestRate;
  474. [vTotalEarnestRate addSubview:lblTotalEarnestRate];
  475. //使用定金
  476. UIView *vUseEarnest= [UIView new];
  477. vUseEarnest.frame=CGRectMake(0,CGRectGetMaxY(vTotalEarnestRate.frame), Screen_Width, heightRow);
  478. [vBody addSubview:vUseEarnest];
  479. UILabel *lblTitleUseEarnest=[UILabel new];
  480. lblTitleUseEarnest.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  481. lblTitleUseEarnest.text=@"使用定金:";
  482. lblTitleUseEarnest.textColor = [UIColor blackColor];
  483. lblTitleUseEarnest.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  484. [vUseEarnest addSubview:lblTitleUseEarnest];
  485. UILabel *lblUseEarnest= [UILabel new];
  486. lblUseEarnest.frame=CGRectMake(CGRectGetMaxX(lblTitleUseEarnest.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleUseEarnest.frame)-10, valueheight);
  487. lblUseEarnest.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  488. lblUseEarnest.text =_salesOrderModel.orderEarnestSum;
  489. [vUseEarnest addSubview:lblUseEarnest];
  490. //合计金额
  491. UIView *vTotalAmount= [UIView new];
  492. vTotalAmount.frame=CGRectMake(0,CGRectGetMaxY(vUseEarnest.frame), Screen_Width, heightRow);
  493. [vBody addSubview:vTotalAmount];
  494. UILabel *lblTitleTotalAmount=[UILabel new];
  495. lblTitleTotalAmount.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  496. lblTitleTotalAmount.text=@"合计金额:";
  497. lblTitleTotalAmount.textColor = [UIColor blackColor];
  498. lblTitleTotalAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  499. [vTotalAmount addSubview:lblTitleTotalAmount];
  500. UILabel *lblTotalAmount= [UILabel new];
  501. lblTotalAmount.frame=CGRectMake(CGRectGetMaxX(lblTitleTotalAmount.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleTotalAmount.frame)-10, valueheight);
  502. lblTotalAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  503. lblTotalAmount.text =_salesOrderModel.totalAmount;
  504. [vTotalAmount addSubview:lblTotalAmount];
  505. UIView *bottomSeparatorView1= [UIView new];
  506. bottomSeparatorView1.frame = CGRectMake(0, CGRectGetMaxY(vTotalAmount.frame), Screen_Width, heightLine);
  507. [bottomSeparatorView1 setBackgroundColor:LineBackgroundColor];
  508. [vBody addSubview:bottomSeparatorView1];
  509. //其它信息
  510. UIView *vOtherInfo= [UIView new];
  511. vOtherInfo.frame=CGRectMake(0,CGRectGetMaxY(bottomSeparatorView1.frame), Screen_Width, heightRow);
  512. [vBody addSubview:vOtherInfo];
  513. UILabel *lblTitleOtherInfo=[UILabel new];
  514. lblTitleOtherInfo.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  515. lblTitleOtherInfo.text=@"其它信息";
  516. lblTitleOtherInfo.textColor = [UIColor redColor];
  517. lblTitleOtherInfo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  518. [vOtherInfo addSubview:lblTitleOtherInfo];
  519. UIView *bottomSeparatorView2= [UIView new];
  520. bottomSeparatorView2.frame = CGRectMake(0, CGRectGetMaxY(vOtherInfo.frame), Screen_Width, heightLine);
  521. [bottomSeparatorView2 setBackgroundColor:LineBackgroundColor];
  522. [vBody addSubview:bottomSeparatorView2];
  523. //体积
  524. UIView *vVolumn= [UIView new];
  525. vVolumn.frame=CGRectMake(0,CGRectGetMaxY(bottomSeparatorView2.frame), Screen_Width, heightRow);
  526. [vBody addSubview:vVolumn];
  527. UILabel *lblTitleVolumn=[UILabel new];
  528. lblTitleVolumn.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  529. lblTitleVolumn.text=@"体 积:";
  530. lblTitleVolumn.textColor = [UIColor blackColor];
  531. lblTitleVolumn.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  532. [vVolumn addSubview:lblTitleVolumn];
  533. UILabel *lblVolumn= [UILabel new];
  534. lblVolumn.frame=CGRectMake(CGRectGetMaxX(lblTitleVolumn.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleVolumn.frame)-10, valueheight);
  535. lblVolumn.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  536. lblVolumn.text =_salesOrderModel.totalVolume;
  537. [vVolumn addSubview:lblVolumn];
  538. //重量
  539. UIView *vWeight= [UIView new];
  540. vWeight.frame=CGRectMake(0,CGRectGetMaxY(vVolumn.frame), Screen_Width, heightRow);
  541. [vBody addSubview:vWeight];
  542. UILabel *lblTitleWeight=[UILabel new];
  543. lblTitleWeight.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  544. lblTitleWeight.text=@"重 量:";
  545. lblTitleWeight.textColor = [UIColor blackColor];
  546. lblTitleWeight.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  547. [vWeight addSubview:lblTitleWeight];
  548. UILabel *lblWeight= [UILabel new];
  549. lblWeight.frame=CGRectMake(CGRectGetMaxX(lblTitleWeight.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleWeight.frame)-10, valueheight);
  550. lblWeight.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  551. lblWeight.text =_salesOrderModel.weight;
  552. [vWeight addSubview:lblWeight];
  553. //送货标识
  554. UIView *vDeliveryFlag= [UIView new];
  555. vDeliveryFlag.frame=CGRectMake(0,CGRectGetMaxY(vWeight.frame), Screen_Width, heightRow);
  556. [vBody addSubview:vDeliveryFlag];
  557. UILabel *lblTitleDeliveryFlag=[UILabel new];
  558. lblTitleDeliveryFlag.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  559. lblTitleDeliveryFlag.text=@"送货标识:";
  560. lblTitleDeliveryFlag.textColor = [UIColor blackColor];
  561. lblTitleDeliveryFlag.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  562. [vDeliveryFlag addSubview:lblTitleDeliveryFlag];
  563. UILabel *lblDeliveryFlag= [UILabel new];
  564. lblDeliveryFlag.frame=CGRectMake(CGRectGetMaxX(lblTitleDeliveryFlag.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleDeliveryFlag.frame)-10, valueheight);
  565. lblDeliveryFlag.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  566. if(_salesOrderModel.deliveryFlag){
  567. lblDeliveryFlag.text =@"送货";
  568. }
  569. else{
  570. lblDeliveryFlag.text =@"不送货";
  571. }
  572. [vDeliveryFlag addSubview:lblDeliveryFlag];
  573. //安装标识
  574. UIView *vInstallationFlag= [UIView new];
  575. vInstallationFlag.frame=CGRectMake(0,CGRectGetMaxY(vDeliveryFlag.frame), Screen_Width, heightRow);
  576. [vBody addSubview:vInstallationFlag];
  577. UILabel *lblTitleInstallationFlag=[UILabel new];
  578. lblTitleInstallationFlag.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  579. lblTitleInstallationFlag.text=@"安装标识:";
  580. lblTitleInstallationFlag.textColor = [UIColor blackColor];
  581. lblTitleInstallationFlag.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  582. [vInstallationFlag addSubview:lblTitleInstallationFlag];
  583. UILabel *lblInstallationFlag= [UILabel new];
  584. lblInstallationFlag.frame=CGRectMake(CGRectGetMaxX(lblTitleInstallationFlag.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleInstallationFlag.frame)-10, valueheight);
  585. lblInstallationFlag.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  586. if(_salesOrderModel.installationFlag){
  587. lblInstallationFlag.text =@"安装";
  588. }
  589. else{
  590. lblInstallationFlag.text =@"不安装";
  591. }
  592. [vInstallationFlag addSubview:lblInstallationFlag];
  593. //预计安装日期
  594. UIView *vInstallationDate= [UIView new];
  595. vInstallationDate.frame=CGRectMake(0,CGRectGetMaxY(vInstallationFlag.frame), Screen_Width, heightRow);
  596. [vBody addSubview:vInstallationDate];
  597. UILabel *lblTitleInstallationDate=[UILabel new];
  598. lblTitleInstallationDate.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  599. lblTitleInstallationDate.text=@"预计安装日期:";
  600. lblTitleInstallationDate.textColor = [UIColor blackColor];
  601. lblTitleInstallationDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  602. [vInstallationDate addSubview:lblTitleInstallationDate];
  603. UILabel *lblInstallationDate= [UILabel new];
  604. lblInstallationDate.frame=CGRectMake(CGRectGetMaxX(lblTitleInstallationDate.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleInstallationDate.frame)-10, valueheight);
  605. lblInstallationDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  606. lblInstallationDate.text=_salesOrderModel.estimateInstallationDate;
  607. [vInstallationDate addSubview:lblInstallationDate];
  608. //预计送货日期
  609. UIView *vDeliveryDate= [UIView new];
  610. vDeliveryDate.frame=CGRectMake(0,CGRectGetMaxY(vInstallationDate.frame), Screen_Width, heightRow);
  611. [vBody addSubview:vDeliveryDate];
  612. UILabel *lblTitleDeliveryDate=[UILabel new];
  613. lblTitleDeliveryDate.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  614. lblTitleDeliveryDate.text=@"预计送货日期:";
  615. lblTitleDeliveryDate.textColor = [UIColor blackColor];
  616. lblTitleDeliveryDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  617. [vDeliveryDate addSubview:lblTitleDeliveryDate];
  618. UILabel *lblDeliveryDate= [UILabel new];
  619. lblDeliveryDate.frame=CGRectMake(CGRectGetMaxX(lblTitleDeliveryDate.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleDeliveryDate.frame)-10, valueheight);
  620. lblDeliveryDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  621. lblDeliveryDate.text=_salesOrderModel.estimateDeliveryDate;
  622. [vDeliveryDate addSubview:lblDeliveryDate];
  623. //送货区域
  624. UIView *vDeliveryArea= [UIView new];
  625. vDeliveryArea.frame=CGRectMake(0,CGRectGetMaxY(vDeliveryDate.frame), Screen_Width, heightRow);
  626. [vBody addSubview:vDeliveryArea];
  627. UILabel *lblTitleDeliveryArea=[UILabel new];
  628. lblTitleDeliveryArea.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  629. lblTitleDeliveryArea.text=@"预计送货日期:";
  630. lblTitleDeliveryArea.textColor = [UIColor blackColor];
  631. lblTitleDeliveryArea.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  632. [vDeliveryArea addSubview:lblTitleDeliveryArea];
  633. UILabel *lblDeliveryArea= [UILabel new];
  634. lblDeliveryArea.frame=CGRectMake(CGRectGetMaxX(lblTitleDeliveryArea.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleDeliveryArea.frame)-10, valueheight);
  635. lblDeliveryArea.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  636. lblDeliveryArea.text=_salesOrderModel.deliveryAreaName;
  637. [vDeliveryArea addSubview:lblDeliveryArea];
  638. //楼层
  639. UIView *vFloor= [UIView new];
  640. vFloor.frame=CGRectMake(0,CGRectGetMaxY(vDeliveryArea.frame), Screen_Width, heightRow);
  641. [vBody addSubview:vFloor];
  642. UILabel *lblTitleFloor=[UILabel new];
  643. lblTitleFloor.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  644. lblTitleFloor.text=@"楼 层:";
  645. lblTitleFloor.textColor = [UIColor blackColor];
  646. lblTitleFloor.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  647. [vFloor addSubview:lblTitleFloor];
  648. UILabel *lblFloor= [UILabel new];
  649. lblFloor.frame=CGRectMake(CGRectGetMaxX(lblTitleFloor.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleFloor.frame)-10, valueheight);
  650. lblFloor.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  651. lblFloor.text=_salesOrderModel.floorsName;
  652. [vFloor addSubview:lblFloor];
  653. //冲正单号
  654. UIView *vCorrectNo= [UIView new];
  655. vCorrectNo.frame=CGRectMake(0,CGRectGetMaxY(vFloor.frame), Screen_Width, heightRow);
  656. [vBody addSubview:vCorrectNo];
  657. UILabel *lblTitleCorrectNo=[UILabel new];
  658. lblTitleCorrectNo.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  659. lblTitleCorrectNo.text=@"冲正单号:";
  660. lblTitleCorrectNo.textColor = [UIColor blackColor];
  661. lblTitleCorrectNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  662. [vCorrectNo addSubview:lblTitleCorrectNo];
  663. UILabel *lblCorrectNo= [UILabel new];
  664. lblCorrectNo.frame=CGRectMake(CGRectGetMaxX(lblTitleCorrectNo.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCorrectNo.frame)-10, valueheight);
  665. lblCorrectNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  666. lblCorrectNo.text=_salesOrderModel.setReversedOrderNo;
  667. [vCorrectNo addSubview:lblCorrectNo];
  668. //创建者
  669. UIView *vCreater= [UIView new];
  670. vCreater.frame=CGRectMake(0,CGRectGetMaxY(vCorrectNo.frame), Screen_Width, heightRow);
  671. [vBody addSubview:vCreater];
  672. UILabel *lblTitleCreater=[UILabel new];
  673. lblTitleCreater.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  674. lblTitleCreater.text=@"创 建 者:";
  675. lblTitleCreater.textColor = [UIColor blackColor];
  676. lblTitleCreater.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  677. [vCreater addSubview:lblTitleCreater];
  678. UILabel *lblCreater= [UILabel new];
  679. lblCreater.frame=CGRectMake(CGRectGetMaxX(lblTitleCreater.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCreater.frame)-10, valueheight);
  680. lblCreater.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  681. lblCreater.text=_salesOrderModel.createUser;
  682. [vCreater addSubview:lblCreater];
  683. //创建时间
  684. UIView *vCreateDate= [UIView new];
  685. vCreateDate.frame=CGRectMake(0,CGRectGetMaxY(vCreater.frame), Screen_Width, heightRow);
  686. [vBody addSubview:vCreateDate];
  687. UILabel *lblTitleCreateDate=[UILabel new];
  688. lblTitleCreateDate.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  689. lblTitleCreateDate.text=@"创建时间:";
  690. lblTitleCreateDate.textColor = [UIColor blackColor];
  691. lblTitleCreateDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  692. [vCreateDate addSubview:lblTitleCreateDate];
  693. UILabel *lblCreateDate= [UILabel new];
  694. lblCreateDate.frame=CGRectMake(CGRectGetMaxX(lblTitleCreateDate.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleCreateDate.frame)-10, valueheight);
  695. lblCreateDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  696. lblCreateDate.text=_salesOrderModel.createTime;
  697. [vCreateDate addSubview:lblCreateDate];
  698. //更新者
  699. UIView *vUpdater= [UIView new];
  700. vUpdater.frame=CGRectMake(0,CGRectGetMaxY(vCreateDate.frame), Screen_Width, heightRow);
  701. [vBody addSubview:vUpdater];
  702. UILabel *lblTitleUpdater=[UILabel new];
  703. lblTitleUpdater.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  704. lblTitleUpdater.text=@"更 新 者:";
  705. lblTitleUpdater.textColor = [UIColor blackColor];
  706. lblTitleUpdater.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  707. [vUpdater addSubview:lblTitleUpdater];
  708. UILabel *lblUpdater= [UILabel new];
  709. lblUpdater.frame=CGRectMake(CGRectGetMaxX(lblTitleUpdater.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleUpdater.frame)-10, valueheight);
  710. lblUpdater.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  711. lblUpdater.text=_salesOrderModel.updateUser;
  712. [vUpdater addSubview:lblUpdater];
  713. //更新时间
  714. UIView *vUpdateDate= [UIView new];
  715. vUpdateDate.frame=CGRectMake(0,CGRectGetMaxY(vUpdater.frame), Screen_Width, heightRow);
  716. [vBody addSubview:vUpdateDate];
  717. UILabel *lblTitleUpdateDate=[UILabel new];
  718. lblTitleUpdateDate.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  719. lblTitleUpdateDate.text=@"更新时间:";
  720. lblTitleUpdateDate.textColor = [UIColor blackColor];
  721. lblTitleUpdateDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  722. [vUpdateDate addSubview:lblTitleUpdateDate];
  723. UILabel *lblUpdateDate= [UILabel new];
  724. lblUpdateDate.frame=CGRectMake(CGRectGetMaxX(lblTitleUpdateDate.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleUpdateDate.frame)-10, valueheight);
  725. lblUpdateDate.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  726. lblUpdateDate.text=_salesOrderModel.updateTime;
  727. [vUpdateDate addSubview:lblUpdateDate];
  728. //备注
  729. UIView *vRemarks= [UIView new];
  730. vRemarks.frame=CGRectMake(0,CGRectGetMaxY(vUpdateDate.frame), Screen_Width, heightRow);
  731. [vBody addSubview:vRemarks];
  732. UILabel *lblTitleRemarks=[UILabel new];
  733. lblTitleRemarks.frame=CGRectMake(lblx, lbly, lblwidth+20, lblheight);
  734. lblTitleRemarks.text=@"备 注:";
  735. lblTitleRemarks.textColor = [UIColor blackColor];
  736. lblTitleRemarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  737. [vRemarks addSubview:lblTitleRemarks];
  738. UILabel *lblRemarks= [UILabel new];
  739. lblRemarks.frame=CGRectMake(CGRectGetMaxX(lblTitleRemarks.frame), valuey, Screen_Width-CGRectGetMaxX(lblTitleRemarks.frame)-10, valueheight);
  740. lblRemarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  741. lblRemarks.text=_salesOrderModel.remarks;
  742. [vRemarks addSubview:lblRemarks];
  743. vBody.frame=CGRectMake(0,0, Screen_Width,CGRectGetMaxY(vRemarks.frame));
  744. _scrollView.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vBody.frame));
  745. _bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_scrollView.frame), 0, 0)];
  746. [self.view addSubview:_bottomView];
  747. UIView *bottomSeparatorView3= [UIView new];
  748. bottomSeparatorView3.frame = CGRectMake(0, 0, Screen_Width, heightLine);
  749. [bottomSeparatorView3 setBackgroundColor:LineBackgroundColor];
  750. [_bottomView addSubview:bottomSeparatorView3];
  751. UILabel *lblBottomGoodsAmount=[UILabel new];
  752. NSString *goodsAmountStr=[NSString stringWithFormat:@"%@%@",@"货物总额:¥",_salesOrderModel.goodsAmount];
  753. CGRect bottomGoodsAmountFrame = [goodsAmountStr textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
  754. bottomGoodsAmountFrame.origin.x =Screen_Width-bottomGoodsAmountFrame.size.width-10;
  755. bottomGoodsAmountFrame.origin.y =CGRectGetMaxY(bottomSeparatorView3.frame)+15;
  756. lblBottomGoodsAmount.frame=bottomGoodsAmountFrame;
  757. lblBottomGoodsAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  758. lblBottomGoodsAmount.textColor=[UIColor redColor];
  759. lblBottomGoodsAmount.text=goodsAmountStr;
  760. [_bottomView addSubview:lblBottomGoodsAmount];
  761. UILabel *lblBottomEarnestAmount=[UILabel new];
  762. NSString *bottomEarnestAmountStr=[NSString stringWithFormat:@"%@%@",@"定金:¥",_salesOrderModel.earnestAmount];
  763. CGRect bottomEarnestAmountFrame = [bottomEarnestAmountStr textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
  764. bottomEarnestAmountFrame.origin.x =Screen_Width-bottomGoodsAmountFrame.size.width-bottomEarnestAmountFrame.size.width-20;
  765. bottomEarnestAmountFrame.origin.y =CGRectGetMaxY(bottomSeparatorView3.frame)+15;
  766. lblBottomEarnestAmount.frame=bottomEarnestAmountFrame;
  767. lblBottomEarnestAmount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  768. lblBottomEarnestAmount.textColor=[UIColor redColor];
  769. lblBottomEarnestAmount.text=bottomEarnestAmountStr;
  770. [_bottomView addSubview:lblBottomEarnestAmount];
  771. UILabel *lblGoodsCount=[UILabel new];
  772. NSString *goodsCountStr=[NSString stringWithFormat:@"%@%@%@",@"共",_salesOrderModel.goodsCount,@"件商品"];
  773. CGRect goodsCountFrame = [goodsCountStr textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:orderDict];
  774. goodsCountFrame.origin.x =Screen_Width-bottomGoodsAmountFrame.size.width-bottomEarnestAmountFrame.size.width-goodsCountFrame.size.width-30;
  775. goodsCountFrame.origin.y =CGRectGetMaxY(bottomSeparatorView3.frame)+15;
  776. lblGoodsCount.frame=goodsCountFrame;
  777. lblGoodsCount.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  778. lblGoodsCount.textColor=[UIColor redColor];
  779. lblGoodsCount.text=goodsCountStr;
  780. [_bottomView addSubview:lblGoodsCount];
  781. //客户地址
  782. UIView *vOperation = [UIView new];
  783. vOperation.frame=CGRectMake(0, CGRectGetMaxY(lblGoodsCount.frame)+10, Screen_Width, heightRow);
  784. [self.view addSubview:vOperation];
  785. // _editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  786. // [_editBtn setTitle:@"编辑" forState:UIControlStateNormal];
  787. // [_editBtn setBackgroundColor:[UIColor whiteColor]];
  788. // _editBtn.layer.cornerRadius = 4;
  789. // [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  790. // _editBtn.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
  791. // [_editBtn addTarget:self action:@selector(btnGoEdit) forControlEvents:UIControlEventTouchUpInside];
  792. // _editBtn.layer.cornerRadius = 10;
  793. // _editBtn.layer.borderWidth = 1.0f;//设置边框颜色
  794. // _editBtn.frame = CGRectMake(Screen_Width-btnwidth-10 ,0 , btnwidth, valueheight);
  795. // [vOperation addSubview:_editBtn];
  796. // _correctBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  797. // [_correctBtn setTitle:@"冲正" forState:UIControlStateNormal];
  798. // [_correctBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  799. // [_correctBtn setBackgroundColor:[UIColor whiteColor]];
  800. // _correctBtn.layer.cornerRadius = 10;
  801. // _correctBtn.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
  802. // _correctBtn.layer.borderWidth = 1.0f;//设置边框颜色
  803. // _correctBtn.frame = CGRectMake(Screen_Width-2*btnwidth-10-8 ,0 , btnwidth, valueheight);
  804. // [_correctBtn addTarget:self action:@selector(btnGoCorrect) forControlEvents:UIControlEventTouchUpInside];
  805. // [vOperation addSubview:_correctBtn];
  806. _detailBtn=[UIButton buttonWithType:UIButtonTypeCustom];
  807. [_detailBtn setTitle:@"商品详细" forState:UIControlStateNormal];
  808. [_detailBtn setBackgroundColor:[UIColor whiteColor]];
  809. _detailBtn.layer.cornerRadius = 10;
  810. _detailBtn.titleLabel.font= [UIFont systemFontOfSize:ButtonFontOfSize];
  811. _detailBtn.layer.borderWidth = 1.0f;//设置边框颜色
  812. _detailBtn.layer.borderColor = [UIColor blackColor].CGColor;
  813. [_detailBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  814. _detailBtn.frame = CGRectMake(Screen_Width-btnwidth-40 ,0 , 70, valueheight);
  815. [_detailBtn addTarget:self action:@selector(btnGoDetail) forControlEvents:UIControlEventTouchUpInside];
  816. [vOperation addSubview:_detailBtn];
  817. [_bottomView addSubview:vOperation];
  818. _bottomView.frame = CGRectMake(_bottomView.frame.origin.x, _bottomView.frame.origin.y, SCREENWIDTH, 80);
  819. // NSInteger status= _salesOrderModel.status;
  820. // switch (status) {
  821. // case 4:
  822. // _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
  823. // [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  824. // [_editBtn setEnabled:YES];
  825. // _correctBtn.layer.borderColor = [UIColor redColor].CGColor;
  826. // [_correctBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  827. // [_correctBtn setEnabled:YES];
  828. // break;
  829. // case 5:
  830. // _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
  831. // [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  832. // [_editBtn setEnabled:YES];
  833. // _correctBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
  834. // [_correctBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
  835. // [_correctBtn setEnabled:NO];
  836. // break;
  837. // case 7:
  838. // _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
  839. // [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  840. // [_editBtn setEnabled:YES];
  841. // _correctBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
  842. // [_correctBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
  843. // [_correctBtn setEnabled:NO];
  844. // break;
  845. // case 10:
  846. // _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
  847. // [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  848. // [_editBtn setEnabled:YES];
  849. // _correctBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
  850. // [_correctBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
  851. // [_correctBtn setEnabled:NO];
  852. // break;
  853. // case 11:
  854. // _editBtn.layer.borderColor = [UIColor blackColor].CGColor;
  855. // [_editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  856. // [_editBtn setEnabled:YES];
  857. // _correctBtn.layer.borderColor = [UIColor redColor].CGColor;
  858. // [_correctBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  859. // [_correctBtn setEnabled:YES];
  860. // break;
  861. // default:
  862. // _editBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
  863. // [_editBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
  864. // [_editBtn setEnabled:NO];
  865. // break;
  866. // }
  867. }
  868. -(void)btnGoCorrect{
  869. UIAlertController *alert = [UIAlertController alertControllerWithTitle:@""
  870. message:@"确定要冲正吗?" preferredStyle:UIAlertControllerStyleAlert];
  871. UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定"
  872. style:UIAlertActionStyleDefault
  873. handler:^(UIAlertAction *action){
  874. [self correctData:_salesOrderModel];
  875. }];
  876. UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消"
  877. style:UIAlertActionStyleDefault
  878. handler:^(UIAlertAction *action){
  879. }];
  880. UIColor *cancelColor=[UIColor blackColor];
  881. UIColor *sureColor=[UIColor redColor];
  882. [cancelAction setValue:cancelColor forKey:@"titleTextColor"];
  883. [okAction setValue:sureColor forKey:@"titleTextColor"];
  884. [alert addAction:okAction];
  885. [alert addAction:cancelAction];
  886. [self presentViewController:alert animated:YES completion:nil];
  887. }
  888. -(void)correctData:(SalesOrderModel *)model{
  889. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  890. [dict setObject:@"SaveReverseOrderIphone" forKey:@"Action"];
  891. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  892. [dict setObject:kkUserCode forKey:@"UserCode"];
  893. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  894. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  895. [dict setObject:model.orderNo== nil?@"":model.orderNo forKey:@"OrderNo"];
  896. [dict setObject:model.orderId == nil?@"":model.orderId forKey:@"OrderID"];
  897. NSString *statusStr = [NSString stringWithFormat:@"%d",model.status];
  898. [dict setObject:statusStr == nil?@"":statusStr forKey:@"Status"];
  899. [dict setObject:@"0" forKey:@"ApplyID"];
  900. [self startLoading];
  901. _downManager = [[ASIDownManager alloc] init];
  902. _downManager.delegate = self;
  903. _downManager.onRequestSuccess = @selector(onCorrectFinish:);
  904. _downManager.onRequestFail = @selector(onCorrectFail:);
  905. [_downManager postHttpRequest:ServerURL dic:dict path:nil fileName:nil];
  906. }
  907. /**
  908. 隐藏进度条
  909. */
  910. - (void)cancel {
  911. [self stopLoading];
  912. }
  913. /**
  914. 加载总数数据成功回调
  915. @param sender <#sender description#>
  916. */
  917. - (void)onCorrectFinish:(ASIDownManager *)sender {
  918. NSDictionary *dic = [sender.mWebStr JSONValue];
  919. [self cancel];
  920. // 服务器返回数据是否正确
  921. if (dic && [dic isKindOfClass:[NSDictionary class]]) {
  922. // 服务器返回数据状态值
  923. int iStatus = [[dic objectForKey:@"Status"] intValue];
  924. int iNewCount = 0;
  925. // 服务器返回数据消息
  926. NSString *message=[dic objectForKey:@"Message"];
  927. // 服务器返回数据状态值正确
  928. if (iStatus == 0) {
  929. __weak typeof (self)weakself = self;
  930. //初始化->
  931. UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示"
  932. message:@"冲正成功!" preferredStyle:
  933. UIAlertControllerStyleAlert ];
  934. // addAction->
  935. [alert addAction:[UIAlertAction actionWithTitle:@"确定"
  936. style:UIAlertActionStyleDefault
  937. handler:^(UIAlertAction *action)
  938. {
  939. [weakself.navigationController popViewControllerAnimated:YES];
  940. //关闭当前页面 刷新一览主界面
  941. if([self.refreshDelegate respondsToSelector:@selector(refreshOrderData)])
  942. {
  943. [self.refreshDelegate refreshOrderData];
  944. }
  945. }]];
  946. //展示->
  947. [self presentViewController:alert animated:YES completion:nil];
  948. }
  949. // 服务器返回数据状态值异常
  950. else if(iStatus == ActionResultStatusAuthError
  951. ||iStatus == ActionResultStatusNoLogin
  952. ||iStatus == ActionResultStatusLogined||iStatus==ActionResultSessionOverdue){
  953. [self showReLoginDialog:message];
  954. }
  955. else{
  956. [self showAlertViewText:message];
  957. }
  958. }
  959. }
  960. /**
  961. 加载总数数据失败回调
  962. @param sender <#sender description#>
  963. */
  964. - (void)onCorrectFail:(ASIDownManager *)sender {
  965. [self cancel];
  966. [self showAlertViewText:@"加载失败"];
  967. }
  968. -(void)btnGoDetail{
  969. self.hidesBottomBarWhenPushed = YES;
  970. OrderGoodsListVC *vc = [[OrderGoodsListVC alloc] init];
  971. vc.salesOrderModel=_salesOrderModel;
  972. [self.navigationController pushViewController:vc animated:YES];
  973. }
  974. -(void)btnGoEdit{
  975. self.hidesBottomBarWhenPushed = YES;
  976. NewSalesOrderHomeVC *vc = [[NewSalesOrderHomeVC alloc] init];
  977. vc.orderId=_salesOrderModel.orderId;
  978. vc.refreshDelegate=self;
  979. vc.editFlag=YES;
  980. [self.navigationController pushViewController:vc animated:YES];
  981. }
  982. - (void)goBack
  983. {
  984. [self.navigationController popViewControllerAnimated:YES];
  985. }
  986. -(void)viewSafeAreaInsetsDidChange{
  987. _scrollView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetHeight(self.view.safeAreaLayoutGuide.layoutFrame)- CGRectGetHeight(_bottomView.frame));
  988. _bottomView.frame = CGRectMake(0, CGRectGetMaxY(_scrollView.frame), CGRectGetWidth(_bottomView.frame), CGRectGetHeight(_bottomView.frame));
  989. [super viewSafeAreaInsetsDidChange];
  990. }
  991. @end