|
@@ -321,16 +321,16 @@
|
|
|
[items insertObject:self.editOrderListButton atIndex:4];
|
|
[items insertObject:self.editOrderListButton atIndex:4];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (![items containsObject:self.mergeListButton]) { // 没显示button
|
|
|
|
|
- [items insertObject:self.mergeListButton atIndex:6];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (![items containsObject:self.mergeListButton]) { // 没显示button
|
|
|
|
|
+// [items insertObject:self.mergeListButton atIndex:6];
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
self.toolbarView.items = items;
|
|
self.toolbarView.items = items;
|
|
|
|
|
|
|
|
} else { // 不能合并
|
|
} else { // 不能合并
|
|
|
- if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
- [items removeObject:self.mergeListButton];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
+// [items removeObject:self.mergeListButton];
|
|
|
|
|
+// }
|
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
|
[items removeObject:self.editOrderListButton];
|
|
[items removeObject:self.editOrderListButton];
|
|
|
}
|
|
}
|
|
@@ -340,9 +340,9 @@
|
|
|
|
|
|
|
|
// Check For Saved Order 不能合并
|
|
// Check For Saved Order 不能合并
|
|
|
if(self.init_style==OL_OPEN || self.orderType == 1) {
|
|
if(self.init_style==OL_OPEN || self.orderType == 1) {
|
|
|
- if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
- [items removeObject:self.mergeListButton];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
+// [items removeObject:self.mergeListButton];
|
|
|
|
|
+// }
|
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
|
[items removeObject:self.editOrderListButton];
|
|
[items removeObject:self.editOrderListButton];
|
|
|
}
|
|
}
|
|
@@ -354,9 +354,9 @@
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
// self.mergeListButton.hidden = YES;
|
|
// self.mergeListButton.hidden = YES;
|
|
|
- if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
- [items removeObject:self.mergeListButton];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
+// [items removeObject:self.mergeListButton];
|
|
|
|
|
+// }
|
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
|
[items removeObject:self.editOrderListButton];
|
|
[items removeObject:self.editOrderListButton];
|
|
|
}
|
|
}
|
|
@@ -1135,7 +1135,7 @@
|
|
|
|
|
|
|
|
if(appDelegate.user_type==USER_ROLE_CUSTOMER) { // Customer
|
|
if(appDelegate.user_type==USER_ROLE_CUSTOMER) { // Customer
|
|
|
if ([Singleton sharedInstance].global_lock) { // Order list 被锁
|
|
if ([Singleton sharedInstance].global_lock) { // Order list 被锁
|
|
|
- [RAUtils message_alert:@"App is locked,You can't view the order Detail" title:@"Warning" controller:self];
|
|
|
|
|
|
|
+ [RAUtils message_alert:@"Permission Needed.\nGoto Menu -> Unlock" title:@"Warning" controller:self];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1807,7 +1807,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
|
|
|
|
|
if (!self.mergeList.count) {
|
|
if (!self.mergeList.count) {
|
|
|
|
|
|
|
|
- [RAUtils message_alert:@"Combine List is Empty" title:@"Warning" controller:self];
|
|
|
|
|
|
|
+// [RAUtils message_alert:@"Combine List is Empty" title:@"Warning" controller:self];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1834,6 +1834,12 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
[strongself.table_order endEditing:YES];
|
|
[strongself.table_order endEditing:YES];
|
|
|
[strongself ReloadData];
|
|
[strongself ReloadData];
|
|
|
|
|
|
|
|
|
|
+ if ([Singleton sharedInstance].customer_can_see_sales_Order) {
|
|
|
|
|
+
|
|
|
|
|
+ [strongself openOrder:ret];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
NSString *msg = [ret objectForKey:@"err_msg"];
|
|
NSString *msg = [ret objectForKey:@"err_msg"];
|
|
@@ -1897,7 +1903,11 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
|
|
|
|
|
- (IBAction)editOrderListButtonClick:(UIBarButtonItem *)sender {
|
|
- (IBAction)editOrderListButtonClick:(UIBarButtonItem *)sender {
|
|
|
|
|
|
|
|
|
|
+ UIImage *gray = [UIImage imageNamed:@"Combine"];
|
|
|
|
|
+ UIImage *green = [[UIImage imageNamed:@"Combinegreen"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
|
|
|
|
+
|
|
|
if (self.table_order.isEditing) {
|
|
if (self.table_order.isEditing) {
|
|
|
|
|
+ [self mergeListButtonClick:nil];
|
|
|
// 结束选择时恢复
|
|
// 结束选择时恢复
|
|
|
if ([Singleton sharedInstance].customer_can_see_sales_Order && ![Singleton sharedInstance].global_lock) { // 有查看Sales order 权限,并且app没有锁
|
|
if ([Singleton sharedInstance].customer_can_see_sales_Order && ![Singleton sharedInstance].global_lock) { // 有查看Sales order 权限,并且app没有锁
|
|
|
if (self.orderTypeSegmentControl.numberOfSegments == 1) {
|
|
if (self.orderTypeSegmentControl.numberOfSegments == 1) {
|
|
@@ -1909,8 +1919,9 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
[self ReloadData];
|
|
[self ReloadData];
|
|
|
|
|
|
|
|
[self.table_order setEditing:NO animated:YES];
|
|
[self.table_order setEditing:NO animated:YES];
|
|
|
- sender.title = @"Select";
|
|
|
|
|
- [self.mergeList removeAllObjects];
|
|
|
|
|
|
|
+// sender.title = @"Select";
|
|
|
|
|
+// [self.mergeList removeAllObjects];
|
|
|
|
|
+ [sender setImage:gray];
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
// 选择时不能选择Sales Order
|
|
// 选择时不能选择Sales Order
|
|
@@ -1925,8 +1936,8 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
[self ReloadData];
|
|
[self ReloadData];
|
|
|
|
|
|
|
|
[self.table_order setEditing:YES animated:YES];
|
|
[self.table_order setEditing:YES animated:YES];
|
|
|
- sender.title = @"Exit";
|
|
|
|
|
-
|
|
|
|
|
|
|
+// sender.title = @"Exit";
|
|
|
|
|
+ [sender setImage:green];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1951,9 +1962,9 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
NSMutableArray *items = [self.toolbarView.items mutableCopy];
|
|
NSMutableArray *items = [self.toolbarView.items mutableCopy];
|
|
|
if (ordertype == 1) {
|
|
if (ordertype == 1) {
|
|
|
// 不能合并
|
|
// 不能合并
|
|
|
- if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
- [items removeObject:self.mergeListButton];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
+// [items removeObject:self.mergeListButton];
|
|
|
|
|
+// }
|
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
|
[items removeObject:self.editOrderListButton];
|
|
[items removeObject:self.editOrderListButton];
|
|
|
}
|
|
}
|
|
@@ -1970,16 +1981,16 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
[items insertObject:self.editOrderListButton atIndex:4];
|
|
[items insertObject:self.editOrderListButton atIndex:4];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (![items containsObject:self.mergeListButton]) { // 没显示button
|
|
|
|
|
- [items insertObject:self.mergeListButton atIndex:6];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (![items containsObject:self.mergeListButton]) { // 没显示button
|
|
|
|
|
+// [items insertObject:self.mergeListButton atIndex:6];
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
self.toolbarView.items = items;
|
|
self.toolbarView.items = items;
|
|
|
|
|
|
|
|
} else { // 不能合并
|
|
} else { // 不能合并
|
|
|
- if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
- [items removeObject:self.mergeListButton];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if ([items containsObject:self.mergeListButton]) { // 显示button
|
|
|
|
|
+// [items removeObject:self.mergeListButton];
|
|
|
|
|
+// }
|
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
if ([items containsObject:self.editOrderListButton]) { // 显示button
|
|
|
[items removeObject:self.editOrderListButton];
|
|
[items removeObject:self.editOrderListButton];
|
|
|
}
|
|
}
|
|
@@ -2002,6 +2013,52 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)openOrder:(NSDictionary *)order {
|
|
|
|
|
+
|
|
|
|
|
+ if (!order) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ NSString *orderCode = [order objectForKey:@"orderCode"];
|
|
|
|
|
+ NSInteger orderStatus = [[order objectForKey:@"orderStatus"] integerValue];
|
|
|
|
|
+ NSString *so = [order objectForKey:@"so#"];
|
|
|
|
|
+
|
|
|
|
|
+ __weak typeof(self) weakself = self;
|
|
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
+
|
|
|
|
|
+ NSDictionary* order_json = [iSalesNetwork open_Order:orderCode];
|
|
|
|
|
+
|
|
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+
|
|
|
|
|
+ if([[order_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
+ {
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+ appDelegate.order_code = orderCode;
|
|
|
|
|
+ appDelegate.order_status = orderStatus;
|
|
|
|
|
+ [appDelegate SetSo:so];
|
|
|
|
|
+
|
|
|
|
|
+ [Singleton sharedInstance].placeOrderFromMerge = YES;
|
|
|
|
|
+
|
|
|
|
|
+ [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
|
|
+ [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
|
|
+ [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
|
|
|
|
|
+ [((MainViewController*)appDelegate.main_vc) switchToCart];
|
|
|
|
|
+ [((MainViewController*)appDelegate.main_vc).cartViewController placeOrder];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ [RAUtils message_alert:[order_json valueForKey:@"err_msg"] title:@"Open Order" controller:weakself] ;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
#pragma mark - notification action
|
|
#pragma mark - notification action
|
|
|
|
|
|
|
|
- (void)changePriceType:(id)notification {
|
|
- (void)changePriceType:(id)notification {
|