Răsfoiți Sursa

eSign 20170424

增加check box 对其他控件的约束逻辑。(demolition work)
Ray Zhang 9 ani în urmă
părinte
comite
60309adee7

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


+ 119 - 23
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -83,6 +83,54 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/DocumentListViewController.m"
+            timestampString = "514283514.514538"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1092"
+            endingLineNumber = "1092"
+            landmarkName = "-tableView:editActionsForRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m"
+            timestampString = "514283024.735881"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "34"
+            endingLineNumber = "34"
+            landmarkName = "-viewDidLoad"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m"
+            timestampString = "514283049.640152"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "192"
+            endingLineNumber = "192"
+            landmarkName = "-loadcontent"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -90,12 +138,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
-            timestampString = "514277720.719844"
+            timestampString = "514697931.312841"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "538"
-            endingLineNumber = "538"
-            landmarkName = "-addTextView:destView:index:"
+            startingLineNumber = "1061"
+            endingLineNumber = "1061"
+            landmarkName = "-CheckButtonClicked:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -106,12 +154,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/PageViewController.m"
-            timestampString = "514280056.103676"
+            timestampString = "514697931.312841"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "491"
-            endingLineNumber = "491"
-            landmarkName = "-addTextView:destView:index:"
+            startingLineNumber = "1064"
+            endingLineNumber = "1064"
+            landmarkName = "-CheckButtonClicked:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -121,13 +169,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/DocumentListViewController.m"
-            timestampString = "514283514.514538"
+            filePath = "common/PageViewController.m"
+            timestampString = "514697931.312841"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1092"
-            endingLineNumber = "1092"
-            landmarkName = "-tableView:editActionsForRowAtIndexPath:"
+            startingLineNumber = "936"
+            endingLineNumber = "936"
+            landmarkName = "-CheckButtonClicked:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -137,13 +185,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "../RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m"
-            timestampString = "514283024.735881"
+            filePath = "common/PageViewController.m"
+            timestampString = "514697931.312841"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "34"
-            endingLineNumber = "34"
-            landmarkName = "-viewDidLoad"
+            startingLineNumber = "974"
+            endingLineNumber = "974"
+            landmarkName = "-CheckButtonClicked:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -153,13 +201,61 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "../RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m"
-            timestampString = "514283049.640152"
+            filePath = "common/PageViewController.m"
+            timestampString = "514697931.312841"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "192"
-            endingLineNumber = "192"
-            landmarkName = "-loadcontent"
+            startingLineNumber = "978"
+            endingLineNumber = "978"
+            landmarkName = "-CheckButtonClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/AppDelegate.m"
+            timestampString = "514691084.386357"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "31"
+            endingLineNumber = "31"
+            landmarkName = "-prepareLocalResource"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/AppDelegate.m"
+            timestampString = "514697398.16548"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "72"
+            endingLineNumber = "72"
+            landmarkName = "-prepareLocalResource"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/PageViewController.m"
+            timestampString = "514698421.691847"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "510"
+            endingLineNumber = "510"
+            landmarkName = "-addTextView:destView:index:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

+ 1 - 1
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/Granite Expo eSign.xcscheme

@@ -42,7 +42,7 @@
       </AdditionalOptions>
    </TestAction>
    <LaunchAction
-      buildConfiguration = "Release"
+      buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       launchStyle = "0"

+ 23 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/na.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "na.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "na@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "na@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/na.imageset/na.png


BIN
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/na.imageset/na@2x.png


BIN
Ants Contract/Granite Expo eSign/Granite Expo eSign/Assets.xcassets/na.imageset/na@3x.png


+ 284 - 104
Ants Contract/Granite Expo eSign/Granite Expo eSign/GEIC - Home Improvement Contract 2017 Update.json

