编辑界面ActionPrintPreView,ActionPrint前置脚本实现非审核状态单据不允许打印:
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.eas.util.client);
easNames.importPackage(Packages.com.kingdee.eas.scm.common);
easNames.importPackage(Packages.com.kingdee.eas.util);
with(easNames) {
var editData = pluginCtx.getDataObject();
if (editData != null) {
var billBaseStatus = editData.getBaseStatus();
if (editData.getId() == null || (billBaseStatus != null && (billBaseStatus.getValue() !=
BillBaseStatusEnum.AUDITED_VALUE
))) {
MsgBox.showInfo("非审核状态单据不允许打印!");
SysUtil.abort();
}
}
}
序时簿ActionMultiPrintPreView,ActionMultiPrint前置脚本实现非审核状态单据不允许打印:
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.eas.util.client);
easNames.importPackage(Packages.com.kingdee.eas.scm.common);
easNames.importPackage(Packages.com.kingdee.eas.util);
with(easNames) {
var tblMain = pluginCtx.getKDTable("tblMain");
var ids = com.kingdee.eas.basedata.framework.util.KDTableUtil.getSelectRowFieldValue(tblMain, "baseStatus");
for (var i = 0; i < ids.length; i++) {
if (ids[i] != "审核") {
MsgBox.showInfo("存在非审核状态的单据,请重新选择!");
SysUtil.abort();
}
}
}
bos代码编辑
public void actionPrint_actionPerformed(ActionEvent e) throws Exception
{
if (this.billStatus.getSelectedItem() != null) {
BillStatus bs = (BillStatus) this.billStatus.getSelectedItem();
if ((!bs.getValue().equals("3")) ) {
MsgBox.showInfo("非审核状态不允许打印!");
SysUtil.abort();
}
}
super.actionPrint_actionPerformed(e);
}
/**
* output actionPrintPreview_actionPerformed
*/
public void actionPrintPreview_actionPerformed(ActionEvent e) throws Exception
{
if (this.billStatus.getSelectedItem() != null) {
BillStatus bs = (BillStatus) this.billStatus.getSelectedItem();
if ((!bs.getValue().equals("3")) ) {
MsgBox.showInfo("非审核状态不允许打印!");
SysUtil.abort();
}
}
super.actionPrintPreview_actionPerformed(e);
}
bos序时簿
public void actionPrint_actionPerformed(ActionEvent e) throws Exception {
    List ids = getSelectedIdValues();
    if ((ids != null) && (ids.size() > 0)) {
      for (int i = 0; i < ids.size(); i++) {
        String id = (String) ids.get(i);
        PayRequestInfo info = PayRequestFactory.getRemoteInstance()
            .getPayRequestInfo(new ObjectUuidPK(id));
        if ((info != null)
            && ((!info.getBillStatus().equals(BillStatus.approve)))) {
          MsgBox.showInfo("单据编号为" + info.getNumber()
              + "的单据非审核状态,不允许打印!");
          SysUtil.abort();
        }
        // 预算返还
        // BgControlCaller bgControlCaller = new
        // com.kingdee.eas.ma.nbudget.BgControlCaller();
        // bgControlCaller.returnBudget(BOSUuid.read(id.toString()));
      }
    }
    super.actionPrint_actionPerformed(e);
  }
  /**
   * output actionPrintPreview_actionPerformed
   */
  public void actionPrintPreview_actionPerformed(ActionEvent e)
      throws Exception {
    List ids = getSelectedIdValues();
    if ((ids != null) && (ids.size() > 0)) {
      for (int i = 0; i < ids.size(); i++) {
        String id = (String) ids.get(i);
        PayRequestInfo info = PayRequestFactory.getRemoteInstance()
            .getPayRequestInfo(new ObjectUuidPK(id));
        if ((info != null)
            && ((!info.getBillStatus().equals(BillStatus.approve)))) {
          MsgBox.showInfo("单据编号为" + info.getNumber()
              + "的单据非审核状态,不允许打印!");
          SysUtil.abort();
        }
        // 预算返还
        // BgControlCaller bgControlCaller = new
        // com.kingdee.eas.ma.nbudget.BgControlCaller();
        // bgControlCaller.returnBudget(BOSUuid.read(id.toString()));
      }
    }
    super.actionPrintPreview_actionPerformed(e);
  }










