...
|
...
|
@@ -631,16 +631,20 @@ function shelveModal(title, html) { |
|
|
}
|
|
|
}
|
|
|
if (!isValidate&&nocancel) {
|
|
|
var checkStorageParam = {'type' : 'skn', 'paramsStr' : JSON.stringify(batchOperateShelve)};
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/product/updateProductSknTimingInfo',
|
|
|
data: data
|
|
|
}, function (res) {
|
|
|
batchOperateShelve = [] ;
|
|
|
batchShelveProduct = [];
|
|
|
shelveLayer.close();
|
|
|
loadtab();
|
|
|
g.reload();
|
|
|
});
|
|
|
url: '/product/checkOfflineStorage',
|
|
|
data: checkStorageParam
|
|
|
}, function(res) {
|
|
|
if (res.data != '' && type == 7) { //当下架操作时 校验线下店存在库存
|
|
|
var existStorageSkn = res.data;
|
|
|
common.dialog.confirm('警告', "此商品 " + existStorageSkn + " 正在线下店销售,下架可能会影响线下店商品正常购买!!!是否确定下架", function() {
|
|
|
statusOprate.updateProductSknTimingInfo(data, shelveLayer);
|
|
|
});
|
|
|
} else {
|
|
|
statusOprate.updateProductSknTimingInfo(data, shelveLayer);
|
|
|
}
|
|
|
}, true);
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -779,41 +783,96 @@ function getdata(Skn, callback) { |
|
|
|
|
|
$(document).on("click", ".btnskc", function () {
|
|
|
var item = goodsList[$(this).data("index")];
|
|
|
var checkStorageParam = {};
|
|
|
checkStorageParam.type = 'skc';
|
|
|
var params = [];
|
|
|
params.push(item.productSkc);
|
|
|
checkStorageParam.paramsStr = JSON.stringify(params);
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/product/updateGoodsStatus',
|
|
|
data: {
|
|
|
productSkc: item.productSkc,
|
|
|
targetStatus: item.status ? 0 : 1
|
|
|
}
|
|
|
}, function (res) {
|
|
|
if (res.code == 200) {
|
|
|
getdata(item.productSkn, function (res) {
|
|
|
goodsList = res.data.goodsList;
|
|
|
shelveTable.init(res.data.goodsList);
|
|
|
});
|
|
|
// g.init("/goods/netsale/getList");
|
|
|
}
|
|
|
})
|
|
|
url: '/product/checkOfflineStorage',
|
|
|
data: checkStorageParam
|
|
|
}, function(res) {
|
|
|
if (res.data != '' && item.status == 1) { //当下架操作时 校验线下店存在库存
|
|
|
common.dialog.confirm('警告', "此商品正在线下店销售,下架可能会影响线下店商品正常购买!!!是否确定下架", function() {
|
|
|
statusOprate.updateSkcStatus(item);
|
|
|
});
|
|
|
} else {
|
|
|
statusOprate.updateSkcStatus(item);
|
|
|
}
|
|
|
}, true);
|
|
|
});
|
|
|
|
|
|
|
|
|
var statusOprate = {
|
|
|
updateSkcStatus : function (item) {
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/product/updateGoodsStatus',
|
|
|
data: {
|
|
|
productSkc: item.productSkc,
|
|
|
targetStatus: item.status ? 0 : 1
|
|
|
}
|
|
|
}, function(res) {
|
|
|
if (res.code == 200) {
|
|
|
getdata(item.productSkn, function (res) {
|
|
|
goodsList = res.data.goodsList;
|
|
|
shelveTable.init(res.data.goodsList);
|
|
|
});
|
|
|
// g.init("/goods/netsale/getList");
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
updateProductSkuStatus : function (item, item1) {
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/product/updateProductSkuStatus',
|
|
|
data: {
|
|
|
productSku: item1.productSku,
|
|
|
targetStatus: item1.status ? 0 : 1
|
|
|
}
|
|
|
}, function (res) {
|
|
|
if (res.code == 200) {
|
|
|
getdata(item.productSkn, function (res) {
|
|
|
goodsList = res.data.goodsList;
|
|
|
console.log(goodsList);
|
|
|
shelveTable.init(res.data.goodsList);
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
updateProductSknTimingInfo : function (data, shelveLayer) {
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/product/updateProductSknTimingInfo',
|
|
|
data: data
|
|
|
}, function (res) {
|
|
|
batchOperateShelve = [] ;
|
|
|
batchShelveProduct = [];
|
|
|
shelveLayer.close();
|
|
|
loadtab();
|
|
|
g.reload();
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
$(document).on("click", ".btnsku", function () {
|
|
|
var item = goodsList[$(this).data("index")]
|
|
|
var item1 = item.goodsSizeList[$(this).data("subindex")];
|
|
|
|
|
|
var checkStorageParam = {};
|
|
|
checkStorageParam.type = 'sku';
|
|
|
var params = [];
|
|
|
params.push(item1.productSku);
|
|
|
checkStorageParam.paramsStr = JSON.stringify(params);
|
|
|
common.util.__ajax({
|
|
|
url: '/goods/product/updateProductSkuStatus',
|
|
|
data: {
|
|
|
productSku: item1.productSku,
|
|
|
targetStatus: item1.status ? 0 : 1
|
|
|
}
|
|
|
}, function (res) {
|
|
|
if (res.code == 200) {
|
|
|
getdata(item.productSkn, function (res) {
|
|
|
goodsList = res.data.goodsList;
|
|
|
console.log(goodsList);
|
|
|
shelveTable.init(res.data.goodsList);
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
url: '/product/checkOfflineStorage',
|
|
|
data: checkStorageParam
|
|
|
}, function(res) {
|
|
|
if (res.data != '' && item1.status == 1) { //当下架操作时 校验线下店存在库存
|
|
|
common.dialog.confirm('警告', "此商品正在线下店销售,下架可能会影响线下店商品正常购买!!!是否确定下架", function() {
|
|
|
statusOprate.updateProductSkuStatus(item, item1);
|
|
|
});
|
|
|
} else {
|
|
|
statusOprate.updateProductSkuStatus(item, item1);
|
|
|
}
|
|
|
}, true);
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
@@ -1055,4 +1114,22 @@ function getProductLabeldata(SknList) { |
|
|
});
|
|
|
}
|
|
|
}, true);
|
|
|
}
|
|
|
|
|
|
|
|
|
var netsaleConfirm = {
|
|
|
checkOfflineStorage: function(content, fn) {
|
|
|
var data = {};
|
|
|
data.productSknList = JSON.stringify(batchOperateShelve);
|
|
|
common.dialog.confirm("SKN 正在线下店销售,下架可能会影响线下店商品正常购买!!!是否确定下架", content, function() {
|
|
|
common.util.__ajax({
|
|
|
url: '/product/checkOfflineStorage',
|
|
|
data: fn()
|
|
|
}, function() {
|
|
|
//g.reload();
|
|
|
//loadTab();
|
|
|
history.go(-1);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|