Authored by liuyue

是否补货字段修改

... ... @@ -341,6 +341,7 @@ grid.prototype = {
reload: function(param) {
var g = this,
p = this.options;
if (param == 1) {
p.page = 1;
}
... ...
... ... @@ -41,7 +41,7 @@ var util = {
success: function(res) {
res = res.data;
if (res.code != 200) {
util.__tip(res.message, "danger");
util.__tip(res.message, "warning");
} else {
return callback.bind(this, res)();
}
... ...
... ... @@ -382,6 +382,56 @@ $('#export-btn').on('click', function() {
window.open("/ajax/down?queryConf=" + JSON.stringify(data) + "&type=netSale");
});
//sku skc上架表格
var shelveTable = new common.grid({
el: "#shelve-table",
secondIndex: 2,
columns: [{
display: 'SKC(商品信息)',
render: function(item) {
return 'SKC:' + item.productSkc + '<br>' +
'颜色:' + item.goodsName;
}
}, {
display: 'SKC上架操作(状态)',
render: function(item) {
if (item.status == 0) {
return '<a class="btn btn-success" data-type="1" data-skc="' + item.productSkc + '" href="javascript:;">点击上架</a>';
} else {
return '<a class="btn btn-danger" data-type="0" data-skc="' + item.productSkc + '" href="javascript:;">点击下架</a>';
}
}
}, {
display: 'SKU',
name: 'productSku'
}, {
display: '尺码',
name: 'sizeName'
}, {
display: '库存',
name: 'stock'
}, {
display: 'SKU上架操作',
render: function(item) {
if (item.status == 0) {
return '下架';
} else {
return '上架';
}
}
}, {
display: 'SKU上架操作',
render: function(item) {
if (item.status == 0) {
return '<a class="btn btn-success" data-type="1" data-sku="' + item.productSku + '" href="javascript:;">上架</a>';
} else {
return '<a class="btn btn-danger" data-type="0" data-sku="' + item.productSku + '" href="javascript:;">下架</a>';
}
}
}]
});
//单个sku,skc上下架
$('#basicTable').on('click', '.shelve-btn', function() {
var that = this,
... ... @@ -406,54 +456,6 @@ $('#basicTable').on('click', '.shelve-btn', function() {
$(that).removeClass('disabled');
var shelveTable = new common.grid({
el: "#shelve-table",
secondIndex: 2,
columns: [{
display: 'SKC(商品信息)',
render: function(item) {
return 'SKC:' + item.productSkc + '<br>' +
'颜色:' + item.goodsName;
}
}, {
display: 'SKC上架操作(状态)',
render: function(item) {
if (item.status == 0) {
return '<a class="btn btn-success" data-type="1" data-skc="' + item.productSkc + '" href="javascript:;">点击上架</a>';
} else {
return '<a class="btn btn-danger" data-type="0" data-skc="' + item.productSkc + '" href="javascript:;">点击下架</a>';
}
}
}, {
display: 'SKU',
name: 'productSku'
}, {
display: '尺码',
name: 'sizeName'
}, {
display: '库存',
name: 'stock'
}, {
display: 'SKU上架操作',
render: function(item) {
if (item.status == 0) {
return '下架';
} else {
return '上架';
}
}
}, {
display: 'SKU上架操作',
render: function(item) {
if (item.status == 0) {
return '<a class="btn btn-success" data-type="1" data-sku="' + item.productSku + '" href="javascript:;">上架</a>';
} else {
return '<a class="btn btn-danger" data-type="0" data-sku="' + item.productSku + '" href="javascript:;">下架</a>';
}
}
}]
});
shelveTable.init(res.data.goodsList, 'goodsSizeList');
$('#shelve-table').on('click', '.btn', function() {
... ...
... ... @@ -2,6 +2,12 @@ var $ = require('jquery'),
common = require('../../common/common');
var basicInfohtml = '',
ENUM = {
isSuppled: {
'Y': '是',
'N': '否'
}
},
convertObj = {
ageLevel: {
'1': '成人',
... ... @@ -91,17 +97,34 @@ basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData);
$('#basic-info').html(basicInfohtml);
//能否补货
$('#goods-table').html(common.util.__template2($('#goodsList').html(), {
goodsList: NETSALEDATA.goodsList
}));
var suppledTable = new common.grid({
el: '#suppled-table',
hash: false,
secondIndex: 1,
columns: [{
display: 'SKC(厂家颜色)',
render: function(item) {
return item.productSkc + '(' + item.goodsName + ')';
}
}, {
display: 'SKU(尺码)',
render: function(item) {
return item.productSku + '(' + item.sizeName + ')';
}
}, {
display: '能否补货',
render: function(item) {
return ENUM.isSuppled[item.isSuppled];
}
}]
});
suppledTable.init(NETSALEDATA.goodsList, 'goodsSizeList')
//上架必填
productExtBo.renderType = $('.contentpanel').data('type');
productExtBo.sellChannels = productExtBo.sellChannels ? productExtBo.sellChannels.replace(/,/g, "|") : '';
productExtBo.shopIds = productExtBo.shopIdList ? productExtBo.shopIdList.join('|') : '';
//productExtBo.shopList =
common.util.__ajax({
url: '/goods/ShopsRest/queryShopsByBrandId',
data: {
... ... @@ -112,7 +135,6 @@ common.util.__ajax({
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
e.init();
}, true);
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
... ...
... ... @@ -138,6 +138,7 @@ var Bll = {
button: [{
value: "提交",
callback: function() {
e.submit(url, function(option) {
option.data.id = item.id;
option.data.productSkn = productSkn;
... ... @@ -197,6 +198,10 @@ $(document).on("click", ".poseditimg .close", function(e) {
});
$(document).on("change", ".poseditimg .pos-text", function() {
var item = Bll.posData[$(this).data("index")];
/*if ($.trim($(this).val()).length > 8) {
common.util.__tip('skn不能超过8位', 'warning');
return;
};*/
item.id = $(this).val();
});
... ... @@ -225,14 +230,14 @@ $(document).on("click", "#dapeiTable .delete", function() {
//修改
$(document).on("click", "#dapeiTable .edit", function() {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
common.util.__ajax2({
url: '/netSale/selectCollocationById',
data: {
param: item.id
}
}, function(data) {
Bll.toast("添加搭配", data.data, "/netSale/updateCollocation");
}, true);
});
// item.infoStr=[{"top":223,"left":380,"id":"ffffff"},{"top":454,"left":309,"id":"ggggg"}];
// Bll.toast("添加搭配",item,"/netSale/updateCollocation");
});
... ...
... ... @@ -8,7 +8,13 @@
</div>
<div id="basicInfoWrap" class="panel-body nopadding">
<div id="basic-info"></div>
<div id="goods-table"></div>
<div id="goods-table">
<div class="form-group">
<h5>能否补货</h5>
<div id="suppled-table" class="dataTables_wrapper no-footer">
</div>
</div>
</div>
<div id="product-ext"></div>
</div>
<div class="panel-footer">
... ... @@ -89,7 +95,7 @@
</div>
</script>
<script type="text/template" id="goodsList">
<!-- <script type="text/template" id="goodsList">
<div class="form-group">
<h5>能否补货</h5>
<table class="table table-bordered">
... ... @@ -119,7 +125,7 @@
</tbody>
</table>
</div>
</script>
</script> -->
<script type="text/template" id="productExtBoTemp">
<div class="form-group">
... ...