Przeglądaj źródła

修改Order提交,使Shop Order不能提交。
增加Email Cart As Quote按钮,并实现其功能。

Pen Li 9 lat temu
rodzic
commit
0e0abbf055

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


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

@@ -26,6 +26,7 @@
 #import "SortButton.h"
 #import "NotificationNameCenter.h"
 #import "Singleton.h"
+#import "JKMessageBoxController.h"
 
 #define ALERT_FREE 1024
 #define ALERT_DEL 1025
@@ -43,6 +44,7 @@
 @property (strong, nonatomic) IBOutlet UIButton *cancelOrderButton;
 
 @property (nonatomic,strong) NSOperationQueue *dataOperationQueue;
+@property (strong, nonatomic) IBOutlet UIButton *emailButton;
 
 @end
 
@@ -470,6 +472,8 @@
     
     [super viewWillAppear:animated];
     
+    // email 39 cancel 44 place order
+    
     // Shop 权限检查
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
@@ -477,10 +481,16 @@
             
             CGRect frame0 = self.cancelOrderButton.frame;
             CGRect frame1 = self.placeOrderButton.frame;
+            CGRect frame2 = self.emailButton.frame;
             
             CGFloat x = CGRectGetMaxX(frame1) - frame0.size.width;
             frame0.origin.x = x;
             self.cancelOrderButton.frame = frame0;
+            
+            x -= 39 + CGRectGetWidth(frame2);
+            frame2.origin.x = x;
+            self.emailButton.frame = frame2;
+            
             self.placeOrderButton.hidden = YES;
         } else {
             self.placeOrderButton.hidden = NO;
@@ -488,6 +498,11 @@
             CGFloat x = CGRectGetMinX(self.placeOrderButton.frame) - 44 - size.width;// 44 为间距
             CGFloat y = CGRectGetMinY(self.placeOrderButton.frame);
             self.cancelOrderButton.frame = CGRectMake(x, y, size.width, size.height);
+            
+            CGRect frame2 = self.emailButton.frame;
+            x -= 39 + CGRectGetWidth(frame2);
+            frame2.origin.x = x;
+            self.emailButton.frame = frame2;
         }
     } else {
 //        self.cancelOrderButton.frame = cancelButtonFrame;
@@ -496,8 +511,16 @@
         CGFloat x = CGRectGetMinX(self.placeOrderButton.frame) - 44 - size.width;// 44 为间距
         CGFloat y = CGRectGetMinY(self.placeOrderButton.frame);
         self.cancelOrderButton.frame = CGRectMake(x, y, size.width, size.height);
+        
+        CGRect frame2 = self.emailButton.frame;
+        x -= 39 + CGRectGetWidth(frame2);
+        frame2.origin.x = x;
+        self.emailButton.frame = frame2;
     }
     
+    // 离线隐藏Email
+    self.emailButton.hidden = appDelegate.offline_mode;
+        
 //    [self reload_data]; // 视图没及时刷新
     
     //    UIApplication * app = [UIApplication sharedApplication];
@@ -2634,5 +2657,57 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     [self reload_data];
 }
 
+#pragma mark - button action
+
+- (IBAction)emailButtonClick:(UIButton *)sender {
+    
+//    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+
+    JKMessageBoxController *emailAddrVC = [JKMessageBoxController messageBoxControllerWithTip:@"Please enter email address"];
+    emailAddrVC.textFiled.secureTextEntry = NO;
+    emailAddrVC.yesButtonTitle = @"send";
+    
+    __weak typeof(emailAddrVC) weakVC = emailAddrVC;
+    __weak typeof(self) weakself = self;
+    
+    emailAddrVC.textHandler = ^(NSString *text){
+        
+        // 验证邮箱格式是否正确
+        NSString *match = @"^[A-Za-zd]+([-_.][A-Za-zd]+)*@([A-Za-zd]+[-.])+[A-Za-zd]{2,5}$";
+        NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",match];
+        BOOL isEmailAddr = [predicate evaluateWithObject:text];
+        if (isEmailAddr) {
+            
+            // 验证是邮件地址,发送邮件
+            [weakVC dismissViewControllerAnimated:YES completion:^{
+                
+                NSDictionary *result = [iSalesNetwork quoteOrder:self.orderid emailAddr:text];
+                if ([[result objectForKey:@"result"] integerValue] != RESULT_TRUE) {
+                    
+                    UIAlertController *errorAlertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"The email send to %@ failed",text] preferredStyle:UIAlertControllerStyleAlert];
+                    UIAlertAction *action = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                        
+                    }];
+                    
+                    [errorAlertVC addAction:action];
+                    [weakself presentViewController:errorAlertVC animated:YES completion:nil];
+                    
+                }
+            }];
+            
+        } else {
+            
+            // 非邮件地址,警告
+            [weakVC warning:@"Please enter right email address"];
+            
+        }
+        
+    };
+    
+    [self presentViewController:emailAddrVC animated:YES completion:nil];
+    
+}
+
+
 
 @end

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

