跳到主要内容

签批控件

使用场景

  • 特性:在签署合同的时候, 使用签批控件进行签署。如下图: sign_virtual_component
⚠️ 签批控件分为主子控件的概念1. 主控件 : SIGN_VIRTUAL_COMBINATION 是个虚拟的控件,只是表示下面的子控件为签批控件的组合。 2. 子控件 : 其中包括 SIGN_SIGNATURE (签名控件) (必须包含) , SIGN_DATE (日期控件, 通常跟签名控件一起出现)(可选), SIGN_SELECTOR(审批意见) (可选), SIGN_MULTI_LINE_TEXT(批注附言)(可选)每一种类的子控件只能有一个。
  • 适用场景:签署方在签署的时候,需要进行批注。
  • 使用限制:签批控件的子组件必须包含签名控件。

使用包含签批控件的模板发起合同

接下来的示例默认您对通过模板发起签署流程 已经熟悉,如您未阅读过此部分,建议先了解如何通过模版发起签署流程

  1. 通过子客企业控制台创建模版。参见第三方应用子客企业自建模板

  2. 模板中,配置一个包含签批控件的模板。 签批控件拖动到模板

  3. 保存模板。

  4. 使用创建签署流程(CreateFlowsByTemplates)创建一个流程即可。

使用文件发起一份包含签批控件的合同

