入库单添加采购申请选择后赋值申请人和申请人部门字段逻辑

This commit is contained in:
xuhaihui 2025-08-27 11:14:29 +08:00
parent b264a65d71
commit 9614b86ae4
1 changed files with 13 additions and 0 deletions

View File

@ -77,6 +77,19 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement
entryCollection.clear(); entryCollection.clear();
this.getView().updateView("entryentity");//刷新分录 this.getView().updateView("entryentity");//刷新分录
} }
if (newValue != null) {
DynamicObject purchaseApply = (DynamicObject) newValue;
QFilter[] qFilter = new QFilter[]{new QFilter("id", QCP.equals, purchaseApply.getPkValue())};
DynamicObject ecma_purchaseApply = BusinessDataServiceHelper.loadSingle("ecma_purchaseapply",
"applyer,zcgj_persondepart", qFilter);//采购申请单
if (ecma_purchaseApply != null) {
this.getModel().setValue("zcgj_reqperson", ecma_purchaseApply.get("applyer"));//物料申请人
this.getModel().setValue("zcgj_applidepart", ecma_purchaseApply.get("zcgj_persondepart"));//申请人部门
}
} else {
this.getModel().setValue("zcgj_reqperson", null);//清空物料申请人字段
this.getModel().setValue("zcgj_applidepart", null);//清空申请人部门字段
}
} else if ("warehouse".equals(key)) { } else if ("warehouse".equals(key)) {
//仓库 //仓库
this.getModel().setValue("zcgj_purchaseapply", null);//清空采购申请单字段 this.getModel().setValue("zcgj_purchaseapply", null);//清空采购申请单字段