/**
 * 交付模块-标准预测查看回复进度页面JS
 *
 * Created by li.kui on 2020/6/10.
 */
'use strict';
var el = {
    planId: '#planId',
    tb: '#tb',
    bodyHeight: document.documentElement.clientHeight
};

$(function () {
    initDataGrid($(el.planId).val());
});


/**
 * 初始化表格
 */
function initDataGrid(planId) {
    var pager = initGridPagerNew(el.bodyHeight - 20, 37, 30);

    $(el.tb).datagrid({
        loadMsg: '数据远程载入中,请等待...',
        url: g.ctx + 'pc/order/basicPlan/rest/get/supplier/reply',
        height: el.bodyHeight - 20,
        rownumbers: true,
        pagination: false,
        // pageSize: pager.pageSize,
        // pageList: pager.pageList,
        queryParams: {
            planId: planId,
            page: 1,
            rows: 1000
        },
        columns: [
            [
                {
                    field: 'supplierCode',
                    title: itableTitlei18n.gysbm,
                    width: 110
                },
                {
                    field: 'supplierName',
                    title: itableTitlei18n.gysmc,
                    width: 300
                },
                {
                    field: 'adjustNum',
                    title: handlei18n.sfyhf,
                    width: 100,
                    formatter: function (value, row) {
                        if (!row.adjustDate) {
                            return handlei18n.no;
                        }
                        return handlei18n.yes;
                    }
                },
                {
                    field: 'adjustDate',
                    title: handlei18n.hfsj,
                    width: 140,
                    formatter: function (value) {
                        if (!value) {
                            return '';
                        }
                        return moment(value).format('YYYY-MM-DD HH:mm:ss');
                    }
                },
                {
                    field: 'replySum',
                    title: handlei18n.hfsl,
                    width: 100,
                    formatter: function (value, row) {
                        return value + '/' + row.replySumAll
                    }
                }
            ]
        ]
    });
}