@Override
  protected void onBoEdit() throws Exception {
    if (getBufferData().isVOBufferEmpty()) {
      return;
    }
    if (getBufferData().getCurrentRow() < 0) {
      getBillUI().showWarningMessage("请选择要修改的单据");
      return;
    }

    String corp =
        PuPubVO.getString_TrimZeroLenAsNull(
            getBufferData().getCurrentVO().getParentVO().getAttributeValue("ccorpid"));
    if (!_getCorp().getPrimaryKey().equalsIgnoreCase(corp))
      throw new BusinessException("矿上新增的物资编码,不可修改");

    String invcode = null;
    BillCardPanel card = getBillCardPanelWrapper().getBillCardPanel();
    BillListPanel list = getBillListPanelWrapper().getBillListPanel();
    if (getBillManageUI().isListPanelSelected()) { // 列表状态
      int selectRow = list.getHeadTable().getSelectedRow();
      invcode =
          PuPubVO.getString_TrimZeroLenAsNull(
              list.getHeadBillModel().getValueAt(selectRow, "invcode"));
    } else {
      invcode = PuPubVO.getString_TrimZeroLenAsNull(card.getHeadItem("invcode").getValueObject());
    }
    if (invcode != null) throw new BusinessException("已经编码,不可修改");
    super.onBoEdit();
    setHeadEditEnableWhenCoding(false);
    setButtonEnable(true, IBillButton.Save);
    setButtonEnable(false, HgPuBtnConst.OK);
  }
 // 设置表头元素编辑性
 private void setHeadEditEnableWhenCoding(boolean flag) {
   String[] keys = HgPubConst.MATERIALS_HEAD_EDITITEMS;
   BillCardPanel card = getBillCardPanelWrapper().getBillCardPanel();
   for (String key : keys) {
     card.getHeadItem(key).setEdit(flag);
   }
 }
Beispiel #3
0
 @Override
 public void handleAppEvent(AddEvent e) {
   String pk_group = e.getContext().getPk_group();
   String pk_org = e.getContext().getPk_org();
   BillCardPanel panel = e.getBillForm().getBillCardPanel();
   // 设置主组织默认值
   panel.setHeadItem("pk_group", pk_group);
   panel.setHeadItem("pk_org", pk_org);
   // 设置单据状态、日期默认值
   panel.setHeadItem("approvestatus", BillStatusEnum.FREE.value());
   panel.setHeadItem("creationtime", AppContext.getInstance().getBusiDate());
 }
 public void onBoCommit() throws Exception {
   String invcode = null;
   BillCardPanel card = getBillCardPanelWrapper().getBillCardPanel();
   BillListPanel list = getBillListPanelWrapper().getBillListPanel();
   if (getBillManageUI().isListPanelSelected()) { // 列表状态
     int selectRow = list.getHeadTable().getSelectedRow();
     invcode =
         PuPubVO.getString_TrimZeroLenAsNull(
             list.getHeadBillModel().getValueAt(selectRow, "invcode"));
   } else {
     invcode = PuPubVO.getString_TrimZeroLenAsNull(card.getHeadItem("invcode").getValueObject());
   }
   if (invcode == null) throw new BusinessException("请先编码后再提交");
   super.onBoCommit();
 }
 protected void onBOCoding() throws Exception {
   PlanApplyInforVO appinfor = ((ClientUI) getBillUI()).m_appInfor;
   if (appinfor == null) {
     getBillUI().showErrorMessage("获取申请信息失败!");
     return;
   }
   if (!_getCorp().getPrimaryKey().equalsIgnoreCase(appinfor.getM_pocorp()))
     throw new BusinessException("矿上不能编码");
   super.onBoEdit();
   getBillCardPanelWrapper().getBillCardPanel().setHeadItem("voperatorid", _getOperator()); // 编码人
   getBillCardPanelWrapper().getBillCardPanel().setHeadItem("reserve12", _getDate()); // 编码日期
   getBillCardPanelWrapper()
       .getBillCardPanel()
       .setHeadItem("pk_corp", _getCorp().getPrimaryKey()); // 公司
   setHeadEditEnableWhenCoding(true);
   BillCardPanel card = getBillCardPanelWrapper().getBillCardPanel();
   card.getHeadItem("invcode").setEdit(true);
   setButtonEnable(false, IBillButton.Save);
   setButtonEnable(true, HgPuBtnConst.OK);
 }
  protected void onBOOK() throws Exception {
    BillCardPanel card = getBillCardPanelWrapper().getBillCardPanel();
    String invcode =
        PuPubVO.getString_TrimZeroLenAsNull(card.getHeadItem("invcode").getValueObject());
    if (invcode == null) throw new BusinessException("请先编码后再确定");

    Object ijjway =
        getBillCardPanelWrapper().getBillCardPanel().getHeadItem("ijjway").getValueObject();
    Object pk_taxitems =
        getBillCardPanelWrapper().getBillCardPanel().getHeadItem("pk_taxitems").getValueObject();
    Object nplanprice =
        getBillCardPanelWrapper().getBillCardPanel().getHeadItem("nplanprice").getValueObject();
    if (PuPubVO.getString_TrimZeroLenAsNull(ijjway) == null)
      throw new BusinessException("结算方式不能为空");
    if (PuPubVO.getString_TrimZeroLenAsNull(pk_taxitems) == null)
      throw new BusinessException("税目不能为空");
    if (PuPubVO.getString_TrimZeroLenAsNull(nplanprice) == null)
      throw new BusinessException("计划价不能为空");
    super.onBoSave();
    card.getHeadItem("invcode").setEdit(false);
  }