//模拟数据（要素）
var data={
    insured:{//被保险人
        l_name:["保单清单","赔案清单"],
        //保单清单
        p_arr:[
            //表头
            ["被保险人证件号","被保险人姓名","保单所属分公司","保单号","险种名称","保险起期","保险终期","保单状态","已缴保费",
                "投保人证件号","投保人姓名","业务员姓名","业务员工号","是否有理赔","赔案号","赔付结论","赔付金额","结案日期"],
            //数据
            [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
            [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2]
        ],
        //赔案清单
        clain:["被保险人证件号","被保险人姓名","赔案所属分公司","赔案号","报案号","出险类型","索赔事故性质","赔付结论","赔付金额","出险日期",
            "报案日期","立案日期","保单号","险种名称","领款人证件号","领款人姓名","支付方式","银行账号","开户行","立案人姓名/工号","理赔初审姓名/工号",
            "理赔复核姓名/工号","调查复核姓名/工号","业务员姓名/工号"],
        c_data:[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
    },
    applicant:{//投保人
        l_name:["保单清单","赔案清单"],
        //保单清单
        policy:["投保人证件号","投保人姓名","被保人证件号","被保人姓名","保单所属分公司","保单号","险种名称","保险起期","保险终期","保单状态","已缴保费",
            "业务员姓名","业务员工号"],
        p_data:[3,3,3,3,3,3,3,3,3,3,3,3,3],
        //赔案清单
        clain:["被保险人证件号","被保险人姓名","赔案所属分公司","赔案号","报案号","出险类型","索赔事故性质","赔付结论","赔付金额","出险日期",
            "报案日期","立案日期","结案日期","保单号","险种名称","领款人证件号","领款人姓名","支付方式","银行账号","开户行","立案人姓名/工号","理赔初审姓名/工号",
            "理赔复核姓名/工号","调查姓名/工号","调查复核姓名/工号","业务员姓名/工号"],
        c_data:[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4]
    },
    payee:{//领款人
        l_name:["赔案清单"],
        //赔案清单
        clain:["领款人证件号","领款人姓名","被保险人证件号","被保险人姓名","赔案所属分公司","赔案号","报案号","出险类型","索赔事故性质","赔付结论","赔付金额","出险日期",
            "报案日期","立案日期","结案日期","保单号","险种名称","支付方式","银行账号","开户行","立案人姓名/工号","理赔初审姓名/工号",
            "理赔复核姓名/工号","调查姓名/工号","调查复核姓名/工号","业务员姓名/工号"],
        c_data:[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]
    }
};
var l_select=$("#listType");
// var l_select=document.getElementById("listType");
function selectP(obj){
    var value = obj.options[obj.options.selectedIndex].value;
    switch(value){
        case "被保险人":
            selectL_I();
            break;
        case "投保人":
            console.log(2);
            break;
    }
}
function selectL_I(){
    for(var i=0;i<data.insured.l_name.length;i++){
        var option="<option>"+data.insured.l_name[i]+"</option>";
        l_select.append(option);
        console.log(option)
    }
    console.log(l_select);
}

function query(){
    var tbody=$("#list_body");
    for(var i=0;i<data.insured.p_arr.length;i++){
        var tr="<tr></tr>"
        var datas=data.insured.p_arr[i];
        // for(var j=0;j<datas.length;j++){
        //     console.log(j,datas[j]);
        //     var th="<th>"+datas[j]+"</th>";
        //     tr.append(th);
        //     // if(i<1){
        //     //
        //     // }
        //     // else{
        //     //     var td="<td>"+datas[j]+"</td>";
        //     //     tr.append(td);
        //     // }
        // }
        tbody.append(tr);
    }
}
function resetSelect(){
    $("#tableName").val("");
    $("#rowKey").val("");
    $("#context_body_header").html("");
    $("#context_body_manager").html("");
}



