Просмотр исходного кода

完成修改价格视图创建Category Price、Set Category Price、Price Setting。

Pen Li 9 лет назад
Родитель
Сommit
52407123ac

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


+ 22 - 2
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -27,6 +27,7 @@
 #import "UserListViewController.h"
 #import "OfflineSettingViewController.h"
 #import "DefaultAppearance.h"
+#import "PriceSettingViewController.h"
 
 @interface MainViewController ()
 
@@ -1696,9 +1697,13 @@
         [map setValue:@"rect_market_news" forKey:@"img"];
         [self.sideMenuItems addObject:map.copy];
         
-
-        
     }
+    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+        [map setValue:@"Price Setting" forKey:@"title"];
+        //        [map setValue:@"rect_market_news" forKey:@"img"];
+        [self.sideMenuItems addObject:map.copy];
+    }
+    
 # endif
     
 //    if([[appDelegate.user lowercaseString] isEqualToString:@"larryl"]||[[appDelegate.user lowercaseString] isEqualToString:@"arpithat"])
@@ -2248,6 +2253,21 @@
         ScannerViewController * scannerVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"ScannerViewController"];
         
         [self.navigationController pushViewController:scannerVC animated:true];
+    } else if ([title isEqualToString:@"Price Setting"]) {
+        
+        PriceSettingViewController *priceSettingVC =[ [UIStoryboard storyboardWithName:@"CUL" bundle:nil] instantiateViewControllerWithIdentifier:@"PriceSettingViewController"];
+        
+        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:priceSettingVC] ;
+        
+        navi.navigationBar.translucent = NO;
+        navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+        [self presentViewController:navi animated:YES completion:^{
+            
+
+            
+        }];
+
+        
     }
 }
 

+ 36 - 0
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -10,6 +10,11 @@
 		4207D2841D8247CB001B4A67 /* NotificationNameCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4207D2831D8247CB001B4A67 /* NotificationNameCenter.m */; };
 		421C55021D81586D00CFA3B1 /* JKTimerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 421C55011D81586D00CFA3B1 /* JKTimerManager.m */; };
 		423A4ADC1D503A53005ECE4A /* createContact.json in Resources */ = {isa = PBXBuildFile; fileRef = 423A4ADB1D503A53005ECE4A /* createContact.json */; };
+		423B49EF1DAC8071004181C2 /* CUL.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 423B49EE1DAC8071004181C2 /* CUL.storyboard */; };
+		423B49F31DAC8D2C004181C2 /* PriceSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 423B49F21DAC8D2C004181C2 /* PriceSettingViewController.m */; };
+		426D40121DACB0990058B96B /* CategoryPriceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 426D40111DACB0990058B96B /* CategoryPriceViewController.m */; };
+		426D40151DACB51F0058B96B /* CategoryPriceCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 426D40141DACB51F0058B96B /* CategoryPriceCell.m */; };
+		426D40181DACC2250058B96B /* SetCategoryPriceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 426D40171DACC2250058B96B /* SetCategoryPriceController.m */; };
 		42969C021D52F31C00FF190A /* editContact.json in Resources */ = {isa = PBXBuildFile; fileRef = 42969C011D52F31C00FF190A /* editContact.json */; };
 		42A225331D6E7D1D00235B62 /* placeOrderTemplate.json in Resources */ = {isa = PBXBuildFile; fileRef = 42A225321D6E7D1D00235B62 /* placeOrderTemplate.json */; };
 		42A51BF41D62F60300F13667 /* more_info.html in Resources */ = {isa = PBXBuildFile; fileRef = 42A51BF31D62F60300F13667 /* more_info.html */; };
