金蝶EAS,代码实现分录中F7带出相关属性

来源:互联网 发布:澳大利亚签证 知乎 编辑:程序博客网 时间:2024/06/07 18:27

业务场景:分录中含有F7字段,还有一些字段值需要从该F7字段中带出,类似于已有基础资料相关属性字段,通过代码实现的话,请参考以下代码片段。

以下示例中,单据包含两个分录:kdtTitle、kdtItem;分录中type、item均为F7字段。


/** * 标题分录编辑结束事件 */protected void kdtTitle_editStopped(KDTEditEvent e) throws Exception {int rowCount = kdtTitle.getRowCount();txttitlesCount.setValue(rowCount); //标题行数int rowIndex = e.getRowIndex(); //当前编辑行DataElementInfo type = (DataElementInfo) kdtTitle.getCell(rowIndex, "type").getValue(); //取数类型if(type != null){if(VerifyUtil.isNull(kdtTitle.getCell(rowIndex, "typeName").getValue())){kdtTitle.getCell(rowIndex, "typeName").setValue(type.getName());}}}/** * 项目分录编辑结束事件 */protected void kdtItem_editStopped(KDTEditEvent e) throws Exception {int rowCount = kdtItem.getRowCount();txtitemsCount.setValue(rowCount); //项目行数int rowIndex = e.getRowIndex(); //当前编辑行RPTItemInfo item = (RPTItemInfo) kdtItem.getCell(rowIndex, "item").getValue(); //报表项目if(item != null){if(VerifyUtil.isNull(kdtItem.getCell(rowIndex, "itemName").getValue())){kdtItem.getCell(rowIndex, "itemName").setValue(item.getName());}}}


阅读全文
0 0
原创粉丝点击