Răsfoiți Sursa

实现店铺提交订单时价格类型检查。

Pen Li 9 ani în urmă
părinte
comite
e1aca3ec6b

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


+ 25 - 1
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -9,6 +9,7 @@
 #import "CreateOrderViewController.h"
 #import "iSalesNetwork.h"
 #import "MainViewController.h"
+#import "Singleton.h"
 #define SUBMIT_CONFIRM 123
 #define KEEP_TAIL 456
 #define CLOSE_ACTION 567
@@ -135,10 +136,33 @@
 }
 - (void)onCommitOrderClick:(id)sender {
     // get customer info
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
+    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+        
+        // 检查价格类型
+        // 提货价才能提交订单
+        NSInteger priceType = [Singleton sharedInstance].npd_shop_price_type;
+        if (priceType != 0) {
+            
+            UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Please Check Your Price Type,Sure It's Delivery Price" 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;
+        }
+    }
     
     
-        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     NSString* msg;
     if(appDelegate.offline_mode)
     {

+ 0 - 2
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -475,8 +475,6 @@ void UncaughtExceptionHandler(NSException *exception) {
     
     content = [content stringByReplacingOccurrencesOfString:@"'" withString:@"''"];
     
-
-    NSLog(@".....");
     
     NSString *sql = [NSString stringWithFormat:@"insert into errlog (errmsg,params) values ('%@','%@');",versionNum,content];