收入支出合同界面插件
This commit is contained in:
parent
0e813a5cfe
commit
c66db79acd
|
@ -0,0 +1,18 @@
|
|||
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
/**
|
||||
* 单据界面插件
|
||||
*/
|
||||
public class EcContractFromPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
|
||||
@Override
|
||||
public void afterCreateNewData(EventObject e) {
|
||||
super.afterCreateNewData(e);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.metadata.dynamicobject.DynamicObjectType;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
/**
|
||||
* 单据界面插件
|
||||
*/
|
||||
public class OutContractFromPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
|
||||
private String entryName = "treelistentry";//分录标识
|
||||
|
||||
private String ecContract = "";//
|
||||
@Override
|
||||
public void propertyChanged(PropertyChangedArgs e) {
|
||||
super.propertyChanged(e);
|
||||
String changeName = e.getProperty().getName();
|
||||
if(changeName.equals(ecContract)){//收入合同字段值改变
|
||||
Object outC = this.getModel().getValue(ecContract);
|
||||
if(outC!=null){
|
||||
DynamicObject outContract = (DynamicObject) outC;
|
||||
DynamicObjectCollection ecCEntrys = outContract.getDynamicObjectCollection(entryName);//获取收入合同合同清单
|
||||
for (int i = 0; i < ecCEntrys.size(); i++) {
|
||||
DynamicObject ecCEntry = ecCEntrys.get(i);
|
||||
int row = this.getModel().insertEntryRow(entryName, i);
|
||||
this.getModel().setValue(entryName, ecCEntry.get(""), row);
|
||||
}
|
||||
DynamicObjectCollection outCEntry = this.getModel().getEntryEntity(entryName);
|
||||
if (outCEntry.size() < 0) {
|
||||
for (int i = 0; i < ecCEntrys.size(); i++) {
|
||||
outCEntry.add(i, ecCEntrys.get(i));
|
||||
}
|
||||
this.getView().updateView(entryName);
|
||||
}
|
||||
outCEntry = this.getModel().getEntryEntity(entryName);
|
||||
if (outCEntry.size() < 0) {
|
||||
for (int i = 0; i < ecCEntrys.size(); i++) {
|
||||
outCEntry.add(ecCEntrys.get(i));
|
||||
}
|
||||
this.getView().updateView(entryName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue