Просмотр исходного кода

修改合并订单(取消合并订单数量控制)。
在Customer登陆时,Order List增加区分Shop Order和Sales Order的SegmentControl。

Pen Li 9 лет назад
Родитель
Сommit
7c21d6cca8

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


+ 4 - 3
RedAnt ERP Mobile/common/Functions/offline/SelectUploadOrderViewController.m

@@ -115,9 +115,10 @@
 //        }];
     
     
-    // merge order
-    if (self.mergeList.count < 2) {
-        [RAUtils message_alert:@"Please Choose More Order" title:@"Warning" controller:self];
+    // merge order,一个订单也可以合并(合并订单也就是将shop order转为sales order)
+
+    if (self.mergeList.count < 1) {
+        [RAUtils message_alert:@"Please add some order" title:@"Warning" controller:self];
         return;
     }
     

+ 48 - 6
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -27,7 +27,10 @@
 
 @property (nonatomic,strong) NSMutableArray *mergeList;
 
+@property (nonatomic,assign) NSInteger orderType;///<sales order/shop order
+
 @property (strong, nonatomic) IBOutlet UIBarButtonItem *mergeListButton;
+@property (strong, nonatomic) IBOutlet UISegmentedControl *orderTypeSegmentControl;
 
 @end
 
@@ -118,7 +121,7 @@
     self.offset = 0;
     self.limit = 25;
     self.content_data = [[NSMutableArray alloc]init];
-    
+    self.orderType = self.orderTypeSegmentControl.selectedSegmentIndex;
     
     UIRefreshControl *ref = [[UIRefreshControl alloc]init];
     ref.tag = 201 ;
@@ -302,6 +305,29 @@
         }
     }
     
+    // 非Customer用户不用区分Sales Order 和 Shop Order
+    if (appDelegate.user_type != USER_ROLE_CUSTOMER) {
+        self.orderTypeSegmentControl.hidden = YES;
+        CGFloat y = CGRectGetMinY(self.orderTypeSegmentControl.frame);
+        CGFloat height = CGRectGetHeight(self.orderTypeSegmentControl.frame);
+        CGRect frame = self.table_order.frame;
+        if (frame.origin.y != y) {
+            frame.origin.y = y;
+            frame.size.height += height;
+        }
+        self.table_order.frame = frame;
+    } else {
+        self.orderTypeSegmentControl.hidden = NO;
+        CGFloat y = CGRectGetMinY(self.orderTypeSegmentControl.frame);
+        CGFloat height = CGRectGetHeight(self.orderTypeSegmentControl.frame);
+        CGRect frame = self.table_order.frame;
+        if (frame.origin.y == y) {
+            frame.origin.y = y + height;
+            frame.size.height -= height;
+        }
+        self.table_order.frame = frame;
+    }
+    
 }
 - (IBAction)onNewOrderClicked:(id)sender {
     
@@ -373,7 +399,7 @@
 }
 
 - (void)operation_loadPage {
-    NSLog(@"count %li",self.dataOperationQueue.operationCount);
+
     if (self.dataOperationQueue.operationCount > 1) { // 队列后面还有操作
         return;
     }
@@ -454,11 +480,20 @@
         }
         
         NSString * str_status = [arr_status componentsJoinedByString:@","];
-        
-        
+    
+    BOOL isMerged = NO;
+    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+        if (self.orderType == 0) {
+            isMerged = NO;
+        } else {
+            isMerged = YES;
+        }
+    }
+    
+    
         NSMutableDictionary* content=nil;
-        content=[[iSalesNetwork request_OrderList:self.offset limit : self.limit keywords:self.keywords status:str_status customer:self.customer_id] mutableCopy];
-        NSLog(@"operation count %lu",self.dataOperationQueue.operationCount);
+        content=[[iSalesNetwork request_OrderList:self.offset limit : self.limit keywords:self.keywords status:str_status customer:self.customer_id is_merged:isMerged] mutableCopy];
     
         
         dispatch_sync(dispatch_get_main_queue(), ^{
@@ -1595,6 +1630,13 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     
 }
 
+- (IBAction)orderTypeChanged:(UISegmentedControl *)sender {
+    
+    self.orderType = sender.selectedSegmentIndex;
+    [self ReloadData];
+    
+}
+
 #pragma mark - notification action
 
 - (void)changePriceType:(id)notification {

+ 1 - 1
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.h

@@ -70,7 +70,7 @@
 +(NSDictionary*) move_wish2cart:(NSString* ) item_ids;
 +(NSDictionary*) move_cart2wish:(NSString* ) item_ids;
 
-+(NSDictionary*)request_OrderList:(int ) offset limit :(int)limit keywords :(NSString* ) keywords status:(NSString*) status_code customer:(NSString*) customer;
++(NSDictionary*)request_OrderList:(int ) offset limit :(int)limit keywords :(NSString* ) keywords status:(NSString*) status_code customer:(NSString*) customer is_merged:(BOOL) isMerged;
 +(NSDictionary*)request_OrderDetail:(NSString* ) orderid;
 +(NSDictionary*)commit_Order:(NSString*) order_code;// saved:(bool) saved;
 +(NSDictionary*)copy_Order:(NSString*) order_code;

+ 2 - 1
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

@@ -1391,7 +1391,7 @@ repeat:
 //    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
 //    return jsobj;
 //}
-+(NSDictionary*)request_OrderList:(int ) offset limit :(int)limit keywords :(NSString* ) keywords status:(NSString*) status_code customer:(NSString*) customer
++(NSDictionary*)request_OrderList:(int ) offset limit :(int)limit keywords :(NSString* ) keywords status:(NSString*) status_code customer:(NSString*) customer is_merged:(BOOL) isMerged
 {
     
     
@@ -1409,6 +1409,7 @@ repeat:
     [params setValue:[NSString stringWithFormat:@"%d",limit ] forKey:@"limit"];
     [params setValue:keywords forKey:@"keyWord"];
     [params setValue:customer forKey:@"customer_filter"];
+    [params setValue:[NSNumber numberWithBool:isMerged] forKey:@"isMerged"];
     
     [params setValue:status_code forKey:@"orderStatus"];
     NSData* json=nil;

Разница между файлами не показана из-за своего большого размера
+ 131 - 134
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard


Некоторые файлы не были показаны из-за большого количества измененных файлов