星瀚KDE-控件值更新事件原创
金蝶云社区-阿伟仔
阿伟仔
3人赞赏了该文章 1,214次浏览 未经作者许可,禁止转载编辑于2022年02月08日 16:16:46
/**
* 
* @date 2022-01-21
*/
var plugin = new BillPlugin({
	registerListener : function(e){
		
	},	
    propertyChanged : function(e){
		var fieldKey = e.getProperty().getName();
        var cd = e.getChangeSet()[0];
	 	var newWord = cd.getNewValue();//获取属性更改的新值
        
        switch (fieldKey) {
                /*收款公司*/
             case "batm_recorg":
			if(newWord.equals("bd_supplier")) {
				this.getView().setVisible(true, "batm_resuporg");
				this.getView().setVisible(false, "batm_reorg");
				this.getView().setVisible(false, "batm_recustcorg");
				this.getView().setVisible(false, "batm_reincorg");
				this.getView().setVisible(false, "batm_repercorg");
			}
			else if(newWord.equals("bd_customer")) {
				this.getView().setVisible(false, "batm_resuporg");
				this.getView().setVisible(false, "batm_reorg");
				this.getView().setVisible(true, "batm_recustcorg");
				this.getView().setVisible(false, "batm_reincorg");
				this.getView().setVisible(false, "batm_repercorg");
			}
			else if(newWord.equals("bos_org")) {
				this.getView().setVisible(false, "batm_resuporg");
				this.getView().setVisible(false, "batm_reorg");
				this.getView().setVisible(false, "batm_recustcorg");
				this.getView().setVisible(true, "batm_reincorg");
				this.getView().setVisible(false, "batm_repercorg");
			}
			else if(newWord.equals("er_payeer")) {
				this.getView().setVisible(false, "batm_resuporg");
				this.getView().setVisible(false, "batm_reorg");
				this.getView().setVisible(false, "batm_recustcorg");
				this.getView().setVisible(false, "batm_reincorg");
				this.getView().setVisible(true, "batm_repercorg");
			}
			else if(newWord.equals("other")) {
				this.getView().setVisible(false, "batm_resuporg");
				this.getView().setVisible(true, "batm_reorg");
				this.getView().setVisible(false, "batm_recustcorg");
				this.getView().setVisible(false, "batm_reincorg");
				this.getView().setVisible(false, "batm_repercorg");
			}
			this.getView().getModel().setValue("batm_resuporg", "");
			this.getView().getModel().setValue("batm_reorg", "");
			this.getView().getModel().setValue("batm_recustcorg", "");
			this.getView().getModel().setValue("batm_reincorg", "");
			this.getView().getModel().setValue("batm_repercorg", "");
			break;
			
			/*付款公司类型*/
		case "batm_paytype":
			if(newWord.equals("bd_customer")) {
				this.getView().setVisible(false, "batm_payinorg");
				this.getView().setVisible(true, "batm_paycustorg");
				this.getView().setVisible(false, "batm_paysuporg");
				this.getView().setVisible(false, "batm_payorg");
			}
			else if(newWord.equals("bd_supplier")) {
				this.getView().setVisible(false, "batm_payinorg");
				this.getView().setVisible(false, "batm_paycustorg");
				this.getView().setVisible(true, "batm_paysuporg");
				this.getView().setVisible(false, "batm_payorg");
			}
			else if(newWord.equals("bos_org")) {
				this.getView().setVisible(true, "batm_payinorg");
				this.getView().setVisible(false, "batm_paycustorg");
				this.getView().setVisible(false, "batm_paysuporg");
				this.getView().setVisible(false, "batm_payorg");
			}
			else if(newWord.equals("other")) {
				this.getView().setVisible(false, "batm_payinorg");
				this.getView().setVisible(false, "batm_paycustorg");
				this.getView().setVisible(false, "batm_paysuporg");
				this.getView().setVisible(true, "batm_payorg");
			}
			this.getView().getModel().setValue("batm_payinorg", "");
			this.getView().getModel().setValue("batm_paycustorg", "");
			this.getView().getModel().setValue("batm_paysuporg", "");
			this.getView().getModel().setValue("batm_payorg", "");
			
			break;
			/*挂账公司类型*/
		case "batm_othertype":
			if(newWord.equals("bd_supplier")) {
				this.getView().setVisible(false, "batm_otherorg");
				this.getView().setVisible(true, "batm_othersuporg");
				this.getView().setVisible(false, "batm_otherinorg");
				this.getView().setVisible(false, "batm_othercustorg");
				this.getView().setVisible(false, "batm_otherperorg");
			}
			else if(newWord.equals("bd_customer")) {
				this.getView().setVisible(false, "batm_otherorg");
				this.getView().setVisible(false, "batm_othersuporg");
				this.getView().setVisible(false, "batm_otherinorg");
				this.getView().setVisible(true, "batm_othercustorg");
				this.getView().setVisible(false, "batm_otherperorg");
			}
			else if(newWord.equals("bos_org")) {
				this.getView().setVisible(false, "batm_otherorg");
				this.getView().setVisible(false, "batm_othersuporg");
				this.getView().setVisible(true, "batm_otherinorg");
				this.getView().setVisible(false, "batm_othercustorg");
				this.getView().setVisible(false, "batm_otherperorg");
			}
			else if(newWord.equals("er_payeer")) {
				this.getView().setVisible(false, "batm_otherorg");
				this.getView().setVisible(false, "batm_othersuporg");
				this.getView().setVisible(false, "batm_otherinorg");
				this.getView().setVisible(false, "batm_othercustorg");
				this.getView().setVisible(true, "batm_otherperorg");
			}
			else if(newWord.equals("other")) {
				this.getView().setVisible(true, "batm_otherorg");
				this.getView().setVisible(false, "batm_othersuporg");
				this.getView().setVisible(false, "batm_otherinorg");
				this.getView().setVisible(false, "batm_othercustorg");
				this.getView().setVisible(false, "batm_otherperorg");
			}
			
			this.getView().getModel().setValue("batm_otherorg", "");
			this.getView().getModel().setValue("batm_othersuporg", "");
			this.getView().getModel().setValue("batm_otherinorg", "");
			this.getView().getModel().setValue("batm_othercustorg", "");
			this.getView().getModel().setValue("batm_otherperorg", "");
			break;
		default:
			break;
        }
        
	},
	
	afterBindData : function(e){
	    var batm_recorg  = this.getModel().getValue("batm_recorg")  /*收款公司*/
        var batm_paytype  = this.getModel().getValue("batm_paytype")  /*付款公司类型*/
        var batm_othertype  = this.getModel().getValue("batm_othertype")  /*挂账公司类型*/
        
        /*收款公司*/
        if(batm_recorg.equals("bd_supplier")) {
				this.getView().setVisible(true, "batm_resuporg");
				this.getView().setVisible(false, "batm_reorg");
				this.getView().setVisible(false, "batm_recustcorg");
				this.getView().setVisible(false, "batm_reincorg");
				this.getView().setVisible(false, "batm_repercorg");
			}
		else if(batm_recorg.equals("bd_customer")) {
				this.getView().setVisible(false, "batm_resuporg");
				this.getView().setVisible(false, "batm_reorg");
				this.getView().setVisible(true, "batm_recustcorg");
				this.getView().setVisible(false, "batm_reincorg");
				this.getView().setVisible(false, "batm_repercorg");
			}
		else if(batm_recorg.equals("bos_org")) {
				this.getView().setVisible(false, "batm_resuporg");
				this.getView().setVisible(false, "batm_reorg");
				this.getView().setVisible(false, "batm_recustcorg");
				this.getView().setVisible(true, "batm_reincorg");
				this.getView().setVisible(false, "batm_repercorg");
			}
		else if(batm_recorg.equals("er_payeer")) {
				this.getView().setVisible(false, "batm_resuporg");
				this.getView().setVisible(false, "batm_reorg");
				this.getView().setVisible(false, "batm_recustcorg");
				this.getView().setVisible(false, "batm_reincorg");
				this.getView().setVisible(true, "batm_repercorg");
			}
		else if(batm_recorg.equals("other")) {
				this.getView().setVisible(false, "batm_resuporg");
				this.getView().setVisible(true, "batm_reorg");
				this.getView().setVisible(false, "batm_recustcorg");
				this.getView().setVisible(false, "batm_reincorg");
				this.getView().setVisible(false, "batm_repercorg");
			}

        /*付款公司类型*/
        if(batm_paytype.equals("bd_customer")) {
				this.getView().setVisible(false, "batm_payinorg");
				this.getView().setVisible(true, "batm_paycustorg");
				this.getView().setVisible(false, "batm_paysuporg");
				this.getView().setVisible(false, "batm_payorg");
			}
			else if(batm_paytype.equals("bd_supplier")) {
				this.getView().setVisible(false, "batm_payinorg");
				this.getView().setVisible(false, "batm_paycustorg");
				this.getView().setVisible(true, "batm_paysuporg");
				this.getView().setVisible(false, "batm_payorg");
			}
			else if(batm_paytype.equals("bos_org")) {
				this.getView().setVisible(true, "batm_payinorg");
				this.getView().setVisible(false, "batm_paycustorg");
				this.getView().setVisible(false, "batm_paysuporg");
				this.getView().setVisible(false, "batm_payorg");
			}
			else if(batm_paytype.equals("other")) {
				this.getView().setVisible(false, "batm_payinorg");
				this.getView().setVisible(false, "batm_paycustorg");
				this.getView().setVisible(false, "batm_paysuporg");
				this.getView().setVisible(true, "batm_payorg");
			}
        
        /*挂账公司类型*/
        if(batm_othertype.equals("bd_supplier")) {
				this.getView().setVisible(false, "batm_otherorg");
				this.getView().setVisible(true, "batm_othersuporg");
				this.getView().setVisible(false, "batm_otherinorg");
				this.getView().setVisible(false, "batm_othercustorg");
				this.getView().setVisible(false, "batm_otherperorg");
			}
			else if(batm_othertype.equals("bd_customer")) {
				this.getView().setVisible(false, "batm_otherorg");
				this.getView().setVisible(false, "batm_othersuporg");
				this.getView().setVisible(false, "batm_otherinorg");
				this.getView().setVisible(true, "batm_othercustorg");
				this.getView().setVisible(false, "batm_otherperorg");
			}
			else if(batm_othertype.equals("bos_org")) {
				this.getView().setVisible(false, "batm_otherorg");
				this.getView().setVisible(false, "batm_othersuporg");
				this.getView().setVisible(true, "batm_otherinorg");
				this.getView().setVisible(false, "batm_othercustorg");
				this.getView().setVisible(false, "batm_otherperorg");
			}
			else if(batm_othertype.equals("er_payeer")) {
				this.getView().setVisible(false, "batm_otherorg");
				this.getView().setVisible(false, "batm_othersuporg");
				this.getView().setVisible(false, "batm_otherinorg");
				this.getView().setVisible(false, "batm_othercustorg");
				this.getView().setVisible(true, "batm_otherperorg");
			}
			else if(batm_othertype.equals("other")) {
				this.getView().setVisible(true, "batm_otherorg");
				this.getView().setVisible(false, "batm_othersuporg");
				this.getView().setVisible(false, "batm_otherinorg");
				this.getView().setVisible(false, "batm_othercustorg");
				this.getView().setVisible(false, "batm_otherperorg");
			}
	},
    
	afterCreateNewData : function(e){
		
	},
	click : function(e){
	
	},
	closedCallBack : function(e){
	
	},
	confirmCallBack : function(e){
	
	},
	itemClick : function(e){
	
	}
});


赞 3