lc/lc123/cloud/app/plugin/form/sys/SupplierAreaFormPlugin.java

67 lines
2.1 KiB
Java
Raw Normal View History

2025-11-13 08:52:10 +00:00
package tqq9.lc123.cloud.app.plugin.form.sys;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.form.FormShowParameter;
import kd.bos.form.control.Control;
import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.bos.form.control.events.ItemClickEvent;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.sdk.plugin.Plugin;
import java.util.EventObject;
import java.util.HashMap;
import java.util.Map;
/**
* 供应商区域资质动态表单
*/
public class SupplierAreaFormPlugin extends AbstractListPlugin implements Plugin {
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
this.addItemClickListeners("tqq9_toolbarap");
}
@Override
public void beforeItemClick(BeforeItemClickEvent evt) {
super.beforeItemClick(evt);
String itemKey = evt.getItemKey();
if ("btnok".equals(itemKey)) {
Object tqq9_qyzz = this.getModel().getValue("tqq9_qyzz");
if (tqq9_qyzz == null) {
this.getView().showMessage("请填写供应商区域资质");
evt.setCancel(true);
}
}
}
@Override
public void itemClick(ItemClickEvent evt) {
super.itemClick(evt);
String itemKey = evt.getItemKey();
if (StringUtils.equals("btnok", itemKey)) {
Map<String, Object> data = new HashMap<>();
data.put("tqq9_qyzz", this.getModel().getValue("tqq9_qyzz"));
data.put("tqq9_ids", this.getModel().getValue("tqq9_ids"));
data.put("isContinue", true);
this.getView().returnDataToParent(data);
this.getView().close();
Control tqq9_toolbarap = this.getView().getControl("tqq9_toolbarap");
}
}
@Override
public void afterCreateNewData(EventObject e) {
// 获取当前页面的FormShowParameter对象
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
// 获取自定义参数
String ids = formShowParameter.getCustomParam("ids");
if (ids != null) {
this.getModel().setValue("tqq9_ids", ids);
}
}
}