/*************************
*功能：工资预提规则设定
*创建人：张振华
*时间：2010-08-16
*备注：此时间是加注释时间
*************************/

var strTableP050902 = "Tp050902";
var strDivP050902 = "divP050902";
var objRecordsP050902;  //修改时保存数据库的记录数
var strRecordsCountP050902; //行数
var iRowP050902 = -1;   //行索引
var iColP050902 = -1;   //列索引
var strOptrTypeP050902 = "1";   //保存标志位
var iFirstIndex = 999999999;  //启始的索引，避免ID重复

//大于列格式化
function formatterP050902Dy() {
    return ">";
}

//小于列格式化
function formatterP050902Xy() {
    return "<=";
}

//格式化数量
function formatterP050902Count(cellValue) {

    if (!isNaN(parseFloat(cellValue)) && cellValue != "-1") {
        return parseFloat(cellValue).toFixed(window.parent.strCountPlace);
    }
    else {
        return "&nbsp;";
    }

}

//格式化百分比
function formatterP050902Rate(cellValue) {
    if (!isNaN(parseFloat(cellValue))) {
        return parseFloat(cellValue).toFixed(window.parent.strPercentPlace) + "%";
    }
    else {
        return "&nbsp;";
    }
}

//反格式化
function unFormatterP050902Rate(cellValue) {
    return cellValue.substring(0, cellValue.length - 1);
}

//格式化金额
function formatterP050902Money(cellValue) {
    if (!isNaN(parseFloat(cellValue)) && cellValue != "-1") {
        return parseFloat(cellValue).toFixed(window.parent.strMoneyPlace);
    }
    else {
        return "&nbsp;";
    }
}

//编辑单元格之后的事件
function afterEditCell_P050902(rowId, cellname, value, iRow, iCol) {

    //单元格索引
    iRowP050902 = iRow;
    iColP050902 = iCol;

    //单元格控件
    var item = $("#" + rowId + " :input[name='" + cellname + "']", this);

    //小数位数
    var strPlace;

    //格式化位数
    switch (cellname) {
        case "end":
            if (RulesList.Type == "0") { //按数量
                strPlace = window.parent.strCountPlace;
            }
            else {
                strPlace = window.parent.strMoneyPlace;
            }
            break;
        case "start":
            if (RulesList.Type == "0") { //按数量
                strPlace = window.parent.strCountPlace;
            }
            else {
                strPlace = window.parent.strMoneyPlace;
            }
            break;
        case "ytbl":
            if (RulesList.Type == "0") { //按数量
                strPlace = window.parent.strMoneyPlace;
                item.autoNumeric({ mDec: strPlace, aSep: "", mNum: 10 }).focus(function () { this.select(); }).css("ime-mode", "disabled");
            }
            else {
                strPlace = window.parent.strPercentPlace;
                item.autoNumeric({ mDec: strPlace, aSep: "" }).focus(function () { this.select(); }).css("ime-mode", "disabled");
            }
            break;
    }

    //出预提比率外，只能输入数字
    if (cellname != "ytbl") {
        item.autoNumeric({ mDec: strPlace, aSep: "" }).focus(function () { this.select(); }).css("ime-mode", "disabled");
    }

    //控件绑定事件
    item.change(function () { dataChangeStateP050902(true); });

    //索引
    item = null;
}

//保存单元格之后的事件
function afterSaveCell_P050902(rowId, cellname, value, iRow, iCol) {
    switch (cellname) {
        case "ytbl":
            //按金额的时候预提比率加上%号
            if ($("#slje", "#" + strDivP050902).combobox('getValue') == "1") {
                $("#" + strTableP050902).setCell(rowId, cellname, value + "%");
            }
            break;
        default:
    }
}

//浮动删除
function addCzHtmlP050902() {
    $("#" + strTableP050902).delegate("tr[id]:visible", "hover", function (e) {
        if (e.type == "mouseenter") {
            var strButtonHtml = "";
            strButtonHtml += "<a href=\"#\" style=\"color:red;text-decoration:none;\" onclick=\"deleteDataP050902(" + this.id + ");return false;\">删除</a> ";
            $("#" + strTableP050902).jqGrid("setCell", this.id, "cz", strButtonHtml);
        }
        else if (e.type == "mouseleave") {
            $("#" + strTableP050902).jqGrid("setCell", this.id, "cz", "&nbsp;");
        }
    });

}

