...
|
...
|
@@ -328,63 +328,76 @@ $(document).on("click", ".edit", function() { |
|
|
Bll.toast(index, Bll.module);
|
|
|
});
|
|
|
|
|
|
/*添加商品*/
|
|
|
/*选择商品表格*/
|
|
|
var goodsgird = new common.grid({
|
|
|
el: '#goodsgird',
|
|
|
parms: function() {
|
|
|
parms: function () {
|
|
|
var beginPrice = 0, endPrice = 1000000;
|
|
|
if (common.util.__input('beginPrice')) {
|
|
|
beginPrice = common.util.__input('beginPrice');
|
|
|
}
|
|
|
if (common.util.__input('endPrice')) {
|
|
|
endPrice = common.util.__input('endPrice')
|
|
|
}
|
|
|
return {
|
|
|
query:common.util.__input('skns')
|
|
|
query: common.util.__input('skns'),
|
|
|
price: beginPrice + "," + endPrice
|
|
|
};
|
|
|
},
|
|
|
columns: [{
|
|
|
display: "选择",
|
|
|
type: "checkbox"
|
|
|
},{
|
|
|
display: "产品图片",
|
|
|
render: function(item) {
|
|
|
if(item.default_images){
|
|
|
item.default_images=common.util.__joinImg("goodsimg",item.default_images);
|
|
|
}
|
|
|
else{
|
|
|
item.default_images="";
|
|
|
columns: [
|
|
|
{
|
|
|
display: "选择",
|
|
|
type: "checkbox"
|
|
|
}, {
|
|
|
display: "产品图片",
|
|
|
render: function (item) {
|
|
|
console.log(item);
|
|
|
if (item.images_url) {
|
|
|
item.images_url = common.util.__joinImg("goodsimg", item.images_url);
|
|
|
}
|
|
|
else {
|
|
|
item.images_url = "";
|
|
|
}
|
|
|
return "<img width=120 height=60 src='" + item.images_url + "'/>";
|
|
|
}
|
|
|
return "<img width=120 height=60 src='"+item.default_images+"'/>";
|
|
|
}
|
|
|
}, {
|
|
|
display: "产品名称",
|
|
|
name: "product_name"
|
|
|
}, {
|
|
|
display: "品牌",
|
|
|
name: "brand_name"
|
|
|
}, {
|
|
|
display: "现价",
|
|
|
name: "sales_price"
|
|
|
}, {
|
|
|
display: "牌价",
|
|
|
name: "market_price"
|
|
|
}, {
|
|
|
display: "预售",
|
|
|
name: "stock_number"
|
|
|
}, {
|
|
|
display: "库存",
|
|
|
name: "storage_num"
|
|
|
}]
|
|
|
}, {
|
|
|
display: "产品名称",
|
|
|
name: "product_name"
|
|
|
}, {
|
|
|
display: "品牌",
|
|
|
name: "brand_name"
|
|
|
}, {
|
|
|
display: "现价",
|
|
|
name: "sales_price"
|
|
|
}, {
|
|
|
display: "牌价",
|
|
|
name: "market_price"
|
|
|
}, {
|
|
|
display: "预售",
|
|
|
name: "stock_number"
|
|
|
}, {
|
|
|
display: "库存",
|
|
|
name: "storage_num"
|
|
|
}]
|
|
|
});
|
|
|
//搜索按钮
|
|
|
$(document).on("click", "#search", function() {
|
|
|
goodsgird.reload();
|
|
|
});
|
|
|
$(document).on("click", "#goodsSelectBtn", function() {
|
|
|
//点击“选择标签”按钮(添加商品)
|
|
|
$(document).on("click", "#goodsSelectBtn", function () {
|
|
|
new common.dialog({
|
|
|
title: "选择商品",
|
|
|
content: $("#template_dialog_goodsgird").html(),
|
|
|
width: '80%',
|
|
|
button: [{
|
|
|
value: "确定",
|
|
|
callback: function() {
|
|
|
Bll.module.data = goodsgird.selected.map(function(item, index) {
|
|
|
callback: function () {
|
|
|
Bll.module.data = goodsgird.selected.map(function (item, index) {
|
|
|
return {
|
|
|
src: item.default_images,
|
|
|
id: item.product_id
|
|
|
src: item.images_url,
|
|
|
id: item.product_skn,
|
|
|
product_skc: item.product_skc
|
|
|
}
|
|
|
});
|
|
|
// Bll.module.data=goodsgird.selected;
|
...
|
...
|
@@ -397,21 +410,14 @@ $(document).on("click", "#goodsSelectBtn", function() { |
|
|
});
|
|
|
goodsgird.init('/yohosearch/search');
|
|
|
});
|
|
|
$(document).on("click", ".removepic", function() {
|
|
|
Bll.module.data.splice($(this).data("index"), 1);
|
|
|
$("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), {
|
|
|
datas: Bll.module.data
|
|
|
}));
|
|
|
});
|
|
|
|
|
|
/*添加商品组*/
|
|
|
$(document).on("click", "#goodsaddBtn", function() {
|
|
|
//点击“添加组”按钮(添加商品组)
|
|
|
$(document).on("click", "#goodsaddBtn", function () {
|
|
|
Bll.module.data.push(Button[4].data[0]);
|
|
|
console.log(Bll.module.data);
|
|
|
Bll.__render("#groupsgoods", "template_dialog_remgoodsgroup", Bll.module);
|
|
|
});
|
|
|
|
|
|
$(document).on("click", ".goodsSelectBtn", function() {
|
|
|
//点击“选择标签”按钮(添加商品组)
|
|
|
$(document).on("click", ".goodsSelectBtn", function () {
|
|
|
var index = $(this).data("index");
|
|
|
new common.dialog({
|
|
|
title: "选择商品",
|
...
|
...
|
@@ -419,17 +425,18 @@ $(document).on("click", ".goodsSelectBtn", function() { |
|
|
width: '80%',
|
|
|
button: [{
|
|
|
value: "确定",
|
|
|
callback: function() {
|
|
|
goodsgird.selected.forEach(function(item, i) {
|
|
|
callback: function () {
|
|
|
goodsgird.selected.forEach(function (item, i) {
|
|
|
Bll.module.data[index].list[i] = {
|
|
|
src: item.default_images,
|
|
|
id: item.product_id,
|
|
|
maxSortId: 1
|
|
|
}
|
|
|
src: item.images_url,
|
|
|
id: item.product_skn,
|
|
|
product_skc: item.product_skc,
|
|
|
maxSortId: item.max_sort_id
|
|
|
};
|
|
|
if (!i) {
|
|
|
Bll.module.data[index].cover = {
|
|
|
cover: item.default_images,
|
|
|
maxSortId: 1
|
|
|
cover: item.images_url,
|
|
|
maxSortId: item.max_sort_id
|
|
|
};
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -440,7 +447,13 @@ $(document).on("click", ".goodsSelectBtn", function() { |
|
|
});
|
|
|
goodsgird.init('/yohosearch/search');
|
|
|
});
|
|
|
|
|
|
//删除图片按钮
|
|
|
$(document).on("click", ".removepic", function() {
|
|
|
Bll.module.data.splice($(this).data("index"), 1);
|
|
|
$("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), {
|
|
|
datas: Bll.module.data
|
|
|
}));
|
|
|
});
|
|
|
|
|
|
|
|
|
/********************************/
|
...
|
...
|
|