Quellcode durchsuchen

1.修改NPD Order Review保存和提交。
2.修改NPD CommonEditor,增加Disable判断。

Pen Li vor 8 Jahren
Ursprung
Commit
f44d60c28e

+ 31 - 7
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -3421,7 +3421,12 @@
             
             cell.labelTitle.text=title;
             
-            
+            int disabble = [[item_json objectForKey:@"disable"] intValue];
+            if (disabble || readonly) {
+                cell.switchCtrl.enabled = NO;
+            } else {
+                cell.switchCtrl.enabled = YES;
+            }
             
             if([required isEqualToString:@"true"])
             {
@@ -3876,6 +3881,12 @@
             //                [title appendString:@"*"];
             //            }
             
+            int disabble = [[item_json objectForKey:@"disable"] intValue];
+            if (disabble || readonly) {
+                cell.imageviewSignature.userInteractionEnabled = NO;
+            } else {
+                cell.imageviewSignature.userInteractionEnabled = YES;
+            }
             
             
             cell.labelTitle.text = title;
@@ -3938,6 +3949,7 @@
                 
                 
             }            cell.backgroundColor = [UIColor whiteColor];
+            
             return cell;
             // CommonEditorCellSignature* cell = (CommonEditorCellSignature*) [self.editorTable cellForRowAtIndexPath:indexPath];
             //cell.imageviewSignature.image = image;
@@ -4082,15 +4094,18 @@
 //
 -(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
-    
+    NSDictionary* item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
     bool readonly = [[self.content_data_download valueForKey:@"readonly"]boolValue];
+    int disable = [[item_json valueForKey:@"disable"] intValue];
+
+    
     DebugLog(@"tableView willSelectRowAtIndexPath");
-    NSDictionary* item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
+    
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     NSString* control = [item_json valueForKey:@"control"];
     if([control isEqualToString:@"enum"])//||[control isEqualToString:@"ui"])
     {
-        int disable = [[item_json valueForKey:@"disable"] intValue];
+//        int disable = [[item_json valueForKey:@"disable"] intValue];
         if(disable==1||readonly)
             return nil;
         //    NSDictionary * item_json = [self.content_data objectForKey:[NSString stringWithFormat:@"item_%d",indexPath.row]];
@@ -4136,12 +4151,17 @@
         
     }else if([control isEqualToString:@"action"])
     {
+        if (disable || readonly) {
+            return nil;
+        }
         NSString* value = [item_json valueForKey:@"value"];
         [self commonAction:value index:indexPath data:item_json];
     }
     else if([control isEqualToString:@"datepicker"])
     {
-        
+        if (disable || readonly) {
+            return nil;
+        }
         
         // NSString* title = [item_json valueForKey:@"aname"];
         
@@ -4178,7 +4198,9 @@
         
     }else if([control isEqualToString:@"monthpicker"])
     {
-        
+        if (disable || readonly) {
+            return nil;
+        }
         
         // NSString* title = [item_json valueForKey:@"aname"];
         
@@ -4237,7 +4259,9 @@
         //
         //        [self.navigationController pushViewController:signvc animated:true];
         
-        
+        if (disable || readonly) {
+            return nil;
+        }
         __block UIImage* signimg=nil;
         SignatureViewController * vc =[ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureViewController"];
         __weak typeof(self) weakself = self;

+ 25 - 14
RedAnt ERP Mobile/common/Functions/order/RAOrderPreviewController.m

@@ -41,7 +41,7 @@
             __weak typeof(self) weakself = self;
             UIAlertAction *action = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                 
-                [weakself.navigationController popViewControllerAnimated:YES];
+                [self.navigationController popToRootViewControllerAnimated:true];
                 
             }];
             [alertVC addAction:action];
@@ -370,6 +370,8 @@
 -(void) download_success
 {
     // 用于处理不同child,在成功去的数据后,需要附加的操作。
+    NSString *title = [self.content_data_download objectForKey:@"title"];
+    self.title = title;
     
     self.have_tail=[[self.content_data_download valueForKey:@"has_reItem"] boolValue];
     
@@ -378,7 +380,7 @@
     
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     appDelegate.order_customer_id = order_customerid;
-    
+
 }
 - (void)viewDidLoad {
     [super viewDidLoad];
@@ -1120,6 +1122,10 @@
             NSMutableDictionary* upparams = [self check_cancommit:true];
             if(self.cancommit==false)
                 return;
+            // ------
+            [self.params enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
+                [upparams setObject:obj forKey:key];
+            }];
             
             if(upparams[@"shipping"]==nil)
                 goto commit_order;
@@ -1223,7 +1229,7 @@
                                                                         }
                                                                         [self prepareReturn:nil];
                                                                         
