技术文章

当前位置:首页>帮助手册>技术文章

O2OA把流程表单保存到附件中-档案系统归档

时间:2022-06-08   
内容导读

本篇介绍在 O2OA 流程中把已填写的表单内容转存为附件并归入档案系统的做法:先调用 html 转 pdf 的接口生成文件,再通过附件上传接口把该文件写入流程附件,随流程流转进入归档环节。文中给出可直接复用的脚本示例与调用顺序说明,并提示样式与页面尺寸的处理要点,便于在表单类审批结束后自动留档,减少人工截图与手工上传,也便于档案系统集中接收。


在 o2oa 流程中把表单内容转存为附件的做法如下:

var html = '<style>table{border-collapse:collapse}td{border:1px solid rgb(3,3,3)}.title{font-weight:bold;height:30px;line-height:30px;width:22%;text-align:center}.content{width:30%;padding-left:10px}</style><table cellspacing="0"style="width: 700px; background-color: rgb(255, 255, 255);"><tr><td colspan="4"style="width: 100%;text-align: center;font-size: 24px; line-height: 60px; font-weight: bold; height: 60px; color: black;">教育系统国内公务考察活动审批表</td></tr><tr><td class="title">主题</td><td colspan="3"class="content">余杭小学外出考察学习审批</td></tr><tr><td class="title">经办人</td><td class="content">张安</td><td class="title">联系电话</td><td class="content">15858248111</td></tr></table>';
var action = this.Actions.load("x_processplatform_assemble_surface");
var fileName = "转换后的pdf标题.pdf";
//html转换成pdf
action.AttachmentAction.htmlToPdf({
    "workHtml" :html,
    "title" : fileName
},function( json ){
    //上传到附件
    var url = "http://host/x_processplatform_assemble_surface/jaxrs/attachment/download/transfer/flag/" + json.data.id;
    action.AttachmentAction.uploadWithUrl({
        "workId" : "26dc4e1c-56b8-4f23-a332-4fdabe41c58c",
        "fileName" : fileName,
        "fileUrl" : url,
        "site" : "attachment",
        "person" : "xadmin"
    },function(){})
}.bind(this));

先调用 html 转 pdf 接口,生成的 pdf 再调用附件上传接口,实现表单转存到附件功能。

相关内容

兰德网络O2OA平台软件

兰德网络 O2OA 平台软件

开源、自主可控的协同办公底座

研发与运营

纵横翱途(杭州)科技有限公司

企业级协同应用 · 工作流引擎 · AI 智能体

www.o2oa.net | 400-888-0545

上一篇:SmartBI集成版快速部署及使用(O2OA容器化部署)

下一篇:o2server人工处理节点底层流转机制详解