接下来的示例默认您对通过文件发起签署流程 已经熟悉,如您未阅读过此部分,建议先了解如何通过文件发起签署流程

  1. 调用创建签署流程接口(CreateFlowByFiles)创建签署流程,如: 此示例为 一份 B2C 合同,B 端签署人有两个签署控件 (签字和审批控件), C 端签署人只有审批控件

         {
    "Action": "ChannelCreateFlowByFiles",
    "Agent": {
    "ProxyOperator": {
    "OpenId": "n9527"
    },
    "ProxyOrganizationOpenId": "org_dianziqian",
    "AppId": "yDwhxUUckp3gl8j5UuFX33LSNozpRsbi"
    },
    "FlowName": "文件发起-签批",
    "FlowApprovers": [
    {
    "ApproverType": "ORGANIZATION",
    "OrganizationOpenId": "org_dianziqian",
    "OpenId": "n9527",
    "Name": "典子谦",
    "Mobile": "13200000000",
    "OrganizationName": "典子谦示例企业",
    "SignComponents": [
    {
    "ComponentId": "ComponentId_1",
    "ComponentPosY": 260,
    "ComponentWidth": 100,
    "FileIndex": 0,
    "ComponentType": "SIGN_SIGNATURE",
    "ComponentPage": 1,
    "ComponentPosX": 160,
    "ComponentHeight": 100,
    "Relation": "ComponentId_2"
    },
    {
    "ComponentId": "ComponentId_2",
    "ComponentPosY": 360,
    "ComponentWidth": 100,
    "FileIndex": 0,
    "ComponentType": "SIGN_DATE",
    "ComponentPage": 1,
    "ComponentPosX": 160,
    "ComponentHeight": 50,
    "Relation": "ComponentId_1"
    },
    {
    "ComponentExtra": "{\"Children\":[\"ComponentId_29\",\"ComponentId_27\",\"ComponentId_28\",\"ComponentId_30\"]}",
    "ComponentHeight": 211,
    "ComponentId": "ComponentId_26",
    "ComponentName": "签批1",
    "ComponentPage": 1,
    "ComponentPosX": 180,
    "ComponentPosY": 478,
    "ComponentType": "SIGN_VIRTUAL_COMBINATION",
    "ComponentWidth": 210,
    "ComponentRequired": false
    },
    {
    "ComponentExtra": "{\"Values\":[\"审批通过\",\"审批不通过\"],\"FontSize\":12,\"FontAlign\":\"Left\",\"Font\":\"黑体\",\"MultiSelect\":false}",
    "ComponentHeight": 20,
    "ComponentId": "ComponentId_29",
    "ComponentName": "审批意见",
    "ComponentPage": 1,
    "ComponentPosX": 180,
    "ComponentPosY": 567,
    "component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
    "ComponentRequired": true,
    "ComponentType": "SIGN_SELECTOR",
    "ComponentWidth": 210
    },
    {
    "ComponentExtra": "{\"Date\":true,\"isAfterCut\":true}",
    "ComponentHeight": 43,
    "ComponentId": "ComponentId_27",
    "ComponentName": "个人签名/印章",
    "ComponentPage": 1,
    "ComponentPosX": 185,
    "ComponentPosY": 478,
    "component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
    "ComponentRequired": true,
    "ComponentType": "SIGN_SIGNATURE",
    "ComponentWidth": 119,
    "Relation": "ComponentId_28"
    },
    {
    "ComponentExtra": "{\"Format\":\"yyyy年m月d日\",\"Gaps\":\"2,2\",\"FontSize\":12,\"FontAlign\":\"Center\",\"Font\":\"黑体\",\"isAfterCut\":true}",
    "ComponentHeight": 20,
    "ComponentId": "ComponentId_28",
    "ComponentName": "签署日期",
    "ComponentPage": 1,
    "ComponentPosX": 185,
    "ComponentPosY": 541,
    "ComponentRequired": true,
    "ComponentType": "SIGN_DATE",
    "ComponentWidth": 119,
    "Relation": "ComponentId_27"
    },
    {
    "ComponentExtra": "{\"FontSize\":12,\"FontAlign\":\"Left\",\"VerticalAlign\":\"Top\",\"Font\":\"黑体\"}",
    "ComponentHeight": 54,
    "ComponentId": "ComponentId_30",
    "ComponentName": "批注附言",
    "ComponentPage": 1,
    "ComponentPosX": 180,
    "ComponentPosY": 635,
    "ComponentRequired": true,
    "ComponentType": "SIGN_MULTI_LINE_TEXT",
    "ComponentWidth": 210
    }
    ]
    },
    {
    "ApproverType": "PERSON",
    "Name": "张三",
    "Mobile": "18888888888",
    "SignComponents": [
    {
    "ComponentPosY": 260,
    "ComponentWidth": 100,
    "FileIndex": 0,
    "ComponentType": "SIGN_SIGNATURE",
    "ComponentPage": 1,
    "ComponentPosX": 160,
    "ComponentHeight": 100
    },
    {
    "ComponentExtra": "{\"Children\":[\"ComponentId_19\",\"ComponentId_17\",\"ComponentId_18\",\"ComponentId_20\"]}",
    "ComponentHeight": 211,
    "ComponentId": "ComponentId_16",
    "ComponentName": "签批1",
    "ComponentPage": 1,
    "ComponentPosX": 280,
    "ComponentPosY": 478,
    "ComponentType": "SIGN_VIRTUAL_COMBINATION",
    "ComponentWidth": 210
    },
    {
    "ComponentExtra": "{\"Values\":[\"审批通过\",\"审批不通过\"],\"FontSize\":12,\"FontAlign\":\"Left\",\"Font\":\"黑体\",\"MultiSelect\":false}",
    "ComponentHeight": 20,
    "ComponentId": "ComponentId_19",
    "ComponentName": "审批意见",
    "ComponentPage": 1,
    "ComponentPosX": 280,
    "ComponentPosY": 567,
    "component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
    "ComponentRequired": true,
    "ComponentType": "SIGN_SELECTOR",
    "ComponentWidth": 210
    },
    {
    "ComponentExtra": "{\"Format\":\"yyyy年m月d日\",\"Gaps\":\"2,2\",\"FontSize\":12,\"FontAlign\":\"Center\",\"Font\":\"黑体\",\"isAfterCut\":true}",
    "ComponentHeight": 20,
    "ComponentId": "ComponentId_18",
    "ComponentName": "签署日期",
    "ComponentPage": 1,
    "ComponentPosX": 285,
    "ComponentPosY": 541,
    "ComponentRequired": true,
    "ComponentType": "SIGN_DATE",
    "ComponentWidth": 119,
    "Relation": "ComponentId_17"
    },
    {
    "ComponentExtra": "{\"Date\":true,\"isAfterCut\":true}",
    "ComponentHeight": 43,
    "ComponentId": "ComponentId_17",
    "ComponentName": "个人签名/印章",
    "ComponentPage": 1,
    "ComponentPosX": 285,
    "ComponentPosY": 478,
    "component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
    "ComponentRequired": true,
    "ComponentType": "SIGN_SIGNATURE",
    "ComponentWidth": 119,
    "Relation": "ComponentId_18"
    },
    {
    "ComponentExtra": "{\"FontSize\":12,\"FontAlign\":\"Left\",\"VerticalAlign\":\"Top\",\"Font\":\"黑体\"}",
    "ComponentHeight": 54,
    "ComponentId": "ComponentId_20",
    "ComponentName": "批注附言",
    "ComponentPage": 1,
    "ComponentPosX": 280,
    "ComponentPosY": 635,
    "ComponentRequired": true,
    "ComponentType": "SIGN_MULTI_LINE_TEXT",
    "ComponentWidth": 210
    }
    ]
    }
    ],
    "FileIds": [
    "yDRSRUUgygj6qnwfUuO4zjEwc193c2hH"
    ],
    "Unordered": true
    }

- `OpenId` 为发起方经办人的用户 ID,具体可在调用接口前请确保您已清楚通用参数Agent中各字段的含义(可参见[接口通用参数说明](/developers/partner/common_params)),以及TemplateId(模版ID)从哪获取。需要注意的是,第三方应用集成的合同发起方只能是子客企业。因此,涉及到的合同发起时的模板、印章等参数,都必须是子客企业下的。。
- `FlowName` 为合同名称。
- `FlowApprovers` 指定签署方信息。
- `ApproverType` 签署方类型。


## 审批控件类型解释

审批控件属于一种特殊的[签署控件](https://qian.tencent.com/developers/partnerApis/dataTypes/#component)。由一个虚拟组合控件(ComponentType 为SIGN_VIRTUAL_COMBINATION), 最多四个不同类型的子控件。其中包括 SIGN_SIGNATURE (签名控件)<font color="red"> (必须包含) </font>, SIGN_DATE (日期控件, 通常跟签名控件一起出现)<font color="red">(可选)</font>, SIGN_SELECTOR(审批意见) <font color="red">(可选)</font>, SIGN_MULTI_LINE_TEXT(批注附言)<font color="red">(可选)</font>


### SIGN_VIRTUAL_COMBINATION 签批

| component_type | component_extra | 描述 |
|--------------|-------------------------|----------------------------------------------------------------|
| SIGN_VIRTUAL_COMBINATION | 必须包含 Children | 子控件的集合 |

### SIGN_SIGNATURE 签名

| component_type | component_extra | 描述 |
|--------------|-------------------------|----------------------------------------------------------------|
| SIGN_SIGNATURE | 无 | 普通签名控件,子控件中必须项 |


### SIGN_DATE 日期

| component_type | component_extra | 描述 |
|--------------|-------------------------|----------------------------------------------------------------|
| SIGN_DATE | 无 可以定义日期格式 | 日期控件,如果需要和签名控件分开 可以添加 \"isAfterCut\":true, 子控件中非必须项 |


### SIGN_SELECTOR 审批意见

| component_type | component_extra | 描述 |
|--------------|-------------------------|----------------------------------------------------------------|
| SIGN_SELECTOR | Values 必须包含,表示审批的意见 | 审批意见的值,单个审批意见的字数长度不能超过这个签署控件的宽度, 子控件中非必须项 |


### SIGN_MULTI_LINE_TEXT 批注附言

| component_type | component_extra | 描述 |
|--------------|-------------------------|----------------------------------------------------------------|
| SIGN_MULTI_LINE_TEXT | 无 | 批注附言 子控件中非必须项 |


示例 1 四个子控件都有的签批控件

```json
"SignComponents": [
{
"component_extra": "{\"Children\":[\"ComponentId_29\",\"ComponentId_27\",\"ComponentId_28\",\"ComponentId_30\"]}",
"component_height": 211,
"component_id": "ComponentId_26",
"component_name": "签批1",
"component_page": 1,
"component_pos_x": 180,
"component_pos_y": 478,
"component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
"component_type": "SIGN_VIRTUAL_COMBINATION",
"component_width": 210
},
{
"component_extra": "{\"Values\":[\"审批通过\",\"审批不通过\"],\"FontSize\":12,\"FontAlign\":\"Left\",\"Font\":\"黑体\",\"MultiSelect\":false}",
"component_height": 20,
"component_id": "ComponentId_29",
"component_name": "审批意见",
"component_page": 1,
"component_pos_x": 180,
"component_pos_y": 567,
"component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
"component_required": true,
"component_type": "SIGN_SELECTOR",
"component_width": 210
},
{
"component_extra": "{\"Date\":true,\"isAfterCut\":true}",
"component_height": 43,
"component_id": "ComponentId_27",
"component_name": "个人签名/印章",
"component_page": 1,
"component_pos_x": 185,
"component_pos_y": 478,
"component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
"component_required": true,
"component_type": "SIGN_SIGNATURE",
"component_width": 119,
"relation": "ComponentId_28"
},
{
"component_extra": "{\"Format\":\"yyyy年m月d日\",\"Gaps\":\"2,2\",\"FontSize\":12,\"FontAlign\":\"Center\",\"Font\":\"黑体\",\"isAfterCut\":true}",
"component_height": 20,
"component_id": "ComponentId_28",
"component_name": "签署日期",
"component_page": 1,
"component_pos_x": 185,
"component_pos_y": 541,
"component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
"component_required": true,
"component_type": "SIGN_DATE",
"component_width": 119,
"relation": "ComponentId_27"
},
{
"component_extra": "{\"FontSize\":12,\"FontAlign\":\"Left\",\"VerticalAlign\":\"Top\",\"Font\":\"黑体\"}",
"component_height": 54,
"component_id": "ComponentId_30",
"component_name": "批注附言",
"component_page": 1,
"component_pos_x": 180,
"component_pos_y": 635,
"component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
"component_required": true,
"component_type": "SIGN_MULTI_LINE_TEXT",
"component_width": 210
}
]
}

签批控件

示例 2:仅有签名和审批意见的签批控件。

"SignComponents": [
{
"component_extra": "{\"Children\":[\"ComponentId_29\",\"ComponentId_27\"}",
"component_height": 211,
"component_id": "ComponentId_26",
"component_name": "签批1",
"component_page": 1,
"component_pos_x": 180,
"component_pos_y": 478,
"component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
"component_type": "SIGN_VIRTUAL_COMBINATION",
"component_width": 210
},
{
"component_extra": "{\"Values\":[\"审批通过\",\"审批不通过\"],\"FontSize\":12,\"FontAlign\":\"Left\",\"Font\":\"黑体\",\"MultiSelect\":false}",
"component_height": 20,
"component_id": "ComponentId_29",
"component_name": "审批意见",
"component_page": 1,
"component_pos_x": 180,
"component_pos_y": 567,
"component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
"component_required": true,
"component_type": "SIGN_SELECTOR",
"component_width": 210
},
{
"component_extra": "{\"Date\":true,\"isAfterCut\":true}",
"component_height": 43,
"component_id": "ComponentId_27",
"component_name": "个人签名/印章",
"component_page": 1,
"component_pos_x": 185,
"component_pos_y": 478,
"component_recipient_id": "yDCHZUUckpa942qzUjtHvxu1eh5y3AmC",
"component_required": true,
"component_type": "SIGN_SIGNATURE",
"component_width": 119,
"relation": "ComponentId_28"
}
]
}

签批控件展示2

购买咨询
微信客服
4006-808-062
4006-808-062