Ejemplo n.º 1
0
  public ZcPProMakeXMEditPanel(
      GkBaseDialog parent, ListCursor listCursor, String tabStatus, ZcPProMakeListPanel listPanel) {

    super(parent, listCursor, tabStatus, listPanel);

    ZcPProMake make = (ZcPProMake) listCursor.getCurrentObject();

    if (make.getZcMakeStatus().equals("0")
        && make.getProcessInstId() != null
        && make.getProcessInstId().longValue() > 0) {

      sendButton.setEnabled(true);

      deleteButton.setEnabled(true);
    }
    if (make.getZcMakeStatus().equals("0") && make.getProcessInstId() == null) {

      deleteButton.setEnabled(false);
      sendButton.setEnabled(true);
    }
    //    if (make.getZcMakeStatus().equals("0") || (saveButton.isVisible() &&
    // deleteButton.isVisible())) {
    //
    //      updateWFSubTableEditable(true);
    //
    //    } else {
    //
    //      updateWFSubTableEditable(false);
    //
    //    }
    //    if ("40".equals(make.getZcMakeStatus()) && this.suggestPassButton.isVisible()) {
    //            setWFSubTableEditable(this.itemTablePanel, true);
    //    }

    if ("N".equals(make.getZcIsImp())) {

      zcImpFile.setEnabled(false);
    }
  }
