Sfoglia il codice sorgente

20170302
Add add document function

Ray Zhang 9 anni fa
parent
commit
f1659d19a7

BIN
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 75 - 2
Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard

@@ -383,7 +383,7 @@
                                         <rect key="frame" x="0.0" y="28" width="768" height="128"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KmC-hR-Rfo" id="twt-7p-gUd">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="127"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="128"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="GE2016121201" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="eH3-OQ-M6Q">
@@ -532,6 +532,79 @@
             </objects>
             <point key="canvasLocation" x="4829" y="-2192"/>
         </scene>
+        <!--Add Ext Document View Controller-->
+        <scene sceneID="ZZ4-D5-eah">
+            <objects>
+                <viewController storyboardIdentifier="AddExtDocumentViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="pYZ-6S-3OA" customClass="AddExtDocumentViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="qJr-B8-Gui">
+                        <rect key="frame" x="0.0" y="0.0" width="540" height="680"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Doc#" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="3FK-p8-lUc">
+                                <rect key="frame" x="20" y="30" width="42" height="21"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" id="mkL-b6-hfi">
+                                <rect key="frame" x="70" y="25" width="160" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <nil key="textColor"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <textInputTraits key="textInputTraits"/>
+                            </textField>
+                            <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="9fO-K4-8uI">
+                                <rect key="frame" x="238" y="25" width="35" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Scan"/>
+                                <connections>
+                                    <action selector="onScanClicked:" destination="pYZ-6S-3OA" eventType="touchUpInside" id="5re-f2-soa"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Wtk-Ar-V7i">
+                                <rect key="frame" x="297" y="26" width="74" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Add Image"/>
+                                <connections>
+                                    <action selector="onAddImageClicked:" destination="pYZ-6S-3OA" eventType="touchUpInside" id="P7H-9P-Otq"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="KMY-bR-M7n">
+                                <rect key="frame" x="388" y="26" width="56" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Add File"/>
+                                <connections>
+                                    <action selector="onAddFileClicked:" destination="pYZ-6S-3OA" eventType="touchUpInside" id="P2b-vX-xu5"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="zip-G1-Y1F">
+                                <rect key="frame" x="472" y="26" width="50" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Upload"/>
+                                <connections>
+                                    <action selector="onUploadClicked:" destination="pYZ-6S-3OA" eventType="touchUpInside" id="NnV-9w-q8j"/>
+                                </connections>
+                            </button>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Bp7-lh-LCu">
+                                <rect key="frame" x="0.0" y="72" width="540" height="565"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <connections>
+                                    <outlet property="dataSource" destination="pYZ-6S-3OA" id="7QE-2C-FZO"/>
+                                    <outlet property="delegate" destination="pYZ-6S-3OA" id="d4g-fQ-rmK"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+                    <size key="freeformSize" width="540" height="680"/>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="M5K-e6-0Rg" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="3935" y="-3229"/>
+        </scene>
         <!--Title-->
         <scene sceneID="eDF-JU-I2G">
             <objects>
@@ -600,7 +673,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="nMH-ja-hYm" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="3935" y="-3081"/>
+            <point key="canvasLocation" x="3935" y="-4014"/>
         </scene>
         <!--Additional Documents-->
         <scene sceneID="qSh-ww-yht">

+ 6 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj

@@ -63,6 +63,7 @@
 		714B870B1E24CAE300A40D18 /* debug.json in Resources */ = {isa = PBXBuildFile; fileRef = 714B870A1E24CAE200A40D18 /* debug.json */; };
 		717243441E1CCCEC00800678 /* CustomIOSAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 717243431E1CCCEC00800678 /* CustomIOSAlertView.m */; };
 		7172434A1E1E208F00800678 /* GEIC - Home Improvement Contract 2017.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 717243491E1E208F00800678 /* GEIC - Home Improvement Contract 2017.pdf */; };
+		71B152EF1E66C87F00D2E5EC /* AddExtDocumentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B152EE1E66C87F00D2E5EC /* AddExtDocumentViewController.m */; };
 		71BBFC371E6419D4008668A7 /* ExtDocumentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BBFC361E6419D4008668A7 /* ExtDocumentsViewController.m */; };
 		71BBFC3A1E651CC4008668A7 /* DocnotesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BBFC391E651CC4008668A7 /* DocnotesViewController.m */; };
 /* End PBXBuildFile section */
@@ -174,6 +175,8 @@
 		717243421E1CCCEC00800678 /* CustomIOSAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomIOSAlertView.h; path = "../../../RedAnt ERP Mobile/common/customUI/CustomIOSAlertView.h"; sourceTree = "<group>"; };
 		717243431E1CCCEC00800678 /* CustomIOSAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CustomIOSAlertView.m; path = "../../../RedAnt ERP Mobile/common/customUI/CustomIOSAlertView.m"; sourceTree = "<group>"; };
 		717243491E1E208F00800678 /* GEIC - Home Improvement Contract 2017.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = "GEIC - Home Improvement Contract 2017.pdf"; path = "Granite Expo eSign/GEIC - Home Improvement Contract 2017.pdf"; sourceTree = "<group>"; };
+		71B152ED1E66C87F00D2E5EC /* AddExtDocumentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddExtDocumentViewController.h; path = ../../common/AddExtDocumentViewController.h; sourceTree = "<group>"; };
+		71B152EE1E66C87F00D2E5EC /* AddExtDocumentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AddExtDocumentViewController.m; path = ../../common/AddExtDocumentViewController.m; sourceTree = "<group>"; };
 		71BBFC351E6419D4008668A7 /* ExtDocumentsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtDocumentsViewController.h; path = ../../common/ExtDocumentsViewController.h; sourceTree = "<group>"; };
 		71BBFC361E6419D4008668A7 /* ExtDocumentsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExtDocumentsViewController.m; path = ../../common/ExtDocumentsViewController.m; sourceTree = "<group>"; };
 		71BBFC381E651CC4008668A7 /* DocnotesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DocnotesViewController.h; path = ../../common/DocnotesViewController.h; sourceTree = "<group>"; };
@@ -252,6 +255,8 @@
 				7115D4261E13B70C00EF4E4C /* DocumentListViewController.m */,
 				71BBFC351E6419D4008668A7 /* ExtDocumentsViewController.h */,
 				71BBFC361E6419D4008668A7 /* ExtDocumentsViewController.m */,
