- [x] 收款单中 需要根据 业务小类对应的 成本中心、利润中心必填逻辑

- [x] 拉取SAP凭证接口过滤条件新增供应商
s
This commit is contained in:
weiyunlong 2025-05-16 17:12:05 +08:00
parent 6d4f995dba
commit 8f8f2b7e39
3 changed files with 51 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.bos.form.events.ClosedCallBackEvent;
import kd.bos.form.field.BasedataEdit;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
@ -44,6 +45,24 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin {
}
}
}
// 获取成本中心和利润中心的控件
BasedataEdit shjh_costcenter = this.getView().getControl("shjh_costcenter");
BasedataEdit shjh_profitcenter = this.getView().getControl("shjh_profitcenter");
//根据业务小类设置 成本中心,利润中心是否必填
DynamicObject shjhBizsmall = (DynamicObject)this.getView().getModel().getValue("shjh_bizsmall");
if (null != shjhBizsmall) {
shjhBizsmall = BusinessDataServiceHelper.loadSingle(shjhBizsmall.getPkValue(),"shjh_bizsmalltype");
// 获取成本中心和利润中心的必填配置
boolean shjhCc = shjhBizsmall.getBoolean("shjh_cc");
boolean shjhPc = shjhBizsmall.getBoolean("shjh_pc");
// 设置成本中心必填状态
shjh_costcenter.setMustInput(shjhCc);
// 设置利润中心必填状态
shjh_profitcenter.setMustInput(shjhPc);
}else {
shjh_costcenter.setMustInput(false);
shjh_profitcenter.setMustInput(false);
}
}
@Override
@ -150,6 +169,24 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin {
}
}
}
// 获取成本中心和利润中心的控件
BasedataEdit shjh_costcenter = this.getView().getControl("shjh_costcenter");
BasedataEdit shjh_profitcenter = this.getView().getControl("shjh_profitcenter");
//根据业务小类设置 成本中心,利润中心是否必填
DynamicObject shjhBizsmall = (DynamicObject)this.getView().getModel().getValue("shjh_bizsmall");
if (null != shjhBizsmall) {
shjhBizsmall = BusinessDataServiceHelper.loadSingle(shjhBizsmall.getPkValue(),"shjh_bizsmalltype");
// 获取成本中心和利润中心的必填配置
boolean shjhCc = shjhBizsmall.getBoolean("shjh_cc");
boolean shjhPc = shjhBizsmall.getBoolean("shjh_pc");
// 设置成本中心必填状态
shjh_costcenter.setMustInput(shjhCc);
// 设置利润中心必填状态
shjh_profitcenter.setMustInput(shjhPc);
}else {
shjh_costcenter.setMustInput(false);
shjh_profitcenter.setMustInput(false);
}
}
//监听分录客户
//当客户拆分=是时,使用分录行客户入账

View File

@ -63,6 +63,7 @@ public class SappzFormPlugin extends AbstractFormPlugin {
Boolean isselfprocurement = (Boolean) this.getModel().getValue("shjh_isselfprocurement");//是否自行采购
DynamicObjectCollection shjh_yymm = (DynamicObjectCollection) this.getModel().getValue("shjh_yymm");//原因码
String shjh_djh = (String) this.getModel().getValue("shjh_djh");//单据号
DynamicObjectCollection shjh_gys = (DynamicObjectCollection) this.getModel().getValue("shjh_gys");//供应商
// 日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
@ -107,6 +108,11 @@ public class SappzFormPlugin extends AbstractFormPlugin {
if (StringUtils.isNotEmpty(shjh_djh)) {
addFilterCondition(IT_LIST, "XBLNR", shjh_djh, shjh_djh);
}
// 添加公司过滤条件--改成多选
for (DynamicObject shjh_gyss : shjh_gys) {
addFilterDumpCondition(IT_LIST, "LIFNR", shjh_gyss.getString("fbasedataid.number"), shjh_gyss.getString("fbasedataid.number"));
}
DynamicObjectCollection shjhEntryentity = this.getModel().getEntryEntity("shjh_entryentity");
shjhEntryentity.clear();
//根据查询条件,调用SAP查询凭证接口,生成分录行

View File

@ -16,8 +16,13 @@ public class TextFieldDemo extends AbstractFormPlugin {
@Override
public void afterBindData(EventObject e) {
Map<String, Object> ctlMap = new HashMap<>();
ctlMap.put(ClientProperties.Editable, true);
this.getView().updateControlMetadata("settletype", ctlMap);
// this.getView().setEnable(false, "settletype");
// this.getView().setEnable(true, "settletype");
// Map<String, Object> ctlMap = new HashMap<>();
// ctlMap.put(ClientProperties.Editable, true);
// this.getView().updateControlMetadata("settletype", ctlMap);
}
}