...
|
...
|
@@ -109,10 +109,9 @@ $(document).on('click', '.delete', function () { |
|
|
new common.dropDown({el: "#shopId", ajax: "shopsRest"});
|
|
|
new common.dropDown({el: "#brandId", ajax: "brand"});
|
|
|
/**
|
|
|
* 列表
|
|
|
* 商品VIP列表
|
|
|
* @type {common.grid}
|
|
|
*/
|
|
|
|
|
|
var g = new common.grid({
|
|
|
el: '#productVipTable',
|
|
|
parms: function () {
|
...
|
...
|
@@ -124,14 +123,15 @@ var g = new common.grid({ |
|
|
};
|
|
|
},
|
|
|
columns: [
|
|
|
// {
|
|
|
// display: "复选框",
|
|
|
// render: function (item) {
|
|
|
// var HtmArr = [];
|
|
|
// HtmArr.push('<label><input name="choose" type="checkbox" value="'+item.productSKN+'"/></label>');
|
|
|
// return HtmArr.join('');
|
|
|
// }
|
|
|
// },
|
|
|
{
|
|
|
display: "复选框",
|
|
|
width: 90,
|
|
|
render: function (item) {
|
|
|
var HtmArr = [];
|
|
|
HtmArr.push('<label><input name="choose" type="checkbox" value="'+item.productSKN+'"/></label>');
|
|
|
return HtmArr.join('');
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
display: "SKN",
|
|
|
name: "productSKN"
|
...
|
...
|
@@ -173,118 +173,93 @@ var g = new common.grid({ |
|
|
}]
|
|
|
});
|
|
|
g.init('/vip/queryProductVipList');
|
|
|
|
|
|
$("#flowShop").click(function() {
|
|
|
if(!$('#all').is(':checked')) {
|
|
|
alert("请勾选复选框!");
|
|
|
return;
|
|
|
}
|
|
|
var params= {
|
|
|
productSkn: common.util.__input('productSkn'),
|
|
|
shopId: common.util.__input('shopId'),
|
|
|
brandId: common.util.__input('brandId'),
|
|
|
productVipStatus: common.util.__input('productVipStatus'),
|
|
|
changeStatus: 0
|
|
|
};
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认批量修改商品VIP状态为跟随店铺?",
|
|
|
function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/vip/batchChangeStatus',
|
|
|
data: params
|
|
|
}, function(res) {
|
|
|
g.reload();
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
$("#open").click(function() {
|
|
|
if(!$('#all').is(':checked')) {
|
|
|
alert("请勾选复选框!");
|
|
|
return;
|
|
|
}
|
|
|
var params= {
|
|
|
productSkn: common.util.__input('productSkn'),
|
|
|
shopId: common.util.__input('shopId'),
|
|
|
brandId: common.util.__input('brandId'),
|
|
|
productVipStatus: common.util.__input('productVipStatus'),
|
|
|
changeStatus: 1
|
|
|
};
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认批量修改商品VIP状态为开启?",
|
|
|
function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/vip/batchChangeStatus',
|
|
|
data: params
|
|
|
}, function(res) {
|
|
|
g.reload();
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
$("#close").click(function() {
|
|
|
if(!$('#all').is(':checked')) {
|
|
|
alert("请勾选复选框!");
|
|
|
/**
|
|
|
* 批量修改商品VIP状态
|
|
|
* @param status
|
|
|
*/
|
|
|
function batchChangeStatus(status) {
|
|
|
var chk_value =[];
|
|
|
$('input[name="choose"]:checked').each(function(){
|
|
|
chk_value.push($(this).val());
|
|
|
});
|
|
|
if(chk_value.length==0) {
|
|
|
alert("你还没有选择任何SKN!");
|
|
|
return;
|
|
|
}
|
|
|
var params= {
|
|
|
productSkn: common.util.__input('productSkn'),
|
|
|
shopId: common.util.__input('shopId'),
|
|
|
brandId: common.util.__input('brandId'),
|
|
|
productVipStatus: common.util.__input('productVipStatus'),
|
|
|
changeStatus: 2
|
|
|
sknList: chk_value.toString(),
|
|
|
changeStatus: status
|
|
|
};
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认批量修改商品VIP状态为关闭?",
|
|
|
"确认批量修改商品VIP状态?",
|
|
|
function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/vip/batchChangeStatus',
|
|
|
data: params
|
|
|
}, function(res) {
|
|
|
g.reload();
|
|
|
$("[name='all']").removeAttr("checked");
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 搜索商品VIP
|
|
|
*/
|
|
|
$("#searchFilter").click(function() {
|
|
|
g.reload(1);
|
|
|
$("[name='all']").removeAttr("checked");
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 当个修改商品VIP状态
|
|
|
* @param productSkn
|
|
|
* @param status
|
|
|
*/
|
|
|
function changeStatus(productSkn,status) {
|
|
|
var param = {
|
|
|
productSkn: productSkn,
|
|
|
productVipStatus: status
|
|
|
};
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认修改状态?",
|
|
|
"确认修改商品VIP状态?",
|
|
|
function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/vip/changeStatus',
|
|
|
data: param
|
|
|
}, function(res) {
|
|
|
g.reload();
|
|
|
$("[name='all']").removeAttr("checked");
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// function DoCheck()
|
|
|
// {
|
|
|
// var ch=document.getElementsByName("choose");
|
|
|
// if(document.getElementsByName("all")[0].checked==true)
|
|
|
// {
|
|
|
// for(var i=0;i<ch.length;i++)
|
|
|
// {
|
|
|
// ch[i].checked=true;
|
|
|
// }
|
|
|
// }else{
|
|
|
// for(var i=0;i<ch.length;i++)
|
|
|
// {
|
|
|
// ch[i].checked=false;
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// window.DoCheck = DoCheck;
|
|
|
/**
|
|
|
* 全选、反选
|
|
|
* @constructor
|
|
|
*/
|
|
|
function DoCheck()
|
|
|
{
|
|
|
var ch=document.getElementsByName("choose");
|
|
|
if(document.getElementsByName("all")[0].checked==true)
|
|
|
{
|
|
|
for(var i=0;i<ch.length;i++)
|
|
|
{
|
|
|
ch[i].checked=true;
|
|
|
}
|
|
|
}else{
|
|
|
for(var i=0;i<ch.length;i++)
|
|
|
{
|
|
|
ch[i].checked=false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
window.DoCheck = DoCheck;
|
|
|
window.changeStatus = changeStatus;
|
|
|
/**
|
|
|
* 切换TAB
|
|
|
* @param tab
|
|
|
*/
|
|
|
function changeTab(tab) {
|
|
|
if(tab == 1){
|
|
|
$("#shopVipTab").show();
|
...
|
...
|
@@ -294,4 +269,5 @@ function changeTab(tab) { |
|
|
$("#productVipTab").show();
|
|
|
}
|
|
|
}
|
|
|
window.changeTab = changeTab; |
|
|
\ No newline at end of file |
|
|
window.changeTab = changeTab;
|
|
|
window.batchChangeStatus = batchChangeStatus; |
|
|
\ No newline at end of file |
...
|
...
|
|