package nc.ui.hr.baod_orders.ace.handler;

import nc.ui.pub.beans.UIRefPane;
import nc.ui.pub.bill.BillItem;
import nc.ui.pubapp.uif2app.event.IAppEventHandler;
import nc.ui.pubapp.uif2app.event.card.CardHeadTailBeforeEditEvent;
import nc.vo.th.baod.entity.BaodHeaderVO;
/**
 * 单据表头表尾字段编辑前事件处理类
 * 
 * @since 6.0
 * @version 2011-7-7 下午02:51:21
 * @author duy
 */
public class AceHeadTailBeforeEditHandler implements IAppEventHandler<CardHeadTailBeforeEditEvent> {

    @Override
    public void handleAppEvent(CardHeadTailBeforeEditEvent e) {
    	 String key = e.getKey();
    	//人员对照
    	if ("clerkcode".equals(key)) {
			BillItem item = e.getBillCardPanel().getHeadItem(key);
			// 获取当前所属组织主键
			String pk_org = (String) e.getBillCardPanel().getHeadItem("pk_org")
					.getValueObject();
			// 获取参照组件
			UIRefPane ref = (UIRefPane) item.getComponent();
			// 设置当前组织
			ref.setPk_org(pk_org);
		
		}
    	//奖金期间
    	if("def6".equals(key)) {
    		BillItem item = e.getBillCardPanel().getHeadItem(key);
    		UIRefPane ref = (UIRefPane) item.getComponent();
    		ref.setMultiSelectedEnabled(true);//设置可以多选
    		ref.setNotLeafSelectedEnabled(false);//不允许选择非末级

    	}
    }

}
