脚本示例(脚本放在视图跳转按钮中的地址脚本处):- (function(){
- var selectid = getparameterastext("_selects");
- var arr = splittext(selectid, ";");
- var applicationid = getapplication();
-
- var request = $web.getparamstable().gethttprequest();
- var user = getwebuser();
- var userid = user.getid();
- var docprocess = getdocprocess(applicationid);
- var formprocess = new packages.cn.myapps.designtime.form.service.formdesigntimeserviceimpl();//4.4或5.0版本
- // var formprocess = new packages.cn.myapps.designtime.form.service.formserviceimpl(); //4.1版本
- var newform = formprocess.doviewbyformname("sign_and_publish_form", applicationid); //创建表单,sign_and_publish_form为表单名称
- var newform2 = formprocess.doviewbyformname("sample_information", applicationid); //创建子表单,sample_information为子表单名称
- var params = createparamstable();
-
- var newdoc = docprocess.donew(newform,user,params);
- var uuid = new packages.cn.myapps.util.sequence.sequence();
-
- var uid1 = uuid.getsequence(); //主表uuid;
- var formid = "__1j10ocalp94ao2oq6da"; //表单formid
- var docid = uid1 "--" formid; //该处主要应用在5.0版本,5.0版本的docic由原来的docid和formid组成,如果是4.4或以下版本直接使用uid1
-
- newdoc.setid(docid);
- newdoc.setapplicationid(applicationid);
- newdoc.setauthor(userid);
- newdoc.setistmp(false);
- newdoc.addstringitem("lssuingtype","02"); //01动态签发 02静态签发
- newdoc.addstringitem("applicant",userid); //申请人
- newdoc.adddateitem("applydate",gettoday()); //创建日期
- newdoc.addstringitem("department",user.getdefaultdepartment()); //申请部门
- docprocess.docreate(newdoc);
- for(var i=0;i
- var fd = finddocument(arr[i]);
- var newdoc2 = docprocess.donew(newform2,user,params);
- var uuid2 = new packages.cn.myapps.util.sequence.sequence();
-
- var uid2 = uuid2.getsequence(); //子表uuid;
- var docid2 = uid2 "--" "__jbuhy3v0jt5txotqkag"; //子表formid
-
- newdoc2.setid(docid2);
- newdoc2.setparent(docid);
- newdoc2.setauthor(userid);
- newdoc2.setistmp(false);
- newdoc2.setapplicationid(applicationid);
- newdoc2.addstringitem("platform", fd.getitemvalueasstring("platform")); //平台
- newdoc2.addstringitem("projectname", fd.getitemvalueasstring("projectname")); //项目名称
- newdoc2.addstringitem("projectcode", fd.getitemvalueasstring("projectcode")); //项目代码
- newdoc2.addstringitem("projectphase", fd.getitemvalueasstring("projectphase")); //项目阶段
- newdoc2.addstringitem("licensenumber", fd.getitemvalueasstring("carnumber")); //车号
- newdoc2.addstringitem("modeldescription", fd.getitemvalueasstring("modeldescription")); //车型描述
- newdoc2.addstringitem("type", fd.getitemvalueasstring("type")); //类型
- newdoc2.addstringitem("consumer", fd.getitemvalueasstring("consumer")); //用户
- newdoc2.addstringitem("purpose", fd.getitemvalueasstring("purpose")); //样车用途
- newdoc2.addstringitem("chassisvin", fd.getitemvalueasstring("chassisvin")); //底盘号vin
- newdoc2.addstringitem("enginenumber", fd.getitemvalueasstring("enginenumber")); //发动机号
- newdoc2.adddateitem("demandtime", fd.getitemvalueasdate("demandtime")); //样车需求时间
- docprocess.docreate(newdoc2);
- }
-
- var url = "http://" request.getservername() ":" request.getserverport() "/static";
- url = "/portal/vue/index.html#/open?appid=" applicationid "&actioncontent=" formid "&docid=" docid "&opentarget=detail&linktype=00";
-
- return url;
- })();
复制代码 效果:
|