@@ -78,10 +78,11 @@
         },
         "control_1": {
             "aname": "Invoice Number",
-            "type": "TextView","margin_left":"4",
-            "margin_top":"1",
-            "tv_vmargin":0.6,
-            "size":"12",
+            "type": "TextView",
+            "margin_left": "4",
+            "margin_top": "1",
+            "tv_vmargin": 0.6,
+            "size": "12",
             "required": false,
             "pos_x": 222,
             "pos_y": 253,
@@ -92,10 +93,11 @@
         },
         "control_2": {
             "aname": "Customer Name",
-            "type": "TextView","margin_left":"4",
-            "size":"12",
-            "margin_top":"1",
-            "tv_vmargin":0.6,
+            "type": "TextView",
+            "margin_left": "4",
+            "size": "12",
+            "margin_top": "1",
+            "tv_vmargin": 0.6,
             "required": true,
             "pos_x": 222,
             "pos_y": 280,
@@ -106,9 +108,10 @@
         },
         "control_3": {
             "aname": "Job Date",
-            "type": "DatePicker","margin_left":"4",
+            "type": "DatePicker",
+            "margin_left": "4",
             "required": false,
-            "size":"12",
+            "size": "12",
             "pos_x": 488,
             "pos_y": 280,
             "width": 156,
@@ -118,11 +121,12 @@
         },
         "control_4": {
             "aname": "Jobsite Address",
-            "type": "TextView","margin_left":"1",
+            "type": "TextView",
+            "margin_left": "1",
             "required": true,
-            "tv_vmargin":0.3,
+            "tv_vmargin": 0.3,
             "margin_top": "3",
-            "size":"10",
+            "size": "10",
             "pos_x": 248,
             "pos_y": 311,
             "width": 397,
@@ -132,11 +136,12 @@
         },
         "control_5": {
             "aname": "Jobsite City",
-            "type": "TextView","margin_left":"1",
+            "type": "TextView",
+            "margin_left": "1",
             "required": true,
             "margin_top": "-1",
-            "tv_vmargin":0.3,
-            "size":"10",
+            "tv_vmargin": 0.3,
+            "size": "10",
             "pos_x": 248,
             "pos_y": 326,
             "width": 152,
@@ -146,12 +151,13 @@
         },
         "control_6": {
             "aname": "Jobsite State",
-            "type": "TextView","margin_left":"1",
+            "type": "TextView",
+            "margin_left": "1",
             "required": true,
-            "size":"10",
-            "tv_vmargin":0.3,
+            "size": "10",
+            "tv_vmargin": 0.3,
             "margin_top": "-1",
-            "capital":"charater",
+            "capital": "charater",
             "pos_x": 432,
             "pos_y": 326,
             "width": 115,
@@ -162,10 +168,11 @@
         "control_7": {
             "aname": "Jobsite Zipcode",
             "margin_top": "-1",
-            "type": "TextView","margin_left":"1",
+            "type": "TextView",
+            "margin_left": "1",
             "required": true,
-            "tv_vmargin":0.3,
-            "size":"10",
+            "tv_vmargin": 0.3,
+            "size": "10",
             "pos_x": 570,
             "pos_y": 326,
             "width": 74,
@@ -176,9 +183,10 @@
         "control_8": {
             "aname": "Telephone",
             "format": "us_tel",
-            "size":"12",
-            "keyboard":"tel",
-            "type": "TextView","margin_left":"4",
+            "size": "12",
+            "keyboard": "tel",
+            "type": "TextView",
+            "margin_left": "4",
             "required": true,
             "pos_x": 222,
             "pos_y": 344,
@@ -188,10 +196,11 @@
             "value": ""
         },
         "control_9": {
-            "aname": "Today's Date","margin_left":"4",
+            "aname": "Today's Date",
+            "margin_left": "4",
             "type": "DatePicker",
             "required": true,
-            "size":"12",
+            "size": "12",
             "pos_x": 488,
             "pos_y": 344,
             "width": 156,
@@ -201,17 +210,18 @@
         },
         "control_10": {
             "aname": "Contract Price",
-            "type": "TextView","margin_left":"4",
+            "type": "TextView",
+            "margin_left": "4",
             "required": true,
-            "size":"12",
+            "size": "12",
             "pos_x": 222,
             "pos_y": 376,
             "width": 183,
-            "keyboard":"number",
-            "value_type":"float",
+            "keyboard": "number",
+            "value_type": "float",
             "height": 30,
             "format": "price",
-            "prefix_str":"$ ",
+            "prefix_str": "$ ",
             "field": "contract_price",
             "action": {
                 "set_val": {
@@ -231,18 +241,19 @@
         },
         "control_11": {
             "aname": "Labor Deposit",
-            "type": "TextView","margin_left":"4",
+            "type": "TextView",
+            "margin_left": "4",
             "required": true,
             "pos_x": 488,
             "pos_y": 376,
             "width": 88,
-            "size":"10",
+            "size": "10",
             "height": 30,
-            "keyboard":"number",
+            "keyboard": "number",
             "field": "labor_deposit",
-            "value_type":"float",
+            "value_type": "float",
             "format": "price",
-            "prefix_str":"$ ",
+            "prefix_str": "$ ",
             "disable": true,
             "action": {
                 "set_val": {
@@ -312,11 +323,12 @@
         },
         "control_12": {
             "aname": "Balance on Account",
-            "type": "TextView","margin_left":"4",
+            "type": "TextView",
+            "margin_left": "4",
             "required": true,
-            "size":"12",
-            "prefix_str":"$ ",
-            "value_type":"float",
+            "size": "12",
+            "prefix_str": "$ ",
+            "value_type": "float",
             "pos_x": 222,
             "pos_y": 408,
             "width": 183,
@@ -377,7 +389,114 @@
                           [
                            133,
                            607
-                           ]
+                           ],
+                          {
+                          "memo": "action",
+                          "conditional_constraint": {
+                          "true": {
+                          "count": 8,
+                          "item_0": {
+                          "page": "3",
+                          "control": "control_0",
+                          "disable": "false",
+                          "set_val": ""
+                          },
+                          "item_1": {
+                          "page": "3",
+                          "control": "control_1",
+                          "disable": "false",
+                          "set_val": ""
+                          },
+                          "item_2": {
+                          "page": "3",
+                          "control": "control_2",
+                          "disable": "false",
+                          "set_val": ""
+                          },
+                          "item_3": {
+                          "page": "3",
+                          "control": "control_3",
+                          "disable": "false",
+                          "set_val": ""
+                          },
+                          "item_4": {
+                          "page": "3",
+                          "control": "control_4",
+                          "disable": "false",
+                          "set_val": ""
+                          },
+                          "item_5": {
+                          "page": "3",
+                          "control": "control_5",
+                          "disable": "false",
+                          "set_val": ""
+                          },
+                          "item_6": {
+                          "page": "3",
+                          "control": "control_6",
+                          "disable": "false",
+                          "set_val": ""
+                          },
+                          "item_7": {
+                          "page": "3",
+                          "control": "control_7",
+                          "disable": "false",
+                          "set_val": ""
+                          }
+                          },
+                          "false": {
+                          "count": 8,
+                          "item_0": {
+                          "page": "3",
+                          "control": "control_0",
+                          "disable": "true",
+                          "set_val": ""
+                          },
+                          "item_1": {
+                          "page": "3",
+                          "control": "control_1",
+                          "disable": "true",
+                          "set_val": ""
+                          },
+                          "item_2": {
+                          "page": "3",
+                          "control": "control_2",
+                          "disable": "true",
+                          "set_val": ""
+                          },
+                          "item_3": {
+                          "page": "3",
+                          "control": "control_3",
+                          "disable": "true",
+                          "set_val": ""
+                          },
+                          "item_4": {
+                          "page": "3",
+                          "control": "control_4",
+                          "disable": "true",
+                          "set_val": ""
+                          },
+                          "item_5": {
+                          "page": "3",
+                          "control": "control_5",
+                          "disable": "true",
+                          "set_val": ""
+                          },
+                          "item_6": {
+                          "page": "3",
+                          "control": "control_6",
+                          "disable": "true",
+                          "set_val": "NA"
+                          },
+                          "item_7": {
+                          "page": "3",
+                          "control": "control_7",
+                          "disable": "true",
+                          "set_val": "NA"
+                          }
+                          }
+                          }
+                          }
                           ],
                          [
                           [
@@ -393,7 +512,9 @@
             "value": []
         },
         "control_14": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -404,7 +525,9 @@
             "value": ""
         },
         "control_15": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -415,7 +538,9 @@
             "value": ""
         },
         "control_16": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -426,7 +551,9 @@
             "value": ""
         },
         "control_17": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -437,7 +564,9 @@
             "value": ""
         },
         "control_18": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -449,7 +578,7 @@
         },
         "control_21": {
             "type": "Label",
-            "textAlignment":"center",
+            "textAlignment": "center",
             "required": true,
             "pos_x": 523,
             "pos_y": 917,
@@ -460,7 +589,6 @@
             "value": ""
         },
         "control_20": {
-
             "type": "Image",
             "required": true,
             "pos_x": 500,
@@ -474,7 +602,9 @@
     "page_1": {
         "count": 22,
         "control_21": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -485,7 +615,9 @@
             "value": ""
         },
         "control_0": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -497,7 +629,7 @@
         },
         "control_1": {
             "aname": "Decision Maker",
-            "linewidth":5,
+            "linewidth": 5,
             "type": "Signature",
             "required": true,
             "pos_x": 230,
@@ -508,7 +640,9 @@
             "value": ""
         },
         "control_2": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -519,7 +653,9 @@
             "value": ""
         },
         "control_3": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -530,7 +666,9 @@
             "value": ""
         },
         "control_4": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -541,7 +679,9 @@
             "value": ""
         },
         "control_5": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -552,7 +692,9 @@
             "value": ""
         },
         "control_6": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -563,7 +705,9 @@
             "value": ""
         },
         "control_7": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -574,7 +718,9 @@
             "value": ""
         },
         "control_8": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -585,7 +731,9 @@
             "value": ""
         },
         "control_20": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -643,7 +791,9 @@
             "value": []
         },
         "control_10": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -654,7 +804,9 @@
             "value": ""
         },
         "control_11": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -665,7 +817,9 @@
             "value": ""
         },
         "control_12": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -676,7 +830,9 @@
             "value": ""
         },
         "control_13": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -687,7 +843,9 @@
             "value": ""
         },
         "control_14": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -698,7 +856,9 @@
             "value": ""
         },
         "control_15": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -709,7 +869,9 @@
             "value": ""
         },
         "control_16": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
             "required": true,
             "pos_x": 615,
