1、该参照为合同根据部门做树表参照
2、代码片段:
package nc.ui.xsjc.ref.model;
import nc.ui.bd.ref.AbstractRefGridTreeModel;
import nc.ui.bd.ref.IRefDocEdit;
import nc.ui.bd.ref.IRefMaintenanceHandler;
/**
* 机场合同管理参照类
* @author 43801
*
*/
public class JchtmanageRefModel extends AbstractRefGridTreeModel {
@Override
public void reset() {
super.reset();
setRefTitle("合同档案");
setRootName("部门");
setClassFieldCode(new String[] { "org_dept.code", "org_dept.name",
"org_dept.pk_dept", "org_dept.pk_fatherorg" });
setClassFatherField("org_dept.pk_fatherorg");
setClassChildField("org_dept.pk_dept");
String pk_org = getPk_org();
setClassWherePart("nvl(org_dept.dr,0) = 0 and org_dept.enablestate=2 and org_dept.pk_org='"+pk_org+"' ");
setClassTableName("org_dept");
setClassDefaultFieldCount(2);
setClassJoinField("org_dept.pk_dept");
setFieldCode(new String[] { "xsjc_jchtmanage.code", "xsjc_jchtmanage.name" ,"xsjc_jchtmanage.pk_dept"});
setFieldName(new String[] { "合同号", "合同名称" });
setHiddenFieldCode(new String[]{"xsjc_jchtmanage.pk_jchtmanage","xsjc_jchtmanage.pk_dept"});
setWherePart("nvl(xsjc_jchtmanage.dr,0) = 0");
setTableName("xsjc_jchtmanage");
setDefaultFieldCount(2);
setDocJoinField("xsjc_jchtmanage.pk_dept");
setRefNameField("xsjc_jchtmanage.code");
setPkFieldCode("xsjc_jchtmanage.pk_jchtmanage");
setRefMaintenanceHandler(new IRefMaintenanceHandler() {//添加新增按钮
@Override
public IRefDocEdit getRefDocEdit() {
return null;
}
@Override
public String[] getFucCodes() {
return new String[] { "H0H10101" };//节点编号
}
});
resetFieldName();
}
}
3、效果图: