NewSalesOutStorageListVC.m 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. //
  2. // NewSalesOutStorageListVC.m
  3. // IBOSSmini
  4. //
  5. // Created by guan hong hou on 2018/4/12.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "NewSalesOutStorageListVC.h"
  9. @interface NewSalesOutStorageListVC (){
  10. UIScrollView *_scrollView;
  11. }
  12. @end
  13. UITextField *_selectedAchievementField;
  14. CGRect originalAchievementFrame;
  15. @implementation NewSalesOutStorageListVC
  16. #pragma mark 公共函数
  17. /**
  18. 视图加载完成函数
  19. */
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. [self initUI];
  23. self.goodsDetailVc.goodsList=[[NSMutableArray alloc]init];
  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 initSlideSlip];
  27. }
  28. - (void)didReceiveMemoryWarning {
  29. [super didReceiveMemoryWarning];
  30. }
  31. /**
  32. 安全区变化函数
  33. */
  34. -(void)viewSafeAreaInsetsDidChange{
  35. _scrollView.frame=CGRectMake(0, CGRectGetMaxY(_middleSeparatorView.frame), Screen_Width,self.view.safeAreaLayoutGuide.layoutFrame.size.height-CGRectGetMaxY(_middleSeparatorView.frame));
  36. [super viewSafeAreaInsetsDidChange];
  37. }
  38. #pragma mark 委托函数
  39. /**
  40. 销售单列表回调函数
  41. @param checkedSalesSlipList <#checkedSalesSlipList description#>
  42. */
  43. -(void) getSelectedSalesSlipList:(NSMutableArray *)checkedSalesSlipList{
  44. _salesSlipListModel=[checkedSalesSlipList objectAtIndex:0];
  45. _lblCustomerCode.text=_salesSlipListModel.customerCode;
  46. _lblCustomerName.text=_salesSlipListModel.customerName;
  47. _lblTelephone.text=_salesSlipListModel.telephone;
  48. _lblCustomerAddress.text=_salesSlipListModel.customerAddress;
  49. if(checkedSalesSlipList!=nil&&checkedSalesSlipList.count>0){
  50. for(SalesOutStorageSalesSlipModel *salesSlipModel in checkedSalesSlipList){
  51. if(salesSlipModel.goodsDetailArray!=nil&&salesSlipModel.goodsDetailArray.count>0){
  52. for( SalesOutStorageSalesSlipGoodsListModel *goodsModel in salesSlipModel.goodsDetailArray){
  53. if(goodsModel.checkedFlag){
  54. [self.goodsDetailVc.goodsList addObject:goodsModel];
  55. }
  56. }
  57. }
  58. }
  59. [self.goodsDetailVc.vTableView reloadData];
  60. }
  61. }
  62. /**
  63. textfield委托回调
  64. @param textField <#textField description#>
  65. @return <#return value description#>
  66. */
  67. -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
  68. {
  69. _selectedAchievementField = textField;
  70. return YES;
  71. }
  72. /**
  73. 司机,装卸工人等返回回调
  74. @param model <#model description#>
  75. @param cr <#cr description#>
  76. */
  77. - (void)customerReportTextDoneDatas:(CustomerReportTextInfoModel *)model CustomerReport:(CustomerReport)cr
  78. {
  79. if (model==nil) {
  80. return;
  81. }
  82. //渠道返回值
  83. if(cr==ReportDriver){
  84. _driverId=model.idCode;
  85. _driverName=model.name;
  86. _lblDriver.text=_driverName;
  87. }
  88. if(cr==ReportDocker){
  89. _dockerId=model.idCode;
  90. _dockerName=model.name;
  91. _lblDocker.text=_dockerName;
  92. }
  93. }
  94. #pragma mark 私有函数
  95. /**
  96. 初始化UI
  97. */
  98. -(void)initUI{
  99. [self.view setBackgroundColor:[UIColor whiteColor]];
  100. UIView *topSeparatorView = [UIView new];
  101. topSeparatorView.frame=CGRectMake(0,3, Screen_Width, 10);
  102. topSeparatorView.backgroundColor = LineBackgroundColor;
  103. [self.view addSubview:topSeparatorView];
  104. CGFloat height = 40;
  105. UIView *searchView = [[UIView alloc]initWithFrame:CGRectMake(0,CGRectGetMaxY(topSeparatorView.frame)+5, Screen_Width, 50)];
  106. searchView.backgroundColor = [UIColor whiteColor];
  107. _btnSearch = [UIButton buttonWithType:UIButtonTypeCustom];
  108. _btnSearch.frame = CGRectMake(5, 5, Screen_Width-45, height);
  109. _btnSearch.layer.cornerRadius = 6.0f;
  110. [_btnSearch setTitle:@"搜索销售单" forState:UIControlStateNormal];
  111. [_btnSearch setTitleColor:NavBarUnEnbleItemColor forState:UIControlStateNormal];
  112. _btnSearch.titleLabel.textAlignment = NSTextAlignmentCenter;
  113. _btnSearch.titleLabel.font = [UIFont systemFontOfSize:LabelAndTextFontOfSize];
  114. _btnSearch.backgroundColor = LineBackgroundColor;
  115. [_btnSearch addTarget:self action:@selector(goodsSearch) forControlEvents:UIControlEventTouchUpInside];
  116. [searchView addSubview:_btnSearch];
  117. [self.view addSubview:searchView];
  118. UIButton *scan=[UIButton buttonWithType:UIButtonTypeCustom];
  119. scan.frame=CGRectMake(searchView.frame.size.width-35,8,35,35);
  120. scan.contentHorizontalAlignment=UIControlContentHorizontalAlignmentRight;
  121. [scan setImage:[UIImage imageNamed:@"scan"] forState:UIControlStateNormal];
  122. [searchView addSubview:scan];
  123. [scan addTarget:self action:@selector(btnScanCilck) forControlEvents:UIControlEventTouchUpInside];
  124. _middleSeparatorView = [UIView new];
  125. _middleSeparatorView.frame=CGRectMake(0, CGRectGetMaxY(searchView.frame)+5, Screen_Width, 10);
  126. _middleSeparatorView.backgroundColor = LineBackgroundColor;
  127. [self.view addSubview:_middleSeparatorView];
  128. [self.view setBackgroundColor:[UIColor whiteColor]];
  129. CGFloat heightRow = 40;
  130. CGFloat lblx = 20;
  131. CGFloat lbly = 8;
  132. CGFloat lblwidth = 80;
  133. CGFloat lblheight = 25;
  134. _scrollView=[UIScrollView new];
  135. _scrollView.frame=CGRectMake(0, CGRectGetMaxY(_middleSeparatorView.frame), Screen_Width,self.view.frame.size.height-CGRectGetMaxY(_middleSeparatorView.frame));
  136. [self.view addSubview:_scrollView];
  137. UIView *vBody = [UIView new];
  138. [_scrollView addSubview:vBody];
  139. UITapGestureRecognizer* singleRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKey)];
  140. [self.view addGestureRecognizer:singleRecognizer];
  141. UIView *vOutStorageNo = [UIView new];
  142. vOutStorageNo.frame=CGRectMake(0,0, Screen_Width, heightRow);
  143. [vBody addSubview:vOutStorageNo];
  144. NSString *outStorageNoTitle=@"出库单号";
  145. UILabel *lblTitleOutStorageNo=[UILabel new];
  146. lblTitleOutStorageNo.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  147. lblTitleOutStorageNo.textColor = [UIColor blackColor];
  148. lblTitleOutStorageNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  149. [vOutStorageNo addSubview:lblTitleOutStorageNo];
  150. lblTitleOutStorageNo.text=outStorageNoTitle;
  151. _lblOutStorageNo = [UILabel new];
  152. _lblOutStorageNo.frame=CGRectMake(CGRectGetMaxX(lblTitleOutStorageNo.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleOutStorageNo.frame)-10, lblheight);
  153. _lblOutStorageNo.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  154. [vOutStorageNo addSubview:_lblOutStorageNo];
  155. UIView *outStorageNoSeparator=[UIView new];
  156. outStorageNoSeparator.backgroundColor=LineBackgroundColor;
  157. outStorageNoSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleOutStorageNo.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleOutStorageNo.frame),1);
  158. [vOutStorageNo addSubview:outStorageNoSeparator];
  159. UIView *vCustomerCode = [UIView new];
  160. vCustomerCode.frame=CGRectMake(0,CGRectGetMaxY(vOutStorageNo.frame), Screen_Width, heightRow);
  161. [vBody addSubview:vCustomerCode];
  162. NSString *customerCodeTitle=@"客户编码";
  163. UILabel *lblTitleCustomerCode=[UILabel new];
  164. lblTitleCustomerCode.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  165. lblTitleCustomerCode.textColor = [UIColor blackColor];
  166. lblTitleCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  167. [vCustomerCode addSubview:lblTitleCustomerCode];
  168. lblTitleCustomerCode.text=customerCodeTitle;
  169. _lblCustomerCode = [UILabel new];
  170. _lblCustomerCode.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleCustomerCode.frame)-10, lblheight);
  171. _lblCustomerCode.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  172. [vCustomerCode addSubview:_lblCustomerCode];
  173. UIView *customerCodeSeparator=[UIView new];
  174. customerCodeSeparator.backgroundColor=LineBackgroundColor;
  175. customerCodeSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerCode.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleCustomerCode.frame),1);
  176. [vCustomerCode addSubview:customerCodeSeparator];
  177. UIView *vCustomerName = [UIView new];
  178. vCustomerName.frame=CGRectMake(0,CGRectGetMaxY(vCustomerCode.frame), Screen_Width, heightRow);
  179. [vBody addSubview:vCustomerName];
  180. NSString *customerNameTitle=@"客户名称";
  181. UILabel *lblTitleCustomerName=[UILabel new];
  182. lblTitleCustomerName.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  183. lblTitleCustomerName.textColor = [UIColor blackColor];
  184. lblTitleCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  185. [vCustomerName addSubview:lblTitleCustomerName];
  186. lblTitleCustomerName.text=customerNameTitle;
  187. _lblCustomerName = [UILabel new];
  188. _lblCustomerName.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerName.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleCustomerName.frame)-10, lblheight);
  189. _lblCustomerName.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  190. [vCustomerName addSubview:_lblCustomerName];
  191. UIView *customerNameSeparator=[UIView new];
  192. customerNameSeparator.backgroundColor=LineBackgroundColor;
  193. customerNameSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleCustomerName.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleCustomerName.frame),1);
  194. [vCustomerName addSubview:customerNameSeparator];
  195. UIView *vTelephone = [UIView new];
  196. vTelephone.frame=CGRectMake(0,CGRectGetMaxY(vCustomerName.frame), Screen_Width, heightRow);
  197. [vBody addSubview:vTelephone];
  198. NSString *telephoneTitle=@"联系电话";
  199. UILabel *lblTitleTelephone=[UILabel new];
  200. lblTitleTelephone.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  201. lblTitleTelephone.textColor = [UIColor blackColor];
  202. lblTitleTelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  203. [vTelephone addSubview:lblTitleTelephone];
  204. lblTitleTelephone.text=telephoneTitle;
  205. _lblTelephone = [UILabel new];
  206. _lblTelephone.frame=CGRectMake(CGRectGetMaxX(lblTitleTelephone.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleTelephone.frame)-10, lblheight);
  207. _lblTelephone.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  208. [vTelephone addSubview:_lblTelephone];
  209. UIView *telephoneSeparator=[UIView new];
  210. telephoneSeparator.backgroundColor=LineBackgroundColor;
  211. telephoneSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleTelephone.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleTelephone.frame),1);
  212. [vTelephone addSubview:telephoneSeparator];
  213. UIView *vDriver = [UIView new];
  214. vDriver.frame=CGRectMake(0,CGRectGetMaxY(vTelephone.frame), Screen_Width, heightRow);
  215. [vBody addSubview:vDriver];
  216. NSString *driverTitle=@"运输司机";
  217. UILabel *lblTitleDriver=[UILabel new];
  218. lblTitleDriver.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  219. lblTitleDriver.textColor = [UIColor blackColor];
  220. lblTitleDriver.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  221. [vDriver addSubview:lblTitleDriver];
  222. lblTitleDriver.text=driverTitle;
  223. _lblDriver = [UILabel new];
  224. _lblDriver.frame=CGRectMake(CGRectGetMaxX(lblTitleDriver.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDriver.frame)-55, lblheight);
  225. _lblDriver.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  226. _lblDriver.text=@"请选择运输司机";
  227. _lblDriver.textColor=LabelGrayTextColor;
  228. _lblDriver.userInteractionEnabled=YES;
  229. UITapGestureRecognizer *driverTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goDriver:)];
  230. [_lblDriver addGestureRecognizer:driverTapGesture];
  231. [vDriver addSubview:_lblDriver];
  232. UIButton *btnDriverRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
  233. btnDriverRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
  234. UIImageView *rightArrowImg = [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
  235. [rightArrowImg setImage:[UIImage imageNamed:@"rightarrow"]];
  236. [ btnDriverRightArrow addSubview:rightArrowImg];
  237. rightArrowImg.userInteractionEnabled=NO;
  238. [vDriver addSubview:btnDriverRightArrow];
  239. UIView *driverSeparator=[UIView new];
  240. driverSeparator.backgroundColor=LineBackgroundColor;
  241. driverSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleDriver.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleDriver.frame),1);
  242. [vDriver addSubview:driverSeparator];
  243. UIView *vDocker = [UIView new];
  244. vDocker.frame=CGRectMake(0,CGRectGetMaxY(vDriver.frame), Screen_Width, heightRow);
  245. [vBody addSubview:vDocker];
  246. NSString *dockerTitle=@"装卸工人";
  247. UILabel *lblTitleDocker=[UILabel new];
  248. lblTitleDocker.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  249. lblTitleDocker.textColor = [UIColor blackColor];
  250. lblTitleDocker.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  251. [vDocker addSubview:lblTitleDocker];
  252. lblTitleDocker.text=dockerTitle;
  253. _lblDocker = [UILabel new];
  254. _lblDocker.frame=CGRectMake(CGRectGetMaxX(lblTitleDocker.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDocker.frame)-55, lblheight);
  255. _lblDocker.textColor=LabelGrayTextColor;
  256. _lblDocker.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  257. _lblDocker.text=@"请选择装卸工人";
  258. _lblDocker.userInteractionEnabled=YES;
  259. UITapGestureRecognizer *dockerTapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(goDocker:)];
  260. [_lblDocker addGestureRecognizer:dockerTapGesture];
  261. [vDocker addSubview:_lblDocker];
  262. UIButton *btnDockerRightArrow = [UIButton buttonWithType:UIButtonTypeCustom];
  263. btnDockerRightArrow.frame=CGRectMake(Screen_Width-50,lbly,32,30);
  264. UIImageView *rightArrowImg1 = [[UIImageView alloc]initWithFrame:CGRectMake(25,9,7, 12)];
  265. [rightArrowImg1 setImage:[UIImage imageNamed:@"rightarrow"]];
  266. [ btnDockerRightArrow addSubview:rightArrowImg1];
  267. rightArrowImg1.userInteractionEnabled=NO;
  268. [vDocker addSubview:btnDockerRightArrow];
  269. UIView *dockerSeparator=[UIView new];
  270. dockerSeparator.backgroundColor=LineBackgroundColor;
  271. dockerSeparator.frame=CGRectMake(CGRectGetMaxX(lblTitleDocker.frame),heightRow,Screen_Width-CGRectGetMaxX(lblTitleDocker.frame),1);
  272. [vDocker addSubview:dockerSeparator];
  273. UIView *vCustomerAddress = [UIView new];
  274. vCustomerAddress.frame=CGRectMake(0,CGRectGetMaxY(vDocker.frame), Screen_Width, heightRow);
  275. [vBody addSubview:vCustomerAddress];
  276. NSString *customerAddressTitle=@"客户地址";
  277. UILabel *lblCustomerAddressTitle=[UILabel new];
  278. lblCustomerAddressTitle.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  279. lblCustomerAddressTitle.textColor = [UIColor blackColor];
  280. lblCustomerAddressTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  281. [vCustomerAddress addSubview:lblCustomerAddressTitle];
  282. lblCustomerAddressTitle.text=customerAddressTitle;
  283. _lblCustomerAddress = [UILabel new];
  284. _lblCustomerAddress.frame=CGRectMake(CGRectGetMaxX(lblTitleDocker.frame), lbly,Screen_Width-CGRectGetMaxX(lblTitleDocker.frame)-55, lblheight);
  285. _lblCustomerAddress.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  286. [vCustomerAddress addSubview:_lblCustomerAddress];
  287. UIView *customerAddressSeparator=[UIView new];
  288. customerAddressSeparator.backgroundColor=LineBackgroundColor;
  289. customerAddressSeparator.frame=CGRectMake(CGRectGetMaxX(lblCustomerAddressTitle.frame),heightRow,Screen_Width-CGRectGetMaxX(lblCustomerAddressTitle.frame),1);
  290. [vCustomerAddress addSubview:customerAddressSeparator];
  291. UIView *vRemarks = [UIView new];
  292. vRemarks.frame=CGRectMake(0,CGRectGetMaxY(vCustomerAddress.frame), Screen_Width, heightRow);
  293. [vBody addSubview:vRemarks];
  294. NSString *remarksTitle=@"备 注";
  295. UILabel *lblRemarksTitle=[UILabel new];
  296. lblRemarksTitle.frame=CGRectMake(lblx,lbly,lblwidth,lblheight);
  297. lblRemarksTitle.textColor = [UIColor blackColor];
  298. lblRemarksTitle.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  299. [vRemarks addSubview:lblRemarksTitle];
  300. lblRemarksTitle.text=remarksTitle;
  301. _txtRemarks = [UITextField new];
  302. _txtRemarks.frame=CGRectMake(CGRectGetMaxX(lblRemarksTitle.frame), lbly,Screen_Width-CGRectGetMaxX(lblRemarksTitle.frame)-10, lblheight);
  303. _txtRemarks.placeholder=@"请输入备注";
  304. _txtRemarks.delegate=self;
  305. _txtRemarks.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize];
  306. [vRemarks addSubview:_txtRemarks];
  307. UIView *remarksSeparator=[UIView new];
  308. remarksSeparator.backgroundColor=LineBackgroundColor;
  309. remarksSeparator.frame=CGRectMake(CGRectGetMaxX(lblRemarksTitle.frame),heightRow,Screen_Width-CGRectGetMaxX(lblRemarksTitle.frame),1);
  310. [vRemarks addSubview:remarksSeparator];
  311. vBody.frame=CGRectMake(0,0, Screen_Width,CGRectGetMaxY(vRemarks.frame));
  312. _scrollView.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(vBody.frame)+rectStatusHeight+rectNavHeight);
  313. originalAchievementFrame=_scrollView.frame;
  314. }
  315. /**
  316. 扫描回调函数
  317. @param code <#code description#>
  318. */
  319. -(void)reloadDataWithOnlyCode:(NSString *)code
  320. {
  321. _salesNo=code;
  322. SalesSlipSearchListVC *searchVc=[[SalesSlipSearchListVC alloc] init];
  323. searchVc.salesNo=_salesNo;
  324. searchVc.salesSlipDelegate=self;
  325. [self.listNavVc pushViewController:searchVc animated:YES];
  326. }
  327. /**
  328. 抽屉初始化
  329. */
  330. - (void)initSlideSlip{
  331. // 抽屉对象
  332. __weak typeof(self) weakself=self;
  333. self.filterController = [[SideSlipFilterController alloc]
  334. initWithSponsor:self
  335. resetBlock:^(NSArray *dataList) {
  336. for (SideSlipModel *model in dataList) {
  337. model.selectedItemList = nil;
  338. model.customDict = nil;
  339. }
  340. } commitBlock:^(NSArray *dataList) {
  341. // 查询条件
  342. SideSlipModel *serviceRegionModel = dataList[0];
  343. SalesSlipSearchModel *m = [serviceRegionModel.customDict objectForKey:SALES_SLIP_SEARCH_RANGE_MODEL];
  344. _salesNo= m.SalesNo;
  345. _customerName=m.customerName;
  346. if([m.startDate isEqualToString:@"请选择开始账务日期"]){
  347. _startDate=@"";
  348. }
  349. else{
  350. _startDate=m.startDate;
  351. }
  352. if([m.endDate isEqualToString:@"请选择结束账务日期"]){
  353. _endDate=@"";
  354. }
  355. else{
  356. _endDate=m.endDate;
  357. }
  358. _goodsCode=m.goodsCode;
  359. _customerCode=m.customerCode;
  360. _address = m.customerAddress;
  361. _invoiceStatus=m.invoiceStatus;
  362. [weakself.filterController dismiss];
  363. SalesSlipSearchListVC *searchVc=[[SalesSlipSearchListVC alloc] init];
  364. searchVc.salesNo=_salesNo;
  365. searchVc.customerName=_customerName;
  366. searchVc.customerCode=_customerCode;
  367. searchVc.address=_address;
  368. searchVc.startDate=_startDate;
  369. searchVc.endDate=_endDate;
  370. searchVc.goodsCode=_goodsCode;
  371. searchVc.invoiceStatus=_invoiceStatus;
  372. searchVc.salesSlipDelegate=self;
  373. searchVc.goodsDetailVc=_goodsDetailVc;
  374. [self.listNavVc pushViewController:searchVc animated:YES];
  375. }];
  376. _filterController.animationDuration = AnimationDuration;
  377. _filterController.hasHeadView = YES;
  378. _filterController.sideSlipLeading = UIScreenSideSlipLeading*[UIScreen mainScreen].bounds.size.width;
  379. _filterController.dataList = [self packageDataList];
  380. }
  381. /**
  382. 隐藏键盘
  383. */
  384. -(void)hideKey{
  385. [self.view endEditing:YES];
  386. }
  387. /**
  388. 键盘弹出函数
  389. @param notification <#notification description#>
  390. */
  391. -(void)keyboardWillShow:(NSNotification*)notification
  392. {
  393. // 获得键盘尺寸
  394. NSDictionary *info = notification.userInfo;
  395. NSValue *aValue = [info objectForKeyedSubscript:UIKeyboardFrameEndUserInfoKey];
  396. CGSize keyboardSize = [aValue CGRectValue].size;
  397. if(!_keyboardShow){
  398. // //重新定义ScrollView的尺寸
  399. CGRect viewFrame = _scrollView.frame;
  400. viewFrame.size.height -=(keyboardSize.height); //原来的尺寸减去键盘的高度
  401. viewFrame.size.height-=130;
  402. _scrollView.frame = viewFrame;
  403. //获取当前文本框架大小
  404. CGRect textFieldRect = [_selectedAchievementField frame];
  405. //滚动到当前文本框
  406. [_scrollView scrollRectToVisible:textFieldRect animated:YES];
  407. }
  408. _keyboardShow=YES;
  409. }
  410. /**
  411. 键盘隐藏函数
  412. @param aNotification <#aNotification description#>
  413. */
  414. - (void)keyboardWillHide:(NSNotification *)aNotification
  415. {
  416. if(_keyboardShow){
  417. _scrollView.frame=originalAchievementFrame;
  418. }
  419. _keyboardShow=NO;
  420. }
  421. /**
  422. 数据源
  423. @return <#return value description#>
  424. */
  425. - (NSArray *)packageDataList {
  426. NSMutableArray *dataArray = [NSMutableArray array];
  427. SideSlipModel *model = [[SideSlipModel alloc] init];
  428. model.containerCellClass = @"SalesOutStorageSalesSlipSearchCell";
  429. model.regionTitle = @"查询条件";
  430. [dataArray addObject:model];
  431. return [dataArray mutableCopy];
  432. }
  433. /**
  434. 跳转到司机页面
  435. @param gesture <#gesture description#>
  436. */
  437. - (void)goDriver:(UITapGestureRecognizer *)gesture {
  438. CustomerReportTextVC *tc=[[CustomerReportTextVC alloc] init];
  439. tc.delegate=self;
  440. tc.dataSourceCode=@"T_MST_Driver";
  441. tc.showDialogViewTag=ReportDriver;
  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. [self.listNavVc pushViewController:tc animated:YES];
  454. }
  455. /**
  456. 打开抽屉
  457. */
  458. -(void)goodsSearch{
  459. [_filterController showPagerView:self.listNavVc];
  460. }
  461. /**
  462. 扫描点击事件
  463. */
  464. -(void)btnScanCilck{
  465. ScanViewController *scanVc=[[ScanViewController alloc]init];
  466. scanVc.rootVC=self;
  467. [self.listNavVc pushViewController:scanVc animated:YES];
  468. }
  469. @end