@@ -57,7 +57,8 @@
     }
     
     if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
-        if ([Singleton sharedInstance].permissions_submit_order) {
+        // customer的订单必须是Sales Order才能提交
+        if ([Singleton sharedInstance].customer_order_type == 1 && [Singleton sharedInstance].permissions_submit_order) {
             [items addObject:self.btnSubmitOrder];
         }
     } else {

+ 3 - 0
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -121,7 +121,9 @@
     self.offset = 0;
     self.limit = 25;
     self.content_data = [[NSMutableArray alloc]init];
+    // Customer Order Type 0 Shop Order/ 1 Sales Order
     self.orderType = self.orderTypeSegmentControl.selectedSegmentIndex;
+    [Singleton sharedInstance].customer_order_type = self.orderType;
     
     UIRefreshControl *ref = [[UIRefreshControl alloc]init];
     ref.tag = 201 ;
@@ -1633,6 +1635,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 - (IBAction)orderTypeChanged:(UISegmentedControl *)sender {
     
     self.orderType = sender.selectedSegmentIndex;
+    [Singleton sharedInstance].customer_order_type = self.orderType;
     [self ReloadData];
     
 }

+ 1 - 0
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.h

@@ -139,5 +139,6 @@
 
 + (NSDictionary *)lock_order:(NSString *)oderCode;
 
++ (NSDictionary *)quoteOrder:(NSString *)so_id emailAddr:(NSString *)addr;// email cart as quote
 
 @end

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

@@ -3891,4 +3891,11 @@ repeat:
         return nil;
 }
 
++ (NSDictionary *)quoteOrder:(NSString *)so_id emailAddr:(NSString *)addr {
+    
+    NSDictionary *result = @{@"result":@(RESULT_FALSE)};
+    
+    return result;
+}
+
 @end

+ 35 - 26
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard

@@ -2143,7 +2143,7 @@
                                         <rect key="frame" x="0.0" y="88" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Pol-lE-P45" id="FAm-1c-nX0">
-                                            <frame key="frameInset" width="730" height="44"/>
+                                            <frame key="frameInset" width="702" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Clean Cache" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="AHm-p1-51h">
@@ -2376,7 +2376,7 @@
                                                 <rect key="frame" x="0.0" y="22" width="768" height="146"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0QE-xl-8q8" id="tZa-g0-y6H">
-                                                    <frame key="frameInset" width="768" height="146"/>
+                                                    <frame key="frameInset" width="768" height="145"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name aaaaaaaaaaaaa aaaaaaaaaa BBBBB  CCCCC" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="S98-fV-nsC" userLabel="name and description">
@@ -2642,8 +2642,8 @@
                                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
-                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Q86-CY-riR">
-                                        <frame key="frameInset" minX="130" minY="89" width="356" height="18"/>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Q86-CY-riR">
+                                        <frame key="frameInset" minX="130" minY="89" width="306" height="18"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -2662,6 +2662,14 @@
                                             <action selector="onEditClick:" destination="Cwo-Rn-ZMW" eventType="touchUpInside" id="P5Y-zO-eCp"/>
                                         </connections>
                                     </button>
+                                    <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="1k1-dx-91p">
+                                        <frame key="frameInset" minY="83" width="46" height="30" maxX="257"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                        <state key="normal" title="Email"/>
+                                        <connections>
+                                            <action selector="emailButtonClick:" destination="Cwo-Rn-ZMW" eventType="touchUpInside" id="LPb-ex-p8b"/>
+                                        </connections>
+                                    </button>
                                 </subviews>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             </view>
@@ -2703,6 +2711,7 @@
                         <outlet property="btn_edit_select" destination="Qyh-x9-Q29" id="SW6-IF-mo5"/>
                         <outlet property="cancelOrderButton" destination="HXI-1Z-Yo5" id="yfI-KK-bHm"/>
                         <outlet property="cartItemView" destination="APc-j8-ZhR" id="aua-Qg-MgJ"/>