-                                                                        [self.navigationController popViewControllerAnimated:true];
+                                                                        [self.navigationController popToRootViewControllerAnimated:true];
                                                                         
                                                                         if(pdf_url.length>0)
                                                                         {
@@ -1315,7 +1321,7 @@
                                                                 //
                                                                 //    NSDictionary * customerinfo = appDelegate.customerInfo;
                                                                 [self prepareReturn:nil];
-                                                                [self.navigationController popViewControllerAnimated:true];
+                                                                [self.navigationController popToRootViewControllerAnimated:true];
                                                                 //                                    [self.navigationController dismissViewControllerAnimated:true completion:^{
                                                                 //
                                                                 //
@@ -1456,7 +1462,7 @@
                                             
                                             [self prepareReturn:value];
                                             
-                                            [self.navigationController popViewControllerAnimated:true];
+                                            [self.navigationController popToRootViewControllerAnimated:true];
                                             
                                             
                                             if(pdf_url.length>0)
@@ -1566,7 +1572,7 @@
                                     //
                                     //                                ;
                                     //                            }];
-                                    [self.navigationController popViewControllerAnimated:true];
+                                    [self.navigationController popToRootViewControllerAnimated:true];
                                     
                                 }
                                 else
@@ -1644,7 +1650,7 @@
     
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     if (self.resumeOrder) {
-        [appDelegate.main_vc.navigationController popViewControllerAnimated:YES];
+        [self.navigationController popToRootViewControllerAnimated:true];
         return;
     }
     
@@ -1815,6 +1821,11 @@
     //    if(self.cancommit==false)
     //        return;
     
+    [self.params enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
+        [upparams setObject:obj forKey:key];
+    }];
+    
+    
     if([upparams[@"shipping"] isEqualToString:@"Shipping To Be Quoted"]||[upparams[@"shipping"] isEqualToString:@"To Be Quoted"])
         upparams[@"shipping"] = nil;
     
@@ -1853,7 +1864,7 @@
                 {
                     [((MainViewController*)appDelegate.main_vc) Loginout:false];
                     [self prepareReturn:nil];
-                    [self.navigationController popViewControllerAnimated:true];
+                    [self.navigationController popToRootViewControllerAnimated:true];
                 }
                 
                 if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
@@ -2260,7 +2271,7 @@
                                                                     }
                                                                     [self prepareReturn:nil];
                                                                     
-                                                                    [self.navigationController popViewControllerAnimated:true];
+                                                                    [self.navigationController popToRootViewControllerAnimated:true];
                                                                     
                                                                     if(pdf_url.length>0)
                                                                     {
@@ -2352,7 +2363,7 @@
                                                             //
                                                             //    NSDictionary * customerinfo = appDelegate.customerInfo;
                                                             [self prepareReturn:nil];
-                                                            [self.navigationController popViewControllerAnimated:true];
+                                                            [self.navigationController popToRootViewControllerAnimated:true];
                                                             //                                    [self.navigationController dismissViewControllerAnimated:true completion:^{
                                                             //
                                                             //
@@ -2486,7 +2497,7 @@
                                         }
                                         [self prepareReturn:nil];
                                         
-                                        [self.navigationController popViewControllerAnimated:true];
+                                        [self.navigationController popToRootViewControllerAnimated:true];
                                         
                                         
                                         if(pdf_url.length>0)
@@ -2596,7 +2607,7 @@
                                 //
                                 //                                ;
                                 //                            }];
-                                [self.navigationController popViewControllerAnimated:true];
+                                [self.navigationController popToRootViewControllerAnimated:true];
                                 
                             }
                             else
@@ -2634,7 +2645,7 @@
         else if(buttonIndex==3)
         {
             
-            [self.navigationController popViewControllerAnimated:false];
+            [self.navigationController popToRootViewControllerAnimated:true];
             
             
             AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
@@ -2673,7 +2684,7 @@
                         [self prepareReturn:nil];
                         
                         
-                        [self.navigationController popViewControllerAnimated:true];
+                        [self.navigationController popToRootViewControllerAnimated:true];
                         //                        [self.navigationController dismissViewControllerAnimated:true completion:^{
                         //                            ;
                         //                        }];

+ 1 - 1
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -135,7 +135,7 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
     //    DebugLog(e);
     //    NSString* d=[AESCrypt decrypt:@"VzB4+lENfbzWX7ggHh2Os1P69l5YBzKmM51yqA37AfoKgPY8bJgdK8M4WvF+wDyOsLWP\/o8H5+bHMivQp1u8wM2QV7SYzgzPwV85QKtYWIzEgLe9T0HO69EdutWz7k1rdAT\/mftsRin0Hy5SHk7txTZT\/zPH5X+FQiExCTFm5Zus39HYvp+VxCX4+kYeymn8B63AUd3mRQyscUvDjfgU2olKR\/TP8PV3g+VQMZxpKfol3P1iOtz3XQlHZV0pM6SAf+SwT0sPfrdn6CZFfNQlrKA9QjMrnBdMeSCquSIWXnmLv6okzvnlJnT0SjvJuUeqNdBC5EZ0ACnhI0MrXVZEsq1EuM9al7oPzvU5EZbjZpmx+fSFIkMzTT8bYClTnG1bsL1MCcU4pSODDorUj8zalA==" password:@"usai2010"];
     params = [self prepare_addtional_params:params];
-    
+    DebugLog(@"\n++++++++++++++++++++++Request++++++++++++++++++++++\n%@\n++++++++++++++++++++++Params++++++++++++++++++++++\n%@\n",url,[RAUtils dict2string:params]);
     return [super get_json:url parameters:params file:(NSString*)file err_recorder:URL_ERR_LOG result_handler:^NSMutableDictionary *(NSMutableDictionary *jsobj) {
         int result=[[jsobj valueForKey:@"result"] intValue];
         //        UIApplication * app = [UIApplication sharedApplication];