Explorar el Código

修改保存Shop Order时切换到Order History,并且保存成功提示SO#。
修改应用被锁时点击Order List提示信息。
修改Order List中Select为Create Po,并删除Convert To Po,并实现Create PO功能。

Pen Li hace 9 años
padre
commit
8d0811dc8b

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


+ 3 - 0
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -836,6 +836,9 @@
         
         
         if (![Singleton sharedInstance].permissions_edit_order) {
+            if ([Singleton sharedInstance].placeOrderFromMerge) {
+                [Singleton sharedInstance].placeOrderFromMerge = NO;
+            }
             return;
         }
         

+ 9 - 3
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -75,8 +75,14 @@
         // 正常情况
         if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
             // customer的订单必须是Sales Order并且有提交权限才能提交
-            if ([Singleton sharedInstance].customer_order_type == 1 && [Singleton sharedInstance].permissions_submit_order) {
+            if (([Singleton sharedInstance].customer_order_type == 1 || [Singleton sharedInstance].placeOrderFromMerge) && [Singleton sharedInstance].permissions_submit_order) {
+                
                 [items addObject:self.btnSubmitOrder];
+                
+                if ([Singleton sharedInstance].placeOrderFromMerge) {
+                    [Singleton sharedInstance].placeOrderFromMerge = NO;
+                }
+                
             }
         } else {
             [items addObject:self.btnSubmitOrder];
@@ -1115,7 +1121,7 @@
                 appDelegate.customerInfo = customerInfo;
                 appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
                 }
-                [RAUtils message_alert:nil title:@"Order Saved" controller:self] ;
+                [RAUtils message_alert:[editor_json objectForKey:@"so#"] title:@"Order Saved" controller:self] ;
                 
                 if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.save_order_logout && appDelegate.user_type ==USER_ROLE_EMPLOYEE)
                 {
@@ -2347,7 +2353,7 @@
     [appDelegate SetSo:nil];
     appDelegate.cart_count=0;
     [appDelegate update_count_mark];
-    [((MainViewController*)appDelegate.main_vc) switchToHome];
+    [((MainViewController*)appDelegate.main_vc) switchToOrder];
 
     [self prepareReturn:nil];
     [self.navigationController popToRootViewControllerAnimated:false];

+ 84 - 27
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -321,16 +321,16 @@
                 [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;
             
         } 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
                 [items removeObject:self.editOrderListButton];
             }
@@ -340,9 +340,9 @@
         
         // Check For Saved Order 不能合并
         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
                 [items removeObject:self.editOrderListButton];
             }
@@ -354,9 +354,9 @@
     } else {
         
 //        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
             [items removeObject:self.editOrderListButton];
         }
@@ -1135,7 +1135,7 @@
 
     if(appDelegate.user_type==USER_ROLE_CUSTOMER) { // Customer
         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;
         }
     }
@@ -1807,7 +1807,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     
     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;
     }
     
@@ -1834,6 +1834,12 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
                 [strongself.table_order endEditing:YES];
                 [strongself ReloadData];
                 
+                if ([Singleton sharedInstance].customer_can_see_sales_Order) {
+                    
+                    [strongself openOrder:ret];
+                    
+                }
+                
             } else {
                 
                 NSString *msg = [ret objectForKey:@"err_msg"];
@@ -1897,7 +1903,11 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 
 - (IBAction)editOrderListButtonClick:(UIBarButtonItem *)sender {
 
+    UIImage *gray = [UIImage imageNamed:@"Combine"];
+    UIImage *green = [[UIImage imageNamed:@"Combinegreen"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
+    
     if (self.table_order.isEditing) {
+        [self mergeListButtonClick:nil];
         // 结束选择时恢复
         if ([Singleton sharedInstance].customer_can_see_sales_Order && ![Singleton sharedInstance].global_lock) { // 有查看Sales order 权限,并且app没有锁
             if (self.orderTypeSegmentControl.numberOfSegments == 1) {
@@ -1909,8 +1919,9 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
         [self ReloadData];
         
         [self.table_order setEditing:NO animated:YES];
-        sender.title = @"Select";
-        [self.mergeList removeAllObjects];
+//        sender.title = @"Select";
+//        [self.mergeList removeAllObjects];
+        [sender setImage:gray];
         
     } else {
         // 选择时不能选择Sales Order
@@ -1925,8 +1936,8 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
         [self ReloadData];
         
         [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];
         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
                 [items removeObject:self.editOrderListButton];
             }
@@ -1970,16 +1981,16 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
                     [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;
                 
             } 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
                     [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
 
 - (void)changePriceType:(id)notification {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 132 - 135
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/Combinegreen.imageset/Combinegreen.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/Combinegreen.imageset/Combinegreen@2x.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/Combinegreen.imageset/Combinegreen@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/Combinegreen.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "Combinegreen.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "Combinegreen@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "Combinegreen@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

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

@@ -34,6 +34,7 @@ typedef enum {
 @property (nonatomic,assign) BOOL customer_can_see_sales_Order;///<是否有权查看Sales Order,控制Order List
 @property (nonatomic,strong) NSMutableDictionary *shop_order_status_filter;///<Shop Order Status
 @property (nonatomic,copy) NSString *specialInstruction;///<登陆时传的Special Instruction,在提交订单时显示
+@property (nonatomic,assign) BOOL placeOrderFromMerge;///<是否是合并订单成功后打开的订单,使用于Order List -》 Open Order、Cart -》Place Order、Place order -》 Submit
 
 #pragma mark - Employee 
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio