Procházet zdrojové kódy

提交订单时提示增加Price Type和Special Instruction。

Pen Li před 9 roky
rodič
revize
a7fde7fbb9

binární
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 1
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -353,7 +353,7 @@
     int section_count=self.content_data_control.count;//[[self.content_data_download valueForKey:@"section_count"] intValue];
     
     
-    NSString* aaa  = [RAUtils dict2string:self.content_data_control];
+//    NSString* aaa  = [RAUtils dict2string:self.content_data_control];
     for(int i=0;i<section_count;i++)
     {
         DebugLog(@"debug...section:%d",i);

+ 70 - 40
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -124,46 +124,46 @@
     // get customer info
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
-    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
-        
-        // 检查价格类型
-        // 提货价才能提交订单
-        /**  价格类型
-         *   0 提货价
-         *   1 统一价
-         *   2 计算价
-         */
-        NSInteger priceType = [Singleton sharedInstance].npd_shop_price_type;
-        if (priceType != 0) {
-
-            NSString* pricename = nil;
-            switch (priceType) {
-                case 1:
-                    pricename=flat_price;
-                    break;
-                case 2:
-                    pricename=given_price;
-                    break;
-                default:
-                    break;
-            }
-            
-            UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"Current price is %@, please change to %@ and try again.",pricename,[Singleton sharedInstance].deliveryString] preferredStyle:UIAlertControllerStyleAlert];
-            
-            UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                
-                [alertVC dismissViewControllerAnimated:YES completion:nil];
-                
-            }];
-            
-            
-            [alertVC addAction:cancelAction];
-            
-            [self presentViewController:alertVC animated:YES completion:nil];
-            
-            return;
-        }
-    }
+//    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+//        
+//        // 检查价格类型
+//        // 提货价才能提交订单
+//        /**  价格类型
+//         *   0 提货价
+//         *   1 统一价
+//         *   2 计算价
+//         */
+//        NSInteger priceType = [Singleton sharedInstance].npd_shop_price_type;
+//        if (priceType != 0) {
+//
+//            NSString* pricename = nil;
+//            switch (priceType) {
+//                case 1:
+//                    pricename=flat_price;
+//                    break;
+//                case 2:
+//                    pricename=given_price;
+//                    break;
+//                default:
+//                    break;
+//            }
+//            
+//            UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"Current price is %@, please change to %@ and try again.",pricename,[Singleton sharedInstance].deliveryString] preferredStyle:UIAlertControllerStyleAlert];
+//            
+//            UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+//                
+//                [alertVC dismissViewControllerAnimated:YES completion:nil];
+//                
+//            }];
+//            
+//            
+//            [alertVC addAction:cancelAction];
+//            
+//            [self presentViewController:alertVC animated:YES completion:nil];
+//            
+//            return;
+//        }
+//    }
     
     
     NSString* msg;
@@ -174,6 +174,16 @@
     else
     {
         msg=@"Are you sure to submit order?";
+        
+        if(appDelegate.user_type == USER_ROLE_CUSTOMER) {
+            
+            NSString *specialInstuction = [Singleton sharedInstance].specialInstruction;
+            msg = [NSString stringWithFormat:@"Are you sure to submit order?\n1.Current Price Type is %@",[self currentPriceTypeName]];
+            if (specialInstuction.length) {
+                msg = [msg stringByAppendingFormat:@"\n2.Special Instruction is %@.",specialInstuction];
+            }
+            
+        }
     }
     
     UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Submit Confirm.", nil) message:NSLocalizedString(msg, nil) delegate:self cancelButtonTitle:NSLocalizedString(@"NO", nil) otherButtonTitles:NSLocalizedString(@"YES", nil), nil];
@@ -1597,4 +1607,24 @@
 //    [self.navigationController popViewControllerAnimated:true];
 //}
 
+- (NSString *)currentPriceTypeName {
+    NSInteger priceType = [Singleton sharedInstance].npd_shop_price_type;
+        
+    NSString* pricename = nil;
+    switch (priceType) {
+        case 0:
+            pricename=[Singleton sharedInstance].deliveryString;
+            break;
+        case 1:
+            pricename=flat_price;
+            break;
+        case 2:
+            pricename=given_price;
+            break;
+        default:
+            break;
+    }
+    return pricename;
+}
+
 @end

+ 3 - 0
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

@@ -3623,6 +3623,9 @@ repeat:
             NSString *shopOrderStatusFilterStr = [objheader valueForKey:@"shopOrderFilter"] ;
             [Singleton sharedInstance].shop_order_status_filter = [[RAUtils string2dict:shopOrderStatusFilterStr] mutableCopy];
             
+            // specialInstruction
+            [Singleton sharedInstance].specialInstruction = [objheader valueForKey:@"specialInstruction"];
+            
             //-价格类型
             [Singleton sharedInstance].npd_shop_price_type = [[objheader valueForKey:@"price_type"] integerValue];
             

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

@@ -33,6 +33,7 @@ typedef enum {
 @property (nonatomic,assign) BOOL global_lock;///<全局锁,Yes表示订单不能查看Detail,需要密码验证Price Setting,Hide Price
 @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,在提交订单时显示
 
 #pragma mark - Employee