This commit is contained in:
yumoqing 2026-04-17 11:07:49 +08:00
parent dd001f63b4
commit 91270d6ced
8 changed files with 558 additions and 546 deletions

View File

@ -1,35 +1,33 @@
{ {
"tblname": "approval_instance", "tblname": "approval_instance",
"title": "审批实例", "title": "审批实例",
"params": { "params": {
"sortby": "created_at DESC", "sortby": ["created_at desc"],
"logined_userorgid": "org_id", "logined_userorgid": "org_id",
"browserfields": { "browserfields": {
"exclouded": ["id", "workflow_id", "module_record_id", "org_id"] "excluded": ["id", "workflow_id", "module_record_id", "org_id"]
}, },
"editexclouded": ["id", "workflow_id", "module_record_id", "org_id", "current_step_id"], "editexcluded": ["id", "workflow_id", "module_record_id", "org_id", "current_step_id"],
"alterations": [ "alters": {
{ "status": {
"field": "status", "uitype": "code",
"widgettype": "Select", "data": [
"options": { {"value": "pending", "text": "待审批"},
"data": "get_code('APPROVAL_STATUS')" {"value": "approved", "text": "已批准"},
} {"value": "rejected", "text": "已拒绝"},
}, {"value": "cancelled", "text": "已取消"}
{ ]
"field": "module_type", },
"widgettype": "Text", "module_type": {
"options": { "uitype": "text"
"readonly": true }
} },
} "subtables": [
], {
"subtables": [ "field": "id",
{ "title": "审批任务",
"field": "id", "subtable": "approval_task"
"title": "审批任务", }
"subtable": "approval_task" ]
} }
]
}
} }

View File

@ -1,28 +1,32 @@
{ {
"tblname": "approval_step", "tblname": "approval_step",
"title": "审批步骤", "title": "审批步骤",
"params": { "params": {
"sortby": "step_order", "sortby": ["step_order"],
"logined_userorgid": "org_id", "logined_userorgid": "org_id",
"browserfields": { "browserfields": {
"exclouded": ["id", "workflow_id", "org_id"] "excluded": ["id", "workflow_id", "org_id"]
}, },
"editexclouded": ["id", "workflow_id", "org_id"], "editexcluded": ["id", "workflow_id", "org_id"],
"alterations": [ "alters": {
{ "approver_type": {
"field": "approver_type", "uitype": "code",
"widgettype": "Select", "data": [
"options": { {"value": "role", "text": "角色"},
"data": "get_code('APPROVER_TYPE')" {"value": "user", "text": "用户"},
{"value": "department", "text": "部门"},
{"value": "dynamic", "text": "动态"}
]
},
"approval_type": {
"uitype": "code",
"data": [
{"value": "single", "text": "单人审批"},
{"value": "multiple", "text": "多人审批"},
{"value": "sequential", "text": "顺序审批"},
{"value": "parallel", "text": "并行审批"}
]
}
} }
}, }
{
"field": "approval_type",
"widgettype": "Select",
"options": {
"data": "get_code('APPROVAL_TYPE')"
}
}
]
}
} }

View File

@ -1,28 +1,22 @@
{ {
"tblname": "approval_task", "tblname": "approval_task",
"title": "审批任务", "title": "审批任务",
"params": { "params": {
"sortby": "assigned_at DESC", "sortby": ["assigned_at desc"],
"logined_userorgid": "org_id", "logined_userorgid": "org_id",
"browserfields": { "browserfields": {
"exclouded": ["id", "instance_id", "step_id", "org_id"] "excluded": ["id", "instance_id", "step_id", "org_id"]
}, },
"editexclouded": ["id", "instance_id", "step_id", "org_id"], "editexcluded": ["id", "instance_id", "step_id", "org_id"],
"alterations": [ "alters": {
{ "status": {
"field": "status", "uitype": "code",
"widgettype": "Select", "data": [
"options": { {"value": "pending", "text": "待审批"},
"data": "get_code('TASK_STATUS')" {"value": "approved", "text": "已批准"},
{"value": "rejected", "text": "已拒绝"}
]
}
} }
}, }
{
"field": "approver_id",
"widgettype": "Select",
"options": {
"data": "get_org_users(org_id)"
}
}
]
}
} }

View File

@ -1,19 +1,19 @@
{ {
"tblname": "approval_workflow", "tblname": "approval_workflow",
"title": "审批工作流", "title": "审批工作流",
"params": { "params": {
"sortby": "workflow_name", "sortby": ["workflow_name"],
"logined_userorgid": "org_id", "logined_userorgid": "org_id",
"browserfields": { "browserfields": {
"exclouded": ["id", "org_id", "created_at", "updated_at"] "excluded": ["id", "org_id", "created_at", "updated_at"]
}, },
"editexclouded": ["id", "org_id"], "editexcluded": ["id", "org_id"],
"subtables": [ "subtables": [
{ {
"field": "id", "field": "id",
"title": "审批步骤", "title": "审批步骤",
"subtable": "approval_step" "subtable": "approval_step"
} }
] ]
} }
} }

View File

@ -1,133 +1,137 @@
{ {
"summary": { "summary": [
"name": "approval_instance", {
"label": "审批实例", "name": "approval_instance",
"comment": "具体的审批实例记录" "title": "审批实例",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 32, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键UUID" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "workflow_id", "comments": "主键UUID"
"title": "工作流ID", },
"type": "str", {
"length": 32, "name": "workflow_id",
"nullable": false, "title": "工作流ID",
"comments": "关联的工作流定义" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "module_type", "comments": "关联的工作流定义"
"title": "模块类型", },
"type": "str", {
"length": 50, "name": "module_type",
"nullable": false, "title": "模块类型",
"comments": "customer/opportunity/contract/financial" "type": "str",
}, "length": 50,
{ "nullable": "no",
"name": "module_record_id", "comments": "customer/opportunity/contract/financial"
"title": "模块记录ID", },
"type": "str", {
"length": 32, "name": "module_record_id",
"nullable": false, "title": "模块记录ID",
"comments": "关联的具体业务记录ID" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "current_step_id", "comments": "关联的具体业务记录ID"
"title": "当前步骤ID", },
"type": "str", {
"length": 32, "name": "current_step_id",
"nullable": true, "title": "当前步骤ID",
"comments": "当前待审批的步骤" "type": "str",
}, "length": 32,
{ "nullable": "yes",
"name": "status", "comments": "当前待审批的步骤"
"title": "状态", },
"type": "str", {
"length": 20, "name": "status",
"nullable": false, "title": "状态",
"comments": "pending/approved/rejected/cancelled" "type": "str",
}, "length": 20,
{ "nullable": "no",
"name": "initiator_id", "comments": "pending/approved/rejected/cancelled"
"title": "发起人ID", },
"type": "str", {
"length": 32, "name": "initiator_id",
"nullable": false, "title": "发起人ID",
"comments": "审批发起人用户ID" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "title", "comments": "审批发起人用户ID"
"title": "标题", },
"type": "str", {
"length": 200, "name": "title",
"nullable": false, "title": "标题",
"comments": "审批标题" "type": "str",
}, "length": 200,
{ "nullable": "no",
"name": "description", "comments": "审批标题"
"title": "描述", },
"type": "str", {
"length": 1000, "name": "description",
"nullable": true, "title": "描述",
"comments": "审批详细描述" "type": "str",
}, "length": 1000,
{ "nullable": "yes",
"name": "org_id", "comments": "审批详细描述"
"title": "组织ID", },
"type": "str", {
"length": 32, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "多租户组织隔离" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "created_at", "comments": "多租户组织隔离"
"title": "创建时间", },
"type": "timestamp", {
"nullable": false, "name": "created_at",
"comments": "创建时间" "title": "创建时间",
}, "type": "timestamp",
{ "nullable": "no",
"name": "completed_at", "comments": "创建时间"
"title": "完成时间", },
"type": "timestamp", {
"nullable": true, "name": "completed_at",
"comments": "完成时间" "title": "完成时间",
} "type": "timestamp",
], "nullable": "yes",
"indexes": [ "comments": "完成时间"
{ }
"name": "idx_instance_workflow", ],
"idxtype": "index", "indexes": [
"fields": ["workflow_id"] {
}, "name": "idx_instance_workflow",
{ "idxtype": "index",
"name": "idx_instance_module", "idxfields": ["workflow_id"]
"idxtype": "index", },
"fields": ["module_type", "module_record_id"] {
}, "name": "idx_instance_module",
{ "idxtype": "index",
"name": "idx_instance_status", "idxfields": ["module_type", "module_record_id"]
"idxtype": "index", },
"fields": ["status"] {
}, "name": "idx_instance_status",
{ "idxtype": "index",
"name": "idx_instance_org", "idxfields": ["status"]
"idxtype": "index", },
"fields": ["org_id"] {
} "name": "idx_instance_org",
], "idxtype": "index",
"codes": [ "idxfields": ["org_id"]
{ }
"tblname": "appcodes", ],
"codevalue": "APPROVAL_STATUS", "codes": [
"valuefield": "k", {
"textfield": "v" "field": "status",
} "table": "appcodes",
] "valuefield": "k",
"textfield": "v",
"cond": "codetype='APPROVAL_STATUS'"
}
]
} }

