...
|
...
|
@@ -37,8 +37,8 @@ var ENUM = { |
|
|
},
|
|
|
isVIP: {
|
|
|
"Y": "是",
|
|
|
"N": "否",
|
|
|
"B": "品牌设置"
|
|
|
"N": "否",
|
|
|
"B": "品牌设置"
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
@@ -75,6 +75,8 @@ var t = new common.tab({ |
|
|
|
|
|
if (columnname == 1 || columnname == 2) {
|
|
|
editPostion = '#position9';
|
|
|
} else {
|
|
|
editPostion = '';
|
|
|
}
|
|
|
|
|
|
g.init($("#gridurl").val());
|
...
|
...
|
@@ -163,7 +165,8 @@ var g = new common.grid({ |
|
|
|
|
|
}
|
|
|
}, {
|
|
|
display: '商品信息',width:'30%',
|
|
|
display: '商品信息',
|
|
|
width: '30%',
|
|
|
render: function(item) {
|
|
|
var productName = item.productName ? item.productName : '',
|
|
|
brandName = item.brandName ? item.brandName : '',
|
...
|
...
|
@@ -338,7 +341,12 @@ function shelveModal(title, html) { |
|
|
g.reload();
|
|
|
}, 'growl-success');
|
|
|
} else {
|
|
|
e.$tip(res.data.message);
|
|
|
//e.$tip(res.data.message);
|
|
|
var html = '';
|
|
|
$.each(res.data.data, function(key, value) {
|
|
|
html += key + ':' + value + '<br>';
|
|
|
});
|
|
|
e.$tip(html);
|
|
|
}
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -398,31 +406,32 @@ var shelveTable = new common.grid({ |
|
|
display: 'SKC上架操作(状态)',
|
|
|
render: function(item) {
|
|
|
if (item.status == 0) {
|
|
|
return '<a class="btn btn-success btnskc" data-type="1" data-index="'+item.__index+'" href="javascript:;">点击上架</a>';
|
|
|
return '<a class="btn btn-success btnskc" data-type="1" data-index="' + item.__index + '" href="javascript:;">点击上架</a>';
|
|
|
} else {
|
|
|
return '<a class="btn btn-danger btnskc" data-type="0" data-index="'+item.__index+'" href="javascript:;">点击下架</a>';
|
|
|
return '<a class="btn btn-danger btnskc" data-type="0" data-index="' + item.__index + '" href="javascript:;">点击下架</a>';
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
display: '<div class="subhhead"><span>SKU</span><span>尺码</span><span>库存</span><span>SKU上架操作</span><span>SKU上架操作</span></div>',
|
|
|
render: function(item){
|
|
|
render: function(item) {
|
|
|
console.log(item);
|
|
|
return common.util.__template2($("#template2").html(),item)
|
|
|
return common.util.__template2($("#template2").html(), item)
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
/*代码优惠*/
|
|
|
var goodsList={},shelveLayer=null;
|
|
|
var goodsList = {},
|
|
|
shelveLayer = null;
|
|
|
//单个sku,skc上下架
|
|
|
$('#basicTable').on('click', '.shelve-btn', function() {
|
|
|
var item=g.rows[$(this).data("index")];
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
$(that).addClass('disabled');
|
|
|
|
|
|
getdata(item.productSkn,function(res){
|
|
|
getdata(item.productSkn, function(res) {
|
|
|
shelveLayer = common.dialog.open({
|
|
|
title: '上/下架',
|
|
|
width: 900,
|
...
|
...
|
@@ -430,78 +439,86 @@ $('#basicTable').on('click', '.shelve-btn', function() { |
|
|
});
|
|
|
|
|
|
$(that).removeClass('disabled');
|
|
|
goodsList=res.data.goodsList;
|
|
|
goodsList = res.data.goodsList;
|
|
|
shelveTable.init(goodsList);
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
function getdata(Skn,callback){
|
|
|
function getdata(Skn, callback) {
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/netsale/getdata',
|
|
|
data: {
|
|
|
param: Skn
|
|
|
}
|
|
|
}, function(res) {
|
|
|
callback&&callback(res);
|
|
|
},true);
|
|
|
callback && callback(res);
|
|
|
}, true);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on("click",".btnskc",function(){
|
|
|
var item=goodsList[$(this).data("index")];
|
|
|
$(document).on("click", ".btnskc", function() {
|
|
|
var item = goodsList[$(this).data("index")];
|
|
|
console.log(item);
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/product/updateGoodsStatus',
|
|
|
data: {productSkc:item.productSkc,targetStatus:item.status}
|
|
|
url: '/goods/product/updateGoodsStatus',
|
|
|
data: {
|
|
|
productSkc: item.productSkc,
|
|
|
targetStatus: item.status ? 0 : 1
|
|
|
}
|
|
|
}, function(res) {
|
|
|
if (res.code == 200) {
|
|
|
getdata(item.productSkc,function(res){
|
|
|
goodsList=res.data.goodsList;
|
|
|
shelveTable.reload();
|
|
|
getdata(item.productSkn, function(res) {
|
|
|
goodsList = res.data.goodsList;
|
|
|
shelveTable.init(res.data.goodsList);
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
|
|
|
$(document).on("click",".btnsku",function(){
|
|
|
var item=goodsList[$(this).data("index")]
|
|
|
var item1=item.goodsSizeList[$(this).data("subindex")];
|
|
|
$(document).on("click", ".btnsku", function() {
|
|
|
var item = goodsList[$(this).data("index")]
|
|
|
var item1 = item.goodsSizeList[$(this).data("subindex")];
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/product/updateProductSkuStatus',
|
|
|
data: {productSkc:item1.productSku,targetStatus:item.status}
|
|
|
url: '/goods/product/updateProductSkuStatus',
|
|
|
data: {
|
|
|
productSku: item1.productSku,
|
|
|
targetStatus: item1.status ? 0 : 1
|
|
|
}
|
|
|
}, function(res) {
|
|
|
if (res.code == 200) {
|
|
|
getdata(item.productSkc,function(res){
|
|
|
goodsList=res.data.goodsList;
|
|
|
getdata(item.productSkn, function(res) {
|
|
|
goodsList = res.data.goodsList;
|
|
|
console.log(goodsList);
|
|
|
shelveTable.reload();
|
|
|
shelveTable.init(res.data.goodsList);
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
|
|
|
$(document).on("change",".wqt_checkbox,.wqt_all",function(){
|
|
|
var _count1=0,_count2=0;
|
|
|
$.each(g.selected,function(index,item){
|
|
|
console.log(item.status);
|
|
|
$(document).on("change", ".wqt_checkbox,.wqt_all", function() {
|
|
|
var _count1 = 0,
|
|
|
_count2 = 0;
|
|
|
$.each(g.selected, function(index, item) {
|
|
|
/*添加兼容逻辑*/
|
|
|
if(item.status){
|
|
|
_count1++;//上
|
|
|
}else{
|
|
|
_count2++;//下
|
|
|
if (item.status == 8 || item.status == 3 || item.status == 2 || item.status == 0) {
|
|
|
_count1++; //上
|
|
|
} else {
|
|
|
_count2++; //下
|
|
|
}
|
|
|
});
|
|
|
if(_count2==g.selected.length){
|
|
|
$("#offshelve").addClass("btn-info").removeClass("btn-default").prop("disabled",false);
|
|
|
}else{
|
|
|
$("#offshelve").addClass("btn-default").removeClass("btn-info").prop("disabled",true);
|
|
|
|
|
|
if (_count1 == g.selected.length) {
|
|
|
$('#onshelve').removeClass('disabled');
|
|
|
} else {
|
|
|
$('#onshelve').addClass('disabled');
|
|
|
}
|
|
|
if(_count1==g.selected.length){
|
|
|
$("#onshelve").addClass("btn-info").removeClass("btn-default").prop("disabled",false);
|
|
|
}else{
|
|
|
$("#onshelve").addClass("btn-default").removeClass("btn-info").prop("disabled",true);
|
|
|
|
|
|
if (_count2 == g.selected.length) {
|
|
|
$('#offshelve').removeClass('disabled');
|
|
|
} else {
|
|
|
$('#offshelve').addClass('disabled');
|
|
|
}
|
|
|
}) |
|
|
\ No newline at end of file |
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|