/*
 * The Hefei Ceshi RDC(Research and Development Centre) Group.
 * __________________
 *
 *    Copyright 2015-2019
 *    All Rights Reserved.
 *
 *    NOTICE:  All information contained herein is, and remains
 *    the property of Ceshi Company and its suppliers,
 *    if any.
 */

/**
 * qizhicai
 * 银行信息查询
 * @type {{dataGrid: {}, initTable: page.initTable}}
 */
var page = {
    dataGrid: {},
    initTable: function () {
        var columns = [[
            {
                field: 'ck',
                checkbox: true
            },
            {
                field: 'interbankNumber',
                title: "联行号",
                width: 130,
                align: 'left'

            },
            {
                field: 'bankName',
                title: "银行名称",
                width: 200,
                align: 'left'

            }
        ]];
        page.dataGrid = $('#tb').datagrid({
            iconCls: 'icon-list',
            width: '100%',
            method: 'GET',
            idField: 'id',
            height: $(window).height() - $('#searchForm').outerHeight() - 20,
            url: g.ctx + 'pc/supplier/bankInfo/rest/list',
            singleSelect: true,
            pagination: true,
            loadMsg: commonMsg.loadData,
            rownumbers: true,
            fitColumns: true,
            nowrap: true,
            remoteSort: true,
            striped: true,
            page: 1,
            pageSize: 20,
            columns: columns
        });
    },
};

$(function () {
    page.initTable();
});


function chooseRow(callback) {
    let rows = $('#tb').datagrid('getChecked');
    if (rows.length !== 1) {
        topWin.layer.msg("请选中一条数据")
        return
    }
    callback(rows[0])
}