NC65增加按钮打开其他单据
需求:A单据增加一个按钮,点击按钮打开或者跳转到B单据
解决方案:
package nc.ui.ct.ctysj.actions;
import java.awt.event.ActionEvent;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.framework.common.NCLocator;
import nc.itf.uap.IUAPQueryBS;
import nc.itf.uap.pf.IPfExchangeService;
import nc.jdbc.framework.processor.BeanListProcessor;
import nc.jdbc.framework.processor.ColumnListProcessor;
import nc.jdbc.framework.processor.MapListProcessor;
import nc.ui.mmf.framework.action.ActionInitializer;
import nc.ui.pub.beans.MessageDialog;
import nc.ui.pubapp.uif2app.actions.RefreshSingleAction;
import nc.ui.pubapp.uif2app.model.BillManageModel;
import nc.ui.pubapp.uif2app.view.BillForm;
import nc.ui.uap.sf.SFClientUtil;
import nc.ui.uif2.NCAction;
import nc.vo.cmp.apply.AggApplyVO;
import nc.vo.cmp.apply.ApplyBVO;
import nc.vo.cmp.apply.ApplyVO;
import nc.vo.ct.cttjd.AggCt_tj;
import nc.vo.ct.cttjd.Ct_tj_b;
import nc.vo.ct.ctysj.AggCt_ht;
import nc.vo.ct.ctysj.Ct_ht;
import nc.vo.ct.ctysj.Ct_ht_payment;
import nc.vo.ct.ctysj.Ct_ht_payplan;
import nc.vo.ct.purdaily.entity.CtPaymentVO;
import nc.vo.pub.AggregatedValueObject;
import nc.vo.pub.BusinessException;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.pub.ISuperVO;
import nc.vo.pub.pf.BillStatusEnum;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.lang.reflect.Array;
import nc.desktop.ui.WorkbenchEnvironment;
import nc.funcnode.ui.FuncletInitData;
import nc.funcnode.ui.FuncletWindowLauncher;
import nc.itf.ct.ICttjdMaintain;
import nc.itf.scmpub.reference.uap.bd.accesor.FinanceorgAccessor;
import nc.itf.scmpub.reference.uap.group.SysInitGroupQuery;
import nc.sfbase.client.ClientToolKit;
import nc.ui.pubapp.uif2app.model.BatchBillTableModel;
import nc.ui.scmf.payplan.model.PayPlanModel;
import nc.ui.scmpub.action.SCMActionInitializer;
import nc.ui.uif2.NCAction;
import nc.ui.uif2.ShowStatusBarMsgUtil;
import nc.ui.uif2.UIState;
import nc.ui.uif2.editor.BatchBillTable;
import nc.vo.bd.accessor.IBDData;
import nc.vo.ml.AbstractNCLangRes;
import nc.vo.ml.NCLangRes4VoTransl;
import nc.vo.pub.AggregatedValueObject;
import nc.vo.pub.lang.MultiLangText;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
import nc.vo.scmf.pub.util.SCMSysParamUtil;
import nc.vo.scmpub.payterm.pay.AbstractPayPlanViewVO;
import nc.vo.sf.pub.linkquery.LinkQueryData;
import nc.vo.sm.funcreg.FuncRegisterVO;
import org.apache.commons.lang.ArrayUtils;
@SuppressWarnings("restriction")
public class PushTjAction extends NCAction {
private static final long serialVersionUID = 1L;
private BillForm billForm;
private BillManageModel model;
public PushTjAction() {
ActionInitializer.initializeAction(this, "PushTjAction", "打开B单据");
}
public void doAction(ActionEvent e) throws Exception {
LinkQueryData data = new LinkQueryData();
data.setBillID("B单据的PK");
data.setBillType("B单据的单据类型编码");
data.setPkOrg("打开单据的组织");
SFClientUtil.openLinkedQueryDialog("B单据的功能注册的编码", billForm.getBillCardPanel(), data);
ShowStatusBarMsgUtil.showStatusBarMsg("打开B单据成功", getModel().getContext());
}
}
public BillForm getBillForm() {
return this.billForm;
}
public BillManageModel getModel() {
return this.model;
}
public void setBillForm(BillForm billForm) {
this.billForm = billForm;
}
public void setModel(BillManageModel model) {
this.model = model;
model.addAppEventListener(this);
}
}