Authored by 王钱钧

修改货到付款限制功能的bug

... ... @@ -45,7 +45,7 @@ tab.prototype = {
g.active = $(this).find("a").attr("columnname");
g.key = $(this).find("a").attr("key");
g.value = $(this).find("a").attr("value");
g.__index__ = $(this).index();
this._init = p._init;
callback && callback.call(this);
});
... ... @@ -87,14 +87,22 @@ tab.prototype = {
li.append(a);
g.tab.append(li);
});
g.__tab = g.tab.html();
g.tab.html(util.__template(g.tab.html(), data || {}));
},
load: function(data) {
var g = this,
p = this.options;
g.tab.html(util.__template(g.tab.html(), data || {}));
g.tab.html(util.__template(g.__tab, data || {}));
if (g.__index__ != undefined) {
$('li',p.el).removeClass('active');
$('li',p.el).eq(g.__index__).addClass('active');
}
}
}
... ...
... ... @@ -18,7 +18,7 @@ var ENUM = {
}
};
var currentSelItem;
var currentSelItem, currentTab;
/*下拉选择*/
common.dropDown({
... ... @@ -40,28 +40,8 @@ var t = new common.tab({
el: "#basicTab",
click: function () {
var columnname = $(this).find('a').attr('columnname');
if (columnname == 'all') {
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = false;
g.options.columns[7].hidden = true;
} else if (columnname == 100) {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = false;
} else {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = false;
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = true;
}
currentTab = columnname;
layoutGridCloum(columnname);
g.init('/payDelivery/queryPayDeliveryList');
},
columns: [{
... ... @@ -86,7 +66,7 @@ var g = new common.grid({
brandId: common.util.__input("brandId"),
isPayDelivery: common.util.__input("isPayDelivery"),
productSkn: common.util.__input("productSkn"),
status: (t.active && t.active != 'all') ? t.active : 400
status: (currentTab && currentTab != 'all') ? currentTab : 400
};
},
columns: [{
... ... @@ -158,6 +138,31 @@ var g = new common.grid({
});
g.init('/payDelivery/queryPayDeliveryList');
function layoutGridCloum(tabname) {
if (tabname == 'all') {
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = false;
g.options.columns[7].hidden = true;
} else if (tabname == 100) {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = false;
} else {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = false;
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = true;
}
}
// tab初始化
var loadTab = function () {
t.active = undefined;
... ... @@ -172,17 +177,33 @@ var loadTab = function () {
}, 800);
};
var reloadTab = function () {
t.active = undefined;
setTimeout(function () {
common.util.__ajax({
url: "/payDelivery/queryCountProductPayDelivery",
data: g.options.parms()
}, function (res) {
var __dt = $.extend({}, ENUM.tips, res.data);
t.load(__dt);
}, true);
}, 800);
};
loadTab();
// 筛选
$(document).on('click', "#filter-btn", function () {
loadTab();
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = false;
g.options.columns[7].hidden = true;
//loadTab();
reloadTab();
//g.options.columns[2].hidden = false;
//g.options.columns[3].hidden = true;
//g.options.columns[4].hidden = true;
//g.options.columns[5].hidden = true;
//g.options.columns[6].hidden = false;
//g.options.columns[7].hidden = true;
layoutGridCloum(currentTab);
g.reload();
//g.init('/payDelivery/queryPayDeliveryList');
});
$(document).on('click', ".edit-class-btn", function () {
... ...