//添加一空行
function addEmptyRowP050902() {
    if (strOptrTypeP050902 != "5") {
        $("#" + strTableP050902).addRowData(++strRecordsCountP050902 + iFirstIndex, { id: strRecordsCountP050902 });
        addCzHtmlP050902();
        resizeGridScroll(strTableP050902);
    }
}

//页面加载时添加的添加空行
function addEmptyRowsP050902() {
    for (var i = iFirstIndex; i < iFirstIndex + strRecordsCountP050902; i++) {
        if (strRecordsCountP050902 == 5 && i == iFirstIndex) {
            $("#" + strTableP050902).addRowData(i, { start: "0" });
        }
        else {
            $("#" + strTableP050902).addRowData(i, {});
        }
    }
}

//修改状态
function dataChangeStateP050902(bState) {
    $("#" + strDivP050902 + "_divform").data("change", bState);
}

//按数量/按金额改变时重新加载表格配置
function reLoadTable() {
    var objTable = $("#" + strTableP050902);

    //清楚grid数据
    objTable.clearGridData();

    //修改名字
    $(".ui-jqgrid-hbox  table th:visible .ui-jqgrid-sortable", "#gbox_" + strTableP050902).each(function () {

        var strText = $.trim($(this).text());
        if ($("#slje", "#" + strDivP050902).combobox('getValue') == "0") {
            //按数量
            if (strText == "金额（元）") {
                $(this).text("数量");
            }
            if (strText == "预提比例（%）") {
                $(this).text("预提金额（元/单位）");
            }
        }
        else {
            //按金额                                   
            if (strText == "数量") {
                $(this).text("金额（元）");
            }
            if (strText == "预提金额（元/单位）") {
                $(this).text("预提比例（%）");
            }
        }
    });

    //重新设置属性
    if ($("#slje", "#" + strDivP050902).combobox('getValue') == "0") {
        objTable.setColProp("start", { formatter: formatterP050902Count });
        objTable.setColProp("end", { formatter: formatterP050902Count });
        objTable.setColProp("ytbl", { formatter: formatterP050902Money });
    }
    else {
        objTable.setColProp("start", { formatter: formatterP050902Money });
        objTable.setColProp("end", { formatter: formatterP050902Money });
        objTable.setColProp("ytbl", { formatter: formatterP050902Rate });
        objTable.setColProp("ytbl", { unformat: unFormatterP050902Rate });
    }

    //事件
    objTable.setGridParam({ afterEditCell: afterEditCell_P050902 });
    objTable.setGridParam({ afterSaveCell: afterSaveCell_P050902 });

    //重新加载数据
    loadTreeData(strTableP050902, objRecordsP050902.Records);

    //添加空行
    addEmptyRowsP050902();

    //加删除列
    addCzHtmlP050902();

    //释放内存
    objTable = null;
}

//创建grid
function createGridP050902(strTableID, objColNames, objColModel) {

    $("#" + strTableID).jqGrid({
        datatype: "local",
        sortname: "id",
        colNames: objColNames,
        colModel: objColModel,
        data: [],
        rowNum: 9999999,
        rownumbers: true,
        autowidth: true,
        rownumWidth: 30,
        cellEdit: true,
        cellsubmit: "clientArray",
        gridview: true
    }).parent(".ui-jqgrid-bdiv").siblings();

    //增加表头‘序号’列
    $("table.ui-jqgrid-htable th:first", $("#gbox_" + strTableID)).text("序号");
}

