Jelajahi Sumber

修改Oder List,在Purchase Order中增加PO#。
修改Customer登陆,隐藏Order Detail中RLS和CPY按钮,并且设置Signature点击响应。

Pen Li 9 tahun lalu
induk
melakukan
73295bc938

TEMPAT SAMPAH
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 22 - 4
RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m

@@ -203,7 +203,7 @@
                                                       action:@selector(onReleaseOrderClick:)];
 //    self.btnRelease.tintColor = UIColorFromRGB(0x996633);
     
-    self.btnPDF = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"sales_order"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
+    self.btnPDF = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"mail"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                    style:UIBarButtonItemStylePlain
                                                   target:self
                                                   action:@selector(onDownloadOrderClick:)];//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Download", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onDownloadOrderClick:)];
@@ -220,18 +220,22 @@
     
     // UIBarButtonItem *fixedItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     // fixedItem.width = 0.0f;
-    
+    AppDelegate *appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
     [items addObject:self.btnOpen];
     //    [items addObject:fixedItem];
     //    [items addObject:self.btnCommit];
     //    [items addObject:fixedItem];
-    [items addObject:self.btnRelease];
+    if (appDelegate.user_type != USER_ROLE_CUSTOMER) {
+        [items addObject:self.btnRelease];
+    }
     //   [items addObject:fixedItem];
     [items addObject:self.btnPDF];
     //   [items addObject:fixedItem];
     [items addObject:self.btnSign];
     //    [items addObject:fixedItem];
-    [items addObject:self.btnCopy];
+    if (appDelegate.user_type != USER_ROLE_CUSTOMER) {
+         [items addObject:self.btnCopy];
+    }
     
     //        [items addObject:item2];
     self.navigationItem.rightBarButtonItems=items;
@@ -1455,7 +1459,21 @@
                 OrderDetailSignatureCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
                 NSString* img_url = [self.content_data valueForKey:@"sign_url"];
                 
+                cell.sign_img.userInteractionEnabled = YES;
+                __block BOOL hasTapGesture = NO;
+                [cell.sign_img.gestureRecognizers enumerateObjectsUsingBlock:^(__kindof UIGestureRecognizer * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+                    
+                    if ([obj isKindOfClass:[UITapGestureRecognizer class]]) {
+                        hasTapGesture = YES;
+                        *stop = YES;
+                    }
+                    
+                }];
                 
+                if (!hasTapGesture) {
+                    UITapGestureRecognizer *signatureTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onSignOrderClick:)];
+                    [cell.sign_img addGestureRecognizer:signatureTap];
+                }
                 
                 NSString* file_name=[img_url lastPathComponent];
                 NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url];

+ 1 - 0
RedAnt ERP Mobile/common/Functions/order/OrderListTableViewCell.h

@@ -18,4 +18,5 @@
 @property (strong, nonatomic) IBOutlet UILabel *label_creator;
 
 @property (strong, nonatomic) IBOutlet UILabel *label_contact;
+@property (strong, nonatomic) IBOutlet UILabel *label_po;
 @end

+ 21 - 5
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -866,7 +866,6 @@
 
 - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
-    
     NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
     
     if(value==nil)
@@ -918,6 +917,8 @@
     [contactlabel sizeToFit];
     [myView addSubview:contactlabel];
     
+    
+    
     //
     //    UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(424, 11, 52, 22)];
     //    modellabel.textColor=[UIColor whiteColor];
@@ -939,7 +940,7 @@
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
     UILabel *pricelabel = nil;
-    if(appDelegate.user_type==USER_ROLE_CUSTOMER&&self.orderType==0)
+    if(appDelegate.user_type==USER_ROLE_CUSTOMER&&self.orderType==1)
         pricelabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 2, 100, 22)];
     else
         pricelabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 11, 100, 22)];
@@ -951,7 +952,7 @@
     [myView addSubview:pricelabel];
     
     
-    if(appDelegate.user_type==USER_ROLE_CUSTOMER&&self.orderType==0)
+    if(appDelegate.user_type==USER_ROLE_CUSTOMER&&self.orderType==1)
     {
         UILabel *polabel = nil;
         polabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 21, 100, 22)];
@@ -1051,7 +1052,7 @@
         NSString *CellIdentifier = @"OrderListTableViewCell";
         OrderListTableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
         
-        NSString* po= [self.content_data[indexPath.row] valueForKey:@"so#"];
+        NSString* so= [self.content_data[indexPath.row] valueForKey:@"so#"];
         NSString* price= [self.content_data[indexPath.row] valueForKey:@"price"];
         if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
         {
@@ -1069,7 +1070,22 @@
         NSString* model_count = [self.content_data[indexPath.row] valueForKey:@"model_count"];
         NSString* sales = [self.content_data[indexPath.row] valueForKey:@"sales_rep"];
         NSString* creator = [self.content_data[indexPath.row] valueForKey:@"create_by"];
-        cell.label_so.text=po;
+        NSString *po = @"MOBPO";
+        
+        CGRect price_frame = cell.labelprice.frame;
+        if (appDelegate.user_type == USER_ROLE_CUSTOMER && self.orderType == 1) {
+            
+            cell.label_po.hidden = NO;
+            price_frame.origin.y = 5;
+            cell.label_po.text = po;
+            
+        } else {
+            
+            cell.label_po.hidden = YES;
+            price_frame.origin.y = 21;
+        }
+        cell.labelprice.frame = price_frame;
+        cell.label_so.text=so;
         cell.labelprice.text=price;
         cell.label_date.text=purchase_time;
         cell.label_contact.text=customer_name;

+ 11 - 3
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard

@@ -2366,7 +2366,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">
-                                                    <rect key="frame" x="0.0" y="0.0" width="768" height="145.5"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="768" height="146"/>
                                                     <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">
@@ -2996,7 +2996,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">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="66"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="65.5"/>
                                             <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#">
@@ -3055,6 +3055,13 @@
                                                     <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" misplaced="YES" text="MOBPO" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="xzc-pd-3Sz">
+                                                    <rect key="frame" x="491" y="31" width="100" height="21"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
                                             </subviews>
                                         </tableViewCellContentView>
                                         <connections>
@@ -3062,6 +3069,7 @@
                                             <outlet property="label_creator" destination="ybz-JS-DI1" id="yLO-HQ-nCO"/>
                                             <outlet property="label_date" destination="qf1-u6-uMA" id="CMS-kz-9ma"/>
                                             <outlet property="label_model" destination="kLZ-2K-sGp" id="g6U-Ym-JFS"/>
+                                            <outlet property="label_po" destination="xzc-pd-3Sz" id="HZB-dh-BQS"/>
                                             <outlet property="label_sales" destination="IaF-dX-BJ5" id="Voq-BU-iLJ"/>
                                             <outlet property="label_so" destination="fu3-Bf-ZH2" id="Shd-7i-d1L"/>
                                             <outlet property="label_status" destination="Cbw-1n-eUD" id="Gor-fe-ds5"/>
@@ -6377,7 +6385,7 @@ 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">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <view contentMode="scaleToFill" id="N1s-I8-bJv" customClass="RTLabel">