...
|
...
|
@@ -17,7 +17,8 @@ var g = new common.grid({ |
|
|
productSkn: common.util.__input('productSkn'),
|
|
|
shopId: common.util.__input('shopId'),
|
|
|
brandId: common.util.__input('brandId'),
|
|
|
vipDiscountType: common.util.__input('vipDiscountType')
|
|
|
vipDiscountType: common.util.__input('vipDiscountType'),
|
|
|
vipReturnCoinStatus: common.util.__input('vipReturnCoinStatus')
|
|
|
};
|
|
|
},
|
|
|
columns: [
|
...
|
...
|
@@ -57,13 +58,29 @@ var g = new common.grid({ |
|
|
return HtmArr.join('');
|
|
|
}
|
|
|
}, {
|
|
|
display: "VIP返币状态",
|
|
|
render: function (item) {
|
|
|
var HtmArr = [];
|
|
|
if(item.vipReturnCoinStatus == 0){
|
|
|
HtmArr.push('<label>关闭</label>');
|
|
|
}else{
|
|
|
HtmArr.push('<label>开启</label>');
|
|
|
}
|
|
|
return HtmArr.join('');
|
|
|
}
|
|
|
}, {
|
|
|
display: '操作',
|
|
|
render: function (item) {
|
|
|
var HtmArr = [];
|
|
|
if(item.vipDiscountType == 3){
|
|
|
HtmArr.push('<a onclick="changeStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启</a>');
|
|
|
HtmArr.push('<a onclick="changeStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启VIP价</a>');
|
|
|
}else{
|
|
|
HtmArr.push('<a onclick="changeStatus('+item.productSKN+',2)" href="javascript:;" class="btn btn-danger">关闭VIP价</a>');
|
|
|
}
|
|
|
if(item.vipReturnCoinStatus == 0){
|
|
|
HtmArr.push('<a onclick="changeReturnCoinStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启VIP返币</a>');
|
|
|
}else{
|
|
|
HtmArr.push('<a onclick="changeStatus('+item.productSKN+',2)" href="javascript:;" class="btn btn-danger">关闭</a>');
|
|
|
HtmArr.push('<a onclick="changeReturnCoinStatus('+item.productSKN+',0)" href="javascript:;" class="btn btn-danger">关闭VIP返币</a>');
|
|
|
}
|
|
|
return HtmArr.join('');
|
|
|
}
|
...
|
...
|
@@ -101,6 +118,37 @@ function batchChangeStatus(status) { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量修改商品VIP返币状态
|
|
|
* @param status
|
|
|
*/
|
|
|
function batchChangeReturnCoinStatus(status) {
|
|
|
console.log(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= {
|
|
|
sknList: chk_value.toString(),
|
|
|
vipReturnCoinStatus: status
|
|
|
};
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认批量修改商品VIP返币状态?",
|
|
|
function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/vip/batchChangeReturnCoinStatus',
|
|
|
data: params
|
|
|
}, function(res) {
|
|
|
g.reload();
|
|
|
$("[name='all']").removeAttr("checked");
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 搜索商品VIP
|
|
|
*/
|
|
|
$("#searchFilter").click(function() {
|
...
|
...
|
@@ -132,6 +180,31 @@ function changeStatus(productSkn,status) { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 单个修改商品VIP返币状态
|
|
|
* @param productSkn
|
|
|
* @param status
|
|
|
*/
|
|
|
function changeReturnCoinStatus(productSkn,status) {
|
|
|
console.log(status);
|
|
|
var param = {
|
|
|
productSkn: productSkn,
|
|
|
vipReturnCoinStatus: status
|
|
|
};
|
|
|
console.log(param);
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认修改商品VIP返币状态?",
|
|
|
function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/vip/changeReturnCoinStatus',
|
|
|
data: param
|
|
|
}, function(res) {
|
|
|
g.reload();
|
|
|
$("[name='all']").removeAttr("checked");
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 全选、反选
|
|
|
* @constructor
|
|
|
*/
|
...
|
...
|
@@ -168,3 +241,5 @@ function changeTab(tab) { |
|
|
}
|
|
|
window.changeTab = changeTab;
|
|
|
window.batchChangeStatus = batchChangeStatus;
|
|
|
window.changeReturnCoinStatus = changeReturnCoinStatus;
|
|
|
window.batchChangeReturnCoinStatus = batchChangeReturnCoinStatus; |
...
|
...
|
|