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

增加侧边栏Order List Lock。

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

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


+ 30 - 0
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -29,6 +29,7 @@
 #import "DefaultAppearance.h"
 #import "PriceSettingViewController.h"
 #import "JKLockController.h"
+#import "Singleton.h"
 
 @interface MainViewController ()
 
@@ -1706,6 +1707,15 @@
         //        [map setValue:@"rect_market_news" forKey:@"img"];
         [self.sideMenuItems addObject:map.copy];
     }
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+        if ([Singleton sharedInstance].order_list_lock) {
+            [map setValue:@"Order List unLock" forKey:@"title"];
+        } else {
+            [map setValue:@"Order List Lock" forKey:@"title"];
+        }
+        
+        [self.sideMenuItems addObject:map.copy];
+    }
     
 # endif
     
@@ -2328,6 +2338,26 @@
         [self.navigationController pushViewController:lockVC animated:YES];
         
         
+    } else if ([title isEqualToString:@"Order List Lock"]) {
+        
+        UIApplication * app = [UIApplication sharedApplication];
+        AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+        
+        JKLockController *lockVC = [[JKLockController alloc] init];
+        [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
+        __weak typeof(self) weakself = self;
+        lockVC.authoReturn = ^(BOOL failure) {
+            
+            if (weakself) {
+                __strong typeof(weakself) strongself = weakself;
+                
+                [Singleton sharedInstance].order_list_lock = ![Singleton sharedInstance].order_list_lock;
+                [self initMenuItems];
+                [self hideMenu];
+            }
+        };
+        [self.navigationController pushViewController:lockVC animated:YES];
+        
     }
 }
 

+ 5 - 0
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -1063,6 +1063,11 @@
     //
     if(indexPath.row==self.content_data.count)
         return;
+    
+    if ([Singleton sharedInstance].order_list_lock) { // Order list 被锁
+        return;
+    }
+    
     NSString* orderid= [self.content_data[indexPath.row] valueForKey:@"order_id"];
     OrderDetailViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailViewController" ];
     

+ 2 - 0
RedAnt ERP Mobile/iSales-NPD/Singleton.h

@@ -30,6 +30,8 @@ typedef enum {
 // 使用枚举吗?Customer_Oder_Type
 @property (nonatomic,assign) NSInteger customer_order_type;///< 0 Shop Order/ 1 Sales Order,
 
+@property (nonatomic,assign) BOOL order_list_lock;///<设置订单表单锁,Yes表示订单不能查看Detail
+
 #pragma mark - Employee