//弹出层
function showDialogP050902(strType, strRowId) {
    try {
        $(".operate").hide();
        strOptrTypeP050902 = strType;
        var objResult;

        //从管理画面中进来的时候判断是否产生了单据
        if (strOptrTypeP050902 == "2") {
            objSelRowP0509 = $("#" + strTableP0509).getRowData(strRowId);
            if (objSelRowP0509.zt == "已停用") {
                objResult = ParseData(window.external.DoOptions(strTableP050901, "GetSingle", "{\"gzguid\":\"" + objSelRowP0509.gzguid + "\"}"));
                if (objResult.flag == "4") {
                    strOptrTypeP050902 = "6";
                }
                else {
                    strOptrTypeP050902 = "2";
                }
            }
            else {
                strOptrTypeP050902 = "5";
            }

        }
        else {
            //规则维护是修改的时候
            if (strOptrTypeP050901 == "2") {
                strOptrTypeP050902 = "3";
            }
            else if (strOptrTypeP050901 == "3") {
                strOptrTypeP050902 = "5";
            }
            else if (strOptrTypeP050901 == "4") {
                strOptrTypeP050902 = "4";
            }
        }
        //查看的时候
        if (strOptrTypeP050902 == "5") {
            creatDiv_ShowDlgHaveTbl(strDivP050902, "规则设定", false, false, strTableP050902, "600");
        }
        else {
            creatDiv_ShowDlgHaveTbl(strDivP050902, "规则设定", false, true, strTableP050902, "600");
        }

        addContentP050902("");

        //屏蔽回车键
        $("#" + strDivP050902).keypress(function (event) {
            if (event.keyCode == 13) {
                return false;
            }
        });
    }
    catch (e) {
        proceError("P050902", e.ToString());
    }
}

