Ver Fonte

修复Order Type未更改,在锁上的时候。

Pen Li há 9 anos atrás
pai
commit
cb5522d4d5

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


+ 13 - 4
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -1767,11 +1767,15 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     
 }
 
-- (IBAction)orderTypeChanged:(UISegmentedControl *)sender {
-    
-    self.orderType = sender.selectedSegmentIndex;
-    [Singleton sharedInstance].customer_order_type = self.orderType;
+- (void)changeOrderType:(NSInteger)ordertype {
+    self.orderType = ordertype;
+    [Singleton sharedInstance].customer_order_type = ordertype;
     [self ReloadData];
+}
+
+- (IBAction)orderTypeChanged:(UISegmentedControl *)sender {
+
+    [self changeOrderType:sender.selectedSegmentIndex];
     
 }
 
@@ -1783,6 +1787,11 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 
 - (void)lockOrderListNotification:(NSNotification *)notification {
     if ([notification.name isEqual:Lock_Permission_Notification]) {
+        if (self.orderType == 1) {
+            self.orderTypeSegmentControl.selectedSegmentIndex = 0;
+            [self changeOrderType:0];
+        }
+        
         [self.orderTypeSegmentControl removeSegmentAtIndex:1 animated:YES];
     } else {
         [self.orderTypeSegmentControl insertSegmentWithTitle:@"Sales Order" atIndex:1 animated:YES];