+				71B152ED1E66C87F00D2E5EC /* AddExtDocumentViewController.h */,
+				71B152EE1E66C87F00D2E5EC /* AddExtDocumentViewController.m */,
 				71BBFC381E651CC4008668A7 /* DocnotesViewController.h */,
 				71BBFC391E651CC4008668A7 /* DocnotesViewController.m */,
 				7128C23E1E124F4500FF635B /* Supporting Files */,
@@ -513,6 +518,7 @@
 				7128C2C91E1250FC00FF635B /* Reachability.m in Sources */,
 				7128C27C1E12500B00FF635B /* SignatureViewController.m in Sources */,
 				7128C3521E12548C00FF635B /* PageViewController.m in Sources */,
+				71B152EF1E66C87F00D2E5EC /* AddExtDocumentViewController.m in Sources */,
 				7128C2DC1E12510900FF635B /* ZipArchive.mm in Sources */,
 				7128C3561E12548C00FF635B /* SignatureTableViewCell.m in Sources */,
 				7128C2B51E1250CA00FF635B /* GroupDrawable.m in Sources */,

+ 13 - 0
Ants Contract/common/AddExtDocumentViewController.h

@@ -0,0 +1,13 @@
+//
+//  AddExtDocumentViewController.h
+//  Granite Expo eSign
+//
+//  Created by Ray on 01/03/2017.
+//  Copyright © 2017 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AddExtDocumentViewController : UIViewController
+@property (strong, nonatomic) NSMutableArray * arr_documents;
+@end

+ 169 - 0
Ants Contract/common/AddExtDocumentViewController.m

@@ -0,0 +1,169 @@
+//
+//  AddExtDocumentViewController.m
+//  Granite Expo eSign
+//
+//  Created by Ray on 01/03/2017.
+//  Copyright © 2017 United Software Applications, Inc. All rights reserved.
+//
+
+#import "AddExtDocumentViewController.h"
+
+@interface AddExtDocumentViewController ()
+
+@end
+
+@implementation AddExtDocumentViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+- (IBAction)onScanClicked:(id)sender {
+}
+- (IBAction)onAddImageClicked:(id)sender {
+}
+- (IBAction)onAddFileClicked:(id)sender {
+}
+- (IBAction)onUploadClicked:(id)sender {
+}
+
+
+#pragma mark - Table view data source
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
+{
+    
+    return 44;
+    
+    
+}
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+    return 1;
+}
+//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+//{
+//    return 44;
+//}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    
+    
+    return self.arr_documents.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    
+    
+    
+    
+    
+    
+    
+    NSString *CellIdentifier = @"ADTableViewCell";
+    UITableViewCell  * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+    NSDictionary * item_json = self.arr_documents[indexPath.row];
+    NSString* type = item_json[@"type"];
+    NSString* file_name = item_json[@"file_name"];
+    NSString* upload_date = item_json[@"upload_date"];
+    NSString* url = item_json[@"url"];
+    if([type isEqualToString:@"file"])
+        cell.imageView.image = [UIImage imageNamed:@"file_icon"];
+    else
+        cell.imageView.image = [UIImage imageNamed:@"picture_icon"];
+    
+    
+    
+    cell.textLabel.text = file_name;
+    cell.detailTextLabel.text = upload_date;
+    
+ 
+    
+    return cell;
+    
+
+}
+#pragma mark tableview delegate
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    
+//    NSDictionary * item_json = self.arr_documents[indexPath.row];
+//    //    NSString* type = item_json[@"type"];
+//    //    NSString* file_name = item_json[@"file_name"];
+//    //    NSString* upload_date = item_json[@"upload_date"];
+//    NSString* url = item_json[@"url"];
+//    
+//    
+//    
+//    bool isLocalFile= false;//[self.content_data[indexPath.row] valueForKey:@"isLocalFile"];
+//    
+//    
+//    
+//    
+//    //    ExtDocumentsViewController * docVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"ExtDocumentsViewController"];
+//    //
+//    //    docVC.docNumber = doc_number;
+//    //    docVC.arr_documents =arr_doc;
+//    //        notesVC.docNotes = notes;
+//    
+//    
+//    
+//    PDFViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"];
+//    ViewController.url = url;
+//    ViewController.canSave = false;
+//    ViewController.isLocalfile=isLocalFile;
+//    ViewController.defaultStyle = true;
+//    //    ViewController.save_name = title;
+//    //
+//    //
+//    //    NSMutableArray* send_to = [[NSMutableArray alloc]init];
+//    //
+//    //    ViewController.mail_to = send_to;
+//    //
+//    //
+//    //    ViewController.mail_subject = subject;
+//    
+//    ViewController.hidenavi = false;
+//    
+//    
+//    UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:ViewController] ;
+//    
+//    
+//    
+//    
+//    
+//    
+//    navi.modalPresentationStyle = UIModalPresentationFullScreen;//有三种状态,自己看看是哪种
+//    [self presentViewController:navi animated:YES completion:^{
+//        
+//        //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+//        
+//        //    DebugLog(@"filter present.........");
+//        
+//        //   self.btop = false;
+//        //  <#code#>
+//    }];
+    
+    
+
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end