@@ -212,6 +217,15 @@
 		421C55001D81586D00CFA3B1 /* JKTimerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JKTimerManager.h; sourceTree = "<group>"; };
 		421C55011D81586D00CFA3B1 /* JKTimerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JKTimerManager.m; sourceTree = "<group>"; };
 		423A4ADB1D503A53005ECE4A /* createContact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = createContact.json; sourceTree = "<group>"; };
+		423B49EE1DAC8071004181C2 /* CUL.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = CUL.storyboard; sourceTree = "<group>"; };
+		423B49F11DAC8D2C004181C2 /* PriceSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PriceSettingViewController.h; sourceTree = "<group>"; };
+		423B49F21DAC8D2C004181C2 /* PriceSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PriceSettingViewController.m; sourceTree = "<group>"; };
+		426D40101DACB0990058B96B /* CategoryPriceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CategoryPriceViewController.h; sourceTree = "<group>"; };
+		426D40111DACB0990058B96B /* CategoryPriceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CategoryPriceViewController.m; sourceTree = "<group>"; };
+		426D40131DACB51F0058B96B /* CategoryPriceCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CategoryPriceCell.h; sourceTree = "<group>"; };
+		426D40141DACB51F0058B96B /* CategoryPriceCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CategoryPriceCell.m; sourceTree = "<group>"; };
+		426D40161DACC2250058B96B /* SetCategoryPriceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetCategoryPriceController.h; sourceTree = "<group>"; };
+		426D40171DACC2250058B96B /* SetCategoryPriceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SetCategoryPriceController.m; sourceTree = "<group>"; };
 		42969C011D52F31C00FF190A /* editContact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = editContact.json; sourceTree = "<group>"; };
 		42A225321D6E7D1D00235B62 /* placeOrderTemplate.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = placeOrderTemplate.json; sourceTree = "<group>"; };
 		42A51BF31D62F60300F13667 /* more_info.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = more_info.html; sourceTree = "<group>"; };
@@ -606,6 +620,21 @@
 			path = JKTimer;
 			sourceTree = "<group>";
 		};
+		423B49F01DAC8CE0004181C2 /* Price Setting */ = {
+			isa = PBXGroup;
+			children = (
+				423B49F11DAC8D2C004181C2 /* PriceSettingViewController.h */,
+				423B49F21DAC8D2C004181C2 /* PriceSettingViewController.m */,
+				426D40101DACB0990058B96B /* CategoryPriceViewController.h */,
+				426D40111DACB0990058B96B /* CategoryPriceViewController.m */,
+				426D40131DACB51F0058B96B /* CategoryPriceCell.h */,
+				426D40141DACB51F0058B96B /* CategoryPriceCell.m */,
+				426D40161DACC2250058B96B /* SetCategoryPriceController.h */,
+				426D40171DACC2250058B96B /* SetCategoryPriceController.m */,
+			);
+			name = "Price Setting";
+			sourceTree = "<group>";
+		};
 		42E58BFF1D7E735A0092810A /* UIColor+HEX */ = {
 			isa = PBXGroup;
 			children = (
@@ -715,10 +744,12 @@
 				713393FE19936C980075BBAC /* Signature */,
 				716387CC1953D693006E65E6 /* sideMenu */,
 				710212821B8D59DE00E1788B /* watchlist */,
+				423B49F01DAC8CE0004181C2 /* Price Setting */,
 				713F76B81929F4A7006A7305 /* AppDelegate.h */,
 				713F76B91929F4A7006A7305 /* AppDelegate.m */,
 				7162A5E71C5899F700AB630E /* MainViewController.h */,
 				7162A5E81C5899F700AB630E /* MainViewController.m */,
+				423B49EE1DAC8071004181C2 /* CUL.storyboard */,
 				71D46D0F1CE1D9EF00A081AC /* OLM.storyboard */,
 				713F76BB1929F4A7006A7305 /* Main.storyboard */,
 				7162A5E41C58781000AB630E /* iSalesNavigationController.h */,
@@ -1348,6 +1379,7 @@
 				71DF74951C57614C00F2789C /* PhotoBorder.png in Resources */,
 				7162A55F1C58724700AB630E /* customer_info_template.json in Resources */,
 				71D46D111CE1D9EF00A081AC /* OLM.storyboard in Resources */,
+				423B49EF1DAC8071004181C2 /* CUL.storyboard in Resources */,
 				42B3C9BB1D642C880053985C /* order_info.html in Resources */,
 				42A225331D6E7D1D00235B62 /* placeOrderTemplate.json in Resources */,
 				7141DD3D1C5726B700F7DF59 /* softScanBeep.wav in Resources */,
@@ -1437,6 +1469,7 @@
 				7162A5831C5872EF00AB630E /* HomeTableViewCellSlide.m in Sources */,
 				7162A5851C5872EF00AB630E /* HomeViewController.m in Sources */,
 				7162A5E31C5877CE00AB630E /* WatchListViewController.m in Sources */,
+				426D40151DACB51F0058B96B /* CategoryPriceCell.m in Sources */,
 				715001FF1D114D9100F5927F /* BundleDetailButton.m in Sources */,
 				7162A5421C58719D00AB630E /* RATreeNodeCollectionController.m in Sources */,
 				71DF74631C575E7900F2789C /* CommonEditorCellSwitch.m in Sources */,
@@ -1460,6 +1493,8 @@
 				7162A5091C586FC100AB630E /* CycleScrollView.m in Sources */,
 				715F30BD1DAB37EB00490EED /* OfflineUnlockViewController.m in Sources */,
 				7162A5161C58704600AB630E /* BundleModelCell.m in Sources */,
+				426D40121DACB0990058B96B /* CategoryPriceViewController.m in Sources */,
+				426D40181DACC2250058B96B /* SetCategoryPriceController.m in Sources */,
 				7141DD621C5747CE00F7DF59 /* NSData+CommonCrypto.m in Sources */,
 				71DF74891C57608F00F2789C /* RadioButton.m in Sources */,
 				7162A5DF1C5876E300AB630E /* ScannerSettingViewController.m in Sources */,
@@ -1533,6 +1568,7 @@
 				7162A5DC1C5876E300AB630E /* LoginViewController.m in Sources */,
 				7162A5811C5872EF00AB630E /* HomeTableViewCellBanner.m in Sources */,
 				7162A5E61C58781000AB630E /* iSalesNavigationController.m in Sources */,
+				423B49F31DAC8D2C004181C2 /* PriceSettingViewController.m in Sources */,
 				7141DD631C5747CE00F7DF59 /* NSString+Base64.m in Sources */,
 				7162A5C41C5873BB00AB630E /* ItemSearchViewController.m in Sources */,
 				7162A5481C58719D00AB630E /* RATreeView+TableViewDataSource.m in Sources */,

+ 7 - 0
RedAnt ERP Mobile/iSales-NPD.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/iSales-NPD.xcscheme

@@ -61,6 +61,13 @@
             ReferencedContainer = "container:iSales-NPD.xcodeproj">
          </BuildableReference>
       </BuildableProductRunnable>
+      <EnvironmentVariables>
+         <EnvironmentVariable
+            key = "OS_ACTIVITY_MODE"
+            value = "disable"
+            isEnabled = "YES">
+         </EnvironmentVariable>
+      </EnvironmentVariables>
       <AdditionalOptions>
       </AdditionalOptions>
    </LaunchAction>

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

@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="16A323" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES">
     <dependencies>
         <deployment identifier="iOS"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
@@ -374,7 +374,7 @@
                                         <rect key="frame" x="0.0" y="28" width="360" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0HM-qr-ZyP" id="qg6-aD-3QW">
-                                            <frame key="frameInset" width="360" height="43"/>
+                                            <frame key="frameInset" width="360" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hql-hH-AXh">

+ 285 - 0
RedAnt ERP Mobile/iSales-NPD/CUL.storyboard

@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
+        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Price Setting-->
+        <scene sceneID="HCH-Yc-Ddy">
+            <objects>
+                <viewController storyboardIdentifier="PriceSettingViewController" title="Price Setting" id="hVu-Cy-75z" customClass="PriceSettingViewController" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="Cuu-f5-Aes"/>
+                        <viewControllerLayoutGuide type="bottom" id="3KL-Lc-pQE"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="dHj-jU-QLP">
+                        <rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Display Price:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="L9s-QJ-zuH">
+                                <frame key="frameInset" minX="20" minY="25" width="115" height="40"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vVs-6N-BCX">
+                                <frame key="frameInset" minX="20" minY="145" width="150" height="40"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <inset key="titleEdgeInsets" minX="-70" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                <state key="normal" title="Hide Price">
+                                    <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                </state>
+                                <state key="selected" title="Show Price"/>
+                                <connections>
+                                    <action selector="showOrHidePriceButtonClick:" destination="hVu-Cy-75z" eventType="touchUpInside" id="I2Y-29-13r"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mw1-Vv-KOj">
+                                <frame key="frameInset" minX="20" minY="85" width="150" height="40"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <inset key="titleEdgeInsets" minX="-10" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                <state key="normal" title="Set Calculate Price">
+                                    <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                </state>
+                                <connections>
+                                    <action selector="calculatePriceButtonClick:" destination="hVu-Cy-75z" eventType="touchUpInside" id="KHe-Jc-oX3"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jtK-Ru-fSW">
+                                <frame key="frameInset" minX="190" minY="25" width="200" height="40"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <inset key="titleEdgeInsets" minX="-160" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                <state key="normal" title="计算价">
+                                    <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                </state>
+                                <connections>
+                                    <action selector="priceTypeButtonClick:" destination="hVu-Cy-75z" eventType="touchUpInside" id="YI6-Mf-nVM"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                    <connections>
+                        <outlet property="priceTypeButton" destination="jtK-Ru-fSW" id="jkm-Cl-oLP"/>
+                        <outlet property="showButton" destination="vVs-6N-BCX" id="KQJ-gx-IAV"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="RNg-Md-X3T" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-469.33593749999994" y="-227.08638360175695"/>
+        </scene>
+        <!--Category Price-->
+        <scene sceneID="4qU-Cd-6mD">
+            <objects>
+                <viewController storyboardIdentifier="CategoryPriceViewController" title="Category Price" id="oSP-hP-k8X" customClass="CategoryPriceViewController" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="cjA-Km-Rwg"/>
+                        <viewControllerLayoutGuide type="bottom" id="oqY-Ei-LvT"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="ZSB-9h-J88">
+                        <rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="6fy-Su-eKE">
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <prototypes>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CategoryPriceCell" rowHeight="47" id="rnb-EK-8yY" customClass="CategoryPriceCell">
+                                        <rect key="frame" x="0.0" y="28" width="1024" height="47"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="rnb-EK-8yY" id="WGZ-Bw-E4C">
+                                            <frame key="frameInset" width="1024" height="46"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Dinning" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3fh-vo-1qn">
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="100" id="jtE-Em-isT"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="base price: 1000 + $50.99" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g3e-To-oS9">
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="g3e-To-oS9" firstAttribute="top" secondItem="WGZ-Bw-E4C" secondAttribute="topMargin" constant="5" id="4TE-Hj-E7W"/>
+                                                <constraint firstAttribute="bottom" secondItem="3fh-vo-1qn" secondAttribute="bottom" constant="5" id="4W9-h9-Ttt"/>
+                                                <constraint firstItem="3fh-vo-1qn" firstAttribute="leading" secondItem="WGZ-Bw-E4C" secondAttribute="leading" constant="35" id="Art-Js-ozz"/>
+                                                <constraint firstAttribute="bottomMargin" secondItem="g3e-To-oS9" secondAttribute="bottom" constant="5" id="Ixx-sP-bPN"/>
+                                                <constraint firstItem="3fh-vo-1qn" firstAttribute="top" secondItem="WGZ-Bw-E4C" secondAttribute="top" constant="5" id="eKG-It-IiK"/>
+                                                <constraint firstItem="g3e-To-oS9" firstAttribute="leading" secondItem="3fh-vo-1qn" secondAttribute="trailing" constant="50" id="o4G-9L-dNV"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="categoryLabel" destination="3fh-vo-1qn" id="y6E-EU-DdM"/>
+                                            <outlet property="priceLabel" destination="g3e-To-oS9" id="bVN-Wr-RG1"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="oSP-hP-k8X" id="0nt-Mu-EU8"/>
+                                    <outlet property="delegate" destination="oSP-hP-k8X" id="HLo-n3-dvs"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <constraints>
+                            <constraint firstAttribute="trailing" secondItem="6fy-Su-eKE" secondAttribute="trailing" id="FhU-0p-lW1"/>
+                            <constraint firstItem="oqY-Ei-LvT" firstAttribute="top" secondItem="6fy-Su-eKE" secondAttribute="bottom" constant="25" id="Vi5-69-OZK"/>
+                            <constraint firstItem="6fy-Su-eKE" firstAttribute="top" secondItem="ZSB-9h-J88" secondAttribute="top" id="hFe-0c-xUS"/>
+                            <constraint firstItem="6fy-Su-eKE" firstAttribute="leading" secondItem="ZSB-9h-J88" secondAttribute="leading" id="m7X-JS-wag"/>
+                        </constraints>
+                    </view>
+                    <connections>
+                        <outlet property="categoryTable" destination="6fy-Su-eKE" id="lyP-Mn-hIf"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="QjD-0M-bvN" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="173" y="-447"/>
+        </scene>
+        <!--Set Price-->
+        <scene sceneID="9Rz-bc-82n">
+            <objects>
+                <viewController storyboardIdentifier="SetCategoryPriceController" title="Set Price" id="UzA-yv-6er" customClass="SetCategoryPriceController" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="taN-CJ-sQt"/>
+                        <viewControllerLayoutGuide type="bottom" id="lSx-hS-2a7"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="ElC-Gn-Euu">
+                        <rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Base Price:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1kG-P9-XdK">
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uh0-7V-Yfl">
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="100" id="eij-Yb-Gtq"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <inset key="titleEdgeInsets" minX="-70" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                <state key="normal" title="统一价"/>
+                                <connections>
+                                    <action selector="basePriceButtonClick:" destination="UzA-yv-6er" eventType="touchUpInside" id="IiH-e5-z7h"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GN9-Cr-63d">
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="24" id="7sN-Uq-t6c"/>
+                                    <constraint firstAttribute="width" constant="24" id="kWZ-Ed-N8c"/>
+                                </constraints>
+                                <state key="normal" image="check_0_24"/>
+                                <state key="selected" image="check_1_24"/>
+                                <connections>
+                                    <action selector="floatCheckButtonClick:" destination="UzA-yv-6er" eventType="touchUpInside" id="Dxm-cx-sod"/>
+                                </connections>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="float:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XyN-x8-6ZP">
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="T1Y-6I-2PT">
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="24" id="I8L-G3-AtJ"/>
+                                    <constraint firstAttribute="height" constant="24" id="lH9-aG-5Jp"/>
+                                </constraints>
+                                <state key="normal" image="check_0_24"/>
+                                <state key="selected" image="check_1_24"/>
+                                <connections>
+                                    <action selector="percentageCheckButtonClick:" destination="UzA-yv-6er" eventType="touchUpInside" id="tzh-hL-hYy"/>
+                                </connections>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="percentage:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5xi-mx-TOq">
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="-9999999999" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Y7Q-PG-43Q">
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="150" id="ePr-Wf-OYY"/>
+                                </constraints>
+                                <nil key="textColor"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="18"/>
+                                <textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
+                                <connections>
+                                    <outlet property="delegate" destination="UzA-yv-6er" id="bca-MD-vcV"/>
+                                </connections>
+                            </textField>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="10000%" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="7fx-7w-auD">
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="150" id="svm-Em-IwF"/>
+                                </constraints>
+                                <nil key="textColor"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="18"/>
+                                <textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
+                                <connections>
+                                    <outlet property="delegate" destination="UzA-yv-6er" id="4Tx-mV-JtV"/>
+                                </connections>
+                            </textField>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4qd-QG-910">
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="102" id="7Y2-2g-mj3"/>
+                                    <constraint firstAttribute="height" constant="30" id="Shc-uc-UFR"/>
+                                </constraints>
+                                <state key="normal" image="btn_save"/>
+                                <connections>
+                                    <action selector="saveButtonClick:" destination="UzA-yv-6er" eventType="touchUpInside" id="quO-ay-mTt"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <constraints>
+                            <constraint firstItem="Uh0-7V-Yfl" firstAttribute="top" secondItem="taN-CJ-sQt" secondAttribute="bottom" constant="25" id="3aK-LL-Z5N"/>
+                            <constraint firstItem="5xi-mx-TOq" firstAttribute="centerY" secondItem="T1Y-6I-2PT" secondAttribute="centerY" id="5bS-6w-qlr"/>
+                            <constraint firstItem="7fx-7w-auD" firstAttribute="leading" secondItem="5xi-mx-TOq" secondAttribute="trailing" constant="10" id="5hh-E7-Q1R"/>
+                            <constraint firstItem="XyN-x8-6ZP" firstAttribute="centerY" secondItem="GN9-Cr-63d" secondAttribute="centerY" id="7iu-Mb-HtF"/>
+                            <constraint firstItem="1kG-P9-XdK" firstAttribute="top" secondItem="taN-CJ-sQt" secondAttribute="bottom" constant="25" id="Ahe-5s-3Xy"/>
+                            <constraint firstItem="Uh0-7V-Yfl" firstAttribute="height" secondItem="1kG-P9-XdK" secondAttribute="height" id="C8M-2p-5b5"/>
+                            <constraint firstItem="T1Y-6I-2PT" firstAttribute="leading" secondItem="ElC-Gn-Euu" secondAttribute="leading" constant="20" id="Fr9-W4-ULG"/>
+                            <constraint firstItem="GN9-Cr-63d" firstAttribute="leading" secondItem="ElC-Gn-Euu" secondAttribute="leading" constant="20" id="Go7-9D-Dc5"/>
+                            <constraint firstItem="XyN-x8-6ZP" firstAttribute="leading" secondItem="GN9-Cr-63d" secondAttribute="trailing" constant="20" id="IKL-s5-JZ3"/>
+                            <constraint firstItem="Y7Q-PG-43Q" firstAttribute="leading" secondItem="XyN-x8-6ZP" secondAttribute="trailing" constant="10" id="JH4-tK-pAf"/>
+                            <constraint firstItem="7fx-7w-auD" firstAttribute="centerY" secondItem="5xi-mx-TOq" secondAttribute="centerY" id="OVQ-gk-KCK"/>
+                            <constraint firstItem="Uh0-7V-Yfl" firstAttribute="leading" secondItem="1kG-P9-XdK" secondAttribute="trailing" constant="30" id="Uve-gL-FiN"/>
+                            <constraint firstItem="1kG-P9-XdK" firstAttribute="leading" secondItem="ElC-Gn-Euu" secondAttribute="leading" constant="20" id="VrC-BJ-4BN"/>
+                            <constraint firstItem="lSx-hS-2a7" firstAttribute="top" secondItem="4qd-QG-910" secondAttribute="bottom" constant="30" id="YLY-Lp-vKb"/>
+                            <constraint firstItem="GN9-Cr-63d" firstAttribute="top" secondItem="1kG-P9-XdK" secondAttribute="bottom" constant="24" id="eI1-Vd-FVh"/>
+                            <constraint firstItem="T1Y-6I-2PT" firstAttribute="top" secondItem="GN9-Cr-63d" secondAttribute="bottom" constant="24" id="gNZ-EF-tL9"/>
+                            <constraint firstItem="5xi-mx-TOq" firstAttribute="leading" secondItem="XyN-x8-6ZP" secondAttribute="leading" id="l59-oq-Ikf"/>
+                            <constraint firstAttribute="trailing" secondItem="4qd-QG-910" secondAttribute="trailing" constant="30" id="uPT-Na-hk8"/>
+                            <constraint firstItem="Y7Q-PG-43Q" firstAttribute="centerY" secondItem="XyN-x8-6ZP" secondAttribute="centerY" id="xsB-4S-RgN"/>
+                        </constraints>
+                    </view>
+                    <connections>
+                        <outlet property="basePriceButton" destination="Uh0-7V-Yfl" id="iGg-Ra-rs6"/>
+                        <outlet property="floatCheckButton" destination="GN9-Cr-63d" id="5Fs-e9-ldZ"/>
+                        <outlet property="floatTextField" destination="Y7Q-PG-43Q" id="ykw-F6-F1N"/>
+                        <outlet property="percentageCheckButton" destination="T1Y-6I-2PT" id="KEb-Tu-quw"/>
+                        <outlet property="percentageTextField" destination="7fx-7w-auD" id="LJT-7w-uQP"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="99Y-5a-CAh" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="927.53906249999989" y="-446.26647144948754"/>
+        </scene>
+    </scenes>
+    <resources>
+        <image name="btn_save" width="102" height="30"/>
+        <image name="check_0_24" width="24" height="24"/>
+        <image name="check_1_24" width="24" height="24"/>
+    </resources>
+</document>

+ 13 - 0
RedAnt ERP Mobile/iSales-NPD/CategoryPriceCell.h

@@ -0,0 +1,13 @@
+//
+//  CategoryPriceCell.h
+//  iSales-NPD
+//
+//  Created by Jack on 2016/10/11.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface CategoryPriceCell : UITableViewCell
+
+@end

+ 32 - 0
RedAnt ERP Mobile/iSales-NPD/CategoryPriceCell.m

@@ -0,0 +1,32 @@
+//
+//  CategoryPriceCell.m
+//  iSales-NPD
+//
+//  Created by Jack on 2016/10/11.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import "CategoryPriceCell.h"
+
+@interface CategoryPriceCell ()
+
+@property (strong, nonatomic) IBOutlet UILabel *categoryLabel;
+
+@property (strong, nonatomic) IBOutlet UILabel *priceLabel;
+
+@end
+
+@implementation CategoryPriceCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+@end

+ 13 - 0
RedAnt ERP Mobile/iSales-NPD/CategoryPriceViewController.h

@@ -0,0 +1,13 @@
+//
+//  CategoryPriceViewController.h
+//  iSales-NPD
+//
+//  Created by Jack on 2016/10/11.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface CategoryPriceViewController : UIViewController
+
+@end

+ 106 - 0
RedAnt ERP Mobile/iSales-NPD/CategoryPriceViewController.m

@@ -0,0 +1,106 @@
+//
+//  CategoryPriceViewController.m
+//  iSales-NPD
+//
+//  Created by Jack on 2016/10/11.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import "CategoryPriceViewController.h"
+#import "const.h"
+#import "CategoryPriceCell.h"
+#import "SetCategoryPriceController.h"
+
+@interface CategoryPriceViewController ()<UITableViewDelegate,UITableViewDataSource>
+
+@property (strong, nonatomic) IBOutlet UITableView *categoryTable;
+
+@end
+
+@implementation CategoryPriceViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self configAppearance];
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+- (void)configAppearance {
+    
+    self.navigationController.navigationBar.translucent = NO;
+    
+    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
+                                                                   style:UIBarButtonItemStylePlain
+                                                                  target:self
+                                                                  action:@selector( returnBackClick:)];
+    
+    self.navigationItem.leftBarButtonItem = backButton;
+}
+
+#pragma mark - action
+
+- (void)returnBackClick:(id)sender {
+    
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+#pragma mark - data source
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+    return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return 100;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    CategoryPriceCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CategoryPriceCell"];
+    
+    
+    
+    return cell;
+}
+
+#pragma mark - delegate
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return 47.0f;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
+    return 40.0f;
+}
+
+- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
+    
+    UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 40)];
+    
+    UILabel *categoryLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, 100, 20)];
+    categoryLabel.textColor = [UIColor blackColor];
+    categoryLabel.font = [UIFont systemFontOfSize:17.0f];
+    categoryLabel.textAlignment = NSTextAlignmentLeft;
+    categoryLabel.text = @"Dinning";
+    
+    [headerView addSubview:categoryLabel];
+    
+    return headerView;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    SetCategoryPriceController *setPriceVC =[ [UIStoryboard storyboardWithName:@"CUL" bundle:nil] instantiateViewControllerWithIdentifier:@"SetCategoryPriceController"];
+    
+    [self.navigationController pushViewController:setPriceVC animated:YES];
+    
+}
+
+
+@end

