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

业务场景:分录中含有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
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值