入库单优化采购申请分录-采购申请过滤条件

This commit is contained in:
xuhaihui 2025-11-06 17:04:22 +08:00
parent d7e6a066db
commit b18123694a
1 changed files with 31 additions and 7 deletions

View File

@ -376,8 +376,8 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter(); ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
List<QFilter> qFilters = new ArrayList<>(); List<QFilter> qFilters = new ArrayList<>();
String propertyName = beforeF7SelectEvent.getProperty().getName(); String propertyName = beforeF7SelectEvent.getProperty().getName();
if ("zcgj_purchaseapply".equals(propertyName) || "zcgj_purchaseapply_f7".equals(propertyName)) { if ("zcgj_purchaseapply".equals(propertyName)) {
//采购申请采购申请分录-采购申请 //采购申请
Object fiaccountorg = this.getModel().getValue("fiaccountorg");//财务记账组织 Object fiaccountorg = this.getModel().getValue("fiaccountorg");//财务记账组织
if (fiaccountorg == null) { if (fiaccountorg == null) {
this.getView().showErrorNotification("请先填写财务记账组织!!"); this.getView().showErrorNotification("请先填写财务记账组织!!");
@ -388,6 +388,30 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement
qFilters.add(new QFilter("fiaccountorg.id", QCP.in, fiaccountorg1.get("id")));//财务记账组织 qFilters.add(new QFilter("fiaccountorg.id", QCP.in, fiaccountorg1.get("id")));//财务记账组织
qFilters.add(new QFilter("billstatus", QCP.equals, "C"));//单据状态为已审核 qFilters.add(new QFilter("billstatus", QCP.equals, "C"));//单据状态为已审核
} }
} else if ("zcgj_purchaseapply_f7".equals(propertyName)) {
//采购申请分录-采购申请
Object fiaccountorg = this.getModel().getValue("fiaccountorg");//财务记账组织
if (fiaccountorg == null) {
this.getView().showErrorNotification("请先填写财务记账组织!!");
beforeF7SelectEvent.setCancel(true);
}
DynamicObject fiaccountorg1 = (DynamicObject) fiaccountorg;//财务记账组织
if (fiaccountorg1 != null) {
qFilters.add(new QFilter("fiaccountorg.id", QCP.in, fiaccountorg1.get("id")));//财务记账组织
qFilters.add(new QFilter("billstatus", QCP.equals, "C"));//单据状态为已审核
}
DynamicObjectCollection purchaseApplyEntryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_purchaseapplyentry");//采购申请分录
int row = beforeF7SelectEvent.getRow();
for (int i = 0; i < purchaseApplyEntryCollection.size(); i++) {
DynamicObject purchaseApplyEntry = purchaseApplyEntryCollection.get(i);
DynamicObject zcgj_purchaseapply_f7 = purchaseApplyEntry.getDynamicObject("zcgj_purchaseapply_f7");//采购申请
if (zcgj_purchaseapply_f7 != null) {
if (row == i){
continue;
}
qFilters.add(new QFilter("id", QCP.not_equals, zcgj_purchaseapply_f7.get("id")));
}
}
} else if ("zcgj_applidepart".equals(propertyName)) { } else if ("zcgj_applidepart".equals(propertyName)) {
//申请人部门 //申请人部门
Object zcgj_reqperson = this.getModel().getValue("zcgj_reqperson");//申请人 Object zcgj_reqperson = this.getModel().getValue("zcgj_reqperson");//申请人