/**
 *
 * @author BOGON
 * @version 1.0
 */

var page = {
    loadGrid: function () {
        var columns = [[{
            field: 'ck', checkbox: true
        },  {
            field: 'componentMaterialCode', title: "组件物料编码", width: 130, align: 'left'

        }, {
            field: 'componentMaterialName', title: "组件物料名称", width: 130, align: 'left'

        }, {
            field: 'requiredQuantity', title: "需求数量", width: 130, align: 'left'

        }, {
            field: 'unitOfMeasure', title: "计量单位", width: 130, align: 'left'
        }, {
            field: 'count', title: "库存数量", width: 130, align: 'left'
        }, {
            field: 'unit', title: "库存单位", width: 130, align: 'left'
        },{
            field: 'purchaseOrder', title: "采购订单号", width: 130, align: 'left'

        }, {
            field: 'lineItem', title: "采购行号", width: 130, align: 'left'

        }, {
            field: 'planLine', title: "交货计划行号", width: 130, align: 'left'

        }, {
            field: 'rsnum', title: "预留号", width: 130, align: 'left'

        }, {
            field: 'rspos', title: "预留行", width: 130, align: 'left'

        }]];
        let url = g.ctx + 'pc/order/purchaseOrderDetail/rest/componentList?orderCode=' + orderCode + "&row=" + row + "&planLine=" + planLine;
        $('#tb').datagrid({
            iconCls: 'icon-list',
            width: '100%',
            method: 'GET',
            height: $(window).height() - 20,
            url: url,
            pagination: false,
            loadMsg: commonMsg.loadData,
            rownumbers: true,
            nowrap: true,
            remoteSort: true,
            striped: true,
            page: 1,
            pageSize: 20,
            columns: columns
        });
    }
}
$(function () {
    page.loadGrid()
})