NewDispatchRequirementGoodsDetailController.m 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  1. //
  2. // NewDispatchRequirementGoodsDetailController.m
  3. // IBOSS-HJ
  4. //
  5. // Created by 关宏厚 on 2021/1/28.
  6. // Copyright © 2021 elongtian. All rights reserved.
  7. //
  8. #import "NewDispatchRequirementGoodsDetailController.h"
  9. #import "NewDeliveryRequirementModel.h"
  10. @interface NewDispatchRequirementGoodsDetailController ()
  11. {
  12. UIScrollView *scroll;
  13. UIView *contentView;
  14. UIButton *btnDateArrow;
  15. UILabel *lblTxtVNextDeliveryDate;
  16. UILabel *lblTitleDeliveryAddress;
  17. UIView *line;
  18. UIView *headerView;
  19. NSIndexPath *_myRow;
  20. NewDispatchRequirementCell *_myCell;
  21. }
  22. @end
  23. @implementation NewDispatchRequirementGoodsDetailController
  24. @synthesize keyboardShow;
  25. - (void)viewDidLoad {
  26. [super viewDidLoad];
  27. _dataList=[[NSMutableArray alloc]init];
  28. [self initUI];
  29. }
  30. -(void)loadData
  31. {
  32. double delayInSeconds = 0.5;
  33. dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
  34. dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
  35. [self loadDataSource];
  36. });
  37. }
  38. /**
  39. 键盘隐藏回调函数
  40. @param cell <#cell description#>
  41. */
  42. - (void)keyboardWillHide:(NewDispatchRequirementCell *)cell{
  43. if (cell.cellIndex == _dataList.count - 1) {
  44. [self keyboardWillHide];
  45. }
  46. }
  47. /**
  48. 键盘弹出回调函数
  49. @param cell <#cell description#>
  50. */
  51. - (void)keyboardWillShow:(NewDispatchRequirementCell *)cell{
  52. if (cell.cellIndex == _dataList.count - 1) {
  53. [self myKeyboardWillShow];
  54. }
  55. }
  56. -(void)loadDataSource
  57. {
  58. [self startLoading];
  59. NSString *urlStr = ServerURL;
  60. NSMutableDictionary *dict = [NSMutableDictionary new];
  61. [dict setObject:@"GetInstallationDemandDetailForReceiptIphone" forKey:@"Action"];
  62. [dict setObject:kkAccountCode forKey:@"AccountCode"];
  63. [dict setObject:kkUserCode forKey:@"UserCode"];
  64. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  65. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  66. [dict setObject:_noReceiptModel.collectDetailId forKey:@"CollectDetailID"];
  67. self.mDownManager = [[ASIDownManager alloc] init];
  68. self.mDownManager.delegate=self;
  69. self.mDownManager.onRequestSuccess=@selector(onLoadFinish:);
  70. self.mDownManager.onRequestFail=@selector(onLoadFail:);
  71. [_mDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  72. }
  73. /**
  74. 单据数据加载完成函数
  75. @param sender <#sender description#>
  76. */
  77. - (void)onLoadFinish:(ASIDownManager *)sender {
  78. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  79. [self stopLoading];
  80. int iStatus =resultModel.status;
  81. NSString *message = resultModel.message;
  82. if (iStatus == 0) {
  83. NSArray * infoArr;
  84. _sReceiptType= @"1";
  85. _receiptFlag=@"1";
  86. infoArr=(NSArray*)resultModel.result;
  87. if(infoArr != nil){
  88. for (int i = 0; i < infoArr.count; i++) {
  89. NSDictionary *info = infoArr[i];
  90. NewDispatchRequirementModel *mod = [NewDispatchRequirementModel dk_modelWithDictionary:info];
  91. [_dataList addObject:mod];
  92. }
  93. }
  94. if([_noReceiptModel.requirementType intValue]==1)
  95. {
  96. _receiptFlag=@"1";
  97. _btnDeliveryType.userInteractionEnabled=YES;
  98. _btnInstallType.userInteractionEnabled=NO;
  99. _btnDeliveryInstallType.userInteractionEnabled=NO;
  100. [_btnDeliveryType selected];
  101. for(int i=0;i<_dataList.count;i++)
  102. {
  103. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  104. datamodel.receiptType=@"1";
  105. datamodel.receiptTypeName=@"完成";
  106. datamodel.installReceiptType=@"0";
  107. datamodel.installReceiptTypeName=@"";
  108. if([datamodel.circulateType intValue] == 1){
  109. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.0f",datamodel.maxReceiptQuantity];
  110. }
  111. else{
  112. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.6f",datamodel.maxReceiptQuantity];
  113. datamodel.installReceiptQuantity=@"0";
  114. }
  115. }
  116. }
  117. if([_noReceiptModel.requirementType intValue]==2)
  118. {
  119. _receiptFlag=@"2";
  120. _btnDeliveryType.userInteractionEnabled=NO;
  121. _btnInstallType.userInteractionEnabled=YES;
  122. [_btnInstallType selected];
  123. _btnDeliveryInstallType.userInteractionEnabled=NO;
  124. for(int i=0;i<_dataList.count;i++)
  125. {
  126. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  127. datamodel.installReceiptType=@"1";
  128. datamodel.installReceiptTypeName=@"完成";
  129. datamodel.receiptType=@"0";
  130. datamodel.receiptTypeName=@"";
  131. datamodel.installReceiptQuantity=datamodel.maxInstallReceiptQuantity;
  132. datamodel.receiptQuantity=@"0";
  133. }
  134. }
  135. if([_noReceiptModel.requirementType intValue]==3)
  136. {
  137. if([_noReceiptModel.deliveryReceiptFlag intValue]==0&&[_noReceiptModel.installReceiptFlag intValue]==0)
  138. {
  139. _receiptFlag=@"3";
  140. _btnDeliveryType.userInteractionEnabled=YES;
  141. [_btnDeliveryInstallType selected];
  142. _btnInstallType.userInteractionEnabled=NO;
  143. _btnDeliveryInstallType.userInteractionEnabled=YES;
  144. for(int i=0;i<_dataList.count;i++)
  145. {
  146. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  147. datamodel.installReceiptType=@"1";
  148. datamodel.installReceiptTypeName=@"完成";
  149. datamodel.receiptType=@"1";
  150. datamodel.receiptTypeName=@"完成";
  151. datamodel.installReceiptQuantity=datamodel.maxInstallReceiptQuantity;
  152. if([datamodel.circulateType intValue] == 1){
  153. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.0f",datamodel.maxReceiptQuantity];
  154. }
  155. else{
  156. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.6f",datamodel.maxReceiptQuantity];
  157. }
  158. }
  159. }
  160. if([_noReceiptModel.deliveryReceiptFlag intValue]==1&&[_noReceiptModel.installReceiptFlag intValue]==0)
  161. {
  162. [_btnInstallType selected];
  163. _btnInstallType.userInteractionEnabled=YES;
  164. _btnDeliveryType.userInteractionEnabled=NO;
  165. _btnDeliveryInstallType.userInteractionEnabled=NO;
  166. for(int i=0;i<_dataList.count;i++)
  167. {
  168. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  169. datamodel.installReceiptType=@"1";
  170. datamodel.installReceiptTypeName=@"完成";
  171. datamodel.receiptType=@"0";
  172. datamodel.receiptTypeName=@"";
  173. datamodel.installReceiptQuantity=datamodel.maxInstallReceiptQuantity;
  174. datamodel.receiptQuantity=@"0";
  175. }
  176. }
  177. }
  178. self.myTableView.frame=CGRectMake(0,0, self.view.bounds.size.width, [self getDataViewHeight:_dataList]+headerView.bounds.size.height) ;
  179. [self.myTableView reloadData];
  180. contentView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetMaxY(self.myTableView.frame));
  181. scroll.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(contentView.frame)+rectStatusHeight+rectNavHeight+200);
  182. }
  183. else if(iStatus == ActionResultStatusAuthError
  184. ||iStatus == ActionResultStatusNoLogin
  185. ||iStatus == ActionResultStatusLogined||iStatus==ActionResultSessionOverdue){
  186. [self showReLoginDialog:message];
  187. return;
  188. }
  189. else {
  190. [self showAlertViewText:message];
  191. }
  192. }
  193. /**
  194. 数据加载失败函数
  195. @param sender <#sender description#>
  196. */
  197. - (void)onLoadFail:(ASIDownManager *)sender {
  198. [self stopLoading];
  199. [self showAlertViewText:@"网络异常"];
  200. }
  201. /**
  202. 获取table view的高度
  203. @param soundArray <#soundArray description#>
  204. @return <#return value description#>
  205. */
  206. - (CGFloat)getDataViewHeight:(NSArray *)dataArray {
  207. // 上下间隔已经在frame上做了
  208. NSInteger row = dataArray.count;
  209. return (row *288);
  210. }
  211. ///**
  212. // 键盘弹出函数
  213. // */
  214. //- (void)myKeyboardWillShow {
  215. // if(!_keyboardShow){
  216. //
  217. // [UIView animateWithDuration:0.3f animations:^ {
  218. // self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y - 190, self.view.frame.size.width, self.view.frame.size.height);
  219. //
  220. // }];
  221. // }
  222. //
  223. // _keyboardShow=YES;
  224. //
  225. //}
  226. //
  227. ///**
  228. // 键盘隐藏函数
  229. // */
  230. //- (void)keyboardWillHide {
  231. // // Animate the current view back to its original position
  232. // if(_keyboardShow){
  233. // [UIView animateWithDuration:0.0f animations:^ {
  234. // self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y + 190, self.view.frame.size.width, self.view.frame.size.height);
  235. //
  236. // }];}
  237. // _keyboardShow=NO;
  238. //}
  239. -(void)initUI
  240. {
  241. scroll = [UIScrollView new];
  242. scroll.delegate = self;
  243. scroll.frame=self.view.bounds;
  244. scroll.tag=1000;
  245. [self.view addSubview:scroll];
  246. if(Screen_Height2 <= 480){
  247. scroll.contentSize=CGSizeMake(self.view.frame.size.width, self.view.frame.size.height + 80);
  248. }
  249. int topMargin=10;
  250. int leftMargin=20;
  251. int titleWidth=70;
  252. int titleHeight=25;
  253. contentView = [[UIView alloc]init];
  254. contentView.frame=CGRectZero;
  255. contentView.backgroundColor = [UIColor whiteColor];
  256. UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(keyboardHide:)];
  257. //设置成NO表示当前控件响应后会传播到其他控件上,默认为YES。
  258. tapGestureRecognizer.cancelsTouchesInView = NO;
  259. // //将触摸事件添加到当前view
  260. [scroll addGestureRecognizer:tapGestureRecognizer];
  261. [scroll addSubview:contentView];
  262. headerView = [[UIView alloc]init];
  263. headerView.frame = CGRectZero;
  264. // headerView.backgroundColor = [UIColor whiteColor];
  265. //联系电话
  266. UILabel *lblTitleTelephone = [[UILabel alloc] initWithFrame:CGRectMake(leftMargin,topMargin,titleWidth, 25)];
  267. lblTitleTelephone.font = kTextFont;
  268. lblTitleTelephone.text = @"联系电话:";
  269. [headerView addSubview: lblTitleTelephone];
  270. _lblTelephone=[UILabel new];
  271. _lblTelephone.font=kTextFont;
  272. _lblTelephone.frame=CGRectMake(CGRectGetMaxX(lblTitleTelephone.frame), topMargin,Screen_Width-CGRectGetMaxX(lblTitleTelephone.frame),25);
  273. [headerView addSubview: _lblTelephone];
  274. lblTitleDeliveryAddress= [[UILabel alloc] initWithFrame:CGRectMake(leftMargin,CGRectGetMaxY(lblTitleTelephone.frame)+topMargin,titleWidth,titleHeight)];
  275. lblTitleDeliveryAddress.font = kTextFont;
  276. lblTitleDeliveryAddress.text = @"送货地址:";
  277. [headerView addSubview: lblTitleDeliveryAddress];
  278. _lbDeliveryAddress = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(lblTitleDeliveryAddress.frame), CGRectGetMaxY(lblTitleTelephone.frame)+topMargin, Screen_Width-CGRectGetMaxX(lblTitleDeliveryAddress.frame),titleHeight)];
  279. _lbDeliveryAddress.font = kTextFont;
  280. [headerView addSubview: _lbDeliveryAddress];
  281. _lbDeliveryAddress = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(lblTitleDeliveryAddress.frame), CGRectGetMaxY(lblTitleTelephone.frame)+topMargin, Screen_Width-CGRectGetMaxX(lblTitleDeliveryAddress.frame),titleHeight)];
  282. _lbDeliveryAddress.font = kTextFont;
  283. [headerView addSubview: _lbDeliveryAddress];
  284. _lblTitlePlateNumber= [[UILabel alloc] initWithFrame:CGRectMake(leftMargin,CGRectGetMaxY(lblTitleDeliveryAddress.frame)+topMargin,titleWidth,titleHeight)];
  285. _lblTitlePlateNumber.font = kTextFont;
  286. _lblTitlePlateNumber.text = @"车 牌 号:";
  287. [headerView addSubview: _lblTitlePlateNumber];
  288. _txtPlateNumber=[UITextField new];
  289. _txtPlateNumber.frame=CGRectMake(CGRectGetMaxX(_lblTitlePlateNumber.frame), CGRectGetMaxY(lblTitleDeliveryAddress.frame)+topMargin, Screen_Width-CGRectGetMaxX(_lblTitlePlateNumber.frame), titleHeight);
  290. _txtPlateNumber.delegate=self;
  291. _txtPlateNumber.font = kTextFont;
  292. _txtPlateNumber.placeholder=@"请输入车牌号";
  293. [headerView addSubview: _txtPlateNumber];
  294. lblTxtVNextDeliveryDate= [UILabel new];
  295. lblTxtVNextDeliveryDate.frame = CGRectMake(20, CGRectGetMaxY(_lblTitlePlateNumber.frame)+10, 70, 25);
  296. lblTxtVNextDeliveryDate.text = @"推迟日期:";
  297. lblTxtVNextDeliveryDate.font = kTextFont;
  298. [headerView addSubview:lblTxtVNextDeliveryDate];
  299. _btnNextDeliveryDate = [UIButton buttonWithType:UIButtonTypeCustom];
  300. _btnNextDeliveryDate.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
  301. _btnNextDeliveryDate.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
  302. _btnNextDeliveryDate.frame = CGRectMake(CGRectGetMaxX(lblTxtVNextDeliveryDate.frame), CGRectGetMaxY(_lblTitlePlateNumber.frame)+10, Screen_Width - CGRectGetMaxX(lblTxtVNextDeliveryDate.frame) - 30, 25);
  303. _btnNextDeliveryDate.titleLabel.font = kTextFont;
  304. [_btnNextDeliveryDate setTitle:@"请选择推迟日期" forState:UIControlStateNormal];
  305. [_btnNextDeliveryDate setTitleColor:[UIColor colorWithWhite:0.5 alpha:0.5] forState:UIControlStateNormal];
  306. [_btnNextDeliveryDate addTarget:self action:@selector(showNextDeliveryDate) forControlEvents:UIControlEventTouchUpInside];
  307. [headerView addSubview:_btnNextDeliveryDate];
  308. btnDateArrow= [UIButton buttonWithType:UIButtonTypeCustom];
  309. btnDateArrow.frame = CGRectMake(Screen_Width-17,CGRectGetMaxY(_lblTitlePlateNumber.frame)+15,7,12);
  310. [ btnDateArrow setImage:[UIImage imageNamed:@"rightarrow"] forState:UIControlStateNormal];
  311. [btnDateArrow addTarget:self action:@selector(clearDate) forControlEvents:UIControlEventTouchUpInside];
  312. [headerView addSubview:btnDateArrow];
  313. UILabel *lblTitleDispatchType = [UILabel new];
  314. lblTitleDispatchType.frame = CGRectMake(leftMargin,CGRectGetMaxY(lblTxtVNextDeliveryDate.frame)+topMargin,titleWidth,titleHeight);
  315. lblTitleDispatchType.text = @"派工类型:";
  316. lblTitleDispatchType.font = kTextFont;
  317. [headerView addSubview:lblTitleDispatchType];
  318. _btnDeliveryType= [[MHRadioButton alloc]initWithGroupId:@"group1" atIndex:0];
  319. _btnInstallType=[[MHRadioButton alloc]initWithGroupId:@"group1" atIndex:1];
  320. _btnDeliveryInstallType=[[MHRadioButton alloc]initWithGroupId:@"group1" atIndex:2];
  321. _btnDeliveryType.frame=CGRectMake(CGRectGetMaxX(lblTitleDispatchType.frame),CGRectGetMaxY(lblTxtVNextDeliveryDate.frame)+10, 25, 25);
  322. [headerView addSubview:_btnDeliveryType];
  323. UILabel *deliveryLabel =[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnDeliveryType.frame)+5, CGRectGetMaxY(lblTxtVNextDeliveryDate.frame)+10, 40, 25)];
  324. deliveryLabel.backgroundColor = [UIColor clearColor];
  325. deliveryLabel.text = @"配送";
  326. deliveryLabel.font = kTextFont;
  327. [headerView addSubview:deliveryLabel];
  328. _btnInstallType.frame=CGRectMake(CGRectGetMaxX(deliveryLabel.frame),CGRectGetMaxY(lblTxtVNextDeliveryDate.frame)+topMargin, 25, 25);
  329. [headerView addSubview:_btnInstallType];
  330. UILabel *installLabel =[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnInstallType.frame)+5, CGRectGetMaxY(lblTxtVNextDeliveryDate.frame)+10, 40, 25)];
  331. installLabel.backgroundColor = [UIColor clearColor];
  332. installLabel.text = @"安装";
  333. installLabel.font = kTextFont;
  334. [headerView addSubview:installLabel];
  335. _btnDeliveryInstallType.frame=CGRectMake(CGRectGetMaxX(installLabel.frame),CGRectGetMaxY(lblTxtVNextDeliveryDate.frame)+topMargin, 25, 25);
  336. [headerView addSubview:_btnDeliveryInstallType];
  337. UILabel *deliveryInstallLabel =[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnDeliveryInstallType.frame)+5, CGRectGetMaxY(lblTxtVNextDeliveryDate.frame)+10, 70, 25)];
  338. deliveryInstallLabel.backgroundColor = [UIColor clearColor];
  339. deliveryInstallLabel.text = @"送安一体";
  340. deliveryInstallLabel.font = kTextFont;
  341. [headerView addSubview:deliveryInstallLabel];
  342. [MHRadioButton addObserver:self forFroupId:@"group1"];
  343. //分割线
  344. line = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_btnDeliveryType.frame)+10, Screen_Width, 3)];
  345. line.backgroundColor = LineBackgroundColor;
  346. [headerView addSubview:line];
  347. self.myTableView = [[UITableView alloc]init];
  348. self.myTableView.dataSource = self;
  349. self.myTableView.delegate = self;
  350. self.myTableView.scrollEnabled = NO;
  351. self.myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  352. self.myTableView.frame =self.view.bounds ;
  353. [contentView addSubview:self.myTableView];
  354. headerView.frame = CGRectMake(0,0,_myTableView.bounds.size.width,CGRectGetMaxY(line.frame)+10);
  355. _myTableView.tableHeaderView = headerView;
  356. contentView.frame=CGRectMake(0, 0, Screen_Width, CGRectGetMaxY(self.myTableView.frame));
  357. scroll.contentSize = CGSizeMake(self.view.frame.size.width, CGRectGetMaxY(contentView.frame)+rectStatusHeight+rectNavHeight+120);
  358. }
  359. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
  360. //用来判断是否可以继续输入, - range.length是为了判断是否可以删除
  361. NSInteger currentLength = textField.text.length - range.length + string.length;
  362. if (currentLength > 7) {
  363. return NO;
  364. }
  365. return YES;
  366. }
  367. -(void)clearDate
  368. {
  369. btnDateArrow.frame = CGRectMake(Screen_Width-17,CGRectGetMaxY(_lblTitlePlateNumber.frame)+10,7,12);
  370. [ btnDateArrow setImage:[UIImage imageNamed:@"rightarrow"] forState:UIControlStateNormal];
  371. [_btnNextDeliveryDate setTitle:@"请选择推迟日期" forState:UIControlStateNormal];
  372. _sNextDeliveryDate=@"";
  373. _sReceiptType=@"1";
  374. if([_receiptFlag intValue]==1)
  375. {
  376. for(int i=0;i<_dataList.count;i++)
  377. {
  378. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  379. datamodel.receiptType=@"1";
  380. datamodel.receiptTypeName=@"完成";
  381. datamodel.installReceiptType=@"0";
  382. datamodel.installReceiptTypeName=@"";
  383. if([datamodel.circulateType intValue] == 1){
  384. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.0f",datamodel.maxReceiptQuantity];
  385. }
  386. else{
  387. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.6f",datamodel.maxReceiptQuantity];
  388. }
  389. datamodel.installReceiptQuantity=@"0";
  390. }
  391. }
  392. if([_receiptFlag intValue]==2)
  393. {
  394. for(int i=0;i<_dataList.count;i++)
  395. {
  396. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  397. datamodel.installReceiptType=@"1";
  398. datamodel.installReceiptTypeName=@"完成";
  399. datamodel.receiptType=@"0";
  400. datamodel.receiptTypeName=@"";
  401. datamodel.installReceiptQuantity=datamodel.maxInstallReceiptQuantity;
  402. datamodel.receiptQuantity=@"0";
  403. }
  404. }
  405. if([_receiptFlag intValue]==3)
  406. {
  407. for(int i=0;i<_dataList.count;i++)
  408. {
  409. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  410. datamodel.installReceiptType=@"1";
  411. datamodel.installReceiptTypeName=@"完成";
  412. datamodel.receiptType=@"1";
  413. datamodel.receiptTypeName=@"完成";
  414. datamodel.installReceiptQuantity=datamodel.maxInstallReceiptQuantity;
  415. if([datamodel.circulateType intValue] == 1){
  416. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.0f",datamodel.maxReceiptQuantity];
  417. }
  418. else{
  419. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.6f",datamodel.maxReceiptQuantity];
  420. }
  421. }
  422. }
  423. [_myTableView reloadData];
  424. }
  425. /**
  426. 文本值变化回调函数
  427. @param cell <#cell description#>
  428. @param txtfield <#txtfield description#>
  429. @param qualityTxt <#qualityTxt description#>
  430. @param remark <#remark description#>
  431. */
  432. - (void)textValueChange:(NewDispatchRequirementCell *)cell txtField:(UITextField *)txtfield qualityField:(UITextField *)qualityTxt remarkField:(UITextField *)remark{
  433. NewDispatchRequirementModel *model = [_dataList objectAtIndex: cell.cellIndex];
  434. if(txtfield.tag == 1000){
  435. model.receiptQuantity = txtfield.text;
  436. }
  437. if(txtfield.tag == 1001){
  438. model.receiptRemarks = txtfield.text;
  439. }
  440. if(txtfield.tag == 2000){
  441. model.installReceiptQuantity = txtfield.text;
  442. }
  443. }
  444. /**
  445. 出示推迟日期函数
  446. @return <#return value description#>
  447. */
  448. - (void)showNextDeliveryDate{
  449. [self.view endEditing:YES];
  450. __weak typeof(self)weakself = self;
  451. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  452. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  453. _sNextDeliveryDate = date;
  454. } andCompletionBlock:^(void){
  455. [weakself.btnNextDeliveryDate setTitle:_sNextDeliveryDate forState:UIControlStateNormal];
  456. [weakself.btnNextDeliveryDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  457. _sReceiptType=@"2";
  458. btnDateArrow.frame = CGRectMake(Screen_Width-30,CGRectGetMaxY(_lblTitlePlateNumber.frame)+10,25,25);
  459. [ btnDateArrow setImage:[UIImage imageNamed:@"clear.png"] forState:UIControlStateNormal];
  460. for(int i=0;i<_dataList.count;i++)
  461. {
  462. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  463. if([_receiptFlag intValue]==1)
  464. {
  465. datamodel.installReceiptType=@"0";
  466. datamodel.installReceiptTypeName=@"";
  467. datamodel.receiptType=@"2";
  468. datamodel.receiptTypeName=@"再送";
  469. datamodel.installReceiptQuantity=@"0";
  470. datamodel.receiptQuantity=@"0";
  471. }
  472. if([_receiptFlag intValue]==2)
  473. {
  474. datamodel.installReceiptType=@"5";
  475. datamodel.installReceiptTypeName=@"再安装";
  476. datamodel.receiptType=@"0";
  477. datamodel.receiptTypeName=@"";
  478. datamodel.installReceiptQuantity=@"0";
  479. datamodel.receiptQuantity=@"0";
  480. }
  481. if([_receiptFlag intValue]==3)
  482. {
  483. datamodel.installReceiptType=@"5";
  484. datamodel.installReceiptTypeName=@"再安装";
  485. datamodel.receiptType=@"2";
  486. datamodel.receiptTypeName=@"再送";
  487. datamodel.installReceiptQuantity=@"0";
  488. datamodel.receiptQuantity=@"0";
  489. }
  490. }
  491. [_myTableView reloadData];
  492. } andCancelBlock:^(void){
  493. _sNextDeliveryDate = weakself.btnNextDeliveryDate.titleLabel.text;
  494. if([_sNextDeliveryDate isEqualToString:@"请选择推迟日期"]){
  495. _sNextDeliveryDate = @"";
  496. }
  497. _sReceiptType=@"1";
  498. for(int i=0;i<_dataList.count;i++)
  499. {
  500. NewDispatchRequirementModel *model = [_dataList objectAtIndex:i];
  501. model.receiptType = @"1";
  502. model.receiptTypeName=@"完成";
  503. if([model.circulateType intValue] == 1){
  504. model.receiptQuantity = [NSString stringWithFormat:@"%.0f",model.maxReceiptQuantity];
  505. }
  506. else{
  507. model.receiptQuantity = [NSString stringWithFormat:@"%.6f",model.maxReceiptQuantity];
  508. }
  509. model.installReceiptType=@"1";
  510. model.installReceiptTypeName=@"完成";
  511. model.installReceiptQuantity=model.maxInstallReceiptQuantity;
  512. }
  513. [_myTableView reloadData];
  514. btnDateArrow.frame = CGRectMake(Screen_Width-17,CGRectGetMaxY(_lblTitlePlateNumber.frame)+10,7,12);
  515. [ btnDateArrow setImage:[UIImage imageNamed:@"rightarrow"] forState:UIControlStateNormal];
  516. }];
  517. [_dealDatePicker show];
  518. }
  519. // 代理方法 监控按钮选中状态的改变
  520. - (void)radioButtonSelectedAtIndex:(NSUInteger)index inGroup:(NSString *)groupID {
  521. if(index==0)
  522. {
  523. _receiptFlag=@"1";
  524. if([_sReceiptType intValue]==1)
  525. {
  526. for(int i=0;i<_dataList.count;i++)
  527. {
  528. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  529. datamodel.receiptType=@"1";
  530. datamodel.receiptTypeName=@"完成";
  531. datamodel.installReceiptType=@"0";
  532. datamodel.installReceiptTypeName=@"";
  533. if([datamodel.circulateType intValue] == 1){
  534. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.0f",datamodel.maxReceiptQuantity];
  535. }
  536. else{
  537. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.6f",datamodel.maxReceiptQuantity];
  538. }
  539. datamodel.installReceiptQuantity=@"0";
  540. }
  541. }
  542. if([_sReceiptType intValue]==2)
  543. {
  544. for(int i=0;i<_dataList.count;i++)
  545. {
  546. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  547. if([_receiptFlag intValue]==1)
  548. {
  549. datamodel.installReceiptType=@"0";
  550. datamodel.installReceiptTypeName=@"";
  551. datamodel.receiptType=@"2";
  552. datamodel.receiptTypeName=@"再送";
  553. datamodel.installReceiptQuantity=@"0";
  554. datamodel.receiptQuantity=@"0";
  555. }
  556. }
  557. }
  558. }
  559. if(index==1)
  560. {
  561. _receiptFlag=@"2";
  562. if([_sReceiptType intValue]==1)
  563. {
  564. for(int i=0;i<_dataList.count;i++)
  565. {
  566. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  567. datamodel.installReceiptType=@"1";
  568. datamodel.installReceiptTypeName=@"完成";
  569. datamodel.receiptType=@"0";
  570. datamodel.receiptTypeName=@"";
  571. datamodel.installReceiptQuantity=datamodel.maxInstallReceiptQuantity;
  572. datamodel.receiptQuantity=@"0";
  573. }
  574. }
  575. if([_sReceiptType intValue]==2)
  576. {
  577. for(int i=0;i<_dataList.count;i++)
  578. {
  579. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  580. if([_receiptFlag intValue]==2)
  581. {
  582. datamodel.installReceiptType=@"5";
  583. datamodel.installReceiptTypeName=@"再安装";
  584. datamodel.receiptType=@"0";
  585. datamodel.receiptTypeName=@"";
  586. datamodel.installReceiptQuantity=@"0";
  587. datamodel.receiptQuantity=@"0";
  588. }
  589. }
  590. }
  591. }
  592. if(index==2)
  593. {
  594. _receiptFlag=@"3";
  595. if([_sReceiptType intValue]==1)
  596. {
  597. for(int i=0;i<_dataList.count;i++)
  598. {
  599. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  600. datamodel.installReceiptType=@"1";
  601. datamodel.installReceiptTypeName=@"完成";
  602. datamodel.receiptType=@"1";
  603. datamodel.receiptTypeName=@"完成";
  604. datamodel.installReceiptQuantity=datamodel.maxInstallReceiptQuantity;
  605. if([datamodel.circulateType intValue] == 1){
  606. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.0f",datamodel.maxReceiptQuantity];
  607. }
  608. else{
  609. datamodel.receiptQuantity = [NSString stringWithFormat:@"%.6f",datamodel.maxReceiptQuantity];
  610. }
  611. }
  612. }
  613. if([_sReceiptType intValue]==2)
  614. {
  615. for(int i=0;i<_dataList.count;i++)
  616. {
  617. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  618. if([_receiptFlag intValue]==3)
  619. {
  620. datamodel.installReceiptType=@"5";
  621. datamodel.installReceiptTypeName=@"再安装";
  622. datamodel.receiptType=@"2";
  623. datamodel.receiptTypeName=@"再送";
  624. datamodel.installReceiptQuantity=@"0";
  625. datamodel.receiptQuantity=@"0";
  626. }
  627. }
  628. }
  629. }
  630. [_myTableView reloadData];
  631. }
  632. //-(void)changeButtonColor
  633. //{
  634. // _btnDeliveryMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  635. // [_btnDeliveryType setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  636. //
  637. // _btnInstallType.layer.borderColor=[UIColor lightGrayColor].CGColor;
  638. // [_btnInstallType setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  639. // _btnDeliveryInstallMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  640. // [_btnDeliveryInstallType setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  641. //
  642. //}
  643. /**
  644. 初始化回执类型
  645. */
  646. - (void)initStatus2{
  647. _arrayStatus = [[NSMutableArray alloc]init];
  648. StatusInfo *s = [[StatusInfo alloc]init];
  649. s.tagName = @"cell";
  650. s.statusId = @"0";
  651. s.name = @"";
  652. [_arrayStatus addObject:s];
  653. s = [[StatusInfo alloc]init];
  654. s.tagName = @"cell";
  655. s.statusId = @"1";
  656. s.name = @"完成";
  657. [_arrayStatus addObject:s];
  658. s = [[StatusInfo alloc]init];
  659. s.tagName = @"cell";
  660. s.statusId = @"2";
  661. s.name = @"再送";
  662. [_arrayStatus addObject:s];
  663. }
  664. /**
  665. 安装回执状态
  666. @param flag <#flag description#>
  667. */
  668. -(void) initStatus3{
  669. _arrayStatus = [[NSMutableArray alloc]init];
  670. StatusInfo *s = [[StatusInfo alloc]init];
  671. s.tagName = @"install";
  672. s.statusId = @"0";
  673. s.name = @"";
  674. [_arrayStatus addObject:s];
  675. s = [[StatusInfo alloc]init];
  676. s.tagName = @"install";
  677. s.statusId = @"1";
  678. s.name = @"完成";
  679. [_arrayStatus addObject:s];
  680. s = [[StatusInfo alloc]init];
  681. s.tagName = @"install";
  682. s.statusId = @"5";
  683. s.name = @"再安装";
  684. [_arrayStatus addObject:s];
  685. }
  686. /**
  687. 安装回执
  688. @param path <#path description#>
  689. */
  690. - (void)setInstallReceiptType:(NSIndexPath*) path{
  691. _myRow= path;
  692. NewDispatchRequirementModel *mode = _dataList[_myRow.row];
  693. [self initStatus3];
  694. StatusInfoTextVC *tc = [[StatusInfoTextVC alloc] init];
  695. tc.sdelegate=self;
  696. [tc.arrFilter addObjectsFromArray: _arrayStatus];
  697. [self.cNav pushViewController:tc animated:YES];
  698. self.hidesBottomBarWhenPushed = NO;
  699. }
  700. /**
  701. 回执类型回调函数
  702. @param s <#s description#>
  703. */
  704. - (void)showStatusValue:(StatusInfo *)s{
  705. //选择Cell回执状态回调
  706. if([s.tagName isEqualToString:@"cell"]){
  707. NewDispatchRequirementModel *model = _dataList[_myRow.row];
  708. switch ([s.statusId intValue]) {
  709. case 0:
  710. model.receiptType = @"0";
  711. model.receiptTypeName=@"";
  712. model.receiptQuantity =@"0";
  713. break;
  714. case 1:
  715. model.receiptType = @"1";
  716. model.receiptTypeName=@"完成";
  717. if([model.circulateType intValue] == 1){
  718. model.receiptQuantity = [NSString stringWithFormat:@"%.0f",model.maxReceiptQuantity];
  719. }
  720. else{
  721. model.receiptQuantity = [NSString stringWithFormat:@"%.6f",model.maxReceiptQuantity];
  722. }
  723. break;
  724. case 2:
  725. model.receiptType = @"2";
  726. model.receiptTypeName=@"再送";
  727. model.receiptQuantity=@"0";
  728. break;
  729. default:
  730. break;
  731. }
  732. }
  733. if([s.tagName isEqualToString:@"install"]){
  734. NewDispatchRequirementModel *model1 = _dataList[_myRow.row];
  735. switch ([s.statusId intValue]) {
  736. case 0:
  737. model1.installReceiptType = @"0";
  738. model1.installReceiptTypeName=@"";
  739. model1.installReceiptQuantity =@"0";
  740. break;
  741. case 1:
  742. model1.installReceiptType = @"1";
  743. model1.installReceiptTypeName=@"完成";
  744. model1.installReceiptQuantity=
  745. model1.installQuantity;
  746. break;
  747. case 5:
  748. model1.installReceiptType = @"5"
  749. ;
  750. model1.installReceiptTypeName = @"再安装";
  751. model1.installReceiptQuantity =@"0"; ;
  752. break;
  753. }
  754. }
  755. [_myTableView reloadData];
  756. }
  757. /**
  758. Cell回执类型回调函数
  759. */
  760. - (void)setDeliveryReceiptType:(NSIndexPath*)path{
  761. _myRow= path;
  762. NewDispatchRequirementModel *mode = _dataList[_myRow.row];
  763. [self initStatus2];
  764. StatusInfoTextVC *tc = [[StatusInfoTextVC alloc] init];
  765. tc.sdelegate=self;
  766. [tc.arrFilter addObjectsFromArray: _arrayStatus];
  767. [self.cNav pushViewController:tc animated:YES];
  768. self.hidesBottomBarWhenPushed = NO;
  769. }
  770. //-(void)goDeliveryType:(UIButton*)sender
  771. //{
  772. // //[self changeButtonColor];
  773. // if(sender.tag==100)
  774. // {
  775. // _btnDeliveryMaskLayer.strokeColor=[UIColor redColor].CGColor;
  776. //// [_btnDeliveryType setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  777. // receiptFlag=@"1";
  778. // for(int i=0;i<_dataList.count;i++)
  779. // {
  780. // NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  781. //
  782. // datamodel.receiptType=@"1";
  783. // datamodel.receiptTypeName=@"完成";
  784. // datamodel.installReceiptType=@"0";
  785. // datamodel.installReceiptTypeName=@"";
  786. //
  787. // if([datamodel.circulateType intValue] == 1){
  788. //
  789. // datamodel.receiptQuantity = [NSString stringWithFormat:@"%.0f",datamodel.maxReceiptQuantity];
  790. // }
  791. //
  792. // else{
  793. //
  794. // datamodel.receiptQuantity = [NSString stringWithFormat:@"%.6f",datamodel.maxReceiptQuantity];
  795. //
  796. // datamodel.installReceiptQuantity=@"0";
  797. // }
  798. // }
  799. //
  800. // }
  801. //
  802. // if(sender.tag==101)
  803. // {
  804. // _btnInstallType.layer.borderColor=[UIColor redColor].CGColor;
  805. //// [_btnInstallType setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  806. // receiptFlag=@"2";
  807. //
  808. // for(int i=0;i<_dataList.count;i++)
  809. // {
  810. // NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  811. //
  812. // datamodel.installReceiptType=@"1";
  813. // datamodel.installReceiptTypeName=@"完成";
  814. // datamodel.receiptType=@"0";
  815. // datamodel.receiptTypeName=@"";
  816. // datamodel.installReceiptQuantity=datamodel.installQuantity;
  817. // datamodel.receiptQuantity=@"0";
  818. //
  819. // }
  820. // }
  821. //
  822. // if(sender.tag==102)
  823. // {
  824. // _btnDeliveryInstallMaskLayer.strokeColor=[UIColor redColor].CGColor;
  825. //// [_btnDeliveryInstallType setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  826. // receiptFlag=@"3";
  827. //
  828. // for(int i=0;i<_dataList.count;i++)
  829. // {
  830. // NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:i];
  831. //
  832. // datamodel.installReceiptType=@"1";
  833. // datamodel.installReceiptTypeName=@"完成";
  834. // datamodel.receiptType=@"1";
  835. // datamodel.receiptTypeName=@"完成";
  836. // datamodel.installReceiptQuantity=datamodel.installQuantity;
  837. // if([datamodel.circulateType intValue] == 1){
  838. //
  839. // datamodel.receiptQuantity = [NSString stringWithFormat:@"%.0f",datamodel.maxReceiptQuantity];
  840. // }
  841. //
  842. // else{
  843. //
  844. // datamodel.receiptQuantity = [NSString stringWithFormat:@"%.6f",datamodel.maxReceiptQuantity];
  845. //
  846. // datamodel.installReceiptQuantity=datamodel.installQuantity;
  847. //
  848. // }
  849. //
  850. // }
  851. //
  852. // }
  853. //}
  854. //- (void)keyboardWillShow:(NSNotification *)info
  855. //{
  856. // CGRect keyboardBounds = [[[info userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
  857. // _myTableView.contentInset = UIEdgeInsetsMake(_myTableView.contentInset.top, 0, keyboardBounds.size.height, 0);
  858. //
  859. //}
  860. //- (void)keyboardWillHide:(NSNotification *)info
  861. //{
  862. // _myTableView.contentInset = UIEdgeInsetsMake(_myTableView.contentInset.top, 0, 0, 0);
  863. //}
  864. /**
  865. 键盘弹出函数
  866. */
  867. - (void)myKeyboardWillShow {
  868. if(!keyboardShow){
  869. [UIView animateWithDuration:0.3f animations:^ {
  870. self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y - 190, self.view.frame.size.width, self.view.frame.size.height);
  871. }];
  872. }
  873. keyboardShow=YES;
  874. }
  875. /**
  876. 键盘隐藏函数
  877. */
  878. - (void)keyboardWillHide {
  879. // Animate the current view back to its original position
  880. if(keyboardShow){
  881. [UIView animateWithDuration:0.0f animations:^ {
  882. self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y + 190, self.view.frame.size.width, self.view.frame.size.height);
  883. }];}
  884. keyboardShow=NO;
  885. }
  886. /**
  887. table view的分区数
  888. @param tableView <#tableView description#>
  889. @return <#return value description#>
  890. */
  891. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  892. {
  893. return 1;
  894. }
  895. /**
  896. table view的行数
  897. @param tableView <#tableView description#>
  898. @param section <#section description#>
  899. @return <#return value description#>
  900. */
  901. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  902. {
  903. return [_dataList count];
  904. }
  905. /**
  906. table view的高度
  907. @param tableView <#tableView description#>
  908. @param indexPath <#indexPath description#>
  909. @return <#return value description#>
  910. */
  911. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  912. return 288;
  913. }
  914. /**
  915. 键盘隐藏函数
  916. @param tap <#tap description#>
  917. */
  918. - (void)keyboardHide:(UITapGestureRecognizer*)tap{
  919. [self.view endEditing:YES];
  920. }
  921. /**
  922. 获取tableview cell
  923. @param tableView <#tableView description#>
  924. @param indexPath <#indexPath description#>
  925. @return <#return value description#>
  926. */
  927. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  928. NSString *CellIdentifier = @"DataListTableViewCell";
  929. NewDispatchRequirementCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  930. cell = [[NewDispatchRequirementCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
  931. cell.dispatchDelegate = self;
  932. cell.nddelegate = self;
  933. cell.receiptQuantity.delegate = self;
  934. cell.receiptQuantity.tag = indexPath.row;
  935. NewDispatchRequirementModel *datamodel = [_dataList objectAtIndex:indexPath.row];
  936. cell.myIndexPath = indexPath;
  937. cell.cellIndex = indexPath.row;
  938. [cell parseInfoModel:datamodel receiptType:_sReceiptType receiptFlag:_receiptFlag ];
  939. return cell;
  940. }
  941. @end