E供應商-財務資料:開戶銀行選擇行名行號後,自動攜帶銀行地址和行名行號編碼

  1. DEP中新增行號字段
  2. BOS代碼擴展事件,用於聯動攜帶操做(因爲財務資料的DEP擴展,不會被加載,只好轉到BOS代碼進行擴展)
public class SupplierEditUICTEx extends SupplierEditUI {


    public SupplierEditUICTEx() throws Exception {
        super();
    }

    @Override
    protected void initCompanyUI() throws Exception {
        super.initCompanyUI();

        // 初始化財務資料頁籤後,給財務頁籤中的銀行信息表格,增長事件

        if (!(currentUI instanceof SupplierCompanyUI)) {
            return;
        }
        SupplierCompanyUI ui = (SupplierCompanyUI) currentUI;
        ui.tblBank.addKDTEditListener(new com.kingdee.bos.ctrl.kdf.table.event.KDTEditAdapter() {
            public void editStopped(com.kingdee.bos.ctrl.kdf.table.event.KDTEditEvent e) {
                try {
                    tblBank_editStopped(e);
                } catch (Exception exc) {
                    handUIException(exc);
                }
            }
        });

    }

    protected void tblBank_editStopped(KDTEditEvent e) {
        if (ObjectUtils.isEquals(e.getOldValue(), e.getValue())) {
            return;
        }

        int editColIndex = e.getColIndex();
        int editRowIndex = e.getRowIndex();
        KDTable tblBank = (KDTable) e.getSource();
        // String colName = tblBank.getColumnKey(editColIndex);
        IRow editRow = tblBank.getRow(editRowIndex);


        // 銀行名稱切換
        if (e.getValue() instanceof BEBankInfo) {
            BEBankInfo beBank = (BEBankInfo) e.getValue();
            ICell cell = editRow.getCell("cnapscode");
            if (cell != null) {
                // 行名行號
                cell.setValue(beBank.getNumber());
            }
            // 銀行地址
            editRow.getCell("bankAddress").setValue(beBank.getAdress());
        }

    }

}
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息