|
|
var $ = require('jquery'),
|
|
|
common = require('../common/common');
|
|
|
|
|
|
var g = new common.grid({
|
|
|
el: "#product-pool",
|
|
|
parms: function () {
|
|
|
return {
|
|
|
id: common.util.__input('search-id'),
|
|
|
poolName: common.util.__input('search-name')
|
|
|
};
|
|
|
},
|
|
|
columns: [
|
|
|
{display: "商品池编号", name: "id"},
|
|
|
{display: "商品池名称", name: "poolName"},
|
|
|
{display: "说明", name: "comment"},
|
|
|
{display: "SKN个数", name: "total"},
|
|
|
{
|
|
|
display: "操作", name: "", render: function (item) {
|
|
|
return '<a class="btn btn-info detail" data-index="' + item.__index + '">详情</a>';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
]
|
|
|
});
|
|
|
|
|
|
g.init('/market/productPool/queryProductPoolPage');
|
|
|
|
|
|
var Bll = {
|
|
|
toast:function(url) {
|
|
|
var e = new common.edit("#baseform", {bucket: "productPool"});
|
|
|
|
|
|
common.dialog.confirm("添加商品池",
|
|
|
common.util.__template($("#template").html(), {}),
|
|
|
function() {
|
|
|
e.submit(url,function(option){
|
|
|
//option.data;
|
|
|
|
|
|
option.success=function(){
|
|
|
g.reload();
|
|
|
};
|
|
|
option.error=function(){
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
e.init();
|
|
|
|
|
|
new common.dropDown({el: "#producttype"});
|
|
|
},
|
|
|
detailtoast:function(index) {
|
|
|
common.dialog({
|
|
|
title:"商品池详情",
|
|
|
content:'<div id="faGrid" style="height: 600px;overflow:auto;"></div>',
|
|
|
button:[{value:"添加", callback:function() {
|
|
|
var e = new common.edit("#baseform", {bucket: "productPool"});
|
|
|
|
|
|
common.dialog.confirm("添加商品池",
|
|
|
common.util.__template($("#template1").html(), {}),
|
|
|
function() {
|
|
|
e.submit("/market/productPool/addProductPoolDetailBo",function(option){
|
|
|
//option.data;
|
|
|
|
|
|
option.success=function(){
|
|
|
g.reload();
|
|
|
};
|
|
|
option.error=function(){
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
e.init();
|
|
|
return false;
|
|
|
}}]
|
|
|
});
|
|
|
var grid = new common.grid({
|
|
|
el:"#faGrid",
|
|
|
parms: function() {
|
|
|
return {id: index};
|
|
|
},
|
|
|
columns:[
|
|
|
{display:"ID", name:"id"},
|
|
|
{display:"SKN",name:"productskn"},
|
|
|
{display:"名称", name:""},
|
|
|
{display:'品牌', name: "brandName"},
|
|
|
{display: '分类',name: "sortName"},
|
|
|
{display: '操作', name: "", render: function(item) {
|
|
|
return '<a class="btn btn-info delbtn" data-index="' + item.__index + '">删除</a>';
|
|
|
}}
|
|
|
]
|
|
|
});
|
|
|
grid.init('/market/productPool/queryProductPoolDetailPage');
|
|
|
$(document).on('click', '.delbtn', function() {
|
|
|
var item = grid.rows[$(this).data("index")];
|
|
|
common.util.__ajax({
|
|
|
url:'/market/productPool/deleteProductPoolDetailBo',
|
|
|
data:{id:item.id}
|
|
|
},function(res) {
|
|
|
grid.reload();
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
$("#add-pool").on('click', function() {
|
|
|
Bll.toast("/market/productPool/addProductPoolBo");
|
|
|
});
|
|
|
|
|
|
$(document).on("click", ".detail", function() {
|
|
|
var item=g.rows[$(this).data("index")];
|
|
|
Bll.detailtoast(item.id);
|
|
|
});
|
|
|
|
|
|
$(document).on("click","#filter-btn",function () {
|
|
|
g.reload(1);
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|