diff --git a/json/approval_instance.json b/json/approval_instance.json index 845b3ea..f91c0a6 100644 --- a/json/approval_instance.json +++ b/json/approval_instance.json @@ -1,35 +1,33 @@ { - "tblname": "approval_instance", - "title": "审批实例", - "params": { - "sortby": "created_at DESC", - "logined_userorgid": "org_id", - "browserfields": { - "exclouded": ["id", "workflow_id", "module_record_id", "org_id"] - }, - "editexclouded": ["id", "workflow_id", "module_record_id", "org_id", "current_step_id"], - "alterations": [ - { - "field": "status", - "widgettype": "Select", - "options": { - "data": "get_code('APPROVAL_STATUS')" - } - }, - { - "field": "module_type", - "widgettype": "Text", - "options": { - "readonly": true - } - } - ], - "subtables": [ - { - "field": "id", - "title": "审批任务", - "subtable": "approval_task" - } - ] - } + "tblname": "approval_instance", + "title": "审批实例", + "params": { + "sortby": ["created_at desc"], + "logined_userorgid": "org_id", + "browserfields": { + "excluded": ["id", "workflow_id", "module_record_id", "org_id"] + }, + "editexcluded": ["id", "workflow_id", "module_record_id", "org_id", "current_step_id"], + "alters": { + "status": { + "uitype": "code", + "data": [ + {"value": "pending", "text": "待审批"}, + {"value": "approved", "text": "已批准"}, + {"value": "rejected", "text": "已拒绝"}, + {"value": "cancelled", "text": "已取消"} + ] + }, + "module_type": { + "uitype": "text" + } + }, + "subtables": [ + { + "field": "id", + "title": "审批任务", + "subtable": "approval_task" + } + ] + } } \ No newline at end of file diff --git a/json/approval_step.json b/json/approval_step.json index cbc5578..d86d6ea 100644 --- a/json/approval_step.json +++ b/json/approval_step.json @@ -1,28 +1,32 @@ { - "tblname": "approval_step", - "title": "审批步骤", - "params": { - "sortby": "step_order", - "logined_userorgid": "org_id", - "browserfields": { - "exclouded": ["id", "workflow_id", "org_id"] - }, - "editexclouded": ["id", "workflow_id", "org_id"], - "alterations": [ - { - "field": "approver_type", - "widgettype": "Select", - "options": { - "data": "get_code('APPROVER_TYPE')" + "tblname": "approval_step", + "title": "审批步骤", + "params": { + "sortby": ["step_order"], + "logined_userorgid": "org_id", + "browserfields": { + "excluded": ["id", "workflow_id", "org_id"] + }, + "editexcluded": ["id", "workflow_id", "org_id"], + "alters": { + "approver_type": { + "uitype": "code", + "data": [ + {"value": "role", "text": "角色"}, + {"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')" - } - } - ] - } + } } \ No newline at end of file diff --git a/json/approval_task.json b/json/approval_task.json index 1d79ed6..e130164 100644 --- a/json/approval_task.json +++ b/json/approval_task.json @@ -1,28 +1,22 @@ { - "tblname": "approval_task", - "title": "审批任务", - "params": { - "sortby": "assigned_at DESC", - "logined_userorgid": "org_id", - "browserfields": { - "exclouded": ["id", "instance_id", "step_id", "org_id"] - }, - "editexclouded": ["id", "instance_id", "step_id", "org_id"], - "alterations": [ - { - "field": "status", - "widgettype": "Select", - "options": { - "data": "get_code('TASK_STATUS')" + "tblname": "approval_task", + "title": "审批任务", + "params": { + "sortby": ["assigned_at desc"], + "logined_userorgid": "org_id", + "browserfields": { + "excluded": ["id", "instance_id", "step_id", "org_id"] + }, + "editexcluded": ["id", "instance_id", "step_id", "org_id"], + "alters": { + "status": { + "uitype": "code", + "data": [ + {"value": "pending", "text": "待审批"}, + {"value": "approved", "text": "已批准"}, + {"value": "rejected", "text": "已拒绝"} + ] + } } - }, - { - "field": "approver_id", - "widgettype": "Select", - "options": { - "data": "get_org_users(org_id)" - } - } - ] - } + } } \ No newline at end of file diff --git a/json/approval_workflow.json b/json/approval_workflow.json index ff25782..380590d 100644 --- a/json/approval_workflow.json +++ b/json/approval_workflow.json @@ -1,19 +1,19 @@ { - "tblname": "approval_workflow", - "title": "审批工作流", - "params": { - "sortby": "workflow_name", - "logined_userorgid": "org_id", - "browserfields": { - "exclouded": ["id", "org_id", "created_at", "updated_at"] - }, - "editexclouded": ["id", "org_id"], - "subtables": [ - { - "field": "id", - "title": "审批步骤", - "subtable": "approval_step" - } - ] - } + "tblname": "approval_workflow", + "title": "审批工作流", + "params": { + "sortby": ["workflow_name"], + "logined_userorgid": "org_id", + "browserfields": { + "excluded": ["id", "org_id", "created_at", "updated_at"] + }, + "editexcluded": ["id", "org_id"], + "subtables": [ + { + "field": "id", + "title": "审批步骤", + "subtable": "approval_step" + } + ] + } } \ No newline at end of file diff --git a/models/approval_instance.json b/models/approval_instance.json index 832a530..c6cb71f 100644 --- a/models/approval_instance.json +++ b/models/approval_instance.json @@ -1,133 +1,137 @@ { - "summary": { - "name": "approval_instance", - "label": "审批实例", - "comment": "具体的审批实例记录" - }, - "fields": [ - { - "name": "id", - "title": "ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "主键UUID" - }, - { - "name": "workflow_id", - "title": "工作流ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "关联的工作流定义" - }, - { - "name": "module_type", - "title": "模块类型", - "type": "str", - "length": 50, - "nullable": false, - "comments": "customer/opportunity/contract/financial" - }, - { - "name": "module_record_id", - "title": "模块记录ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "关联的具体业务记录ID" - }, - { - "name": "current_step_id", - "title": "当前步骤ID", - "type": "str", - "length": 32, - "nullable": true, - "comments": "当前待审批的步骤" - }, - { - "name": "status", - "title": "状态", - "type": "str", - "length": 20, - "nullable": false, - "comments": "pending/approved/rejected/cancelled" - }, - { - "name": "initiator_id", - "title": "发起人ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "审批发起人用户ID" - }, - { - "name": "title", - "title": "标题", - "type": "str", - "length": 200, - "nullable": false, - "comments": "审批标题" - }, - { - "name": "description", - "title": "描述", - "type": "str", - "length": 1000, - "nullable": true, - "comments": "审批详细描述" - }, - { - "name": "org_id", - "title": "组织ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "多租户组织隔离" - }, - { - "name": "created_at", - "title": "创建时间", - "type": "timestamp", - "nullable": false, - "comments": "创建时间" - }, - { - "name": "completed_at", - "title": "完成时间", - "type": "timestamp", - "nullable": true, - "comments": "完成时间" - } - ], - "indexes": [ - { - "name": "idx_instance_workflow", - "idxtype": "index", - "fields": ["workflow_id"] - }, - { - "name": "idx_instance_module", - "idxtype": "index", - "fields": ["module_type", "module_record_id"] - }, - { - "name": "idx_instance_status", - "idxtype": "index", - "fields": ["status"] - }, - { - "name": "idx_instance_org", - "idxtype": "index", - "fields": ["org_id"] - } - ], - "codes": [ - { - "tblname": "appcodes", - "codevalue": "APPROVAL_STATUS", - "valuefield": "k", - "textfield": "v" - } - ] + "summary": [ + { + "name": "approval_instance", + "title": "审批实例", + "primary": "id", + "catelog": "entity" + } + ], + "fields": [ + { + "name": "id", + "title": "ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "主键UUID" + }, + { + "name": "workflow_id", + "title": "工作流ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "关联的工作流定义" + }, + { + "name": "module_type", + "title": "模块类型", + "type": "str", + "length": 50, + "nullable": "no", + "comments": "customer/opportunity/contract/financial" + }, + { + "name": "module_record_id", + "title": "模块记录ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "关联的具体业务记录ID" + }, + { + "name": "current_step_id", + "title": "当前步骤ID", + "type": "str", + "length": 32, + "nullable": "yes", + "comments": "当前待审批的步骤" + }, + { + "name": "status", + "title": "状态", + "type": "str", + "length": 20, + "nullable": "no", + "comments": "pending/approved/rejected/cancelled" + }, + { + "name": "initiator_id", + "title": "发起人ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "审批发起人用户ID" + }, + { + "name": "title", + "title": "标题", + "type": "str", + "length": 200, + "nullable": "no", + "comments": "审批标题" + }, + { + "name": "description", + "title": "描述", + "type": "str", + "length": 1000, + "nullable": "yes", + "comments": "审批详细描述" + }, + { + "name": "org_id", + "title": "组织ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "多租户组织隔离" + }, + { + "name": "created_at", + "title": "创建时间", + "type": "timestamp", + "nullable": "no", + "comments": "创建时间" + }, + { + "name": "completed_at", + "title": "完成时间", + "type": "timestamp", + "nullable": "yes", + "comments": "完成时间" + } + ], + "indexes": [ + { + "name": "idx_instance_workflow", + "idxtype": "index", + "idxfields": ["workflow_id"] + }, + { + "name": "idx_instance_module", + "idxtype": "index", + "idxfields": ["module_type", "module_record_id"] + }, + { + "name": "idx_instance_status", + "idxtype": "index", + "idxfields": ["status"] + }, + { + "name": "idx_instance_org", + "idxtype": "index", + "idxfields": ["org_id"] + } + ], + "codes": [ + { + "field": "status", + "table": "appcodes", + "valuefield": "k", + "textfield": "v", + "cond": "codetype='APPROVAL_STATUS'" + } + ] } \ No newline at end of file diff --git a/models/approval_step.json b/models/approval_step.json index 5512d15..8c93d41 100644 --- a/models/approval_step.json +++ b/models/approval_step.json @@ -1,113 +1,118 @@ { - "summary": { - "name": "approval_step", - "label": "审批步骤", - "comment": "审批工作流步骤定义" - }, - "fields": [ - { - "name": "id", - "title": "ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "主键UUID" - }, - { - "name": "workflow_id", - "title": "工作流ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "关联的工作流" - }, - { - "name": "step_name", - "title": "步骤名称", - "type": "str", - "length": 100, - "nullable": false, - "comments": "审批步骤名称" - }, - { - "name": "step_order", - "title": "步骤顺序", - "type": "long", - "nullable": false, - "comments": "步骤执行顺序" - }, - { - "name": "approver_type", - "title": "审批人类型", - "type": "str", - "length": 20, - "nullable": false, - "comments": "role/user/department/dynamic" - }, - { - "name": "approver_value", - "title": "审批人值", - "type": "str", - "length": 100, - "nullable": true, - "comments": "角色ID/用户ID/部门ID/动态表达式" - }, - { - "name": "approval_type", - "title": "审批类型", - "type": "str", - "length": 20, - "nullable": false, - "comments": "single/multiple/sequential/parallel" - }, - { - "name": "timeout_hours", - "title": "超时小时数", - "type": "long", - "nullable": true, - "comments": "审批超时时间(小时)" - }, - { - "name": "description", - "title": "描述", - "type": "str", - "length": 500, - "nullable": true, - "comments": "步骤描述" - }, - { - "name": "org_id", - "title": "组织ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "多租户组织隔离" - } - ], - "indexes": [ - { - "name": "idx_step_workflow", - "idxtype": "index", - "fields": ["workflow_id"] - }, - { - "name": "idx_step_order", - "idxtype": "index", - "fields": ["workflow_id", "step_order"] - } - ], - "codes": [ - { - "tblname": "appcodes", - "codevalue": "APPROVER_TYPE", - "valuefield": "k", - "textfield": "v" - }, - { - "tblname": "appcodes", - "codevalue": "APPROVAL_TYPE", - "valuefield": "k", - "textfield": "v" - } - ] + "summary": [ + { + "name": "approval_step", + "title": "审批步骤", + "primary": "id", + "catelog": "entity" + } + ], + "fields": [ + { + "name": "id", + "title": "ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "主键UUID" + }, + { + "name": "workflow_id", + "title": "工作流ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "关联的工作流" + }, + { + "name": "step_name", + "title": "步骤名称", + "type": "str", + "length": 100, + "nullable": "no", + "comments": "审批步骤名称" + }, + { + "name": "step_order", + "title": "步骤顺序", + "type": "long", + "nullable": "no", + "comments": "步骤执行顺序" + }, + { + "name": "approver_type", + "title": "审批人类型", + "type": "str", + "length": 20, + "nullable": "no", + "comments": "role/user/department/dynamic" + }, + { + "name": "approver_value", + "title": "审批人值", + "type": "str", + "length": 100, + "nullable": "yes", + "comments": "角色ID/用户ID/部门ID/动态表达式" + }, + { + "name": "approval_type", + "title": "审批类型", + "type": "str", + "length": 20, + "nullable": "no", + "comments": "single/multiple/sequential/parallel" + }, + { + "name": "timeout_hours", + "title": "超时小时数", + "type": "long", + "nullable": "yes", + "comments": "审批超时时间(小时)" + }, + { + "name": "description", + "title": "描述", + "type": "str", + "length": 500, + "nullable": "yes", + "comments": "步骤描述" + }, + { + "name": "org_id", + "title": "组织ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "多租户组织隔离" + } + ], + "indexes": [ + { + "name": "idx_step_workflow", + "idxtype": "index", + "idxfields": ["workflow_id"] + }, + { + "name": "idx_step_order", + "idxtype": "index", + "idxfields": ["workflow_id", "step_order"] + } + ], + "codes": [ + { + "field": "approver_type", + "table": "appcodes", + "valuefield": "k", + "textfield": "v", + "cond": "codetype='APPROVER_TYPE'" + }, + { + "field": "approval_type", + "table": "appcodes", + "valuefield": "k", + "textfield": "v", + "cond": "codetype='APPROVAL_TYPE'" + } + ] } \ No newline at end of file diff --git a/models/approval_task.json b/models/approval_task.json index d8d6e3b..8c64f10 100644 --- a/models/approval_task.json +++ b/models/approval_task.json @@ -1,111 +1,115 @@ { - "summary": { - "name": "approval_task", - "label": "审批任务", - "comment": "具体的审批任务分配" - }, - "fields": [ - { - "name": "id", - "title": "ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "主键UUID" - }, - { - "name": "instance_id", - "title": "实例ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "关联的审批实例" - }, - { - "name": "step_id", - "title": "步骤ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "关联的审批步骤" - }, - { - "name": "approver_id", - "title": "审批人ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "具体审批人用户ID" - }, - { - "name": "status", - "title": "状态", - "type": "str", - "length": 20, - "nullable": false, - "comments": "pending/approved/rejected" - }, - { - "name": "decision", - "title": "决策", - "type": "str", - "length": 1000, - "nullable": true, - "comments": "审批意见" - }, - { - "name": "org_id", - "title": "组织ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "多租户组织隔离" - }, - { - "name": "assigned_at", - "title": "分配时间", - "type": "timestamp", - "nullable": false, - "comments": "任务分配时间" - }, - { - "name": "completed_at", - "title": "完成时间", - "type": "timestamp", - "nullable": true, - "comments": "任务完成时间" - }, - { - "name": "due_at", - "title": "截止时间", - "type": "timestamp", - "nullable": true, - "comments": "任务截止时间" - } - ], - "indexes": [ - { - "name": "idx_task_instance", - "idxtype": "index", - "fields": ["instance_id"] - }, - { - "name": "idx_task_approver", - "idxtype": "index", - "fields": ["approver_id"] - }, - { - "name": "idx_task_status", - "idxtype": "index", - "fields": ["status"] - } - ], - "codes": [ - { - "tblname": "appcodes", - "codevalue": "TASK_STATUS", - "valuefield": "k", - "textfield": "v" - } - ] + "summary": [ + { + "name": "approval_task", + "title": "审批任务", + "primary": "id", + "catelog": "entity" + } + ], + "fields": [ + { + "name": "id", + "title": "ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "主键UUID" + }, + { + "name": "instance_id", + "title": "实例ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "关联的审批实例" + }, + { + "name": "step_id", + "title": "步骤ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "关联的审批步骤" + }, + { + "name": "approver_id", + "title": "审批人ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "具体审批人用户ID" + }, + { + "name": "status", + "title": "状态", + "type": "str", + "length": 20, + "nullable": "no", + "comments": "pending/approved/rejected" + }, + { + "name": "decision", + "title": "决策", + "type": "str", + "length": 1000, + "nullable": "yes", + "comments": "审批意见" + }, + { + "name": "org_id", + "title": "组织ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "多租户组织隔离" + }, + { + "name": "assigned_at", + "title": "分配时间", + "type": "timestamp", + "nullable": "no", + "comments": "任务分配时间" + }, + { + "name": "completed_at", + "title": "完成时间", + "type": "timestamp", + "nullable": "yes", + "comments": "任务完成时间" + }, + { + "name": "due_at", + "title": "截止时间", + "type": "timestamp", + "nullable": "yes", + "comments": "任务截止时间" + } + ], + "indexes": [ + { + "name": "idx_task_instance", + "idxtype": "index", + "idxfields": ["instance_id"] + }, + { + "name": "idx_task_approver", + "idxtype": "index", + "idxfields": ["approver_id"] + }, + { + "name": "idx_task_status", + "idxtype": "index", + "idxfields": ["status"] + } + ], + "codes": [ + { + "field": "status", + "table": "appcodes", + "valuefield": "k", + "textfield": "v", + "cond": "codetype='TASK_STATUS'" + } + ] } \ No newline at end of file diff --git a/models/approval_workflow.json b/models/approval_workflow.json index 64a88de..4aebc32 100644 --- a/models/approval_workflow.json +++ b/models/approval_workflow.json @@ -1,97 +1,100 @@ { - "summary": { - "name": "approval_workflow", - "label": "审批工作流", - "comment": "跨模块审批工作流定义" - }, - "fields": [ - { - "name": "id", - "title": "ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "主键UUID" - }, - { - "name": "workflow_name", - "title": "工作流名称", - "type": "str", - "length": 100, - "nullable": false, - "comments": "审批工作流名称" - }, - { - "name": "module_type", - "title": "模块类型", - "type": "str", - "length": 50, - "nullable": false, - "comments": "关联的模块类型(customer/opportunity/contract/financial)" - }, - { - "name": "trigger_condition", - "title": "触发条件", - "type": "str", - "length": 500, - "nullable": true, - "comments": "JSON格式的触发条件表达式" - }, - { - "name": "description", - "title": "描述", - "type": "str", - "length": 500, - "nullable": true, - "comments": "工作流描述" - }, - { - "name": "org_id", - "title": "组织ID", - "type": "str", - "length": 32, - "nullable": false, - "comments": "多租户组织隔离" - }, - { - "name": "created_at", - "title": "创建时间", - "type": "timestamp", - "nullable": false, - "comments": "创建时间" - }, - { - "name": "updated_at", - "title": "更新时间", - "type": "timestamp", - "nullable": false, - "comments": "更新时间" - }, - { - "name": "is_active", - "title": "是否激活", - "type": "str", - "length": 1, - "nullable": false, - "comments": "Y/N" - } - ], - "indexes": [ - { - "name": "idx_workflow_org", - "idxtype": "index", - "fields": ["org_id"] - }, - { - "name": "idx_workflow_module", - "idxtype": "index", - "fields": ["module_type"] - }, - { - "name": "uk_workflow_name_org", - "idxtype": "unique", - "fields": ["workflow_name", "org_id"] - } - ], - "codes": [] + "summary": [ + { + "name": "approval_workflow", + "title": "审批工作流", + "primary": "id", + "catelog": "entity" + } + ], + "fields": [ + { + "name": "id", + "title": "ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "主键UUID" + }, + { + "name": "workflow_name", + "title": "工作流名称", + "type": "str", + "length": 100, + "nullable": "no", + "comments": "审批工作流名称" + }, + { + "name": "module_type", + "title": "模块类型", + "type": "str", + "length": 50, + "nullable": "no", + "comments": "关联的模块类型(customer/opportunity/contract/financial)" + }, + { + "name": "trigger_condition", + "title": "触发条件", + "type": "str", + "length": 500, + "nullable": "yes", + "comments": "JSON格式的触发条件表达式" + }, + { + "name": "description", + "title": "描述", + "type": "str", + "length": 500, + "nullable": "yes", + "comments": "工作流描述" + }, + { + "name": "org_id", + "title": "组织ID", + "type": "str", + "length": 32, + "nullable": "no", + "comments": "多租户组织隔离" + }, + { + "name": "created_at", + "title": "创建时间", + "type": "timestamp", + "nullable": "no", + "comments": "创建时间" + }, + { + "name": "updated_at", + "title": "更新时间", + "type": "timestamp", + "nullable": "no", + "comments": "更新时间" + }, + { + "name": "is_active", + "title": "是否激活", + "type": "str", + "length": 1, + "nullable": "no", + "comments": "Y/N" + } + ], + "indexes": [ + { + "name": "idx_workflow_org", + "idxtype": "index", + "idxfields": ["org_id"] + }, + { + "name": "idx_workflow_module", + "idxtype": "index", + "idxfields": ["module_type"] + }, + { + "name": "uk_workflow_name_org", + "idxtype": "unique", + "idxfields": ["workflow_name", "org_id"] + } + ], + "codes": [] } \ No newline at end of file