+                        <outlet property="emailButton" destination="1k1-dx-91p" id="FKf-oN-u9b"/>
                         <outlet property="itemListTable" destination="r3H-Zh-AQ4" id="RxD-ZP-Gbh"/>
                         <outlet property="labelTotal" destination="Rak-uF-hDd" id="zd4-Ey-hCG"/>
                         <outlet property="label_carton" destination="ur8-5x-2YG" id="Kme-E8-VpV"/>
@@ -3019,7 +3028,7 @@
                                         <rect key="frame" x="0.0" y="22" width="768" height="66"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="H8t-DU-AtW" id="q6R-9a-SsD">
-                                            <frame key="frameInset" width="768" height="65.5"/>
+                                            <frame key="frameInset" width="768" height="65"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WEB1509140024" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fu3-Bf-ZH2" userLabel="So#">
@@ -3030,14 +3039,14 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345678.00" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="N3e-hc-gFF" userLabel="price">
-                                                    <frame key="frameInset" minY="23" width="100" maxX="176" maxY="21.5"/>
+                                                    <frame key="frameInset" minY="23" width="100" maxX="176" maxY="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="02/02/2015 10:10:10" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qf1-u6-uMA" userLabel="date">
-                                                    <frame key="frameInset" minY="11" width="148" maxX="15" maxY="11.5"/>
+                                                    <frame key="frameInset" minY="11" width="148" maxX="15" maxY="11"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -3058,7 +3067,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99999" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kLZ-2K-sGp">
-                                                    <frame key="frameInset" minY="5" width="100" maxX="176" maxY="39.5"/>
+                                                    <frame key="frameInset" minY="5" width="100" maxX="176" maxY="39"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -3127,8 +3136,8 @@
                                 <frame key="frameInset" minY="66" height="29"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
                                 <segments>
-                                    <segment title="First"/>
-                                    <segment title="Second"/>
+                                    <segment title="Shop Order"/>
+                                    <segment title="Sales Order"/>
                                 </segments>
                                 <connections>
                                     <action selector="orderTypeChanged:" destination="Jst-hh-WTF" eventType="valueChanged" id="cmC-na-IVt"/>
@@ -4890,7 +4899,7 @@
                                 <color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellModel" rowHeight="140" id="n4c-77-hLv" customClass="CommonEditorCellModel">
-                                        <rect key="frame" x="0.0" y="55.5" width="768" height="140"/>
+                                        <rect key="frame" x="0.0" y="56" width="768" height="140"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="n4c-77-hLv" id="DvL-17-pkX">
                                             <frame key="frameInset" width="768" height="139"/>
@@ -4950,7 +4959,7 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellEnum" id="Xog-Cl-i5m" customClass="CommonEditorCellEnum">
-                                        <rect key="frame" x="0.0" y="195.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="196" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Xog-Cl-i5m" id="POr-6Z-bgE">
                                             <frame key="frameInset" width="768" height="43"/>
@@ -4976,7 +4985,7 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellSwitch" rowHeight="44" id="bU5-1H-8Ym" customClass="CommonEditorCellSwitch">
-                                        <rect key="frame" x="0.0" y="239.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="240" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bU5-1H-8Ym" id="ThQ-zS-Kmf">
                                             <frame key="frameInset" width="768" height="43"/>
@@ -5028,7 +5037,7 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellSignature" rowHeight="140" id="1Ld-bY-s0l" customClass="CommonEditorCellSignature">
-                                        <rect key="frame" x="0.0" y="327.5" width="768" height="140"/>
+                                        <rect key="frame" x="0.0" y="328" width="768" height="140"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="1Ld-bY-s0l" id="keH-oZ-gZA">
                                             <frame key="frameInset" width="768" height="139"/>
@@ -5053,7 +5062,7 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellLabel" id="n0g-se-pw1" customClass="CommonEditorCellLabel">
-                                        <rect key="frame" x="0.0" y="467.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="468" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="n0g-se-pw1" id="MTt-Lc-1Mu">
                                             <frame key="frameInset" width="768" height="43"/>
@@ -5081,7 +5090,7 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="nEditorCellAction" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellAction" id="lUK-Sp-QMR" customClass="CommonEditorCellAction">
-                                        <rect key="frame" x="0.0" y="511.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="512" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="lUK-Sp-QMR" id="SU0-Og-nm9">
                                             <frame key="frameInset" width="768" height="43"/>