@@ -721,7 +883,7 @@
         },
         "control_19": {
             "type": "Label",
-            "textAlignment":"center",
+            "textAlignment": "center",
             "required": true,
             "pos_x": 523,
             "pos_y": 917,
@@ -746,11 +908,11 @@
         "count": 10,
         "control_0": {
             "aname": "Agent Signature",
-            "linewidth":8,
+            "linewidth": 8,
             "type": "Signature",
             "required": true,
-            "required_validation":true,
-            "validation_code":"1111",
+            "required_validation": true,
+            "validation_code": "1111",
             "pos_x": 163,
             "pos_y": 791,
             "width": 146,
@@ -760,7 +922,7 @@
         },
         "control_1": {
             "aname": "Homeowner Signature",
-            "linewidth":8,
+            "linewidth": 8,
             "type": "Signature",
             "required": true,
             "pos_x": 405,
@@ -773,10 +935,10 @@
         "control_2": {
             "aname": "Agent Name",
             "type": "TextView",
-            "textAlignment":"center",
+            "textAlignment": "center",
             "margin_top": "2",
-            "size":"10",
-            "tv_vmargin":0.3,
+            "size": "10",
+            "tv_vmargin": 0.3,
             "required": true,
             "pos_x": 194,
             "pos_y": 838,
@@ -787,11 +949,11 @@
         },
         "control_3": {
             "aname": "Print Name",
-            "tv_vmargin":0.3,
+            "tv_vmargin": 0.3,
             "type": "TextView",
-            "textAlignment":"center",
+            "textAlignment": "center",
             "margin_top": "2",
-            "size":"10",
+            "size": "10",
             "required": true,
             "pos_x": 472,
             "pos_y": 838,
@@ -812,11 +974,11 @@
         },
         "control_5": {
             "aname": "Homeowner Name",
-            "tv_vmargin":0.3,
+            "tv_vmargin": 0.3,
             "type": "TextView",
-            "textAlignment":"center",
+            "textAlignment": "center",
             "required": true,
-            "size":"10",
+            "size": "10",
             "pos_x": 472,
             "pos_y": 854,
             "width": 165,
@@ -827,12 +989,12 @@
         },
         "control_6": {
             "aname": "Telephone Number",
-            "tv_vmargin":0.3,
+            "tv_vmargin": 0.3,
             "format": "us_tel",
-            "keyboard":"tel",
+            "keyboard": "tel",
             "type": "TextView",
-            "textAlignment":"center",
-            "size":"10",
+            "textAlignment": "center",
+            "size": "10",
             "margin_top": "2",
             "required": true,
             "pos_x": 472,
@@ -844,7 +1006,7 @@
         },
         "control_9": {
             "type": "Label",
-            "textAlignment":"center",
+            "textAlignment": "center",
             "required": true,
             "pos_x": 523,
             "pos_y": 917,
@@ -868,8 +1030,11 @@
     "page_3": {
         "count": 10,
         "control_0": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
+            "disable":true,
             "required": true,
             "pos_x": 615,
             "pos_y": 669,
@@ -879,8 +1044,11 @@
             "value": ""
         },
         "control_1": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
+            "disable":true,
             "required": true,
             "pos_x": 615,
             "pos_y": 685,
@@ -890,8 +1058,11 @@
             "value": ""
         },
         "control_2": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
+            "disable":true,
             "required": true,
             "pos_x": 615,
             "pos_y": 712,
@@ -901,8 +1072,11 @@
             "value": ""
         },
         "control_3": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
+            "disable":true,
             "required": true,
             "pos_x": 615,
             "pos_y": 749,
@@ -912,8 +1086,11 @@
             "value": ""
         },
         "control_4": {
-            "aname": "Initial","linewidth":8,"can_fill": "true",
+            "aname": "Initial",
+            "linewidth": 8,
+            "can_fill": "true",
             "type": "Signature",
+            "disable":true,
             "required": true,
             "pos_x": 615,
             "pos_y": 787,
@@ -924,8 +1101,9 @@
         },
         "control_5": {
             "aname": "Homeowner Signature",
-            "linewidth":8,
+            "linewidth": 8,
             "type": "Signature",
+            "disable":true,
             "required": true,
             "pos_x": 150,
             "pos_y": 833,
@@ -937,32 +1115,34 @@
         "control_6": {
             "aname": "Demolition Print name",
             "type": "TextView",
-            "margin_left":"4",
-            "margin_top":"1",
+            "margin_left": "4",
+            "margin_top": "1",
             "required": true,
+            "disable":true,
             "pos_x": 345,
             "pos_y": 833,
             "width": 195,
             "height": 24,
             "field": "demolition_printname",
-            "value": ""
+            "value": "NA"
         },
         "control_7": {
             "aname": "Demolition Date",
             "type": "DatePicker",
-            "margin_left":"4",
-            "margin_top":"1",
+            "margin_left": "4",
+            "margin_top": "1",
             "required": true,
+            "disable":true,
             "pos_x": 560,
             "pos_y": 833,
             "width": 66,
             "height": 24,
             "field": "demolition_date",
-            "value": ""
+            "value": "NA"
         },
         "control_9": {
             "type": "Label",
-            "textAlignment":"center",
+            "textAlignment": "center",
             "required": true,
             "pos_x": 523,
             "pos_y": 917,
@@ -987,7 +1167,7 @@
         "count": 2,
         "control_0_ignor": {
             "aname": "Homeowner Signature",
-            "linewidth":8,
+            "linewidth": 8,
             "type": "ignor",
             "required": true,
             "pos_x": 127,
@@ -999,7 +1179,7 @@
         },
         "control_1_ignor": {
             "aname": "Handwrite Print Name",
-            "linewidth":5,
+            "linewidth": 5,
             "type": "ignor",
             "required": true,
             "pos_x": 326,
@@ -1011,7 +1191,7 @@
         },
         "control_2_ignor": {
             "aname": "Handwrite date",
-            "linewidth":5,
+            "linewidth": 5,
             "type": "ignor",
             "required": true,
             "pos_x": 552,
@@ -1023,7 +1203,7 @@
         },
         "control_1": {
             "type": "Label",
-            "textAlignment":"center",
+            "textAlignment": "center",
             "required": true,
             "pos_x": 523,
             "pos_y": 917,

+ 1 - 1
Ants Contract/common/AddExtDocumentViewController.m

@@ -231,7 +231,7 @@
     
 }
 - (IBAction)onAddFileClicked:(id)sender {
-    [RAUtils alert_view:@"To upload a file, you must share it from thrid-part App." title:@"Upload"];
+    [RAUtils alert_view:@"To upload a file, you must share it from Third Party App." title:@"Upload"];
     return;
 }
 - (IBAction)onUploadClicked:(id)sender {

+ 1 - 1
Ants Contract/common/AppDelegate.h

@@ -22,7 +22,7 @@ typedef NS_ENUM(NSInteger, AppAccessMode) {
 @property bool bLogin;
 //@property bool bCanModify;
 //@property (strong,nonatomic) NSString* offPrefix;
-
+@property (strong,nonatomic) NSString* na_path;
 @property (strong,nonatomic) NSString* user;
 @property (strong,nonatomic) NSString * password;
 @property (strong,nonatomic) NSString* build;

+ 47 - 0
Ants Contract/common/AppDelegate.m

@@ -25,10 +25,57 @@
 
 @implementation AppDelegate
 
+-(void) prepareLocalResource
+{
+    
+    
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+    NSString *cachefolder = [paths objectAtIndex:0];
+    
+    NSString *folder = [cachefolder stringByAppendingPathComponent:@"local_resource"];
+    
+    
+    NSFileManager* fileManager = [NSFileManager defaultManager];
+    BOOL bdir=YES;
+    if(!  [fileManager fileExistsAtPath:folder isDirectory:&bdir])
+    {
+        
+        NSError *error = nil;
+        bool bsuccess=[fileManager createDirectoryAtPath:folder withIntermediateDirectories:YES attributes:nil error:&error];
+        
+        if(!bsuccess)
+        {
+            DebugLog(@"Create local resource folder failed");
+            return ;
+        }
+        
+        
 
+//        if(![fileManager copyItemAtPath:from toPath:folder error:&error])
+//        {
+//            return ;
+//        }
+        
+    }
+    
+    
+    UIImage* img=[UIImage imageNamed:@"na"];
+    
+    NSString* file = [folder stringByAppendingPathComponent:@"NA.png"];
+    
+    bool bwrite=[UIImagePNGRepresentation(img) writeToFile:file atomically:YES];
+    if(bwrite)
+        self.na_path = file;
+    else
+        self.na_path = nil;
+    
+}
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     // Override point for customization after application launch.
     
+    
+    [self prepareLocalResource];
+    
     self.accessMode = AppAccessModeOnline;
     
     self.bEnable_Cache = true;

+ 13 - 4
Ants Contract/common/DocumentPageViewController.m

@@ -39,7 +39,7 @@
 
 -(NSMutableDictionary*) templateInit:(NSMutableDictionary*) template
 {
-    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
     NSString* temp = NSTemporaryDirectory();
     NSString* filename =[NSString stringWithFormat:@"%@.png", [[NSUUID UUID] UUIDString]];
@@ -57,6 +57,7 @@
             NSMutableDictionary* control =page[[NSString stringWithFormat:@"control_%d",j]];
             NSString* type = control[@"type"];
             NSString* field =control[@"field"];
+            bool disable = [control[@"disable"] boolValue];
             if([type isEqualToString:@"Label"])
             {
                 if([field isEqualToString:@"doc_number"])
@@ -85,6 +86,11 @@
                     control[@"value"]= date;
                 }
             }
+            else if([type isEqualToString:@"Signature"]&&disable)
+            {
+                control[@"value"]= appDelegate.na_path;
+
+            }
         }
     }
     return template;
@@ -166,7 +172,7 @@
         [self.navigationController popViewControllerAnimated:false];
         return;
     }
-    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Are you sure cancel customer? All your entered information will lost." message:nil preferredStyle:UIAlertControllerStyleAlert];
+    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Are you sure to cancel the customer ? You will loose all the information you entered." message:nil preferredStyle:UIAlertControllerStyleAlert];
     
     UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
         [self.navigationController popViewControllerAnimated:false];
@@ -847,6 +853,9 @@
                         NSString* type = dest[@"type"];
                         if(![type isEqualToString:@"Signature"])
                             continue;
+                        
+                        if([dest[@"disable"] boolValue])
+                            continue;
                         if([dest[@"name"] isEqualToString:subtype])
                         {
                             dest[@"value"]=file;
@@ -871,8 +880,8 @@
         //        }
                 
     };
-    PageViewController.controlTemplate = self.controlTemplate[[NSString stringWithFormat:@"page_%lu",(unsigned long)index]];
-    
+    PageViewController.page_controlTemplate = self.controlTemplate[[NSString stringWithFormat:@"page_%lu",(unsigned long)index]];
+    PageViewController.doc_controlTemplate = self.controlTemplate;
     PageViewController.signatureData = self.signatureData;
     //PageViewController.pdfview = [self.pagePDF objectAtIndex:index];
     

+ 2 - 2
Ants Contract/common/PageViewController.h

@@ -22,8 +22,8 @@
 @property (nonatomic , copy) void (^blk_Fill)(NSString* file,NSString* subtype, bool fillFullDoc);
 
 
-@property (strong, nonatomic) NSMutableDictionary * controlTemplate;
-
+@property (strong, nonatomic) NSMutableDictionary * page_controlTemplate;
+@property (strong, nonatomic) NSMutableDictionary * doc_controlTemplate;
 @property (strong, nonatomic) NSMutableDictionary * signatureData;
 @property (strong, nonatomic) UITextView * hotTextView;
 @property bool keyboard_show;

+ 255 - 129
Ants Contract/common/PageViewController.m

@@ -21,6 +21,8 @@
 #import "DatePickerViewController.h"
 
 #import "RAUtils.h"
+#import "AppDelegate.h"
+
 
 typedef enum {
     ScreenOrientationUnknown = 0,
@@ -292,10 +294,10 @@ typedef enum {
         return;
 //    return;
     [self clearControlView]; // fill all时未显示。
-    int count = [self.controlTemplate[@"count"] intValue];
+    int count = [self.page_controlTemplate[@"count"] intValue];
     for(int i=0;i<count;i++)
     {
-        NSMutableDictionary * control =self.controlTemplate [[NSString stringWithFormat:@"control_%d",i] ];
+        NSMutableDictionary * control =self.page_controlTemplate [[NSString stringWithFormat:@"control_%d",i] ];
         if([control[@"type"] isEqualToString:@"TextView"])
         {
             [self addTextView:control destView:self.editControlView index:i];
@@ -335,11 +337,11 @@ typedef enum {
 }
 -(void) refreshControl
 {
-    int count = [self.controlTemplate[@"count"] intValue];
+    int count = [self.page_controlTemplate[@"count"] intValue];
     for(int i=0;i<count;i++)
     {
         NSString* controlname =[NSString stringWithFormat:@"control_%d",i];
-        NSMutableDictionary * control =self.controlTemplate [ controlname];
+        NSMutableDictionary * control =self.page_controlTemplate [ controlname];
         
         
 //        if([control[@"type"] isEqualToString:@"TextView"])
@@ -439,9 +441,11 @@ typedef enum {
 {
     if([condition isEqualToString:@"true"])
         return true;
+    if([condition isEqualToString:@"false"])
+        return false;
     if([condition isEqualToString:@"control_18:[value]==0"])
     {
-        NSArray* arr= self.controlTemplate[@"control_18"][@"value"];
+        NSArray* arr= self.page_controlTemplate[@"control_18"][@"value"];
         if(arr.count==0)
             return false;
         else
@@ -465,10 +469,10 @@ typedef enum {
     
 
     
-    int count = [self.controlTemplate[@"count"] intValue];
+    int count = [self.page_controlTemplate[@"count"] intValue];
     for(long i=index+1;i<count;i++)
     {
-        NSMutableDictionary * control =self.controlTemplate [[NSString stringWithFormat:@"control_%ld",i] ];
+        NSMutableDictionary * control =self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",i] ];
         if(![control[@"type"] isEqualToString:@"TextView"])
         {
             continue;
@@ -698,7 +702,7 @@ typedef enum {
     [destView addSubview:btn];
     NSArray* cadedate = template[@"cadedate"];
     
-    NSArray* checkedData = self.controlTemplate [[NSString stringWithFormat:@"control_%d",index] ][@"value"];
+    NSArray* checkedData = self.page_controlTemplate [[NSString stringWithFormat:@"control_%d",index] ][@"value"];
     float fontsize = [template[@"size"] floatValue];
     if(fontsize==0)
         fontsize=10;
@@ -772,6 +776,17 @@ typedef enum {
         btn.image = image;
         
     }
+    else
+    {
+        if([template[@"disable"] boolValue]&& [template[@"required"] boolValue])
+        {
+            AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            UIImage* img = [UIImage imageNamed:@"na"];
+            btn.image = img;
+            template[@"value"]=appDelegate.na_path;
+            
+        }
+    }
     
 
     btn.backgroundColor = UIColorFromRGB(SIG_BG);
@@ -854,6 +869,12 @@ typedef enum {
     
         long index = sender.tag - CONTROL_BASE;
     
+    
+    if([self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"disable"] boolValue] )
+    {
+        return;
+    }
+    
     __weak __typeof(self)weakSelf = self;
     NSDateFormatter * formatter = [[NSDateFormatter alloc]init];
     [formatter setDateFormat:@"MM/dd/yyyy"];
@@ -881,8 +902,8 @@ typedef enum {
         
         [sender setTitle:strdate forState:UIControlStateNormal];
         
-           weakSelf.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = strdate;
-        weakSelf.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"]=[NSNumber numberWithBool:true];
+           weakSelf.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = strdate;
+        weakSelf.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"]=[NSNumber numberWithBool:true];
     };
     dpvc.title=@"Please choose a date";
     [self.navigationController pushViewController:dpvc animated:true];
@@ -901,10 +922,10 @@ typedef enum {
     long index = sender.tag - CONTROL_BASE;
     
 
-    bool single_select = [self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"single_select"] boolValue];
-    bool show_detail = [self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"show_detail"] boolValue];
-    NSArray* rowData = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"cadedate"];
-    NSArray* checkedData = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"];
+    bool single_select = [self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"single_select"] boolValue];
+    bool show_detail = [self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"show_detail"] boolValue];
+    NSArray* rowData = self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"cadedate"];
+    NSArray* checkedData = self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"];
     CheckSelectorViewController *checkVC = [ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"CheckSelectorViewController"];
     
     checkVC.blk_OK = ^(NSArray* checkedData){
@@ -920,115 +941,189 @@ typedef enum {
             
             NSArray* item = rowData[i];
             NSArray* checkmarker = item[1];
+            
+            // checkmarker 不显示,则显示选项内容文字。
             if(checkmarker.count==0)
             {
                 sender.backgroundColor = UIColorFromRGB(CK_BG);
+
                 if([checkedData containsObject:[NSNumber numberWithLong:i]])
                 {
                     [sender setTitle:item[0][0] forState:UIControlStateNormal];
-                    if(item.count>=3)
+                }
+//                continue;
+            }
+            else
+            {
+                [sender setTitle:@"" forState:UIControlStateNormal];
+                if([checkedData containsObject:[NSNumber numberWithLong:i]])
+                {
+                    // [checkedData removeObject:[NSNumber numberWithLong:indexPath.row]];
+                    
+                    [sender.superview viewWithTag:tag].backgroundColor= [UIColor blackColor];
+                    
+                }
+                else
+                {
+                    // [self.checkedData addObject:[NSNumber numberWithLong:indexPath.row] ];
+                    [sender.superview viewWithTag:tag].backgroundColor= [UIColor clearColor];
+                }
+            }
+            
+            bool checked =[checkedData containsObject:[NSNumber numberWithLong:i]];
+            if(item.count>=3) // 模板有action项
+            {
+                //[sender setTitle:item[0][0] forState:UIControlStateNormal];
+                                    NSMutableDictionary* action = item[2];
+                if(checked)
+                {
+
+                    NSArray* disable_arr = action[@"disable"] ;
+                    for(int d = 0 ; d<disable_arr.count;d++)
                     {
-                        NSMutableDictionary* action = item[2];
-                        NSArray* disable_arr = action[@"disable"] ;
-                        for(int d = 0 ; d<disable_arr.count;d++)
-                        {
-                            self.controlTemplate [disable_arr[d] ] [@"disable"] = [NSNumber numberWithBool:true];
-                            NSString* s_idx =disable_arr[d];
-                            s_idx=[s_idx stringByReplacingOccurrencesOfString:@"control_" withString:@""];
-                            int d_idx = [s_idx intValue];
-                            ((UITextView*)[sender.superview viewWithTag:d_idx+CONTROL_BASE]).editable = false;
-                        }
-                        NSArray* enable_arr = action[@"enable"] ;
-                        for(int e = 0 ; e<enable_arr.count;e++)
-                        {
-                            self.controlTemplate [enable_arr[e] ] [@"disable"] = [NSNumber numberWithBool:false];
-                            
-                            NSString* s_idx =enable_arr[e];
-                            s_idx=[s_idx stringByReplacingOccurrencesOfString:@"control_" withString:@""];
-                            int d_idx = [s_idx intValue];
+                        self.page_controlTemplate [disable_arr[d] ] [@"disable"] = [NSNumber numberWithBool:true];
+                        NSString* s_idx =disable_arr[d];
+                        s_idx=[s_idx stringByReplacingOccurrencesOfString:@"control_" withString:@""];
+                        int d_idx = [s_idx intValue];
+                        ((UITextView*)[sender.superview viewWithTag:d_idx+CONTROL_BASE]).editable = false;
+                    }
+                    NSArray* enable_arr = action[@"enable"] ;
+                    for(int e = 0 ; e<enable_arr.count;e++)
+                    {
+                        self.page_controlTemplate [enable_arr[e] ] [@"disable"] = [NSNumber numberWithBool:false];
+                        
+                        NSString* s_idx =enable_arr[e];
+                        s_idx=[s_idx stringByReplacingOccurrencesOfString:@"control_" withString:@""];
+                        int d_idx = [s_idx intValue];
+                        
+                        ((UITextView*)[sender.superview viewWithTag:d_idx+CONTROL_BASE]).editable = true;
+                    }
+                    
 
-                            ((UITextView*)[sender.superview viewWithTag:d_idx+CONTROL_BASE]).editable = true;
-                        }
+                    
+                    
+                    
+                    NSMutableDictionary* json_setval=action[@"set_val"] ;
+                    for(int i=0;i<[json_setval[@"count"] intValue];i++)
+                    {
                         
-                        NSMutableDictionary* json_setval=action[@"set_val"] ;
-                        for(int i=0;i<[json_setval[@"count"] intValue];i++)
+                        NSMutableDictionary * control =  json_setval [[NSString stringWithFormat:@"item_%d",i] ];
+                        UITextView* tv = (UITextView*) [self findControl:control[@"control"]];
+                        NSString* value = control[@"value"];
+                        
+                        UITextView* tv6 = (UITextView*) [self findControl:@"control_10"];
+                        NSString* text = tv6.text;
+                        NSString* newvalue = nil;
+                        if([value isEqualToString:@"*0.1"])
                         {
                             
-                            NSMutableDictionary * control =  json_setval [[NSString stringWithFormat:@"item_%d",i] ];
-                            UITextView* tv = (UITextView*) [self findControl:control[@"control"]];
-                            NSString* value = control[@"value"];
-                            
-                            UITextView* tv6 = (UITextView*) [self findControl:@"control_10"];
-                            NSString* text = tv6.text;
-                            NSString* newvalue = nil;
-                            if([value isEqualToString:@"*0.1"])
-                            {
-                                
-                                NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
-                                formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
-                                NSString* prefix_str= self.controlTemplate [control[@"control"] ][@"prefix_str"];
-                                if(prefix_str.length==0)
-                                    prefix_str = @"";
-                                text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
-                                double f = [[formatter numberFromString:text] doubleValue]*0.1;
-                                newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
-                                
-                                newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
-//                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.1;
-//                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
-                                self.controlTemplate [control[@"control"] ][@"value"] = newvalue;
-                                self.controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
-                            }
-                            else if([value isEqualToString:@"*0.9"])
-                            {
-//                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
-                                NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
-                                formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
-                                NSString* prefix_str= self.controlTemplate [control[@"control"] ][@"prefix_str"];
-                                if(prefix_str.length==0)
-                                    prefix_str = @"";
-                                text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
-                                double f = [[formatter numberFromString:text] doubleValue]*0.9;
-                                newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
-                                newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
-//                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
-                                self.controlTemplate [control[@"control"] ][@"value"] = newvalue;
-                                self.controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
-                            }
-
-                            
-                            tv.text = newvalue;
+                            NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
+                            formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
+                            NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
+                            if(prefix_str.length==0)
+                                prefix_str = @"";
+                            text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
+                            double f = [[formatter numberFromString:text] doubleValue]*0.1;
+                            newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
                             
+                            newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
+                            //                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.1;
+                            //                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
+                            self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+                            self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
+                        }
+                        else if([value isEqualToString:@"*0.9"])
+                        {
+                            //                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
+                            NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
+                            formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
+                            NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
+                            if(prefix_str.length==0)
+                                prefix_str = @"";
+                            text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
+                            double f = [[formatter numberFromString:text] doubleValue]*0.9;
+                            newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
+                            newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
+                            //                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
+                            self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+                            self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
                         }
+                        
+                        
+                        tv.text = newvalue;
+                        
                     }
-                    
                 }
-                continue;
-            }
-            else
-            {
-                [sender setTitle:@"" forState:UIControlStateNormal];
-            }
-            
-           // UIView* v= sender;
-            if([checkedData containsObject:[NSNumber numberWithLong:i]])
-            {
-               // [checkedData removeObject:[NSNumber numberWithLong:indexPath.row]];
                 
-                [sender.superview viewWithTag:tag].backgroundColor= [UIColor blackColor];
                 
-            }
-            else
-            {
-               // [self.checkedData addObject:[NSNumber numberWithLong:indexPath.row] ];
-                [sender.superview viewWithTag:tag].backgroundColor= [UIColor clearColor];
+                NSMutableDictionary* json_cd=action[@"conditional_constraint"][checked?@"true":@"false"] ;
+                {
+                    for(int i=0;i<[json_cd[@"count"] intValue];i++)
+                    {
+                        
+                        NSMutableDictionary * destination =  json_cd [[NSString stringWithFormat:@"item_%d",i] ];
+                        int page = [destination[@"page"] intValue];
+                        NSString* control = destination[@"control"];
+                        self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"disable"]=destination[@"disable"];
+                        id value =destination[@"set_val"];
+                                                self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"value"]=value;
+//                        UITextView* tv = (UITextView*) [self findControl:destination[@"control"]];
+//                        NSString* value = control[@"value"];
+//                        
+//                        UITextView* tv6 = (UITextView*) [self findControl:@"control_10"];
+//                        NSString* text = tv6.text;
+//                        NSString* newvalue = nil;
+//                        if([value isEqualToString:@"*0.1"])
+//                        {
+//                            
+//                            NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
+//                            formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
+//                            NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
+//                            if(prefix_str.length==0)
+//                                prefix_str = @"";
+//                            text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
+//                            double f = [[formatter numberFromString:text] doubleValue]*0.1;
+//                            newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
+//                            
+//                            newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
+//                            //                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.1;
+//                            //                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
+//                            self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+//                            self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
+//                        }
+//                        else if([value isEqualToString:@"*0.9"])
+//                        {
+//                            //                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
+//                            NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
+//                            formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
+//                            NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
+//                            if(prefix_str.length==0)
+//                                prefix_str = @"";
+//                            text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
+//                            double f = [[formatter numberFromString:text] doubleValue]*0.9;
+//                            newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
+//                            newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
+//                            //                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
+//                            self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+//                            self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
+//                        }
+//                        
+//                        
+//                        tv.text = newvalue;
+                        
+                    }
+                }
+                
             }
             
+           // UIView* v= sender;
+
+            
             
         }
-        self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"]=checkedData;
+        self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"]=checkedData;
         
-        self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] = [NSNumber numberWithBool:true];
+        self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] = [NSNumber numberWithBool:true];
     };
     checkVC.rowData = rowData;
     checkVC.checkedData = [checkedData mutableCopy];
@@ -1064,7 +1159,7 @@ typedef enum {
         return false;
     }
     
-    NSString* tv_format=self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"format"];
+    NSString* tv_format=self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"format"];
     if([tv_format isEqualToString:@"us_tel"])
     {
         NSMutableString *newString = [[textView.text stringByReplacingCharactersInRange:range withString:text] mutableCopy];
@@ -1172,7 +1267,7 @@ typedef enum {
         
         bool canChange=true;
         
-        int max_line = [self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"lines"] intValue];
+        int max_line = [self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"lines"] intValue];
         if(max_line==0)//默认只能有一行
             max_line=1;
         long linecount=[TextUtils countOccurencesOfString:oldtext find:@"\n"];
@@ -1185,7 +1280,7 @@ typedef enum {
         }
 
         
-        int lenth = [self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"length"] intValue];
+        int lenth = [self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"length"] intValue];
         if(lenth==0)
             return canChange;
         else
@@ -1205,11 +1300,11 @@ typedef enum {
 - (void)textViewDidBeginEditing:(UITextView *)textView
 {
                 long index = textView.tag - CONTROL_BASE;
-    NSString* tv_format=self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"format"];
+    NSString* tv_format=self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"format"];
     if([tv_format isEqualToString:@"price"])
     {
         
-        NSString* prefix_str= self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
+        NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
         if(prefix_str.length==0)
             prefix_str = @"";
         
@@ -1243,6 +1338,20 @@ typedef enum {
     
     NSLog(@"textViewShouldBeginEditing");
     
+    
+//    long index = textView.tag - CONTROL_BASE;
+//    
+//    
+//    NSMutableDictionary* control_json = self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ];
+//    
+//    if([control_json[@"disable"] boolValue] )
+//    {
+//        return false;
+//    }
+//    
+    
+    
+    
     self.hotTextView = textView;//(UITableViewCell*)textView.superview.superview;
     
 
@@ -1261,12 +1370,12 @@ typedef enum {
     
     
     //处理 prefix 和 浮点格式化
-        NSString* prefix_str= self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
+        NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
     if(prefix_str.length==0)
         prefix_str = @"";
     NSString* text =textView.text;// [textView.text stringByReplacingOccurrencesOfString:prefix_str withString:@""];
     
-    NSString* value_type= self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value_type"];
+    NSString* value_type= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value_type"];
     if([value_type isEqualToString:@"float"])
         text=[NSString stringWithFormat:@"%.2f",[text doubleValue] ];
     
@@ -1276,7 +1385,7 @@ typedef enum {
 
     
     
-    if([self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"format"] isEqualToString:@"price"])
+    if([self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"format"] isEqualToString:@"price"])
     {
         text =textView.text;
 
@@ -1299,9 +1408,9 @@ typedef enum {
     
     if(text==nil)
         text=@"";
-    self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = text;
-    self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] =[NSNumber numberWithBool:true];
-    NSDictionary* action = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"action"];
+    self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = text;
+    self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] =[NSNumber numberWithBool:true];
+    NSDictionary* action = self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"action"];
     NSArray* keys=[action allKeys];
     for(int k=0;k<keys.count;k++)
     {
@@ -1324,7 +1433,7 @@ typedef enum {
                 NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
                 formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
                 
-                NSString* prefix_str= self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
+                NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
                 if(prefix_str.length==0)
                     prefix_str = @"";
                 
@@ -1351,8 +1460,8 @@ typedef enum {
                 }
 
                 
-                self.controlTemplate [control[@"control"] ][@"value"] = newvalue;
-                self.controlTemplate [control[@"control"] ][@"dirty"] =[NSNumber numberWithBool:true];
+                self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+                self.page_controlTemplate [control[@"control"] ][@"dirty"] =[NSNumber numberWithBool:true];
             }
             else if([value isEqualToString:@"*0.9"])
             {
@@ -1360,7 +1469,7 @@ typedef enum {
                 NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
                 formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
                 
-                NSString* prefix_str= self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
+                NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
                 if(prefix_str.length==0)
                     prefix_str = @"";
                 
@@ -1376,8 +1485,8 @@ typedef enum {
                 newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
                 }
 //                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
-                self.controlTemplate [control[@"control"] ][@"value"] = newvalue;
-                self.controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
+                self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+                self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
                 
             }
             else if([value isEqualToString:@"control_6-control_7"])
@@ -1393,7 +1502,7 @@ typedef enum {
                 NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
                 formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
                 
-                NSString* prefix_str= self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
+                NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
                 if(prefix_str.length==0)
                     prefix_str = @"";
                 NSString * text6=[tv6.text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
@@ -1407,8 +1516,8 @@ typedef enum {
                 newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f6-f7]];
                 newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
 //                newvalue = [NSString stringWithFormat:@"$ %.2f",f6-f7];
-                self.controlTemplate [control[@"control"] ][@"value"] = newvalue;
-                self.controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
+                self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+                self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
             }
             
             tv.text = newvalue;
@@ -1444,7 +1553,7 @@ typedef enum {
     long index = touchImageView.tag - CONTROL_BASE;
     
     
-    NSMutableDictionary* control_json = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ];
+    NSMutableDictionary* control_json = self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ];
 
     
     //    CGRect cellrect_screen = [RAUtils relativeFrameForScreenWithView:trigger];
@@ -1478,8 +1587,8 @@ typedef enum {
             touchImageView.image = image;
             
             long index = touchImageView.tag - CONTROL_BASE;
-            weakSelf.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
-            weakSelf.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] = [NSNumber numberWithBool:true];
+            weakSelf.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
+            weakSelf.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] = [NSNumber numberWithBool:true];
         }
         
     };
