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());
        }

    }

}