...
|
...
|
@@ -508,4 +508,135 @@ $(document).on("click", "#sub_btn", function() { |
|
|
console.log(res.data);
|
|
|
window.location.href=window.location.href;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
/****************************************************************************************************/
|
|
|
/*商品,商品组*/
|
|
|
|
|
|
/*选择商品表格*/
|
|
|
var goodsgird = new common.grid({
|
|
|
el: '#goodsgird',
|
|
|
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'),
|
|
|
price: beginPrice + "," + endPrice
|
|
|
};
|
|
|
},
|
|
|
columns: [
|
|
|
{
|
|
|
display: "选择",
|
|
|
type: "checkbox"
|
|
|
}, {
|
|
|
display: "产品图片",
|
|
|
render: function (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 + "?imageView/2/w/100/h/100'/>";
|
|
|
}
|
|
|
}, {
|
|
|
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 () {
|
|
|
new common.dialog({
|
|
|
title: "选择商品",
|
|
|
content: $("#template_dialog_goodsgird").html(),
|
|
|
width: '80%',
|
|
|
button: [{
|
|
|
value: "确定",
|
|
|
callback: function () {
|
|
|
Bll.module.contentData.data = goodsgird.selected.map(function (item, index) {
|
|
|
return {
|
|
|
src: item.images_url,
|
|
|
id: item.product_skn,
|
|
|
product_skc: item.product_skc
|
|
|
}
|
|
|
});
|
|
|
// Bll.module.data=goodsgird.selected;
|
|
|
Bll.__render("#goodspic", "template_dialog_goodsimgs", {
|
|
|
datas: Bll.module.contentData.data
|
|
|
});
|
|
|
},
|
|
|
css: "btn-primary"
|
|
|
}]
|
|
|
});
|
|
|
goodsgird.init('/yohosearch/search');
|
|
|
});
|
|
|
//点击“添加组”按钮(添加商品组)
|
|
|
$(document).on("click", "#goodsaddBtn", function () {
|
|
|
if(Bll.module.contentData.data[0].list.length){
|
|
|
Bll.module.contentData.data.push(Button[5].data[0]);
|
|
|
}
|
|
|
Bll.__render("#groupsgoods", "template_dialog_remgoodsgroup", Bll.module);
|
|
|
});
|
|
|
//点击“选择标签”按钮(添加商品组)
|
|
|
$(document).on("click", ".goodsSelectBtn", function () {
|
|
|
var index = $(this).data("index");
|
|
|
new common.dialog({
|
|
|
title: "选择商品",
|
|
|
content: $("#template_dialog_goodsgird").html(),
|
|
|
width: '80%',
|
|
|
button: [{
|
|
|
value: "确定",
|
|
|
callback: function () {
|
|
|
goodsgird.selected.forEach(function (item, i) {
|
|
|
Bll.module.contentData.data[index].list[i] = {
|
|
|
src: item.images_url,
|
|
|
id: item.product_skn,
|
|
|
product_skc: item.product_skc,
|
|
|
maxSortId: item.max_sort_id
|
|
|
};
|
|
|
if (!i) {
|
|
|
Bll.module.contentData.data[index].cover = {
|
|
|
cover: item.images_url,
|
|
|
maxSortId: item.max_sort_id
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
Bll.__render("#groupsgoods", "template_dialog_remgoodsgroup", Bll.module);
|
|
|
},
|
|
|
css: "btn-primary"
|
|
|
}]
|
|
|
});
|
|
|
goodsgird.init('/yohosearch/search');
|
|
|
});
|
|
|
//删除图片按钮
|
|
|
$(document).on("click", ".removepic", function() {
|
|
|
Bll.module.contentData.data.splice($(this).data("index"), 1);
|
|
|
$("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), {
|
|
|
datas: Bll.module.contentData.data
|
|
|
}));
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|