|
@@ -27,7 +27,10 @@
|
|
|
|
|
|
|
|
@property (nonatomic,strong) NSMutableArray *mergeList;
|
|
@property (nonatomic,strong) NSMutableArray *mergeList;
|
|
|
|
|
|
|
|
|
|
+@property (nonatomic,assign) NSInteger orderType;///<sales order/shop order
|
|
|
|
|
+
|
|
|
@property (strong, nonatomic) IBOutlet UIBarButtonItem *mergeListButton;
|
|
@property (strong, nonatomic) IBOutlet UIBarButtonItem *mergeListButton;
|
|
|
|
|
+@property (strong, nonatomic) IBOutlet UISegmentedControl *orderTypeSegmentControl;
|
|
|
|
|
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
@@ -118,7 +121,7 @@
|
|
|
self.offset = 0;
|
|
self.offset = 0;
|
|
|
self.limit = 25;
|
|
self.limit = 25;
|
|
|
self.content_data = [[NSMutableArray alloc]init];
|
|
self.content_data = [[NSMutableArray alloc]init];
|
|
|
-
|
|
|
|
|
|
|
+ self.orderType = self.orderTypeSegmentControl.selectedSegmentIndex;
|
|
|
|
|
|
|
|
UIRefreshControl *ref = [[UIRefreshControl alloc]init];
|
|
UIRefreshControl *ref = [[UIRefreshControl alloc]init];
|
|
|
ref.tag = 201 ;
|
|
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 {
|
|
- (IBAction)onNewOrderClicked:(id)sender {
|
|
|
|
|
|
|
@@ -373,7 +399,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)operation_loadPage {
|
|
- (void)operation_loadPage {
|
|
|
- NSLog(@"count %li",self.dataOperationQueue.operationCount);
|
|
|
|
|
|
|
+
|
|
|
if (self.dataOperationQueue.operationCount > 1) { // 队列后面还有操作
|
|
if (self.dataOperationQueue.operationCount > 1) { // 队列后面还有操作
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -454,11 +480,20 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
NSString * str_status = [arr_status componentsJoinedByString:@","];
|
|
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;
|
|
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(), ^{
|
|
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
|
|
#pragma mark - notification action
|
|
|
|
|
|
|
|
- (void)changePriceType:(id)notification {
|
|
- (void)changePriceType:(id)notification {
|