Преглед изворни кода

增加portfolio在编辑或删除之后有提示标志

Pen Li пре 9 година
родитељ
комит
460fab1ce4

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 20 - 3
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m

@@ -32,6 +32,9 @@
 @property (nonatomic,assign) int sortIndex;
 @property (nonatomic,strong) SortButton *sortButton;
 
+@property (nonatomic,assign) NSInteger editedRow;
+@property (nonatomic,assign) NSInteger deletedRow;
+
 @end
 
 @implementation PortfolioViewController
@@ -486,7 +489,8 @@
     self.label_net_err.layer.masksToBounds=true;
     
     self.sortIndex = 0;
-    
+    self.editedRow = -1;
+    self.deletedRow = -1;
     
     UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(refresh_btn_click:)];
     //            tap.minimumPressDuration = 0.8; //定义按的时间
@@ -1166,7 +1170,15 @@
         
         
     }
+    
     cell.backgroundColor = [UIColor whiteColor];// [UIColor whiteColor];;
+    if (indexPath.row == self.editedRow) {
+        cell.backgroundColor = UIColorFromRGB(0xff9933);
+    }
+    if (indexPath.row == self.deletedRow) {
+        cell.backgroundColor = UIColorFromRGB(0x336699);
+    }
+    
     return cell;
     
 }
@@ -1232,13 +1244,13 @@
     // 添加一个删除按钮
     
     self.indexPath=indexPath;
+    ModelItemCell * cell = [tableView cellForRowAtIndexPath:indexPath];
+    
     
     UITableViewRowAction *deleteRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
         
         NSLog(@"delete click");
         
-        
-        
         UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Delete confirm", nil) message:NSLocalizedString(@"Are you sure remove model from portfolio?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"NO", nil) otherButtonTitles:NSLocalizedString(@"YES", nil), nil];
         alert.tag = ALERT_DEL;
         // alert.
@@ -1306,6 +1318,7 @@
                     
                     if([[cart_json valueForKey:@"result"] intValue]==2)
                     {
+                        self.editedRow = indexPath.row;
                         if(qty>=0)
                         item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
                         else
@@ -1431,6 +1444,9 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     {
         if(buttonIndex!=alertView.cancelButtonIndex)
         {
+            int count =[[self.content_data valueForKey:@"count"] intValue];
+            BOOL delete_last = self.indexPath.row == count - 1 ? YES : NO;
+            
             [self.itemListTable reloadRowsAtIndexPaths:@[self.indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
             NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)self.indexPath.row]] mutableCopy];
             
@@ -1447,6 +1463,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
                     
                     if([[cart_json valueForKey:@"result"] intValue]==2)
                     {
+                        self.deletedRow = delete_last ? -1 : self.indexPath.row;
                         [self reload_data];
                     }
                     else

+ 1 - 0
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -457,6 +457,7 @@ void UncaughtExceptionHandler(NSException *exception) {
     content = [content stringByReplacingOccurrencesOfString:@"'" withString:@"''"];
     
 
+    NSLog(@".....");
     
     NSString *sql = [NSString stringWithFormat:@"insert into errlog (errmsg,params) values ('%@','%@');",versionNum,content];