支出合同列表添加收入合同编码超链接跳转事件

This commit is contained in:
xuhaihui 2025-10-14 14:48:12 +08:00
parent 8849c41f10
commit d4fd002735
1 changed files with 29 additions and 0 deletions

View File

@ -3,7 +3,11 @@ package zcgj.zcdev.zcdev.pr.plugin.form;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.greenpineyu.fel.common.NumberUtil;
import kd.bos.bill.BillShowParameter;
import kd.bos.bill.OperationStatus;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.resource.ResManager;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.datamodel.ListSelectedRow;
import kd.bos.entity.datamodel.ListSelectedRowCollection;
import kd.bos.form.CloseCallBack;
@ -12,16 +16,24 @@ import kd.bos.form.ShowType;
import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.bos.form.control.events.ItemClickEvent;
import kd.bos.form.events.BeforeDoOperationEventArgs;
import kd.bos.form.events.HyperLinkClickArgs;
import kd.bos.form.operate.FormOperate;
import kd.bos.list.BillList;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.bos.mvc.bill.BillModel;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.ec.basedata.common.utils.OpenPageUtils;
import kd.fi.dhc.util.BillShowParameterUtil;
import org.jetbrains.annotations.NotNull;
import java.util.*;
/**
* 支出合同列表插件
*/
public class RenewalContractBillPlugin extends AbstractListPlugin {
@ -58,6 +70,23 @@ public class RenewalContractBillPlugin extends AbstractListPlugin {
}
public void billListHyperLinkClick(HyperLinkClickArgs args) {
super.billListHyperLinkClick(args);
String fielldName = args.getHyperLinkClickEvent().getFieldName();
if (StringUtils.equals(fielldName, "incontract_number")) {
//收入合同编码
args.setCancel(true);
ListSelectedRow selectRow = ((BillList) this.getControl("billlistap")).getCurrentSelectedRowInfo();
Long selectId = (Long) selectRow.getPrimaryKeyValue();
DynamicObject ec_in_contract = QueryServiceHelper.queryOne("ec_in_contract", "id", new QFilter[]{new QFilter("id", "=", selectId)});//收入合同
if (ec_in_contract == null) {
this.getView().showTipNotification(ResManager.loadKDString("您选择的数据已被删除", "MyBillListPlugin_5", "fi-dhc-formplugin", new Object[0]));
} else {
BillShowParameter billShowParameter = OpenPageUtils.buildBillShowParam(selectId, "ec_in_contract");//收入合同
this.getView().showForm(billShowParameter);//打开收入合同
}
}
}
@Override
public void itemClick(ItemClickEvent evt) {
String itemKey = evt.getItemKey();