View File

@ -1,113 +1,118 @@
{ {
"summary": { "summary": [
"name": "approval_step", {
"label": "审批步骤", "name": "approval_step",
"comment": "审批工作流步骤定义" "title": "审批步骤",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 32, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键UUID" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "workflow_id", "comments": "主键UUID"
"title": "工作流ID", },
"type": "str", {
"length": 32, "name": "workflow_id",
"nullable": false, "title": "工作流ID",
"comments": "关联的工作流" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "step_name", "comments": "关联的工作流"
"title": "步骤名称", },
"type": "str", {
"length": 100, "name": "step_name",
"nullable": false, "title": "步骤名称",
"comments": "审批步骤名称" "type": "str",
}, "length": 100,
{ "nullable": "no",
"name": "step_order", "comments": "审批步骤名称"
"title": "步骤顺序", },
"type": "long", {
"nullable": false, "name": "step_order",
"comments": "步骤执行顺序" "title": "步骤顺序",
}, "type": "long",
{ "nullable": "no",
"name": "approver_type", "comments": "步骤执行顺序"
"title": "审批人类型", },
"type": "str", {
"length": 20, "name": "approver_type",
"nullable": false, "title": "审批人类型",
"comments": "role/user/department/dynamic" "type": "str",
}, "length": 20,
{ "nullable": "no",
"name": "approver_value", "comments": "role/user/department/dynamic"
"title": "审批人值", },
"type": "str", {
"length": 100, "name": "approver_value",
"nullable": true, "title": "审批人值",
"comments": "角色ID/用户ID/部门ID/动态表达式" "type": "str",
}, "length": 100,
{ "nullable": "yes",
"name": "approval_type", "comments": "角色ID/用户ID/部门ID/动态表达式"
"title": "审批类型", },
"type": "str", {
"length": 20, "name": "approval_type",
"nullable": false, "title": "审批类型",
"comments": "single/multiple/sequential/parallel" "type": "str",
}, "length": 20,
{ "nullable": "no",
"name": "timeout_hours", "comments": "single/multiple/sequential/parallel"
"title": "超时小时数", },
"type": "long", {
"nullable": true, "name": "timeout_hours",
"comments": "审批超时时间(小时)" "title": "超时小时数",
}, "type": "long",
{ "nullable": "yes",
"name": "description", "comments": "审批超时时间(小时)"
"title": "描述", },
"type": "str", {
"length": 500, "name": "description",
"nullable": true, "title": "描述",
"comments": "步骤描述" "type": "str",
}, "length": 500,
{ "nullable": "yes",
"name": "org_id", "comments": "步骤描述"
"title": "组织ID", },
"type": "str", {
"length": 32, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "多租户组织隔离" "type": "str",
} "length": 32,
], "nullable": "no",
"indexes": [ "comments": "多租户组织隔离"
{ }
"name": "idx_step_workflow", ],
"idxtype": "index", "indexes": [
"fields": ["workflow_id"] {
}, "name": "idx_step_workflow",
{ "idxtype": "index",
"name": "idx_step_order", "idxfields": ["workflow_id"]
"idxtype": "index", },
"fields": ["workflow_id", "step_order"] {
} "name": "idx_step_order",
], "idxtype": "index",
"codes": [ "idxfields": ["workflow_id", "step_order"]
{ }
"tblname": "appcodes", ],
"codevalue": "APPROVER_TYPE", "codes": [
"valuefield": "k", {
"textfield": "v" "field": "approver_type",
}, "table": "appcodes",
{ "valuefield": "k",
"tblname": "appcodes", "textfield": "v",
"codevalue": "APPROVAL_TYPE", "cond": "codetype='APPROVER_TYPE'"
"valuefield": "k", },
"textfield": "v" {
} "field": "approval_type",
] "table": "appcodes",
"valuefield": "k",
"textfield": "v",
"cond": "codetype='APPROVAL_TYPE'"
}
]
} }