@@ -5764,11 +5773,11 @@ Email: redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="22" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="6hT-I3-WW3" id="gKI-En-sgV">
-                                            <frame key="frameInset" width="768" height="43"/>
+                                            <frame key="frameInset" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <view contentMode="scaleToFill" id="Eyx-Zr-PLO" customClass="RTLabel">
-                                                    <frame key="frameInset" minX="-6" minY="-7" maxX="22" maxY="18"/>
+                                                    <frame key="frameInset" minX="-6" minY="-7" maxX="22" maxY="19"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                 </view>
@@ -5782,7 +5791,7 @@ Email: redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="66" width="768" height="190"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="lSe-2G-cT7" id="KDS-aU-tYT">
-                                            <frame key="frameInset" width="768" height="189"/>
+                                            <frame key="frameInset" width="768" height="190"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345678.00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="yQq-ma-HdT" userLabel="unit price">
@@ -5906,7 +5915,7 @@ Email: redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="256" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9rG-Hv-ICg" id="e5s-wc-IkL">
-                                            <frame key="frameInset" width="768" height="43"/>
+                                            <frame key="frameInset" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="$123456789.00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fNL-sW-tkk" userLabel="price">
@@ -5934,11 +5943,11 @@ Email: redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="300" width="768" height="186"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9hm-qp-u5H" id="PQ9-FQ-6Si">
-                                            <frame key="frameInset" width="768" height="185"/>
+                                            <frame key="frameInset" width="768" height="186"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <webView userInteractionEnabled="NO" contentMode="scaleToFill" allowsInlineMediaPlayback="NO" mediaPlaybackRequiresUserAction="NO" mediaPlaybackAllowsAirPlay="NO" keyboardDisplayRequiresUserAction="NO" id="9m6-iq-KMk">
-                                                    <frame key="frameInset" minY="5" maxY="4"/>
+                                                    <frame key="frameInset" minY="5" maxY="5"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <dataDetectorType key="dataDetectorTypes"/>
@@ -5953,7 +5962,7 @@ Email: redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="486" width="768" height="148"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="s5l-6k-iWO" id="8ms-PN-eNw">
-                                            <frame key="frameInset" width="768" height="147"/>
+                                            <frame key="frameInset" width="768" height="148"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="wjN-UC-W3J">
@@ -6400,11 +6409,11 @@ Email: redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="22" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Vyi-Ez-P2a" id="LVn-pY-YDc">
-                                            <frame key="frameInset" width="768" height="43.5"/>
+                                            <frame key="frameInset" width="768" height="43"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <view contentMode="scaleToFill" id="N1s-I8-bJv" customClass="RTLabel">
-                                                    <frame key="frameInset" minX="15" minY="8" maxX="59" maxY="7.5"/>
+                                                    <frame key="frameInset" minX="15" minY="8" maxX="59" maxY="7"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                 </view>
@@ -7878,7 +7887,7 @@ Email: redantsupport@united-us.net</string>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="HwF-54-hzr">
-                                                    <frame key="frameInset" minX="15" width="698" height="43.5"/>
+                                                    <frame key="frameInset" minX="28" width="672" height="43.5"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

+ 3 - 0
RedAnt ERP Mobile/iSales-NPD/JKLock/JKMessageBoxController.h

@@ -18,6 +18,9 @@ typedef void(^inputHandler)(NSString *text);
 
 @property (nonatomic,copy) inputHandler textHandler;
 
+@property (nonatomic,copy) NSString *yesButtonTitle;
+
+@property (nonatomic,strong) UITextField *textFiled;///<default secureTextEntry = Yes
 
 + (instancetype)messageBoxControllerWithTip:(NSString *)msg;
 

+ 12 - 6
RedAnt ERP Mobile/iSales-NPD/JKLock/JKMessageBoxController.m

@@ -9,10 +9,13 @@
 #import "JKMessageBoxController.h"
 #import "AppDelegate.h"
 
+#define Button_Title_Normal_Color [UIColor colorWithRed:0.0 green:0.4 blue:0.8 alpha:1]
+#define Button_Title_Highlight_Color [UIColor colorWithRed:0.0 green:0.3 blue:0.8 alpha:1]
+
+
 @interface JKMessageBoxController ()<UITextFieldDelegate>
 
 @property (nonatomic,strong) UILabel *titleLabel;
-@property (nonatomic,strong) UITextField *textFiled;
 @property (nonatomic,strong) UIView *buttonBackground;
 @property (nonatomic,strong) UIButton *cancelButton;
 @property (nonatomic,strong) UIButton *yesButton;
