Authored by dongjunjie

店铺销售类目

... ... @@ -60,9 +60,6 @@ module.exports = function (app){
//店铺销售类目列表
app.post("/shops/shopCategory/list","shopCategory_shopsCategoryList");
//新增保存店铺销售类目
app.post("/shops/shopCategory/add","shopCategory_insertShopsAndLinkCategory");
//编辑保存店铺销售类目
app.post("/shops/shopCategory/update","shopCategory_updateShopsAndLinkCategory");
... ... @@ -81,5 +78,8 @@ module.exports = function (app){
//取消选择
app.post("/shops/shopCategory/unlink","shopCategory_deleteProductLinkCategory");
//全部取消选择
app.post("/shops/shopCategory/unlinkAll","shopCategory_deleteAllProductLinkedCategory");
}
... ...
... ... @@ -92,6 +92,14 @@ module.exports={
{name:"categoryId",type:"Number"},
{name:"productSKN",type:"Number"}
]
},
deleteAllProductLinkedCategory:{
title:"取消所有商品与类目的关联关系",
url:"/ShopsSalesCategoryRest/deleteAllProductLinkedCategory",
params:[
{name:"categoryId",type:"Number"}
]
}
}
}
... ...
... ... @@ -26,6 +26,9 @@ var g1 = new common.grid({
{display: "商品名称", name: "productName"},
{display: "销售价(元)", name: "salePrice"},
{display: "分类", name: "productSort"},
{display: "销售类目", render: function (item) {
return ''
}},
{display: "操作", render: function (item) {
if(item.checked){
return '<a href="javascript:" class="btn btn-warning btn-xs cancelProduct" data-index="'+item.__index+'">取消选择</a>'
... ... @@ -59,6 +62,9 @@ var g2 = new common.grid({
{display: "商品名称", name: "productName"},
{display: "销售价(元)", name: "salePrice"},
{display: "分类", name: "productSort"},
{display: "销售类目", render: function (item) {
return ''
}},
{display: "操作", render: function (item) {
return '<a href="javascript:" class="btn btn-warning btn-xs cancelProduct" data-index="'+item.__index+'">取消选择</a>'
}}
... ... @@ -154,6 +160,25 @@ $(document).on("click", ".cancelProduct", function () {
}, true);
});
//全部取消选择
$(document).on("click", ".cancelAll", function () {
common.dialog.confirm(
"温馨提示", "你确定全部取消选择所有商品么?",
function(){
common.util.__ajax({
url:'/shops/shopCategory/unlinkAll',
data:{
categoryId: curCategoryId
}
},function(){
g2.reload();
}, true);
},
function(){}
);
});
//筛选
$(document).on("click", ".filter-btn", function () {
if(curTab == 0){
... ...
... ... @@ -29,7 +29,7 @@ var Bll = {
},
//展示销售类目列表
showList: function (isLoading) {
if(isLoading==1) loadModal = common.dialog.load();
//if(isLoading==1) loadModal = common.dialog.load();
common.util.__ajax({
url:'/shops/shopCategory/list',
... ... @@ -107,7 +107,7 @@ $(document).on('click', '.addBtn', function () {
$(document).on('click', '.deleteBtn', function () {
var categoryName = $(this).parent().parent().find('td').eq(1).text();
var categoryId = $(this).data('categoryid');
common.dialog.confirm(
"删除店铺销售类目",
"你确定<b style='color: #ff0000'>&nbsp;删除&nbsp;</b>销售类目<b style='color:#428bca'>&nbsp;"+categoryName+"&nbsp;</b>么?",
... ...
... ... @@ -21,8 +21,8 @@ var g = new common.grid({
{display: "商品名称", name: "productName"},
{display: "销售价(元)", name: "salePrice"},
{display: "分类", name: "productSort"},
{display: "销售类目", render: function () {
{display: "销售类目", render: function (item) {
return ''
}}
]
});
... ...