NewOtherOutStorageVC.m 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. //
  2. // NewOtherOutStorageVC.m
  3. // IBOSSmini
  4. //
  5. // Created by guan hong hou on 2018/4/28.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "NewOtherOutStorageVC.h"
  9. @interface NewOtherOutStorageVC (){
  10. UIScrollView *_scrollView;
  11. UITextField *_selectedAchievementField;
  12. CGRect originalAchievementFrame;
  13. }
  14. @end
  15. @implementation NewOtherOutStorageVC
  16. #pragma mark 公共函数
  17. /**
  18. 视图加载完成
  19. */
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. _customerCodeValid=NO;
  23. [self initUI];
  24. [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
  25. [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
  26. [self loadDataSource];
  27. }
  28. /**
  29. 修改:2017-9-25
  30. 适配机型
  31. 安全区视图发生变化
  32. */
  33. -(void)viewSafeAreaInsetsDidChange{
  34. _scrollView.frame = CGRectMake(0, 0,Screen_Width, self.view.safeAreaLayoutGuide.layoutFrame.size.height);
  35. [super viewSafeAreaInsetsDidChange];
  36. }
  37. /**
  38. 内存警告
  39. */
  40. - (void)didReceiveMemoryWarning {
  41. [super didReceiveMemoryWarning];
  42. }
  43. #pragma mark 委托函数
  44. /**
  45. 客户编码回调
  46. @param searchModel <#searchModel description#>
  47. */
  48. -(void)getCustomerOrder:(CustomerCodeSearchModel*)searchModel{
  49. _customerId=[NSString stringWithFormat:@"%ld",searchModel.customerId];
  50. _customerCode=searchModel.customerCode;
  51. _customerName=searchModel.customerName;
  52. _telephone=searchModel.telephone;
  53. _address=searchModel.address;
  54. _contacts=searchModel.contacts;
  55. _lblCustomerCode.text=_customerCode;
  56. }
  57. /**
  58. 文本开始编辑回调
  59. @param textField <#textField description#>
  60. @return <#return value description#>
  61. */
  62. -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
  63. {
  64. _selectedAchievementField = textField;
  65. return YES;
  66. }
  67. /**
  68. 司机,装卸工,供应商等返回回调
  69. @param model <#model description#>
  70. @param cr <#cr description#>
  71. */
  72. - (void)customerReportTextDoneDatas:(CustomerReportTextInfoModel *)model CustomerReport:(CustomerReport)cr
  73. {
  74. if (model==nil) {
  75. return;
  76. }
  77. //渠道返回值
  78. if(cr==ReportDriver){
  79. _driverId=model.idCode;
  80. _driverName=model.name;
  81. _lblDriver.text=_driverName;
  82. }
  83. if(cr==ReportDocker){
  84. _dockerId=model.idCode;
  85. _dockerName=model.name;
  86. _lblDocker.text=_dockerName;
  87. }
  88. if(cr==ReportSupplier){
  89. _supplierId=model.idCode;
  90. _supplierName=model.name;
  91. _lblSupplier.text=_supplierName;
  92. }
  93. }
  94. /**
  95. 业务员,业务部门等返回回调
  96. @param Amodel <#Amodel description#>
  97. @param cr <#cr description#>
  98. */
  99. -(void)achiementData:(AchiementDepartmentInfoModel *)Amodel CustomerReport:(CustomerReport)cr{
  100. //返回值
  101. if(cr== ReportAchiementDepartmt){
  102. _organizationName=Amodel.organizationName;
  103. _organizationId=Amodel.organizationId;
  104. _organizationCode=Amodel.organizationCode;
  105. _lblDepartment.text=_organizationName;
  106. }
  107. // 业务员
  108. if(cr==ReportAchiementmn){
  109. _staffId=Amodel.staffId;
  110. _staffName=Amodel.staffName;
  111. _lblStaff.text=_staffName;
  112. }
  113. }
  114. /**
  115. 基本数据源加载成功回调
  116. @param sender <#sender description#>
  117. */
  118. - (void)onDataSourceLoadFinish:(ASIDownManager *)sender {
  119. NSDictionary *dic = [sender.mWebStr JSONValue];
  120. [self stopLoading];
  121. // 服务器返回数据是否正确
  122. if (dic && [dic isKindOfClass:[NSDictionary class]]) {
  123. // 服务器返回数据状态值
  124. int iStatus = [[dic objectForKey:@"Status"] intValue];
  125. // 服务器返回数据消息
  126. NSString *message=[dic objectForKey:@"Message"];
  127. // 服务器返回数据状态值正确
  128. if (iStatus == 0) {
  129. NSDictionary * infoDic=[dic objectForKey:@"Result"];
  130. // 返回结果
  131. if(infoDic!=nil&& infoDic.count>0)
  132. {
  133. NSArray *departmentArray=[infoDic objectForKey:@"Table"];
  134. if(departmentArray!=nil&&departmentArray.count>0){
  135. _departmentList=departmentArray;
  136. }
  137. NSArray *staffArray=[infoDic objectForKey:@"Table1"];
  138. if(staffArray!=nil&&staffArray.count>0){
  139. _staffList=staffArray;
  140. }
  141. NSArray *driverArray=[infoDic objectForKey:@"Table2"];
  142. if(driverArray!=nil&&driverArray.count>0){
  143. _driverList=driverArray;
  144. _dockerList=driverArray;
  145. }
  146. NSArray *supplierArray=[infoDic objectForKey:@"Table3"];
  147. if(supplierArray!=nil&&supplierArray.count>0){
  148. _supplierList=supplierArray;
  149. }
  150. }
  151. }
  152. // 服务器返回数据状态值异常
  153. else if(iStatus==ActionResultStatusAuthError
  154. ||iStatus==ActionResultStatusNoLogin
  155. ||iStatus==ActionResultStatusLogined ||iStatus == ActionResultStatusLoginedInvalid){
  156. [self showReLoginDialog:message];
  157. }
  158. else{
  159. [self showAlertViewText:message];
  160. }
  161. }
  162. }
  163. /**
  164. 基本数据源加载失败回调
  165. @param sender <#sender description#>
  166. */
  167. - (void)onDataSourceLoadFail:(ASIDownManager *)sender {
  168. [self stopLoading];
  169. [self showAlertViewText:@"加载失败"];
  170. }
  171. #pragma mark 私有函数
  172. /**
  173. 初始化UI
  174. */
  175. -(void)initUI{
  176. [self.view setBackgroundColor:[UIColor whiteColor]];
  177. UIView *topSeparatorView = [UIView new];
  178. topSeparatorView.frame=CGRectMake(0,3, Screen_Width, 10);
  179. topSeparatorView.backgroundColor = LineBackgroundColor;
  180. [self.view addSubview:topSeparatorView];
  181. CGFloat heightRow = 40;
  182. CGFloat lblx = 20;
  183. CGFloat lbly = 8;
  184. CGFloat lblwidth = 80;
  185. CGFloat lblheight = 25;
  186. _scrollView=[UIScrollView new];
  187. _scrollView.frame=CGRectMake(0,CGRectGetMaxY(topSeparatorView.frame), Screen_Width,self.view.frame.size.height-CGRectGetMaxY(topSeparatorView.frame));
  188. [self.view addSubview:_scrollView];
  189. UIView *vBody = [UIView new];
  190. [_scrollView addSubview:vBody];
  191. UITapGestureRecognizer* singleRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKey)];
  192. [self.view addGestureRecognizer:singleRecognizer];
  193. UIView *vDriver = [UIView new];
  194. vDriver.frame=CGRectMake(0,0, Screen_Width, heightRow);
  195. [vBody addSubview:vDriver];
  196. NSString *driverTitle=@"运输司机";
  197. UILabel *lblTitleDriver=[UILabel new];
  198. lblTitleDriver.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  199. lblTitleDriver.textColor = [UIColor blackColor];
  200. lblTitleDriver.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  201. [vDriver addSubview:lblTitleDriver];
  202. lblTitleDriver.text=driverTitle;
  203. _lblDriver = [UILabel new];
  204. _lblDriver.frame=CGRectMake(CGRectGetMaxX(lblTitleDriver.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDriver.frame)-55, lblheight);
  205. _lblDriver.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  206. _lblDriver.text=@"请选择运输司机";
  207. _lblDriver.userInteractionEnabled=YES;
  208. UITapGestureRecognizer *driverTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goDriver:)];
  209. [_lblDriver addGestureRecognizer:driverTapGesture];
  210. [vDriver addSubview:_lblDriver];
  211. UIButton *btnDriverRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
  212. btnDriverRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
  213. UIImageView *rightArrowImg = [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
  214. [rightArrowImg setImage:[UIImage imageNamed:@"rightarrow"]];
  215. [ btnDriverRightArrow addSubview:rightArrowImg];
  216. rightArrowImg.userInteractionEnabled=NO;
  217. [vDriver addSubview:btnDriverRightArrow];
  218. UIView *driverSeparator=[UIView new];
  219. driverSeparator.backgroundColor=LineBackgroundColor;
  220. driverSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleDriver.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleDriver.frame),1);
  221. [vDriver addSubview:driverSeparator];
  222. UIView *vDocker = [UIView new];
  223. vDocker.frame=CGRectMake(0,CGRectGetMaxY(vDriver.frame), Screen_Width, heightRow);
  224. [vBody addSubview:vDocker];
  225. NSString *dockerTitle=@"装卸工人";
  226. UILabel *lblTitleDocker=[UILabel new];
  227. lblTitleDocker.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  228. lblTitleDocker.textColor = [UIColor blackColor];
  229. lblTitleDocker.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  230. [vDocker addSubview:lblTitleDocker];
  231. lblTitleDocker.text=dockerTitle;
  232. _lblDocker = [UILabel new];
  233. _lblDocker.frame=CGRectMake(CGRectGetMaxX(lblTitleDocker.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDocker.frame)-55, lblheight);
  234. _lblDocker.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  235. _lblDocker.text=@"请选择装卸工人";
  236. _lblDocker.userInteractionEnabled=YES;
  237. UITapGestureRecognizer *dockerTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goDocker:)];
  238. [_lblDocker addGestureRecognizer:dockerTapGesture];
  239. [vDocker addSubview:_lblDocker];
  240. UIButton *btnDockerRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
  241. btnDockerRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
  242. UIImageView *rightArrowImg1 = [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
  243. [rightArrowImg1 setImage:[UIImage imageNamed:@"rightarrow"]];
  244. [ btnDockerRightArrow addSubview:rightArrowImg1];
  245. rightArrowImg1.userInteractionEnabled=NO;
  246. [vDocker addSubview:btnDockerRightArrow];
  247. UIView *dockerSeparator=[UIView new];
  248. dockerSeparator.backgroundColor=LineBackgroundColor;
  249. dockerSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleDocker.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleDocker.frame),1);
  250. [vDocker addSubview:dockerSeparator];
  251. UIView *vSupplier = [UIView new];
  252. vSupplier.frame=CGRectMake(0,CGRectGetMaxY(vDocker.frame), Screen_Width, heightRow);
  253. [vBody addSubview:vSupplier];
  254. NSString *supplierTitle=@"供 应 商";
  255. UILabel *lblTitleSupplier=[UILabel new];
  256. lblTitleSupplier.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  257. lblTitleSupplier.textColor = [UIColor blackColor];
  258. lblTitleSupplier.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  259. [vSupplier addSubview:lblTitleSupplier];
  260. lblTitleSupplier.text=supplierTitle;
  261. _lblSupplier = [UILabel new];
  262. _lblSupplier.frame=CGRectMake(CGRectGetMaxX(lblTitleSupplier.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleSupplier.frame)-55, lblheight);
  263. _lblSupplier.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  264. _lblSupplier.text=@"请选择供应商";
  265. _lblSupplier.userInteractionEnabled=YES;
  266. UITapGestureRecognizer *supplierTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goSupplier:)];
  267. [_lblSupplier addGestureRecognizer:supplierTapGesture];
  268. [vSupplier addSubview:_lblSupplier];
  269. UIButton *btnSupplierRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
  270. btnSupplierRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
  271. UIImageView *rightArrowImg2= [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
  272. [rightArrowImg2 setImage:[UIImage imageNamed:@"rightarrow"]];
  273. [ btnSupplierRightArrow addSubview:rightArrowImg2];
  274. rightArrowImg2.userInteractionEnabled=NO;
  275. [vSupplier addSubview:btnSupplierRightArrow];
  276. UIView *supplierSeparator=[UIView new];
  277. supplierSeparator.backgroundColor=LineBackgroundColor;
  278. supplierSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleSupplier.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleSupplier.frame),1);
  279. [vSupplier addSubview:supplierSeparator];
  280. UIView *vCustomerCode = [UIView new];
  281. vCustomerCode.frame=CGRectMake(0,CGRectGetMaxY(vSupplier.frame), Screen_Width, heightRow);
  282. [vBody addSubview:vCustomerCode];
  283. NSString *customerCodeTitle=@"客户编码";
  284. UILabel *lblTitleCustomerCode=[UILabel new];
  285. lblTitleCustomerCode.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  286. lblTitleCustomerCode.textColor = [UIColor blackColor];
  287. lblTitleCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  288. [vCustomerCode addSubview:lblTitleCustomerCode];
  289. lblTitleCustomerCode.text=customerCodeTitle;
  290. _lblCustomerCode = [UILabel new];
  291. _lblCustomerCode.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleCustomerCode.frame)-55, lblheight);
  292. _lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  293. _lblCustomerCode.text=@"请选择客户编码";
  294. _lblCustomerCode.userInteractionEnabled=YES;
  295. UITapGestureRecognizer *customerCodeTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(searchCustomerCode)];
  296. [_lblCustomerCode addGestureRecognizer:customerCodeTapGesture];
  297. [vCustomerCode addSubview:_lblCustomerCode];
  298. UIButton *btnCustomerCodeRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
  299. btnCustomerCodeRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
  300. UIImageView *rightArrowImg3= [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
  301. [rightArrowImg3 setImage:[UIImage imageNamed:@"rightarrow"]];
  302. [ btnCustomerCodeRightArrow addSubview:rightArrowImg3];
  303. rightArrowImg3.userInteractionEnabled=NO;
  304. [vCustomerCode addSubview:btnCustomerCodeRightArrow];
  305. UIView *customerCodeSeparator=[UIView new];
  306. customerCodeSeparator.backgroundColor=LineBackgroundColor;
  307. customerCodeSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleCustomerCode.frame),1);
  308. [vCustomerCode addSubview:customerCodeSeparator];
  309. //业务员
  310. UIView *vStaff = [UIView new];
  311. vStaff.frame=CGRectMake(0,CGRectGetMaxY(vCustomerCode.frame), Screen_Width, heightRow);
  312. [vBody addSubview:vStaff];
  313. NSString *staffTitle=@"业 务 员";
  314. UILabel *lblTitleStaff=[UILabel new];
  315. lblTitleStaff.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  316. lblTitleStaff.textColor = [UIColor blackColor];
  317. lblTitleStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  318. [vStaff addSubview:lblTitleStaff];
  319. lblTitleStaff.text=staffTitle;
  320. _lblStaff = [UILabel new];
  321. _lblStaff.frame=CGRectMake(CGRectGetMaxX(lblTitleStaff.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleStaff.frame)-55, lblheight);
  322. _lblStaff.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  323. _lblStaff.text=@"请选择业务员";
  324. _lblStaff.userInteractionEnabled=YES;
  325. UITapGestureRecognizer *staffTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goStaff:)];
  326. [_lblStaff addGestureRecognizer:staffTapGesture];
  327. [vStaff addSubview:_lblStaff];
  328. UIButton *btnStaffRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
  329. btnStaffRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
  330. UIImageView *rightArrowImg4= [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
  331. [rightArrowImg4 setImage:[UIImage imageNamed:@"rightarrow"]];
  332. [ btnStaffRightArrow addSubview:rightArrowImg4];
  333. rightArrowImg4.userInteractionEnabled=NO;
  334. [vStaff addSubview:btnStaffRightArrow];
  335. UIView *staffSeparator=[UIView new];
  336. staffSeparator.backgroundColor=LineBackgroundColor;
  337. staffSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleStaff.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleStaff.frame),1);
  338. [vStaff addSubview:staffSeparator];
  339. UIView *vDepartment = [UIView new];
  340. vDepartment.frame=CGRectMake(0,CGRectGetMaxY(vStaff.frame), Screen_Width, heightRow);
  341. [vBody addSubview:vDepartment];
  342. NSString *departmentTitle=@"业务部门";
  343. UILabel *lblTitleDepartment=[UILabel new];
  344. lblTitleDepartment.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  345. lblTitleDepartment.textColor = [UIColor blackColor];
  346. lblTitleDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  347. [vDepartment addSubview:lblTitleDepartment];
  348. lblTitleDepartment.text=departmentTitle;
  349. _lblDepartment = [UILabel new];
  350. _lblDepartment.frame=CGRectMake(CGRectGetMaxX(lblTitleDepartment.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDepartment.frame)-55, lblheight);
  351. _lblDepartment.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  352. _lblDepartment.text=@"请选择业务部门";
  353. _lblDepartment.userInteractionEnabled=YES;
  354. UITapGestureRecognizer *departmentTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goDepartment:)];
  355. [_lblDepartment addGestureRecognizer:departmentTapGesture];
  356. [vDepartment addSubview:_lblDepartment];
  357. UIButton *btnDepartmentRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
  358. btnDepartmentRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
  359. UIImageView *rightArrowImg5= [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
  360. [rightArrowImg5 setImage:[UIImage imageNamed:@"rightarrow"]];
  361. [ btnDepartmentRightArrow addSubview:rightArrowImg5];
  362. rightArrowImg5.userInteractionEnabled=NO;
  363. [vDepartment addSubview:btnDepartmentRightArrow];
  364. UIView *departmentSeparator=[UIView new];
  365. departmentSeparator.backgroundColor=LineBackgroundColor;
  366. departmentSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleDepartment.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleDepartment.frame),1);
  367. [vDepartment addSubview:departmentSeparator];
  368. UIView *vRemarks = [UIView new];
  369. vRemarks.frame=CGRectMake(0,CGRectGetMaxY(vDepartment.frame), Screen_Width, heightRow);
  370. [vBody addSubview:vRemarks];
  371. NSString *remarksTitle=@"备 注";
  372. UILabel *lblRemarksTitle=[UILabel new];
  373. lblRemarksTitle.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  374. lblRemarksTitle.textColor = [UIColor blackColor];
  375. lblRemarksTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  376. [vRemarks addSubview:lblRemarksTitle];
  377. lblRemarksTitle.text=remarksTitle;
  378. _txtRemarks = [UITextField new];
  379. _txtRemarks.frame=CGRectMake(CGRectGetMaxX(lblRemarksTitle.frame), lbly,Screen_Width-CGRectGetMaxX(lblRemarksTitle.frame)-10, lblheight);
  380. _txtRemarks.placeholder=@"请输入备注";
  381. _txtRemarks.delegate=self;
  382. _txtRemarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  383. [vRemarks addSubview:_txtRemarks];
  384. UIView *remarksSeparator=[UIView new];
  385. remarksSeparator.backgroundColor=LineBackgroundColor;
  386. remarksSeparator.frame=CGRectMake(CGRectGetMaxX(lblRemarksTitle.frame),heightRow,Screen_Width-CGRectGetMaxX(lblRemarksTitle.frame),1);
  387. [vRemarks addSubview:remarksSeparator];
  388. vBody.frame=CGRectMake(0,0, Screen_Width,CGRectGetMaxY(vRemarks.frame));
  389. _scrollView.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vBody.frame)+rectStatusHeight+rectNavHeight);
  390. originalAchievementFrame=_scrollView.frame;
  391. }
  392. /**
  393. 隐藏键盘
  394. */
  395. -(void)hideKey{
  396. [self.view endEditing:YES];
  397. }
  398. /**
  399. 弹出键盘
  400. @param notification <#notification description#>
  401. */
  402. -(void)keyboardWillShow:(NSNotification*)notification
  403. {
  404. // 获得键盘尺寸
  405. NSDictionary *info = notification.userInfo;
  406. NSValue *aValue = [info objectForKeyedSubscript:UIKeyboardFrameEndUserInfoKey];
  407. CGSize keyboardSize = [aValue CGRectValue].size;
  408. if(!_keyboardShow){
  409. // //重新定义ScrollView的尺寸
  410. CGRect viewFrame = _scrollView.frame;
  411. viewFrame.size.height -=(keyboardSize.height); //原来的尺寸减去键盘的高度
  412. viewFrame.size.height-=130;
  413. _scrollView.frame = viewFrame;
  414. //获取当前文本框架大小
  415. CGRect textFieldRect = [_selectedAchievementField frame];
  416. //滚动到当前文本框
  417. [_scrollView scrollRectToVisible:textFieldRect animated:YES];
  418. }
  419. _keyboardShow=YES;
  420. }
  421. /**
  422. 隐藏键盘
  423. @param aNotification <#aNotification description#>
  424. */
  425. - (void)keyboardWillHide:(NSNotification *)aNotification
  426. {
  427. if(_keyboardShow){
  428. _scrollView.frame=originalAchievementFrame;
  429. }
  430. _keyboardShow=NO;
  431. }
  432. /**
  433. 跳转到司机界面
  434. @param gesture <#gesture description#>
  435. */
  436. - (void)goDriver:(UITapGestureRecognizer *)gesture {
  437. CustomerReportTextVC *tc=[[CustomerReportTextVC alloc] init];
  438. tc.delegate=self;
  439. tc.dataSourceCode=@"T_MST_Driver";
  440. tc.showDialogViewTag=ReportDriver;
  441. tc.jsonArr=_driverList;
  442. [self.listNavVc pushViewController:tc animated:YES];
  443. }
  444. /**
  445. 跳转到装卸工人界面
  446. @param gesture <#gesture description#>
  447. */
  448. - (void)goDocker:(UITapGestureRecognizer *)gesture {
  449. CustomerReportTextVC *tc=[[CustomerReportTextVC alloc] init];
  450. tc.delegate=self;
  451. tc.dataSourceCode=@"T_MST_Docker";
  452. tc.showDialogViewTag=ReportDocker;
  453. tc.jsonArr=_dockerList;
  454. [self.listNavVc pushViewController:tc animated:YES];
  455. }
  456. /**
  457. 跳转到供应商界面
  458. @param gesture <#gesture description#>
  459. */
  460. - (void)goSupplier:(UITapGestureRecognizer *)gesture {
  461. self.hidesBottomBarWhenPushed = YES;
  462. CustomerReportTextVC *tc=[[CustomerReportTextVC alloc] init];
  463. tc.delegate=self;
  464. tc.jsonArr=_supplierList;
  465. tc.showDialogViewTag=ReportSupplier;
  466. [self.listNavVc pushViewController:tc animated:YES];
  467. }
  468. /**
  469. 跳转到业务部门
  470. */
  471. - (void)goDepartment:(UITapGestureRecognizer *)gesture{
  472. CustomerAchievementTextVC *tc=[CustomerAchievementTextVC new];
  473. tc.cDelegate = self;
  474. tc.showDialogViewTag=ReportAchiementDepartmt;
  475. tc.jsonArr=_departmentList;
  476. [self.listNavVc pushViewController:tc animated:YES];
  477. }
  478. /**
  479. 跳转到客户编码查询界面
  480. */
  481. -(void)searchCustomerCode{
  482. CustomerCodeSearchVC *customerCodeVC=[[ CustomerCodeSearchVC alloc] init];
  483. UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:customerCodeVC];
  484. navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
  485. navigationController.preferredContentSize = CGSizeMake(frameSize.x, frameSize.y);
  486. customerCodeVC.orderDelegate=self;
  487. customerCodeVC.flag=@"otherInStorage";
  488. [self.listNavVc pushViewController:customerCodeVC animated:YES];
  489. }
  490. /**
  491. 跳转到业务员界面
  492. */
  493. - (void)goStaff:(UITapGestureRecognizer *)gesture{
  494. CustomerAchievementTextVC *tc=[[CustomerAchievementTextVC alloc] init];
  495. tc.cDelegate=self;
  496. tc.showDialogViewTag=ReportAchiementmn;
  497. tc.jsonArr=_staffList;
  498. [self.listNavVc pushViewController:tc animated:YES];
  499. }
  500. /**
  501. 加载基本数据源
  502. */
  503. -(void)loadDataSource{
  504. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  505. [dict setObject:@"GetOtherDeliveryInitData" forKey:@"Action"];
  506. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  507. [dict setObject:kkUserCode forKey:@"UserCode"];
  508. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  509. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  510. [dict setObject:kkOrganizationId forKey:@"OrganizationID"];
  511. _downManager = [[ASIDownManager alloc] init];
  512. [self startLoading];
  513. _downManager.delegate = self;
  514. _downManager.OnImageDown = @selector(onDataSourceLoadFinish:);
  515. _downManager.OnImageFail = @selector(onDataSourceLoadFail:);
  516. [_downManager postHttpRequest:ServerURL dic:dict path:nil fileName:nil];
  517. }
  518. @end