+ 16 - 0
RedAnt ERP Mobile/iSales-NPD/PriceSettingViewController.h

@@ -0,0 +1,16 @@
+//
+//  PriceSetting.h
+//  iSales-NPD
+//
+//  Created by Jack on 2016/10/11.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface PriceSettingViewController : UIViewController
+
+@property (nonatomic,assign) NSInteger priceType;
+@property (nonatomic,assign) BOOL showPrice;
+
+@end

+ 168 - 0
RedAnt ERP Mobile/iSales-NPD/PriceSettingViewController.m

@@ -0,0 +1,168 @@
+//
+//  PriceSetting.m
+//  iSales-NPD
+//
+//  Created by Jack on 2016/10/11.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import "PriceSettingViewController.h"
+#import "const.h"
+#import "EnumSelectViewController.h"
+#import "CategoryPriceViewController.h"
+#import "iSalesNetwork.h"
+
+
+
+@interface PriceSettingViewController ()
+
+@property (strong, nonatomic) IBOutlet UIButton *priceTypeButton;
+
+@property (strong, nonatomic) IBOutlet UIButton *showButton;
+
+@end
+
+@implementation PriceSettingViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self configAppearance];
+    
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+#pragma mark - Customer Inint
+
+- (void)configAppearance {
+    [self changePriceType:self.priceType];
+    self.showButton.selected = self.showPrice;
+    
+    UIBarButtonItem *closeButton =   [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
+                                                                      style:UIBarButtonItemStylePlain
+                                                                     target:self
+                                                                     action:@selector(onCloseClick:)];
+    self.navigationItem.rightBarButtonItem = closeButton;
+    
+}
+
+- (void)changePriceType:(NSInteger)type {
+    
+    NSString *title = @"提货价";
+    switch (type) {
+        case 0: {
+            title = @"提货价";
+        }
+            break;
+        case 1: {
+            title = @"统一价";
+        }
+            break;
+        case 2: {
+            title = @"计算价";
+        }
+            break;
+            
+        default:
+            break;
+    }
+    
+    self.priceType = type;
+    [self.priceTypeButton setTitle:title forState:UIControlStateNormal];
+    
+}
+
+#pragma mark - action
+
+- (void)onCloseClick:(id)sender {
+    [self dismissViewControllerAnimated:YES completion:^{
+        
+    }];
+}
+
+- (IBAction)showOrHidePriceButtonClick:(UIButton *)sender {
+    
+    sender.selected = !sender.selected;
+    self.showPrice = sender.selected;
+    
+}
+
+- (IBAction)calculatePriceButtonClick:(UIButton *)sender {
+    
+    CategoryPriceViewController *categoryPriceVC =[ [UIStoryboard storyboardWithName:@"CUL" bundle:nil] instantiateViewControllerWithIdentifier:@"CategoryPriceViewController"];
+    
+    [self.navigationController pushViewController:categoryPriceVC animated:YES];
+}
+
+- (NSString *)checkPriceType:(NSInteger)priceType {
+    return  self.priceType == priceType ? @"1" : @"0";
+}
+
+- (NSInteger)checkedCadedate:(NSDictionary *)cadedate {
+    
+    int priceType = 0;
+    int count = [[cadedate objectForKey:@"count"] intValue];
+    for (int i = 0; i < count; i++) {
+        NSDictionary *dic = [cadedate objectForKey:[NSString stringWithFormat:@"val_%d",i]];
+        int check = [[dic objectForKey:@"check"] intValue];
+        if (check) {
+            
+            priceType = [[dic objectForKey:@"value_code"] integerValue];
+            
+            break;
+        }
+    }
+    
+    return priceType;
+}
+
+- (IBAction)priceTypeButtonClick:(UIButton *)sender {
+    
+    EnumSelectViewController* enumvc =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"EnumSelectorViewController"];
+
+    enumvc.max_select = 1;
+    
+    
+    enumvc.cadedate = @{
+                        @"count" : @"3",
+                        @"val_0" : @{@"value" : @"提货价",@"value_code" : @"0",@"check" : [self checkPriceType:0]},
+                        @"val_1" : @{@"value" : @"统一价",@"value_code" : @"1",@"check" : [self checkPriceType:1]},
+                        @"val_2" : @{@"value" : @"计算价",@"value_code" : @"2",@"check" : [self checkPriceType:2]}
+                        }.mutableCopy;
+    enumvc.title = @"";
+    
+    
+    enumvc.single_select =true;
+    
+    __weak typeof(self) weakSelf = self;
+    
+    enumvc.returnValue = ^(NSMutableDictionary* value){
+        
+        if (weakSelf) {
+            
+            __strong typeof(weakSelf) strongSelf = weakSelf;
+            
+            [strongSelf changePriceType:[strongSelf checkedCadedate:value]];
+            
+            NSString *url = @"http://192.168.0.126:8080/site/isales/setSeePriceType.htm";
+            
+            NSData *data = [iSalesNetwork get_json:url parameters:@{@"price_type" : [NSString stringWithFormat:@"%d",strongSelf.priceType]}.mutableCopy];
+            
+            NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
+            
+            NSLog(@"%@",dic);
+            
+        }
+        
+    };
+    
+    [self.navigationController pushViewController:enumvc animated:true];
+}
+
+
+@end