Ejemplo n.º 2
0
  protected void refreshData() { // add shijia 20111105

    ZcPProMake zcPProMake = (ZcPProMake) listCursor.getCurrentObject();

    boolean isNew;

    if (zcPProMake != null) {

      isNew = false;

      zcPProMake =
          getZcPProMakeServiceDelegate()
              .selectByPrimaryKey(zcPProMake.getZcMakeCode(), this.requestMeta);

      fukuanValId = zcPProMake.getZcMakeSequence();
      List biList =
          getZcPProMakeServiceDelegate()
              .getZcPProMitemBi(zcPProMake.getZcMakeCode(), ZcUtil.useBudget(), requestMeta);
      zcPProMake.setBiList(biList);

      listCursor.setCurrentObject(zcPProMake);

      if (biList != null && biList.size() > 0) {
        if (ZcUtil.useBudget()) {
          String sumId = "";
          for (int i = 0; i < biList.size(); i++) {
            ZcPProMitemBi bi = (ZcPProMitemBi) biList.get(i);
            if ("A".equals(bi.getPaytypeCode())) {
              bi.setZcBiPayType("2");
              bi.setZcBiDoSum(null);
              continue;
            }
            bi.setZcBiPayType("1");
            if (sumId.length() > 0) {
              sumId = sumId + ",'" + bi.getZcBiNo() + "'";
            } else {
              sumId = "'" + bi.getZcBiNo() + "'";
            }
          }
          getDto.setZcText3(sumId);
        }
      }
      if (ZcUtil.useBudget()) {
        getDto.setZcMakeCode(zcPProMake.getZcMakeCode());
      }

    } else {

      isNew = true;

      zcPProMake = new ZcPProMake();

      setDeftValue(zcPProMake);

      zcPProMake.setCoCode(this.requestMeta.getSvCoCode());

      initOrg(zcPProMake);

      zcPProMake.setNd(this.requestMeta.getSvNd());

      zcPProMake.setBiList(new ArrayList());

      zcPProMake.setItemList(new ArrayList());
      zcPProMake.setZcInputDate(this.requestMeta.getSysDate());

      // 新增数据默认插入一行

      ZcPProMitem item = new ZcPProMitem();

      setItemDefaultValue(item);

      zcPProMake.getItemList().add(item);

      ZcPProMitemBi bi = new ZcPProMitemBi();

      setItemBiDefaultValue(bi);

      zcPProMake.getBiList().add(bi);

      listCursor.getDataList().add(zcPProMake);

      listCursor.setCurrentObject(zcPProMake);
    }
    if (ZcUtil.useBudget()) {
      getDto.setNd(requestMeta.getSvNd());
      getDto.setZcText2("1");
      getDto.setCoCode(
          zcPProMake.getCoCode() != null ? zcPProMake.getCoCode() : requestMeta.getSvCoCode());
    }

    this.setEditingObject(zcPProMake);

    if (zcPProMake.getProcessInstId() != null && zcPProMake.getProcessInstId().longValue() > 0) {

      // 工作流的单据

      wfCanEditFieldMap = BillElementMeta.getWfCanEditField(zcPProMake, requestMeta);
    }

    itemTablePanel.setTableModel(
        new ZcPProMakeToTableModelConverter()
            .convertSubItemTableData(zcPProMake.getItemList(), getItemInfo(), wfCanEditFieldMap));

    if (ZcUtil.useBudget()) {
      biTablePanel.setTableModel(
          ZcPProMakeToTableModelConverter.convertSubBiTableData(
              zcPProMake.getBiList(), wfCanEditFieldMap));
    } else {
      biTablePanel.setTableModel(
          ZcPProMakeToTableModelConverter.convertSubBiTableDataWithOutBudget(
              zcPProMake.getBiList(), wfCanEditFieldMap));
    }

    // 刷新竞价信息和成交信息

    refreshJinJiaChengJiao();

    // 翻译从表表头列

    ZcUtil.translateColName(itemTablePanel.getTable(), getItemInfo());

    if (ZcUtil.useBudget()) {
      ZcUtil.translateColName(biTablePanel.getTable(), ZcPProMakeToTableModelConverter.biInfo);
    } else {
      ZcUtil.translateColName(biTablePanel.getTable(), ZcPProMakeToTableModelConverter.biInfo2);
    }

    // 设置从表列类型

    setTableBiEditor(biTablePanel.getTable());

    setTableItemEditor(itemTablePanel.getTable());

    // 设置从表监听

    addBiTableLisenter(biTablePanel.getTable());

    addItemTableLisenter(itemTablePanel.getTable());

    setOldObject();

    // 根据工作流模版设置功能按钮是否可用

    setButtonStatus(zcPProMake, requestMeta, this.listCursor);

    // 根据工作流模版设置字段是否可编辑

    updateWFEditorEditable(zcPProMake, requestMeta);

    this.fitTable();

    // 草稿状态设置【批复采购方式】只读

    if ("0".equals(zcPProMake.getZcMakeStatus())
        || (saveButton.isVisible() && deleteButton.isVisible())) {

      if (zcPifuCgfs != null) {

        zcPifuCgfs.setEnabled(true);
      }
      if (zcMakePfSequence != null) {
        zcMakePfSequence.setEnabled(false);
      }
    }

    if (isNew) {

      biTablePanel.getTable().setRowSelectionInterval(0, 0);

      itemTablePanel.getTable().setRowSelectionInterval(0, 0);
    }

    if (zcPProMake.getZcMakeStatus().equals("0")
        && zcPProMake.getProcessInstId() != null
        && zcPProMake.getProcessInstId().longValue() > 0) {

      sendButton.setEnabled(false);

    } else if (zcPProMake.getZcMakeStatus().equals("0")
        && zcPProMake.getProcessInstId() != null
        && zcPProMake.getProcessInstId().longValue() < 0) {

      sendButton.setEnabled(true);

    } else if (zcPProMake.getZcMakeStatus().equals("0") && zcPProMake.getProcessInstId() != null) {

      sendButton.setEnabled(true);
    }

    //    if (zcPProMake.getZcMakeStatus().equals("0") || (saveButton.isVisible() &&
    // deleteButton.isVisible())) {
    //
    //      updateWFSubTableEditable(true);
    //
    //    } else {
    //
    //      updateWFSubTableEditable(false);
    //
    //    }

    // 退回状态时,明细都可以编辑 add shijia 20111105

    if (zcPProMake.getZcMakeStatus().equals(ZcSettingConstants.WF_STATUS_DRAFT)
        && WorkEnv.getInstance().containRole(ZcSettingConstants.ROLE_YSDWJB)) {

      String valId = ((AsValComboBox) zcPitemOpiway.getField()).getSelectedAsVal().getValId();

      valId = ((AsValComboBox) zcIsImp.getField()).getSelectedAsVal().getValId();

      if ("N".equals(valId)) { // 当是否涉及进出口选择否的时候,将附件上传设置为不可用,如果是从“是”跳转回来的话,要将上传的附件从数据库中删除

        zcImpFile.setEnabled(false);
      } else {
        zcImpFile.setEnabled(true);
      }
    }

    // end add

    biTabPane.repaint();

    itemTabPane.repaint();
  }