Authored by liyalin

Merge remote-tracking branch 'origin/dev_店铺vip设置' into dev_店铺vip设置

... ... @@ -30,13 +30,8 @@ module.exports = {
title: "修改商品VIP状态",
url: '/vip/batchChangeStatus',
params: {
productSkn: {type: Number},
shopId: {type: Number},
brandId: {type: Number},
productVipStatus: {type: Number},
page: {type: Number},
sknList: {type: String},
changeStatus: {type: Number}
}
},
shopVipTrigger: {
... ...
... ... @@ -35,11 +35,11 @@
</div>
</div>
</div>
<div>
<label><input name="all" id="all" type="checkbox" value=""/>选中当前页</label>
<a id="flowShop" href="javascript:;" class="btn btn-info">跟随店铺</a>
<a id="open" href="javascript:;" class="btn btn-info">开启</a>
<a id="close" href="javascript:;" class="btn btn-info">关闭</a>
<div style="margin-left:10px;margin-bottom: 10px">
<label><input name="all" id="all" type="checkbox" onclick="DoCheck()" value=""/>选中当前页</label>
<a onclick="batchChangeStatus(0)" href="javascript:;" class="btn btn-primary">跟随店铺</a>
<a onclick="batchChangeStatus(1)" href="javascript:;" class="btn btn-info">开启</a>
<a onclick="batchChangeStatus(2)" href="javascript:;" class="btn btn-danger">关闭</a>
</div>
<div class="panel panel-primary-head">
<div class="dataTab_wrapper" id="productVipTable" ></div>
... ...
... ... @@ -110,10 +110,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 () {
... ... @@ -125,14 +124,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"
... ... @@ -174,118 +174,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();
... ... @@ -295,4 +270,5 @@ function changeTab(tab) {
$("#productVipTab").show();
}
}
window.changeTab = changeTab;
\ No newline at end of file
window.changeTab = changeTab;
window.batchChangeStatus = batchChangeStatus;
... ...