/*-------------------------------文档信息-----------------------------------
///功能：税金支付单单据
///创建人: 翟新乐
///创建时间：------------------------
///修改人：------------------------
///修改时间：-----------------------
///修改原因：-----------------------
///详细说明：-----------------------
---------------------------------------------------------------------*/
var strTableTp040301_zfd = "Tp040301";          //gridId

//打开单据
function showDialogP040301_zfd(strDialogId, strDjbh) {
    $("#" + strDialogId).empty();
    creatDiv_ShowDialog(strDialogId, "税金支付", false, false, strTableTp040301_zfd, "650");
    $("#idMust", $("#" + strDialogId)).append("NO:" + strDjbh);
    creatDialogItem_P040301(strDialogId,strDjbh);
}

//创建表单元素并加载数据
function creatDialogItem_P040301(strDialogId, strDjbh) {
    var config = ParseData(window.external.DoOptions(strTableTp040301_zfd, "GetTableConfig", "{}"));
    if (config == null) {
        window.parent.cihoAlert(msg.other.modelInfoFail);
        return;
    }

    if (strDjbh != "") {
        var objRecords = ParseData(window.external.DoOptions(strTableTp040301_zfd, '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 + "' ";
            strForm += " value=''  ";
            strForm += " id='" + Item.index + "' disabled />";
            strForm += "</li>";
        }
    }
    strForm += "</ul><br/>";
    $("#" + strDialogId + "_divform").append(strForm);
    //加载数据
    $("#djdate",$("#" + strDialogId+ "_divform")).val(objRecords.djdate);
    $("#kmdm", $("#" + strDialogId+ "_divform")).val(objRecords.kmmc);
    $("#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));
    $("#" + strDialogId).dialog("option", "position", "center");
    config = null;
    objRecords = {};
    strForm = null;
    Item = null;
    i = null;
}