//添加弹出层内容
function addContentP050902() {

    //常用变量定义
    var config = ParseData(window.external.DoOptions(strTableP050902, "GetTableConfig", "{}"));
    var objSlje = [{ "dm": "0", "mc": "按数量" }, { "dm": "1", "mc": "按金额"}];
    var strForm;
    var i = 0;
    var item;

    //修改的时候的数据
    objRecordsP050902 = { Records: [] };

    //第一此进来时从数据库取值
    if (RulesList.Rules.length == 0 && strOptrTypeP050902 != "1") {
        //从数据库中取值
        objRecordsP050902 = ParseData(window.external.DoOptions(strTableP050902, "GetList", "{\"gzguid\":\"" + objSelRowP0509.gzguid + "\"}"));
    }

    //从管理画面中进来的时候取按数量/按金额，预提方式的值
    if (strOptrTypeP050902 != "1" && RulesList.Rules.length == 0) {
        RulesList.Type = objSelRowP0509.slje
    }

    //转化数据
    if (RulesList.Rules.length != 0) {
        for (i = 0; i < RulesList.Rules.length; i++) {
            var strRecord = { "start": "", "end": "", "dy": ">", "xy": "<=", "cz": "", "ytbl": "", "mxguid": "" };
            strRecord.ytbl = RulesList.Rules[i].rate;
            strRecord.start = RulesList.Rules[i].sData;
            strRecord.end = RulesList.Rules[i].eData;
            objRecordsP050902.Records.push(strRecord);
        }

    }

    //添加加载配置信息
    strForm = "<ul>";
    for (i = 0; i < config.pageHeader.length; i++) {

        Item = config.pageHeader[i];
        if (Item.hidden == true) {
            continue;
        }
        if (Item.edittype == "text") {
            strForm += "<li class='inp_70'>";
            strForm += Item.xsmc + "：";
            strForm += "<input type='text'  name='" + Item.index + "' ";
            strForm += " value=''  ";
            strForm += " id='" + Item.index + "'>";
            strForm += "</li>";
        }
        else if (Item.edittype == "select") {
            strForm += "<li>";
            strForm += Item.xsmc + "：";
            strForm += "<select name='" + Item.index + "' id='" + Item.index + "'";
            strForm += " class='easyui-combobox' >";
            strForm += "</select>";
            strForm += "</li>";
        }
        else if (Item.edittype == "checkbox") {
            strForm += "<li class=\"unline\">";
            strForm += Item.xsmc + "：";
            strForm += "<input type='checkbox'   name='" + Item.index + "' ";
            strForm += " value=''  ";
            strForm += " id='" + Item.index + "'>";
            strForm += "分段预提";
            strForm += "</li>";
        }
    }
    strForm += "</ul>";
    strForm += "<table id=" + strTableP050902 + "></table>";
    strForm += "</br>";

    //往弹出层里添加内容
    $("#" + strDivP050902 + "_divform").append(strForm);

    //数量金额
    $("#slje", "#" + strDivP050902).combobox({
        width: _iWidth100,
        panelHeight: 42,
        textField: "mc",
        valueField: "dm",
        editable: false,
        onChange: function (newValue, oldValue) {
            dataChangeStateP050902(true);
        },
        onSelect: function (Record) {
            if (Record.dm == undefined) {
                return;
            }
            //RulesList.Type = Record.dm;
            objRecordsP050902.Records = [];
            //RulesList.Rules = [];
            strRecordsCountP050902 = 5;
            reLoadTable();

        },
        enterDown: function () {
            //RulesList.Type = $("#slje", "#" + strDivP050902).combobox("getValue");
            objRecordsP050902.Records = [];
            //RulesList.Rules = [];
            strRecordsCountP050902 = 5;
            reLoadTable();
        }
    });
    objSlje[RulesList.Type].selected = true;
    $("#slje", "#" + strDivP050902).combobox('loadData', objSlje);

    //表格对象
    var objTable = $("#" + strTableP050902);

    //修改的时候，如果规则是按数量，
    //预提对象选择按销售回款的问题。
    if ((strOptrTypeP050902 == "3" || strOptrTypeP050902 == "4") && $("#ytfs", "#" + strDivP050901).combobox("getValue") == "1" && RulesList.Type != "1") {
        $("#slje", "#" + strDivP050902).combobox("setValue", "1");
        $("#slje", "#" + strDivP050902).combobox('disable');
    }

    //加载列配置，0是数量1是金额
    if ($("#slje", "#" + strDivP050902).combobox('getValue') == "0") {
        config.colNames[0] = "大于";
        config.colNames[1] = "数量";
        config.colNames[2] = "小于";
        config.colNames[3] = "数量";
        config.colNames[4] = "预提金额（元/单位）";
    }
    else {
        config.colNames[0] = "大于";
        config.colNames[1] = "金额（元）";
        config.colNames[2] = "小于";
        config.colNames[3] = "金额（元）";
        config.colNames[4] = "预提比例（%）";
    }

    //创建表格设定高度
    createGridP050902(strTableP050902, config.colNames, config.colModel);
    $("#" + strTableP050902).setGridHeight(141);

    //设置表格属性
    objTable.setColProp("dy", { formatter: formatterP050902Dy });
    objTable.setColProp("xy", { formatter: formatterP050902Xy });

    if ($("#slje", "#" + strDivP050902).combobox('getValue') == "0") {
        objTable.setColProp("start", { formatter: formatterP050902Count });
        objTable.setColProp("end", { formatter: formatterP050902Count });
        objTable.setColProp("ytbl", { formatter: formatterP050902Money });
    }
    else {
        objTable.setColProp("start", { formatter: formatterP050902Money });
        objTable.setColProp("end", { formatter: formatterP050902Money });
        objTable.setColProp("ytbl", { formatter: formatterP050902Rate });
        objTable.setColProp("ytbl", { unformat: unFormatterP050902Rate });
    }

    //加载表格事件
    objTable.setGridParam({ afterEditCell: afterEditCell_P050902 });
    objTable.setGridParam({ afterSaveCell: afterSaveCell_P050902 });

    //设定状态
    switch (strOptrTypeP050902) {

        case "1":
        case "2":
            //从管理画面中进来，该条数据没产生单据
        case "3":
            //修改的时候，该条数据没产生单据
            break;
        case "4":
            //修改的时候，该条数据产生单据了
            //$("#slje", "#" + strDivP050902).combobox('disable');
            //$("#celj", "#" + strDivP050902).attr("disabled", false);
            break;
        case "5":
            //查看的时候
            objTable.setColProp("start", { editable: false });
            objTable.setColProp("end", { editable: false });
            objTable.setColProp("ytbl", { editable: false });
            $("#slje", "#" + strDivP050902).combobox('disable');
            $("#celj", "#" + strDivP050902).attr("disabled", true);
            break;
        case "6":
            //管理画面中进来，该条数据产生单据了
            //$("#slje", "#" + strDivP050902).combobox('disable');
            //$("#celj", "#" + strDivP050902).attr("disabled", true);
            break;
        default:

    }

    //加载数据
    if (objRecordsP050902.Records == "{}") {
        objRecordsP050902.Records = [];
    }

    //修改的时候，如果规则是按数量，
    //预提对象选择按销售回款的问题。
    if ((strOptrTypeP050902 == "3" || strOptrTypeP050902 == "4") && $("#ytfs", "#" + strDivP050901).combobox("getValue") == "1" && RulesList.Type != "1") {
        strRecordsCountP050902 = 5;
    }
    else {
        //加载数据
        loadTreeData(strTableP050902, objRecordsP050902.Records);

        //添加空行
        strRecordsCountP050902 = objRecordsP050902.Records.length > 5 ? objRecordsP050902.Records.length : (5 - objRecordsP050902.Records.length);

        //数量金额状态
        if (strOptrTypeP050902 != "5" && strOptrTypeP050902 != "6" && strOptrTypeP050902 != "2" && $("#ytfs", "#" + strDivP050901).combobox('getValue') == "1") {
            $("#slje", "#" + strDivP050902).combobox('disable');
        }

        //规则维护画面进来的时候，加载头部信息
        if (strOptrTypeP050902 != "1") {
            if (objSelRowP0509.celj == "False") {
                $("#celj", "#" + strDivP050902)[0].checked = false;
            }
            else {
                $("#celj", "#" + strDivP050902)[0].checked = true;
            }
        }

        //规则维护画面进来的时候，加载头部信息
        if (RulesList.Rules.length != 0) {
            $("#celj", "#" + strDivP050902)[0].checked = RulesList.CumToTotal;
        }

        //从管理画面中进来
        if (strOptrTypeP050902 == "6" || strOptrTypeP050902 == "2") {
            if (objSelRowP0509.ytfs == "1") {
                $("#slje", "#" + strDivP050902).combobox('disable');
            }
        }
    }

    //添加空行
    if (strRecordsCountP050902 <= 5) {
        addEmptyRowsP050902();
    }

    //除停用外操作列增加删除项
    if (strOptrTypeP050902 != "5") {
        addCzHtmlP050902();
    }

    //给层加状态
    $(":input", $("#" + strDivP050902 + "_divform")).change(function () {
        $("#" + strDivP050902 + "_divform").data("change", true);
    });
    $("#" + strDivP050902 + "_divform").data("change", false);

    //移除多余按钮
    $(".btn02", "#" + strDivP050902).remove();
    $(".btn03 a", "#" + strDivP050902).css("margin-left", "-55");

    //设置层序
    $(".layoutpanel").css("z-index", "50000009");

    //调整表格
    resizeGridScroll(strTableP050902);

    //头部添加新增按钮
    $(".ui-jqgrid-htable th:visible:last").html('<img id="btnAddP050902"  style="cursor:pointer"  title="添加行" src="../../Content/Default/images/edit_add.gif" onclick="addEmptyRowP050902(); "/>');

    //释放内存
    objTable = null;

}

