入库单表单插件逻辑优化
This commit is contained in:
parent
4a66d95a59
commit
3e9c202d7f
|
@ -11,6 +11,8 @@ import kd.bos.dataentity.resource.ResManager;
|
||||||
import kd.bos.dataentity.utils.StringUtils;
|
import kd.bos.dataentity.utils.StringUtils;
|
||||||
import kd.bos.entity.EntityMetadataCache;
|
import kd.bos.entity.EntityMetadataCache;
|
||||||
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||||
|
import kd.bos.entity.datamodel.events.ChangeData;
|
||||||
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||||
import kd.bos.form.*;
|
import kd.bos.form.*;
|
||||||
import kd.bos.form.events.AfterDoOperationEventArgs;
|
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||||
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
||||||
|
@ -28,7 +30,9 @@ import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入库单表单插件:入库单点击选择采购申请按钮后弹出对应采购申请分录内容,后通过选择弹出的采购申请分录行赋值给入库单中
|
* 入库单表单插件
|
||||||
|
* 说明:1:入库单点击选择采购申请按钮后弹出对应采购申请分录内容,后通过选择弹出的采购申请分录行赋值给入库单中
|
||||||
|
* 2:采购申请字段内容修改后清空分录
|
||||||
*/
|
*/
|
||||||
public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implements Plugin {
|
public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implements Plugin {
|
||||||
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
||||||
|
@ -40,6 +44,37 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void propertyChanged(PropertyChangedArgs e) {
|
||||||
|
super.propertyChanged(e);
|
||||||
|
String key = e.getProperty().getName();
|
||||||
|
if ("zcgj_purchaseapply".equals(key)) {
|
||||||
|
ChangeData[] changeSet = e.getChangeSet();
|
||||||
|
ChangeData changeData = changeSet[0];
|
||||||
|
Object newValue = changeData.getNewValue();//新值
|
||||||
|
Object oldValue = changeData.getOldValue();//旧值
|
||||||
|
if (newValue == null || !newValue.equals(oldValue)) {
|
||||||
|
// // 消息模板#{x}为超链接占位符,格式如“保存成功,#{0},单据详情,#{1}”
|
||||||
|
// String tempMsg = "更改采购申请单将自动清单入库单明细,您确定更改吗?";
|
||||||
|
// List<MessageBoxLink> msglinks = new ArrayList<MessageBoxLink>();
|
||||||
|
// // 消息框按钮类型
|
||||||
|
// MessageBoxOptions options = MessageBoxOptions.OKCancel;
|
||||||
|
// // 确认提示类型
|
||||||
|
// ConfirmTypes confirmTypes = ConfirmTypes.Default;
|
||||||
|
// // 确认框回调
|
||||||
|
// ConfirmCallBackListener callBack = new ConfirmCallBackListener("CALLBACKID_DEMO2", this);
|
||||||
|
// // 按钮名称
|
||||||
|
// Map<Integer, String> btnNameMaps = new HashMap<Integer, String>();
|
||||||
|
// btnNameMaps.put(2, "按钮名称2");
|
||||||
|
// btnNameMaps.put(6, "按钮名称6");
|
||||||
|
// this.getView().showConfirm(tempMsg, msglinks, options, confirmTypes, callBack, btnNameMaps);
|
||||||
|
DynamicObjectCollection entryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity");//入库单分录
|
||||||
|
entryCollection.clear();
|
||||||
|
this.getView().updateView("entryentity");//刷新分录
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void doPurchaseApply() {
|
private void doPurchaseApply() {
|
||||||
DynamicObject purchaseApply = (DynamicObject) this.getModel().getValue("zcgj_purchaseapply");//采购申请单
|
DynamicObject purchaseApply = (DynamicObject) this.getModel().getValue("zcgj_purchaseapply");//采购申请单
|
||||||
if (purchaseApply == null) {
|
if (purchaseApply == null) {
|
||||||
|
|
Loading…
Reference in New Issue