Index.js 1.21 KB
'use strict';
var $ = require('jquery'),
    common = require('../../../common/common');

new common.dropDown({
    el: '#shop',
    ajax: 'shopsRest'
});

new common.dropDown({
    el: '#brand',
    ajax: 'brand',
    params:function(){
        return {userLimitFlag:true};
    }
});

//多级菜单
var tabTree = new common.tabTree("#sortTree", {status: 1, sortLevel: 1});
tabTree.init();

/***********************批量导出***********************/
$("#batchExportPrice").click(function(){
    var select = tabTree.getAddress();
    var shopId = common.util.__input("shop");
    var brandId = common.util.__input("brand");
    //if(!shopId && !brandId && !(select[0] && select[0].id)){
    //    alert("请至少选择一个筛选条件后再导出!");
    //    return false;
    //}
    var getResult=function(){
        return {
            shop_id: shopId,
            brand_id: brandId,
            stock: 1,
            status: 1,
            max_sort_id: select[0] ? select[0].id : "",
            middle_sort_id: select[1] ? select[1].id : "",
            small_sort_id: select[2] ? select[2].id : ""
        }
    }
    window.open("/ajax/down?queryConf=" + JSON.stringify(getResult()) + "&type=productPriceExport");
});