技术文章

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

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

时间:2022-06-08   

在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再调用附件上传接口,实现表单转存到附件功能。

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

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