dst.defineClass("com.dst.slms.plan.annualpaymentplan.annualPaymentPlanList", dst.framework.coreBillBaseList, {
	initalizeDOM:function(){
		com.dst.slms.plan.annualpaymentplan.annualPaymentPlanList.superClass.initalizeDOM.call(this);
		var zTree = $.fn.zTree.getZTreeObj("orgTree");            
	    var nodeList = zTree.getNodes();　　　　　　
	    zTree.expandNode(nodeList[0], true);
	},
	type_onClick:function(event, treeId, treeNode){
		var _self = this;
		var filter = _self.getDefaultFilterItems();
		var zTree = $.fn.zTree.getZTreeObj("orgTree");       
		var childNodes = zTree.transformToArray(treeNode); 

        var nodes = new Array(); 

        for(i = 0; i < childNodes.length; i++) { 
        	nodes[i] = childNodes[i].value; 
        } 
        filter['selectTreeId']= nodes.join(",");
        $(_self.gridId).datagrid('reload');
	},
	
	reviseAction:function(d,c,a,g){//修订
		var billid = this.getSelectedIds('id');
		if(billid==undefined ||billid==null||''==billid){
			dst.tip({
				message: "请选择行!"
			});
			return false;
		}
		var isSuccess = "false"
		dst.remoteCall({
			method : "isLast",
			async:false,  
			url: "annualPaymentPlanController",
			param : {billid:billid},
			success : function(data, textStatus) {
				if('true'==data.data){
					isSuccess = "true";
				}
				if('noAudit'==data.data){
					isSuccess = "noAudit";
				}
			}
		});
		if(isSuccess == "true"){
			dst.tip({message:"年度支付计划不是最新版，无法修订"});
			return;
		}
		if(isSuccess == "noAudit"){
			dst.tip({message:"年度支付计划已有新版本，请修改新版本"});
			return;
		}
		var data = this.uiPutContext('editAction');
		this.createJson(data,'oprtState','EDIT');
		this.createJson(data,'id',encodeURIComponent(billid));
		var b={url:this.uipk,method:"revise",param:data};
		dst.openBillWindow(this.title,dst.getContextPath()+'/'+dst.getAjaxUrlForParms(b),'null','null',this,'true')
	},
});