View File

@ -1,111 +1,115 @@
{ {
"summary": { "summary": [
"name": "approval_task", {
"label": "审批任务", "name": "approval_task",
"comment": "具体的审批任务分配" "title": "审批任务",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 32, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键UUID" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "instance_id", "comments": "主键UUID"
"title": "实例ID", },
"type": "str", {
"length": 32, "name": "instance_id",
"nullable": false, "title": "实例ID",
"comments": "关联的审批实例" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "step_id", "comments": "关联的审批实例"
"title": "步骤ID", },
"type": "str", {
"length": 32, "name": "step_id",
"nullable": false, "title": "步骤ID",
"comments": "关联的审批步骤" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "approver_id", "comments": "关联的审批步骤"
"title": "审批人ID", },
"type": "str", {
"length": 32, "name": "approver_id",
"nullable": false, "title": "审批人ID",
"comments": "具体审批人用户ID" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "status", "comments": "具体审批人用户ID"
"title": "状态", },
"type": "str", {
"length": 20, "name": "status",
"nullable": false, "title": "状态",
"comments": "pending/approved/rejected" "type": "str",
}, "length": 20,
{ "nullable": "no",
"name": "decision", "comments": "pending/approved/rejected"
"title": "决策", },
"type": "str", {
"length": 1000, "name": "decision",
"nullable": true, "title": "决策",
"comments": "审批意见" "type": "str",
}, "length": 1000,
{ "nullable": "yes",
"name": "org_id", "comments": "审批意见"
"title": "组织ID", },
"type": "str", {
"length": 32, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "多租户组织隔离" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "assigned_at", "comments": "多租户组织隔离"
"title": "分配时间", },
"type": "timestamp", {
"nullable": false, "name": "assigned_at",
"comments": "任务分配时间" "title": "分配时间",
}, "type": "timestamp",
{ "nullable": "no",
"name": "completed_at", "comments": "任务分配时间"
"title": "完成时间", },
"type": "timestamp", {
"nullable": true, "name": "completed_at",
"comments": "任务完成时间" "title": "完成时间",
}, "type": "timestamp",
{ "nullable": "yes",
"name": "due_at", "comments": "任务完成时间"
"title": "截止时间", },
"type": "timestamp", {
"nullable": true, "name": "due_at",
"comments": "任务截止时间" "title": "截止时间",
} "type": "timestamp",
], "nullable": "yes",
"indexes": [ "comments": "任务截止时间"
{ }
"name": "idx_task_instance", ],
"idxtype": "index", "indexes": [
"fields": ["instance_id"] {
}, "name": "idx_task_instance",
{ "idxtype": "index",
"name": "idx_task_approver", "idxfields": ["instance_id"]
"idxtype": "index", },
"fields": ["approver_id"] {
}, "name": "idx_task_approver",
{ "idxtype": "index",
"name": "idx_task_status", "idxfields": ["approver_id"]
"idxtype": "index", },
"fields": ["status"] {
} "name": "idx_task_status",
], "idxtype": "index",
"codes": [ "idxfields": ["status"]
{ }
"tblname": "appcodes", ],
"codevalue": "TASK_STATUS", "codes": [
"valuefield": "k", {
"textfield": "v" "field": "status",
} "table": "appcodes",
] "valuefield": "k",
"textfield": "v",
"cond": "codetype='TASK_STATUS'"
}
]
} }

View File

@ -1,97 +1,100 @@
{ {
"summary": { "summary": [
"name": "approval_workflow", {
"label": "审批工作流", "name": "approval_workflow",
"comment": "跨模块审批工作流定义" "title": "审批工作流",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 32, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键UUID" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "workflow_name", "comments": "主键UUID"
"title": "工作流名称", },
"type": "str", {
"length": 100, "name": "workflow_name",
"nullable": false, "title": "工作流名称",
"comments": "审批工作流名称" "type": "str",
}, "length": 100,
{ "nullable": "no",
"name": "module_type", "comments": "审批工作流名称"
"title": "模块类型", },
"type": "str", {
"length": 50, "name": "module_type",
"nullable": false, "title": "模块类型",
"comments": "关联的模块类型(customer/opportunity/contract/financial)" "type": "str",
}, "length": 50,
{ "nullable": "no",
"name": "trigger_condition", "comments": "关联的模块类型(customer/opportunity/contract/financial)"
"title": "触发条件", },
"type": "str", {
"length": 500, "name": "trigger_condition",
"nullable": true, "title": "触发条件",
"comments": "JSON格式的触发条件表达式" "type": "str",
}, "length": 500,
{ "nullable": "yes",
"name": "description", "comments": "JSON格式的触发条件表达式"
"title": "描述", },
"type": "str", {
"length": 500, "name": "description",
"nullable": true, "title": "描述",
"comments": "工作流描述" "type": "str",
}, "length": 500,
{ "nullable": "yes",
"name": "org_id", "comments": "工作流描述"
"title": "组织ID", },
"type": "str", {
"length": 32, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "多租户组织隔离" "type": "str",
}, "length": 32,
{ "nullable": "no",
"name": "created_at", "comments": "多租户组织隔离"
"title": "创建时间", },
"type": "timestamp", {
"nullable": false, "name": "created_at",
"comments": "创建时间" "title": "创建时间",
}, "type": "timestamp",
{ "nullable": "no",
"name": "updated_at", "comments": "创建时间"
"title": "更新时间", },
"type": "timestamp", {
"nullable": false, "name": "updated_at",
"comments": "更新时间" "title": "更新时间",
}, "type": "timestamp",
{ "nullable": "no",
"name": "is_active", "comments": "更新时间"
"title": "是否激活", },
"type": "str", {
"length": 1, "name": "is_active",
"nullable": false, "title": "是否激活",
"comments": "Y/N" "type": "str",
} "length": 1,
], "nullable": "no",
"indexes": [ "comments": "Y/N"
{ }
"name": "idx_workflow_org", ],
"idxtype": "index", "indexes": [
"fields": ["org_id"] {
}, "name": "idx_workflow_org",
{ "idxtype": "index",
"name": "idx_workflow_module", "idxfields": ["org_id"]
"idxtype": "index", },
"fields": ["module_type"] {
}, "name": "idx_workflow_module",
{ "idxtype": "index",
"name": "uk_workflow_name_org", "idxfields": ["module_type"]
"idxtype": "unique", },
"fields": ["workflow_name", "org_id"] {
} "name": "uk_workflow_name_org",
], "idxtype": "unique",
"codes": [] "idxfields": ["workflow_name", "org_id"]
}
],
"codes": []
} }