功能:把主表字段赋值给明细表字段
核心代码:
<script>
jQuery(document).ready(function(){
$('#setcgy').click(function(){
var cgy_txt = WfForm.getBrowserShowName("field1207");
debugger
var cgy = WfForm.getFieldValue("field1207");
var rowArr = WfForm.getDetailAllRowIndexStr("detail_1").split(",");
for(var i=0; i<rowArr.length; i++){
var rowIndex = rowArr[i];
if(rowIndex !== ""){
// var fieldMark = "field111_"+rowIndex; //遍历明细行字段
WfForm.changeFieldValue("field6587_" + rowIndex, { value:cgy ,specialobj:[ {id:cgy,name:cgy_txt}]});
}
}
})
})
效果: