diff --git a/total/GTOApp/Business/NewObtainViewController.m b/total/GTOApp/Business/NewObtainViewController.m index 3a58eb5245d0c098473811157303cb9661f02fe4..558cb95ace2a0bb5bf432bb1838212ff75178079 100644 --- a/total/GTOApp/Business/NewObtainViewController.m +++ b/total/GTOApp/Business/NewObtainViewController.m @@ -1047,10 +1047,10 @@ [HttpRequestManager requestNetworkwithURL:string withRequestType:ZERO withParameter:[orderBill toDictionary] withSuccess:^(id returnValue) { if ([returnValue[@"success"] isEqualToNumber:@1]) { - [IBTLoadingView hideHUDWithText:@"ä¿å˜æˆåŠŸ"]; if (!boolValue) { block(returnValue[@"data"][@"uuid"]);return; } + [IBTLoadingView hideHUDWithText:@"ä¿å˜æˆåŠŸ"]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ SeeObtainViewController *orderBill = [weakSelf.storyboard instantiateViewControllerWithIdentifier:@"SeeObtainViewController"]; orderBill.orderUUIDString = returnValue[@"data"][@"uuid"]; diff --git a/total/GTOApp/Business/NewOrderViewController.m b/total/GTOApp/Business/NewOrderViewController.m index 2e1e9fda17b65c1a08a82330237e5c48f9ece415..8391d8d1388ce5fc46887595a9517ae775c4446f 100644 --- a/total/GTOApp/Business/NewOrderViewController.m +++ b/total/GTOApp/Business/NewOrderViewController.m @@ -368,7 +368,7 @@ //油站ç»è¥ç±»åž‹ order.operatingType = self.recordSelectGasStation[@"operatingType"]; //订å•çŠ¶æ€ - order.state = boolValue?@"initial":@"submit"; + order.state = @"initial"; //æ‰€å±žä¸šä¸»å…¬å¸ UCN *company = [[UCN alloc]init]; company.code = user.orgCode; @@ -416,14 +416,7 @@ [IBTLoadingView hideHUDWithText:@"ä¿å˜æˆåŠŸ"]; saveSuccess(returnValue[@"data"],order); if (!boolValue) return;//æäº¤è°ƒç”¨ä¿å˜æ—¶ä¸éœ€è¦è·³è½¬åˆ°è¯¦æƒ… - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"]; - orderDetail.orderUUIDString = returnValue[@"data"][@"uuid"]; - orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray; - orderDetail.title = @"订油å•详情"; - orderDetail.boolValue = YES; - [weakSelf PushViewController:orderDetail animated:YES]; - }); + [weakSelf gotoOrderDetail:returnValue[@"data"][@"uuid"]]; } else { [IBTLoadingView hideHUDWithText:returnValue[@"message"]]; } @@ -434,6 +427,18 @@ }]; } +#pragma mark -订å•详情 +- (void)gotoOrderDetail:(NSString *)uuid +{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"]; + orderDetail.orderUUIDString = uuid; + orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray; + orderDetail.title = @"订油å•详情"; + orderDetail.boolValue = YES; + [self PushViewController:orderDetail animated:YES]; + }); +} #pragma mark -æäº¤è®¢æ²¹å• - (void)commitOilOrder @@ -470,6 +475,7 @@ } else { [IBTLoadingView hideHUDWithText:returnValue[@"message"]]; + [weakSelf gotoOrderDetail:dict[@"uuid"]]; } } withFailed:^(NSError *failed) { diff --git a/total/GTOApp/Business/NewRequestViewController.m b/total/GTOApp/Business/NewRequestViewController.m index 5856ba164cd0aefaaf4db22dff8031aa9bd9ede2..bb8a1dc0a30eb32cf298eb88de79f3c8087b244d 100644 --- a/total/GTOApp/Business/NewRequestViewController.m +++ b/total/GTOApp/Business/NewRequestViewController.m @@ -270,6 +270,16 @@ { TypeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TypeTableViewCell" forIndexPath:indexPath]; cell.titleLabe.text = @"é…é€åŒºåŸŸ:"; + //åªæœ‰ä¸€ä¸ªé…é€åŒºåŸŸæƒ…况 + if (self.distributionArray.count == 1) { + self.distributionDict = [self.distributionArray firstObject]; + cell.contentLabe.text = self.distributionDict[@"name"]; + } + //æ— é…é€åŒºåŸŸæƒ…况 + if (!self.distributionArray.count) { + cell.contentLabe.text = @"æ— "; + } + cell.userInteractionEnabled = self.distributionArray.count > 1; if (self.isSaveDetails) { cell.contentLabe.text = self.orderDetails.deliveryArea.name; } @@ -380,7 +390,11 @@ break; case 1://é…é€åŒºåŸŸ { + TypeTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; + if (![ICRUserUtil sharedInstance].storeArray.count) { + [IBTLoadingView showTextOnly:@"当å‰ç”¨æˆ·æ²¡æœ‰æ‰€å±žæ²¹ç«™ï¼Œä¸èƒ½é€‰æ‹©é…é€åŒºåŸŸ"];return; + } PromptTableViewController *selectArea = [[PromptTableViewController alloc]init]; selectArea.title = @"选择é…é€åŒºåŸŸ"; NSMutableArray *tempArray = [NSMutableArray array]; @@ -467,7 +481,7 @@ #pragma mark -UITextFieldç›‘å¬ - (void)changeTextfieldString:(UITextField *)textField { - if (!self.oilPrice) { + if (!self.oilPrice.records.count) { [IBTLoadingView showTextOnly:@"æ²¹å“ä»·æ ¼å¼‚å¸¸"]; textField.text = nil; return; @@ -509,6 +523,7 @@ } TimeSelectTableViewCell *cell = [self.createWarehouseTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0]]; DepotRequestBill *orderBill = [[DepotRequestBill alloc]init]; + orderBill.version = self.orderDetails.version; ICRUserUtil *user = [ICRUserUtil sharedInstance]; //çŠ¶æ€ orderBill.state = @"initial"; @@ -551,13 +566,13 @@ time.endDateTime = [NSString stringWithFormat:@"%@ 23:59:59",[cell.endTimeButton currentTitle]]; orderBill.deliveryTime = time; //ç”³è¯·ä»·æ ¼ - orderBill.reqPrice = [NSNumber numberWithFloat:[[self.oilPrice.records firstObject][@"salePrice"] doubleValue]]; + orderBill.reqPrice = [NSNumber numberWithDouble:[[self.oilPrice.records firstObject][@"salePrice"] doubleValue]]; NumberTableViewCell *numberCell = [self.createWarehouseTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:5 inSection:0]]; if ([orderBill.reqPrice isEqualToNumber:@0]) { [IBTLoadingView showTextOnly:@"ä»·æ ¼å¼‚å¸¸"];return; } //ç”³è¯·æ•°é‡ - orderBill.quantity = [NSNumber numberWithFloat:[numberCell.createNumberField.text doubleValue]]; + orderBill.quantity = [NSNumber numberWithDouble:[numberCell.createNumberField.text doubleValue]]; if ([orderBill.quantity isEqualToNumber:@0]) { [IBTLoadingView showTextOnly:@"æ•°é‡å¼‚常"];return; } @@ -571,18 +586,12 @@ [HttpRequestManager requestNetworkwithURL:string withRequestType:ZERO withParameter:[orderBill toDictionary] withSuccess:^(id returnValue) { if ([returnValue[@"success"] isEqualToNumber:@1]) { + if (!isPushDetails) { + [IBTLoadingView hideHUDWithText:nil]; + block(returnValue[@"data"],orderBill);return; + } [IBTLoadingView hideHUDWithText:@"ä¿å˜æˆåŠŸ"]; - block(returnValue[@"data"],orderBill); - if (!isPushDetails) return;//是å¦éœ€è¦è·³è½¬å¤ªè¯¦æƒ…页 - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - NewRequestViewController *details = [weakSelf.storyboard instantiateViewControllerWithIdentifier:@"NewRequestViewController"]; - details.orderUUID = returnValue[@"data"][@"uuid"]; - details.isSaveDetails = YES; - details.title = @"修改建仓å•"; - details.oilTypeDict = weakSelf.oilTypeDict; - details.distributionDict = weakSelf.distributionDict; - [weakSelf PushViewController:details animated:YES]; - }); + [weakSelf saveOrderSuccess:returnValue[@"data"][@"uuid"]]; } else { [IBTLoadingView hideHUDWithText:returnValue[@"message"]]; @@ -594,6 +603,20 @@ }]; } +#pragma mark -ä¿å˜æˆåŠŸ +- (void)saveOrderSuccess:(NSString *)uuidString +{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + NewRequestViewController *details = [self.storyboard instantiateViewControllerWithIdentifier:@"NewRequestViewController"]; + details.orderUUID = uuidString; + details.isSaveDetails = YES; + details.title = @"å»ºä»“ç”³è¯·å•æ˜Žç»†"; + details.oilTypeDict = self.oilTypeDict; + details.distributionDict = self.distributionDict; + [self PushViewController:details animated:YES]; + }); +} + #pragma mark -æäº¤å»ºä»“å• - (void)commitOrder { @@ -622,6 +645,7 @@ } else { [IBTLoadingView hideHUDWithText:returnValue[@"message"]]; + [weakSelf saveOrderSuccess:dict[@"uuid"]]; } } withFailed:^(NSError *failed) { [IBTLoadingView hideHUDWithText:nil]; diff --git a/total/GTOApp/Business/OrderDetailsViewController.m b/total/GTOApp/Business/OrderDetailsViewController.m index d79ac64295bafe9a87c19e0d8fe90a88e345aa66..dfc1221c4490f6e9b1d8c4e88e77e5e39b521d40 100644 --- a/total/GTOApp/Business/OrderDetailsViewController.m +++ b/total/GTOApp/Business/OrderDetailsViewController.m @@ -368,7 +368,7 @@ //油站ç»è¥ç±»åž‹ order.operatingType = self.orderDetails.operatingType; //订å•çŠ¶æ€ - order.state = boolValue?@"initial":@"submit"; + order.state = @"initial"; order.version = self.orderDetails.version; order.uuid = self.orderDetails.uuid; order.billnumber = self.orderDetails.billnumber; @@ -415,17 +415,13 @@ NSDictionary *orderDict = [order toDictionary]; [HttpRequestManager requestNetworkwithURL:string withRequestType:ZERO withParameter:orderDict withSuccess:^(id returnValue) { if ([returnValue[@"success"] isEqualToNumber:@1]) { + + if (!boolValue) { + [IBTLoadingView hideHUDWithText:nil]; + saveSuccess(returnValue[@"data"],order);return; + } [IBTLoadingView hideHUDWithText:@"ä¿å˜æˆåŠŸ"]; - saveSuccess(returnValue[@"data"],order); - if (!boolValue) return;//æäº¤è°ƒç”¨ä¿å˜æ—¶ä¸éœ€è¦è·³è½¬åˆ°è¯¦æƒ… - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"]; - orderDetail.orderUUIDString = returnValue[@"data"][@"uuid"]; - orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray; - orderDetail.title = @"订油å•详情"; - orderDetail.boolValue = YES; - [weakSelf PushViewController:orderDetail animated:YES]; - }); + [weakSelf gotoOrderDetail:returnValue[@"data"][@"uuid"]]; }else { [IBTLoadingView hideHUDWithText:returnValue[@"message"]]; @@ -436,6 +432,19 @@ }]; } +#pragma mark -订å•详情 +- (void)gotoOrderDetail:(NSString *)uuid +{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"]; + orderDetail.orderUUIDString = uuid; + orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray; + orderDetail.title = @"订油å•详情"; + orderDetail.boolValue = YES; + [self PushViewController:orderDetail animated:YES]; + }); +} + #pragma mark -æäº¤è®¢æ²¹å• - (void)commitOilOrder @@ -462,17 +471,11 @@ if ([returnValue[@"success"] isEqualToNumber:@1]) { [IBTLoadingView hideHUDWithText:@"æäº¤æˆåŠŸ"]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"]; - orderDetail.orderUUIDString = dict[@"uuid"]; - orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray; - orderDetail.title = @"订油å•详情"; - orderDetail.boolValue = YES; - [weakSelf PushViewController:orderDetail animated:YES]; - }); + [weakSelf gotoOrderDetail:dict[@"uuid"]]; } else { [IBTLoadingView hideHUDWithText:returnValue[@"message"]]; + [weakSelf gotoOrderDetail:dict[@"uuid"]]; } } withFailed:^(NSError *failed) { diff --git a/total/GTOApp/Business/SeeObtainViewController.m b/total/GTOApp/Business/SeeObtainViewController.m index 87fd52f18380abac33beb2714ba17c4dc45f6eca..55f794a83bc9540161833e02d7ef8c6477fed84c 100644 --- a/total/GTOApp/Business/SeeObtainViewController.m +++ b/total/GTOApp/Business/SeeObtainViewController.m @@ -1003,22 +1003,16 @@ self.orderDetails.remark = self.userInputArray[ONE][9]; NSString *urlString = [NSString stringWithFormat:@"%@/receiveBill/save?operId=%@&operName=%@&time=%@",HTTP_REST_API_BASE_URL,user.f_user_uuid,user.f_user_name,[GTOCommonTools GetCurrenttime]]; NSString *string = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - NSLog(@"%@",[self.orderDetails toDictionary]); [IBTLoadingView showProgressLabel:@"ä¿å˜ä¸..."]; [HttpRequestManager requestNetworkwithURL:string withRequestType:ZERO withParameter:[self.orderDetails toDictionary] withSuccess:^(id returnValue) { if ([returnValue[@"success"] isEqualToNumber:@1]) { - [IBTLoadingView hideHUDWithText:@"ä¿å˜æˆåŠŸ"]; if (!boolValue) { + [IBTLoadingView hideHUDWithText:nil]; bolck(returnValue[@"data"][@"uuid"]);return; } - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - SeeObtainViewController *orderBill = [weakSelf.storyboard instantiateViewControllerWithIdentifier:@"SeeObtainViewController"]; - orderBill.orderUUIDString = returnValue[@"data"][@"uuid"]; - orderBill.storeDict = self.storeDict;//油站 - orderBill.isReturnRootVC = YES; - [weakSelf PushViewController:orderBill animated:YES]; - }); + [IBTLoadingView hideHUDWithText:@"ä¿å˜æˆåŠŸ"]; + [weakSelf saveOrderSuccess:returnValue[@"data"][@"uuid"]]; } else { [IBTLoadingView hideHUDWithText:returnValue[@"message"]]; } @@ -1053,6 +1047,7 @@ } else { [IBTLoadingView hideHUDWithText:returnValue[@"message"]]; + [weakSelf saveOrderSuccess:uuidString]; } } withFailed:^(NSError *failed) { @@ -1063,6 +1058,18 @@ } isPushDetails:NO]; } +#pragma mark -ä¿å˜æ”¶æ²¹å•æˆåŠŸ +- (void)saveOrderSuccess:(NSString *)uuidString +{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + SeeObtainViewController *orderBill = [self.storyboard instantiateViewControllerWithIdentifier:@"SeeObtainViewController"]; + orderBill.orderUUIDString = uuidString; + orderBill.storeDict = self.storeDict;//油站 + orderBill.isReturnRootVC = YES; + [self PushViewController:orderBill animated:YES]; + }); +} + #pragma mark -返回æç¤ºä¿¡æ¯ - (NSString *)returnPromptInformation:(NSInteger)index diff --git a/total/GTOApp/Business/SeeOrderViewController.m b/total/GTOApp/Business/SeeOrderViewController.m index c93a50d8d150518c808c6d764311e1cfacaa054b..e514cdb10c7fe6beaefd81ac114917272dcd126d 100644 --- a/total/GTOApp/Business/SeeOrderViewController.m +++ b/total/GTOApp/Business/SeeOrderViewController.m @@ -319,7 +319,7 @@ typedef enum : NSUInteger { NewRequestViewController *details = [self.storyboard instantiateViewControllerWithIdentifier:@"NewRequestViewController"]; details.orderUUID = dict[@"uuid"]; details.isSaveDetails = YES; - details.title = @"修改建仓å•"; + details.title = @"å»ºä»“ç”³è¯·å•æ˜Žç»†"; details.oilTypeDict = dict[@"item"]; details.distributionDict = dict[@"deliveryArea"]; [self PushViewController:details animated:YES]; diff --git a/total/GTOApp/Business/SeePriceViewController.m b/total/GTOApp/Business/SeePriceViewController.m index 7b2ea51f6223cf60d20e06c0452970bad04bbc7b..dc9f5eb975aa23879a0c0a151d6cb226afd6ea09 100644 --- a/total/GTOApp/Business/SeePriceViewController.m +++ b/total/GTOApp/Business/SeePriceViewController.m @@ -114,6 +114,7 @@ self.seePriceTableview.delegate = self; self.seePriceTableview.dataSource = self; self.seePriceTableview.tableFooterView = [UIView new]; + self.seePriceTableview.userInteractionEnabled = [ICRUserUtil sharedInstance].storeArray.count; } #pragma mark -获å–é…é€åŒºåŸŸæ•°æ®ã€èŽ·å–è¡Œæ”¿åŒºåŸŸæ•°æ® diff --git a/total/GTOApp/Business/SeeRequestViewController.m b/total/GTOApp/Business/SeeRequestViewController.m index 4fc7fcc743e8d477e64a81d65a41d828ef2ed223..fa7f92c72c9960ab2a1172cd2f9638ce3dc54633 100644 --- a/total/GTOApp/Business/SeeRequestViewController.m +++ b/total/GTOApp/Business/SeeRequestViewController.m @@ -192,7 +192,7 @@ cell.establishWarehouseUnitLabe.text = self.orderDetails.org.name; cell.establishName.text = self.orderDetails.createInfo.operator.operName; cell.establishDate.text = self.orderDetails.createInfo.time; - if ([self.orderDetails.state isEqualToString:@"general"]) { + if ([self.orderDetails.type isEqualToString:@"general"]) { cell.typeLabe.text = @"普通"; } cell.distributionLabe.text = self.orderDetails.deliveryArea.name; @@ -324,8 +324,6 @@ options:WYPopoverAnimationOptionFadeWithScale]; } - - #pragma mark -åˆ é™¤æˆ–è€…ä½œåºŸåŽè¿”回æ¤è®¢å•UUID - (void)returnUUIDsingAfterDeleteOrCancel:(BOOL)isDelete { diff --git a/total/GTOApp/UserUtil/PromptTableViewController.m b/total/GTOApp/UserUtil/PromptTableViewController.m index 949ab7c132c047a871fa37e4c28d902dff36e11f..2874463cc1f4bfe9b19a7ae31d37e11d8c1e3e13 100644 --- a/total/GTOApp/UserUtil/PromptTableViewController.m +++ b/total/GTOApp/UserUtil/PromptTableViewController.m @@ -93,12 +93,12 @@ #pragma mark -确定 - (void)completeButtonClick:(UIBarButtonItem *)item { + [self dismissViewControllerAnimated:YES completion:nil]; if (self.selectTitle || self.currentTitle) { if (self.selectCellTitle) { self.selectCellTitle(self.selectTitle?self.selectTitle:self.currentTitle,self.indexpathSelect.row); } } - [self dismissViewControllerAnimated:YES completion:nil]; } diff --git a/total/Macro/GTOAppMacro.h b/total/Macro/GTOAppMacro.h index ed8413f903d8e40ca0bb37bdd7af1ae8161ad78b..8b8268ebd7dafcfe8ff33ac2d48807e2ee1b1cd2 100644 --- a/total/Macro/GTOAppMacro.h +++ b/total/Macro/GTOAppMacro.h @@ -84,12 +84,12 @@ //#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:7080" //测试环境 -//#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:8180/total-server/rest" -//#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:8180" +#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:8180/total-server/rest" +#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:8180" //å¼€å‘环境 -#define HTTP_LOCAL_BASE_URL @"http://139.196.195.30:8093" -#define HTTP_REST_API_BASE_URL @"http://139.196.195.30:8093/total-server/rest" +//#define HTTP_LOCAL_BASE_URL @"http://139.196.195.30:8093" +//#define HTTP_REST_API_BASE_URL @"http://139.196.195.30:8093/total-server/rest" #define HTTP_WEATHER_URL @"http://apis.baidu.com/heweather/weather/free"