流程表单JS通过接口拿到数组对象,赋值给明细表字段,代码如下:
if (response && response.length > 0) {debuggerconsole.log("服务端返回数据:", response);// 循环处理每条数据response.forEach(function(item, index) {var rowIndex = WfForm.addDetailRow("detail_1");WfForm.changeFieldValue("field8813_" + rowIndex, { value: item.lcbh }); ......}
其中,response为调用其他接口返回的数据集,detail_1表示赋值给明细表1的字段,field8813是明细1对应的1个字段名,lcbh是response返回的对象字段名,以此类推赋值给其他字段和明细表。