/**
 *添加扩展分类[+]
 */
function addMoreCat(conObj) {
    var sel = document.createElement("SELECT");
    var selCat = document.forms['myform'].elements['cat_id'];
    var browser = navigator.userAgent;
    for (i = 0; i < selCat.length; i++) {
        var opt = document.createElement("OPTION");
        opt.text = selCat.options[i].text;
        opt.value = selCat.options[i].value;
        if (browser.indexOf("MSIE") > 0) {
            sel.add(opt);
        } else {
            sel.appendChild(opt);
        }
    }
    conObj.appendChild(sel);
    sel.name = "more_cat[]";
    sel.style.display = "inline";
}
//商品导出
function do_export() {
    var keyword = $("[name='keyword']").val();
    var catid = $("[name='catid']").val();
    var brandid = $("[name='brandid']").val();
    var suppliersid = $("[name='suppliersid']").val();
    var url = APP + "Shop/Goods/export.html" + "&keyword=" + keyword + "&catid=" + catid + "&brandid=" + brandid + "&suppliersid=" + suppliersid;
    window.location.href = url;
}
//品牌搜索
function search_brand() {
    var keyword = $('#search_brand_keyword').val();
    var query = new Object();
    query.keyword = keyword;
    var url = APP + "Shop/Goods/search_brand.html"
    $.ajax({
        url: url,
        data: query,
        type: "post",
        dataType: "json",
        success: function (obj) {
            if (obj.status) {
                $('#brand_id').html(obj.options);
                return false;
            } else {
                return false;
            }
        }
    });
}
//品牌搜索
function psearch_brand() {
    var keyword = $('#search_brand_keyword').val();
    var query = new Object();
    query.keyword = keyword;
    var url = APP + "Supplier/PurGoods/search_brand.html"
    $.ajax({
        url: url,
        data: query,
        type: "post",
        dataType: "json",
        success: function (obj) {
            if (obj.status) {
                $('#brand_id').html(obj.options);
                return false;
            } else {
                return false;
            }
        }
    });
}
function addunit(){
    $('#addunit').attr('style',"display:''");
}
/**
 * 申请调价
 */
function modify_price(id,packageid){
    $.openUrl(APP+'Supplier/PurGoods/modify_price/id/'+id+'/packageid/'+packageid+'.html','申请调价',id, '350', function () {
        return false;
    }, function () {
        return false;
    });
}