付款收款会计科目过滤

This commit is contained in:
zhangzhiguo 2025-03-14 10:53:56 +08:00
parent 785132b439
commit 75e5298a95
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package zcgj.zcdev.zcdev.pr.plugin.form;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.sdk.plugin.Plugin;
import java.util.EventObject;
/**
* 收付款申请单选择合同时项目提醒插件
*/
public class ContractSelectProjectPlugin extends AbstractBillPlugIn implements Plugin {
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
//监听工具栏按钮点击事件
this.addItemClickListeners("entrytoolbar");
//this.addClickListeners("advcontoolbarap");
}
@Override
public void beforeItemClick(BeforeItemClickEvent evt) {
//工具栏上的所有按钮的点击都会激活itemClick和beforeItemClick方法 //要开发人员实现不同按钮的逻辑
if (evt.getItemKey().equals("selectcontract")) {
Object project = this.getModel().getValue("project");
if(project == null) {
evt.setCancel(true);
this.getView().showErrorNotification("请选择项目");
}
}
super.beforeItemClick(evt);
}
}