Authored by chenchao

save new

... ... @@ -11,7 +11,7 @@
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
</div>
<div class="panel-col">
<a id="onshelve" href="javascript:;" class="btn btn-success" >添加产品参数类别</a>
<a id="add-btn" href="javascript:;" class="btn btn-success" >添加产品参数类别</a>
</div>
</div>
... ...
... ... @@ -95,7 +95,9 @@ var appendAllSortName = function(allSorts){
}
return sortName.substr(0,sortName.lastIndexOf("/"));
}
/**
修改
**/
$(document).on('click', '.edit-class-btn', function () {
var item = g.rows[$(this).data("index")];
var sortName=appendAllSortName(getAllSortName());
... ... @@ -127,8 +129,58 @@ $(document).on('click', '.edit-class-btn', function () {
});
});
});
/**
新增
**/
$(document).on('click', '#add-btn', function () {
var item = g.rows[$(this).data("index")];
var sortName=appendAllSortName(getAllSortName());
var smallSortId = tabTree.selected[2] ? tabTree.selected[2].id : "";
var standardSort = {
sortId: smallSortId,
standardSortName: common.util.__input("standardSortName"),
orderBy: common.util.__input("orderBy"),
sortName: sortName,
};
common.dialog.confirm("新增参数类别",
common.util.__template2($("#edit-template").html(),standardSort),
function () {
common.util.__ajax({
url: '/erpproduct/standardSort/add',
data: (function () {
var standardSortName = $('#standardSortName').val();
if (standardSortName === '' || $.trim(standardSortName) === '')
{
common.util.__tip("参数类别名称不能为空", "warning");
return;
}
var orderBy = $('#orderBy').val();
if (orderBy < 0)
{
common.util.__tip("排序不能为负数", "warning");
return;
}
return {
sortId: smallSortId,
standardSortName: $("#standardSortName").val(),
orderBy: $("#orderBy").val()
};
})()
}, function () {
g.reload();
});
});
new common.dropDown({
el: '#stortTypeId',
ajax: 'queryStortType',
hash: true,
params:function(){
return {sortId: smallSortId};
}
});
});
... ...