/*-------------------------------文档信息-----------------------------------
///功能：税金调整单据
///创建人: 翟新乐
///创建时间：2011-07-01
///修改人：------------------------
///修改时间：-----------------------
///修改原因：-----------------------
///详细说明：-----------------------
---------------------------------------------------------------------*/
//页面全局变量
var strTableP040401_tzd = "Tp040401";   //表格ID
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓**事件方法 开始**↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/

//弹出单据方法
function showDialogP040401_tzd(strDialogID, strDjbh) {
    $("#" + strDialogID).empty();
    //弹出窗口的创建
    creatDiv_ShowDialog(strDialogID, "税金调整", false, false, strTableP040401_tzd, "650");

    //创建窗口元素
    $("#idMust", $("#" + strDialogID)).append("NO:" + strDjbh);
    creatDialogItem_P040401(strDialogID,strDjbh);
      //设置窗口居中显示
    $("#" + strDialogID).dialog("option", "position", "center");
}

//创建表单元素并加载数据
function creatDialogItem_P040401(strDialogId,strDjbh) {
    var config = ParseData(window.external.DoOptions(strTableP040401_tzd, "GetTableConfig", "{}"));
    if (config == null) {
        window.parent.cihoAlert(msg.other.modelInfoFail);
        return;
    }
    if (strDjbh != "") {
        var objRecords = ParseData(window.external.DoOptions(strTableP040401_tzd, 'GetList', "{\"djbh\":\"" + strDjbh + "\"}"));
    }
    //创建头部
    var i = 0;
    var strForm = "";
    var Item;
    strForm += "<ul>";
    for (i = 0; i < config.pageHeader.length; i++) {
        Item = config.pageHeader[i];
        if (Item.hidden == true) {
            continue;
        }
        else {
            strForm += "<li>";
            strForm += Item.xsmc + "：";
            strForm += "<input type='text'  name='" + Item.index + "' disabled ";
            strForm += " value=''  ";
            strForm += " id='" + Item.index + "'/>";
            strForm += "</li>";
        }
    }
    strForm += "</ul>";
    $("#" + strDialogId + "_divform").append(strForm);
    $("#djdate", $("#" + strDialogId +"_divform")).val(objRecords.djdate);
    $("#djtypedm", $("#" + strDialogId + "_divform")).val(objRecords.djtypemc);
    $("#kpdwdm", $("#" + strDialogId + "_divform")).val(objRecords.kpdwmc);
    $("#czydm", $("#" + strDialogId + "_divform")).val(objRecords.czymc);
    $("#a1", $("#" + strDialogId + "_divform")).val(parseFloat(objRecords.a1).toFixed(window.parent.strMoneyPlace));
    $("#bz", $("#" + strDialogId + "_divform")).val(escape(objRecords.bz));
    config = null;
    objRecords = {};
    strForm = null;
    Item = null;
    i = null;
}