@@ -1535,8 +1644,8 @@ typedef enum {
             {
                 NSString* file=[PDFUtils addSignature:signimg to:self.signatureData subType:control_json[@"name"]];
                 long index = touchImageView.tag - CONTROL_BASE;
-                self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
-                self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] =[NSNumber numberWithBool:true];
+                self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
+                self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] =[NSNumber numberWithBool:true];
 
                 touchImageView.image = signimg;
             }
@@ -1576,6 +1685,17 @@ typedef enum {
 }
 - (void) TouchImageViewOnLongPress:(TouchImageView *)touchImageView
 {
+    
+    long index = touchImageView.tag - CONTROL_BASE;
+    
+    
+    NSMutableDictionary* control_json = self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ];
+    
+    if([control_json[@"disable"] boolValue] )
+    {
+        return;
+    }
+    
     if(touchImageView.image!=nil)
     {
         NSLog(@"long press");
@@ -1616,8 +1736,8 @@ typedef enum {
     }
 //    NSMutableDictionary* control_json = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ];
     
-    self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = @"";
-    self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] =[NSNumber numberWithBool:true];
+    self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = @"";
+    self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"dirty"] =[NSNumber numberWithBool:true];
 }
 - (void) touchImageModify:(id) sender
 {
@@ -1636,8 +1756,14 @@ typedef enum {
         long index = touchImageView.tag - CONTROL_BASE;
     
         
-        NSMutableDictionary* control_json = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ];
+        NSMutableDictionary* control_json = self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ];
 
+    if([control_json[@"disable"] boolValue] )
+    {
+        return;
+    }
+    
+    
     bool bvalidation=[control_json[@"required_validation"] boolValue];
     NSString* pwd= control_json[@"validation_code"];
     if(bvalidation&& pwd.length>0)