//验证
function checkFormP050902(strDialog, strType) {

    //表格对象
    var objTable = $("#" + strTableP050902);
    objTable.saveCell(iRowP050902, iColP050902);

    //所有行id
    var arrIds = objTable.getDataIDs();

    //其他变量定义
    var i = 0;
    var objTr;
    var objNextTr;
    var strMsg;

    //一条数据没有事false
    var IsHasRecord = false;

    if (!$("#slje", "#" + strDivP050902).combobox('getValue')) {
        window.parent.cihoAlert(msg.gz.selSlJeNoEmpty);
        return;
    }

    //循环表格判断
    for (i = 0; i < arrIds.length; i++) {

        //清空一下数据
        objNextTr = null;
        objTr = null;

        objTr = objTable.getRowData(arrIds[i]);
        if ((i + 1) < arrIds.length) {
            objNextTr = objTable.getRowData(arrIds[i + 1]);
        }
        var strStart = objTr.start;
        var strEnd = objTr.end;

        //初始值不能为空
        if (objTr.ytbl != "" && strStart == "") {
            if (RulesList.Type == "0") {
                strMsg = msg.other.dnh + (i + 1) + msg.gz.CountNoEmpty;
            }
            else {
                strMsg = msg.other.dnh + (i + 1) + msg.gz.MoneyNoEmpty;
            }
            window.parent.cihoAlert(strMsg);
            return false;
        }

        //比率不能为空
        if (strStart != "" && objTr.ytbl == "") {

            if (RulesList.Type == "0") {
                strMsg = msg.other.dnh + (i + 1) + msg.gz.ytJeNoEmpty;
                window.parent.cihoAlert(strMsg);
            }
            else {
                strMsg = msg.other.dnh + (i + 1) + msg.gz.ytblNoEmpty;
                window.parent.cihoAlert(strMsg);
            }
            return false;
        }

        //如果有数据
        if (strStart != "" && objTr.ytbl != "") {
            IsHasRecord = true;
        }

        strStart = parseFloat(strStart);
        strEnd = parseFloat(strEnd);
        if (!isNaN(strStart) && !isNaN(strEnd)) {
            if (strEnd <= strStart) {
                strMsg = msg.other.dnh + (i + 1) + msg.other.EndDyStart;
                window.parent.cihoAlert(strMsg);
                return false;
            }
        }
        if (objNextTr != null && objNextTr.start != "" && objNextTr.start != objTr.end) {
            strMsg = msg.other.InetrContnu;
            window.parent.cihoAlert(strMsg);
            return false;
        }

    }

    //如果表格中一条单据没有
    if (IsHasRecord == false) {
        window.parent.cihoAlert(msg.gz.gzNoRecord);
        return false;
    }

    //释放内存
    objTable = null;
}

