//弹出窗口_选择部门
function AdvancedSearch_Department(keyword) {
    var url = "../../Component/AdvancedSearch/Department_List.aspx?keyword=" + escape(keyword);
    asyncbox.open({
        id: 'win_select',
        url: url,
        modal: true,
        width: 400,
        height: 400,
        title: '选择部门'
    });
}
//弹出窗口_选择存货分类
function AdvancedSearch_InventoryClass(keyword) {
    var url = "../../Component/AdvancedSearch/InventoryClass_List.aspx?keyword=" + escape(keyword);
    asyncbox.open({
        id: 'win_select',
        url: url,
        modal: true,
        width: 400,
        height: 400,
        title: '选择存货分类'
    });
}
//弹出窗口_选择客户分类
function AdvancedSearch_CustomerClass(keyword) {
    var url = "../../Component/AdvancedSearch/CustomerClass_List.aspx?keyword=" + escape(keyword);
    asyncbox.open({
        id: 'win_select',
        url: url,
        modal: true,
        width: 400,
        height: 400,
        title: '选择客户分类'
    });
}
//弹出窗口_选择供应商分类
function AdvancedSearch_VendorClass(keyword) {
    var url = "../../Component/AdvancedSearch/VendorClass_List.aspx?keyword=" + escape(keyword);
    asyncbox.open({
        id: 'win_select',
        url: url,
        modal: true,
        width: 400,
        height: 400,
        title: '选择供应商分类'
    });
}

//弹出窗口_选择收发类型
function AdvancedSearch_IOType(keyword,iot_flag) {
    var url = "../../Component/AdvancedSearch/IOType_List.aspx?keyword=" + escape(keyword) + "&iot_flag=" + iot_flag;
    asyncbox.open({
        id: 'win_select',
        url: url,
        modal: true,
        width: 400,
        height: 400,
        title: '选择收发类型'
    });
}
//弹出窗口_选择费用
function AdvancedSearch_Cost(keyword) {
    var url = "../../Component/AdvancedSearch/Cost_List.aspx?keyword=" + escape(keyword);
    var win_style = "center:yes;resizable:no;status:no;dialogHeight:400px;dialogWidth:400px";
    var r = window.showModalDialog(url, null, win_style);
    if (r != null) {
        var id = r;
        SearchService_Cost(id);
    }
}
//弹出窗口_选择自定义项
function AdvancedSearch_DefineItem(keyword, di_code, element_id) {
    if ($F(element_id).readOnly == true) {
        return;
    }
    var url = "../../Component/AdvancedSearch/DefineItem_Select.aspx?keyword=" + escape(keyword)
        + "&di_code=" + di_code + "&element_id=" + element_id;
    var win_style = "center:yes;resizable:no;status:no;dialogHeight:500px;dialogWidth:600px";
    asyncbox.open({
        id: 'win_select',
        url: url,
        modal: true,
        width: 600,
        height: 450,
        title: '自定义项'
    });
}
//弹出窗口_选择批次
function AdvancedSearch_Batch(keyword) {
    var wh_id = $("#d_wh_id").val();
    var i_id = $("#i_id").val();
    var free1 = $("#free1").val();
    var free2 = $("#free2").val();
    var url = "../../Component/AdvancedSearch/Batch_Select.aspx?keyword=" + escape(keyword)
            + "&wh_id=" + wh_id + "&i_id=" + i_id
            + "&free1=" + escape(free1) + "&free2=" + escape(free2);
    asyncbox.open({
        id: 'win_select',
        url: url,
        modal: true,
        width: 600,
        height: 450,
        title: '选择批次'
    });
    /*
    var win_style = "center:yes;resizable:no;status:no;dialogHeight:500px;dialogWidth:700px";
    var r = window.showModalDialog(url, null, win_style);
    if (r != null) {
        $("#batch").val(r[0]);
        $("#quantity").val(r[1]);
        if ($("#aunit").val() != "") {
            $("#num").val(r[2]);
        }
    }*/
}