+ 15 - 0
RedAnt ERP Mobile/iSales-NPD/SetCategoryPriceController.h

@@ -0,0 +1,15 @@
+//
+//  SetCategoryPriceController.h
+//  iSales-NPD
+//
+//  Created by Jack on 2016/10/11.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface SetCategoryPriceController : UIViewController
+
+
+
+@end

+ 248 - 0
RedAnt ERP Mobile/iSales-NPD/SetCategoryPriceController.m

@@ -0,0 +1,248 @@
+//
+//  SetCategoryPriceController.m
+//  iSales-NPD
+//
+//  Created by Jack on 2016/10/11.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import "SetCategoryPriceController.h"
+#import "const.h"
+#import "EnumSelectViewController.h"
+
+#define Percent  100
+#define Float    101
+#define NoChange 102
+
+#define NUMBERS @"0123456789.\n"
+#define NEGATIVE_NUMBERS @"0123456789.-\n"
+
+
+@interface SetCategoryPriceController ()<UITextFieldDelegate>
+
+@property (strong, nonatomic) IBOutlet UIButton *basePriceButton;
+@property (strong, nonatomic) IBOutlet UIButton *floatCheckButton;
+@property (strong, nonatomic) IBOutlet UIButton *percentageCheckButton;
+@property (strong, nonatomic) IBOutlet UITextField *floatTextField;
+@property (strong, nonatomic) IBOutlet UITextField *percentageTextField;
+
+@property (nonatomic,assign) NSInteger changePrice;
+@property (nonatomic,assign) NSInteger priceType;
+
+@end
+
+@implementation SetCategoryPriceController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    self.changePrice = NoChange;
+    [self configAppearance];
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+- (void)configAppearance {
+    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
+                                                                   style:UIBarButtonItemStylePlain
+                                                                  target:self
+                                                                  action:@selector( returnBackClick:)];
+    
+    self.navigationItem.leftBarButtonItem = backButton;
+}
+
+- (void)returnBackClick:(id)sender {
+    
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+- (void)changePriceType:(NSInteger)type {
+    
+    NSString *title = @"提货价";
+    switch (type) {
+        case 0: {
+            title = @"提货价";
+        }
+            break;
+        case 1: {
+            title = @"统一价";
+        }
+            break;
+            
+        default:
+            break;
+    }
+    
+    self.priceType = type;
+    [self.basePriceButton setTitle:title forState:UIControlStateNormal];
+    
+}
+
+
+- (NSString *)checkPriceType:(NSInteger)priceType {
+    return  self.priceType == priceType ? @"1" : @"0";
+}
+
+- (NSInteger)checkedCadedate:(NSDictionary *)cadedate {
+    
+    int priceType = 0;
+    int count = [[cadedate objectForKey:@"count"] intValue];
+    for (int i = 0; i < count; i++) {
+        NSDictionary *dic = [cadedate objectForKey:[NSString stringWithFormat:@"val_%d",i]];
+        int check = [[dic objectForKey:@"check"] intValue];
+        if (check) {
+            
+            priceType = [[dic objectForKey:@"value_code"] integerValue];
+            
+            break;
+        }
+    }
+    
+    return priceType;
+}
+
+
+- (IBAction)basePriceButtonClick:(UIButton *)sender {
+    
+    EnumSelectViewController* enumvc =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"EnumSelectorViewController"];
+    
+    enumvc.max_select = 1;
+    
+    
+    enumvc.cadedate = @{
+                        @"count" : @"2",
+                        @"val_0" : @{@"value" : @"提货价",@"value_code" : @"0",@"check" : [self checkPriceType:0]},
+                        @"val_1" : @{@"value" : @"统一价",@"value_code" : @"1",@"check" : [self checkPriceType:1]}
+                        }.mutableCopy;
+    enumvc.title = @"";
+    
+    
+    enumvc.single_select =true;
+    
+    __weak typeof(self) weakSelf = self;
+    
+    enumvc.returnValue = ^(NSMutableDictionary* value){
+        
+        if (weakSelf) {
+            __strong typeof(weakSelf) strongSelf = weakSelf;
+            [strongSelf changePriceType:[strongSelf checkedCadedate:value]];
+        }
+        
+    };
+    
+    [self.navigationController pushViewController:enumvc animated:true];
+}
+
+- (IBAction)percentageCheckButtonClick:(UIButton *)sender {
+    if (self.changePrice == NoChange || self.changePrice == Percent) {
+        sender.selected = !sender.selected;
+        if (sender.selected) {
+            self.changePrice = Percent;
+        } else {
+            self.changePrice = NoChange;
+        }
+        self.percentageTextField.enabled = sender.selected;
+    }
+    
+}
+
+- (IBAction)floatCheckButtonClick:(UIButton *)sender {
+    if (self.changePrice == NoChange || self.changePrice == Float) {
+        
+        sender.selected = !sender.selected;
+        if (sender.selected) {
+            self.changePrice = Float;
+        } else {
+            self.changePrice = NoChange;
+        }
+        self.floatTextField.enabled = sender.selected;
+    }
+    
+}
+- (IBAction)saveButtonClick:(UIButton *)sender {
+}
+
+#pragma mark - text field delegate
+
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+    
+    NSString *newText = [textField.text stringByReplacingCharactersInRange:range withString:string];
+    
+    if (newText.length == 0)
+        return YES;
+
+    // 第一个字符不能为小数点
+    if ([newText isEqualToString:@"."])
+        return NO;
+    if ([newText componentsSeparatedByString:@"."].count > 2) {
+        return NO;
+    } // 不能有多个小数点
+    
+    // 只能第一个字符为减号
+    if (newText.length > 1 && [string isEqualToString:@"-"]) {
+        return NO;
+    }
+
+    // 校验正数
+    NSCharacterSet *cs;
+    cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS]invertedSet];
+    NSString *filtered = [[string componentsSeparatedByCharactersInSet:cs]componentsJoinedByString:@""];
+    BOOL canChange = [string isEqualToString:filtered];
+    
+    if ([textField isEqual:self.floatTextField]) {
+
+        // 校验负数
+        NSCharacterSet *negative_cs;
+        
+        negative_cs = [[NSCharacterSet characterSetWithCharactersInString:NEGATIVE_NUMBERS]invertedSet];
+        NSString *negative_filtered = [[string componentsSeparatedByCharactersInSet:negative_cs]componentsJoinedByString:@""];
+        
+        BOOL negative_canChange = [string isEqualToString:negative_filtered];
+        
+        // 只能第一个字符为减号
+        if ([string isEqualToString:@"-"]) {
+            
+            if (newText.length == 1 && [string isEqualToString:@"-"]) {
+                negative_canChange = YES && negative_canChange;
+            } else {
+                negative_canChange = NO;
+            }
+        }
+
+        
+        return canChange || negative_canChange;
+    } else {
+        return canChange;
+    }
+    
+    
+    // 正则表达式
+    BOOL plus = YES; // 正数
+    NSString *plus_match = @"^[0-9]+(\\.[0-9]+){0,1}$";
+    NSPredicate *plus_predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",plus_match];
+    
+    plus = [plus_predicate evaluateWithObject:newText];
+    
+    BOOL negative = YES; // 负数
+    NSString *negative_match = @"^-([0-9]+(\\.[0-9]+){0,1})$";
+    NSPredicate *negative_predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",negative_match];
+    negative = [negative_predicate evaluateWithObject:newText];
+    
+    BOOL zerobegin = NO; // 01231
+    NSString *zerobegin_match = @"^0[1-9]+(\\.[0-9]+){0,1}$";
+    NSPredicate *zerobegin_predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",zerobegin_match];
+    
+    zerobegin = [zerobegin_predicate evaluateWithObject:newText];
+    
+    if (zerobegin) {
+        return NO;
+    }
+    
+    return plus || negative;
+}
+
+@end

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/config.h

@@ -10,7 +10,7 @@
 #define RedAnt_ERP_Mobile_config_h
 #define BUILD_NPD
 
-//#define test_server
+#define test_server
 
 //#define ENCRYPT_OFF