//保存到数据库
function saveToDbP050902(strDialog, strType) {

    //table对象，所有行ID
    var objTable = $("#" + strTableP050902);
    var arrIds = objTable.getDataIDs();

    //行对象
    var objTr;

    //保存数据
    if (strOptrTypeP050902 == "2" || strOptrTypeP050902 == "6") {
        //如果是从管理画面中点击过来的直接存到数据库里

        //组字符串
        var strData = "{";
        strData += "\"gzguid\":\"" + objSelRowP0509.gzguid + "\"";
        strData += ",\"slje\":\"" + $("#slje", "#" + strDivP050902).combobox('getValue') + "\""
        strData += ",\"celj\":\"" + $("#celj", "#" + strDivP050902)[0].checked + "\"";
        strData += ",Records:[";

        //table里的字符串
        for (var i = 0; i < arrIds.length; i++) {
            //每次清空数据
            objTr = null;
            objNextTr = null;

            objTr = objTable.getRowData(arrIds[i]);
            if (objTr.start == "" || objTr.ytbl == "") {
                continue;
            }

            if (i != 0) {
                strData += ",";
            }

            strData += "{";
            strData += "\"start\":\"" + objTr.start + "\"";
            if (objTr != undefined && objTr.end != "") {
                strData += ",\"end\":\"" + objTr.end + "\"";
            }
            else {
                strData += ",\"end\":\"-1\"";
            }
            strData += ",\"ytbl\":\"" + objTr.ytbl + "\"";
            strData += "}";
        }
        strData += "]";
        strData += "}";

        //保存数据
        var objResult = ParseData(window.external.DoOptions(strTableP050902, "Edit", strData));

        //保存失败弹出提示
        if (objResult.ReturnCode != "0") {
            window.parent.cihoAlert(objResult.MSG);
            return;
        }

        //重新加载数据
        searchDataClickP0509("id", "desc");
    }
    else {
        //转化格式存到全局变量里面
        RulesList.Rules = [];
        RulesList.Type = $("#slje", "#" + strDivP050902).combobox('getValue');
        RulesList.CumToTotal = $("#celj", "#" + strDivP050902)[0].checked;
        for (var i = 0; i < arrIds.length; i++) {

            objTr = objTable.getRowData(arrIds[i]);
            var Rules = { sData: "", eData: "", rate: "" };
            if (objTr.start == "" || objTr.ytbl == "") {
                continue;
            }

            Rules.sData = objTr.start;

            if (objTr.end == "") {
                Rules.eData = "-1";
            }
            else {
                Rules.eData = objTr.end;
            }

            Rules.rate = objTr.ytbl;
            RulesList.Rules.push(Rules);

        }
    }

    cihoDlgClose(strDialog);
    $("#" + strDivP050902 + "_divform").data("change", false);

    //释放内存
    strRecordsCountP050902 = null;
    objTable = null;
}

//保存数据
function saveDataP050902(strDialog, strType) {

    //验证
    if (checkFormP050902(strDialog, strType) == false) {
        return;
    }

    //保存到数据库里
    saveToDbP050902(strDialog, strType);
}

//删除行数据
function deleteDataP050902(rowId) {
    try {

        //table对象
        var objTable = $("#" + strTableP050902);

        //保存时取消单元格编辑
        objTable.saveCell(iRowP050902, iColP050902);

        objTable.delRowData(rowId);

        //设置表格宽度
        resizeGridScroll(strTableP050902);

        $("#" + strDivP050902 + "_divform").data("change", true);

        //释放内存
        objTable = null;
    }
    catch (e) {
        proceError("P050902", e.ToString());
    }
}