@@ -82,10 +85,11 @@
         _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
         _cancelButton.frame = CGRectMake(0, 0.5, self.preferredContentSize.width / 2 - 0.25, CGRectGetHeight(self.buttonBackground.frame));
         [_cancelButton setTitle:@"cancel" forState:UIControlStateNormal];
-        [_cancelButton setTitleColor:[UIColor colorWithRed:0.3 green:0.3 blue:0.8 alpha:1] forState:UIControlStateNormal];
-        [_cancelButton setTitleColor:[UIColor colorWithRed:0.1 green:0.1 blue:0.9 alpha:1] forState:UIControlStateHighlighted];
+        [_cancelButton setTitleColor:Button_Title_Normal_Color forState:UIControlStateNormal];
+        [_cancelButton setTitleColor:Button_Title_Highlight_Color forState:UIControlStateHighlighted];
         _cancelButton.backgroundColor = [UIColor whiteColor];
         _cancelButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
+        _cancelButton.titleEdgeInsets = UIEdgeInsetsMake(-15, 0, 0, 0);
         [_cancelButton addTarget:self action:@selector(cancelButtonClick:) forControlEvents:UIControlEventTouchUpInside];
     }
     return _cancelButton;
@@ -95,11 +99,13 @@
     if (!_yesButton) {
         _yesButton = [UIButton buttonWithType:UIButtonTypeCustom];
         _yesButton.frame = CGRectMake(CGRectGetMaxX(self.cancelButton.frame) + 0.5, 0.5, self.preferredContentSize.width / 2 - 0.25, CGRectGetHeight(self.buttonBackground.frame));
-        [_yesButton setTitle:@"ok" forState:UIControlStateNormal];
-        [_yesButton setTitleColor:[UIColor colorWithRed:0.3 green:0.3 blue:0.8 alpha:1] forState:UIControlStateNormal];
-        [_yesButton setTitleColor:[UIColor colorWithRed:0.1 green:0.1 blue:0.9 alpha:1] forState:UIControlStateHighlighted];
+        NSString *title = self.yesButtonTitle == nil ? @"ok" : self.yesButtonTitle;
+        [_yesButton setTitle:title forState:UIControlStateNormal];
+        [_yesButton setTitleColor:Button_Title_Normal_Color forState:UIControlStateNormal];
+        [_yesButton setTitleColor:Button_Title_Highlight_Color forState:UIControlStateHighlighted];
         _yesButton.backgroundColor = [UIColor whiteColor];
         _yesButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
+        _yesButton.titleEdgeInsets = UIEdgeInsetsMake(-15, 0, 0, 0);
         [_yesButton addTarget:self action:@selector(yesButtonClick:) forControlEvents:UIControlEventTouchUpInside];
     }
     return _yesButton;

+ 15 - 5
RedAnt ERP Mobile/iSales-NPD/Singleton.h

@@ -11,20 +11,30 @@
 
 @interface Singleton : NSObject
 
-@property (nonatomic,assign) sqlite3 *currentDB;///<当前打开的数据库
-
-@property (nonatomic,assign) NSInteger npd_shop_price_type;///<Shop设置的价格类型,0提货价、1统一卖价、 2计算价
+typedef enum {
+    Shop_Order = 0,
+    Sales_Order = 1
+}Customer_Oder_Type;
 
-@property (nonatomic,copy) NSString *deliveryString;///<登陆成功后接收的提货价名称
+@property (nonatomic,assign) sqlite3 *currentDB;///<当前打开的数据库
 
-#pragma mark - Shop 用户权限
+#pragma mark - Customer
 
 @property (nonatomic,assign) BOOL permissions_price_setting;///<价格设置权限
 @property (nonatomic,assign) BOOL permissions_edit_order;///<编辑订单权限,Place Order
 @property (nonatomic,assign) BOOL permissions_submit_order;///<提交订单权限
 @property (nonatomic,assign) BOOL permissions_merge_order;///<合并订单权限
 
+@property (nonatomic,assign) NSInteger npd_shop_price_type;///<Shop设置的价格类型,0提货价、1统一卖价、 2计算价
+@property (nonatomic,copy) NSString *deliveryString;///<登陆成功后接收的提货价名称
+// 使用枚举吗?Customer_Oder_Type
+@property (nonatomic,assign) NSInteger customer_order_type;///< 0 Shop Order/ 1 Sales Order,
+
+#pragma mark - Employee 
+
+
 
+#pragma mark - Method
 
 + (instancetype)sharedInstance;