

**此方案自控行很强，使用请注意依据自己逻辑，不作为标准方案**

## **1、代码示例**

```javascript

function ebdfpageBatchAggregationPrint(){
  var cardSdk = ebdfpageSDK.getCardSDK();
  var dataId = cardSdk.getBaseInfo().dataid;
  var appId  = cardSdk.getAppID();
  var formid = cardSdk.getBaseFormID();
  var templateId = "1027782852312866817";//模板id  --需要自己查一下
 
   weappUtils.request({
      method: "post",
      url: "/api/print/batchPrint/saveBatchPrintInfo",
      data: {
       "type":"aggregation",
       "aggregationHtmlBatchDto":{
            "module":"ebuilderform",
            "targetId":formid  , //formid  表单模块的表单id
            "templateId":templateId ,//模板id  --需要自己查一下
            "fieldList":[{"dataId":dataId }]  //数据id
         },
      "sharedParam":{"appId":appId  }  //应用id
   },
  }).then(res=>{
    console.log(res);
    const tempdata = res.data;
    window.open(`/sp/print/batchAggregationPrintPage/ebuilderform/${formid}/${templateId}/${tempdata?.batchId}?apiModule=ebuilder/form&appId=${appId}`)
  });
};

ebdfpageBatchAggregationPrint();
```

## 2、按钮配置

[图片附件未整合: ../../../../../_assets/238844610787409920/001-686a0fd36f.png]

## **3、效果**

[图片附件未整合: ../../../../../_assets/238844610787409920/002-3a99ef7a6c.png]
