入库单发票号码超链接点击事件逻辑添加
This commit is contained in:
parent
bde479ef56
commit
914e721dfa
|
@ -0,0 +1,47 @@
|
||||||
|
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||||
|
|
||||||
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.bill.BillShowParameter;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
import kd.bos.form.ShowType;
|
||||||
|
import kd.bos.form.control.EntryGrid;
|
||||||
|
import kd.bos.form.events.HyperLinkClickEvent;
|
||||||
|
import kd.bos.form.events.HyperLinkClickListener;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单发票号码超链接点击事件
|
||||||
|
*/
|
||||||
|
public class MaterialInBillPlugin extends AbstractBillPlugIn implements HyperLinkClickListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerListener(EventObject e) {
|
||||||
|
super.registerListener(e);
|
||||||
|
EntryGrid control = this.getControl("zcgj_entryentity");
|
||||||
|
control.addHyperClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hyperLinkClick(HyperLinkClickEvent hyperLinkClickEvent) {
|
||||||
|
EntryGrid entryGrid = getView().getControl("zcgj_entryentity");//合同进项发票信息分录
|
||||||
|
int[] selectRows = entryGrid.getSelectRows();//选择行
|
||||||
|
if (selectRows != null && selectRows.length == 1) {
|
||||||
|
DynamicObjectCollection dynamicObjectCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_entryentity");//合同进项发票信息分录具体信息
|
||||||
|
DynamicObject dynamicObject = dynamicObjectCollection.get(selectRows[0]);
|
||||||
|
DynamicObject zcgjInvoice = dynamicObject.getDynamicObject("zcgj_invoice");//发票号码
|
||||||
|
long invoiceId = zcgjInvoice.getLong("id");
|
||||||
|
if (invoiceId != 0) {
|
||||||
|
//弹出发票详情
|
||||||
|
BillShowParameter showParameter = new BillShowParameter();
|
||||||
|
showParameter.setPkId(invoiceId);
|
||||||
|
showParameter.setFormId("ec_in_invoice");
|
||||||
|
showParameter.getOpenStyle().setShowType(ShowType.MainNewTabPage); //打开方式
|
||||||
|
getView().showForm(showParameter);//打开界面
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.getView().showTipNotification("请选择一条发票数据。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue