Authored by chenchao

try 2

... ... @@ -13,11 +13,15 @@ module.exports=function(app) {
app.post("/erpproduct/standard/update","productparm_update");
/*添加*/
app.post("/erpproduct/standardSort/add","productparm_add");
/*修改*/
app.post("/erpproduct/standardSort/update","productparm_update");
/*参数类别列表*/
app.post("/erpproduct/standardSort/list","standardSort_list");
/*参数类别添加*/
app.post("/erpproduct/standardSort/add","standardSort_add");
/*参数类别修改*/
app.post("/erpproduct/standardSort/update","standardSort_update");
/*参数类别删除*/
app.post("/erpproduct/standardSort/update","standardSort_del");
/*商品参数类别*/
app.get("/erpproduct/standardSort/index","baserule.standardSort.Index",function(){
this.$extend={
... ...
module.exports={
namespace:"standardSort",
apis:{
list:{
title:'查询产品参数列表',
url: '/standardSort/getAllStandardSortBySortId',
params: [
{name: 'sortId', type: 'Number'}
]
},
add:{
title:'增加',
url: '/standardSort/addStandardSort',
params:[
{name: 'sortId', type: 'Number'},
{name: 'standardSortName', type: 'String'},
{name: 'orderBy', type: 'Number'}
]
},
update:{
title:'修改',
url: '/standardSort/updateStandardSort',
params:[
{name: 'id', type: 'Number'},
{name: 'standardSortName', type: 'String'},
{name: 'orderBy', type: 'Number'}
]
},
del:{
title:'删除',
url: '/standardSort/delStandardSort',
params:[
{name: 'id', type: 'Number'}
]
}
}
}
\ No newline at end of file
... ...
... ... @@ -50,12 +50,12 @@ var g = new common.grid({
render: function(items) {
var HtmArr = [];
HtmArr.push('<a data-index="'+ items.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn">编辑</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs del-standard">删除</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs del-standardSort">删除</a>');
return HtmArr.join('');
}
}]
});
g.init("/erpproduct/prodcutparm/list");
g.init("/erpproduct/standardSort/list");
//筛选
$("#filter-btn").click(function () {
... ... @@ -63,11 +63,11 @@ $("#filter-btn").click(function () {
});
//删除
$('tbody').on('click', '.del-standard', function() {
$('tbody').on('click', '.del-standardSort', function() {
var item=g.rows[$(this).data("index")];
common.dialog.confirm("温馨提示", "你确定要删除吗?", function () {
common.util.__ajax({
url:'/erpproduct/standard/del',
url:'/erpproduct/standardSort/del',
data:{id:item.id}
},function(){
g.reload();
... ... @@ -108,21 +108,25 @@ $(document).on('click', '.edit-class-btn', function () {
if(tabTree.selected[2]){
sortName=sortName+tabTree.selected[2].sortName;
}
var standardSort = {
id: item.id,
sortId: item.sortId,
standardName: item.standardSortName,
orderBy: item.orderBy
};
common.dialog.confirm("修改参数",
common.util.__template($("#template").html(),
{id: item.id, standardName: item.standardName,
orderBy:item.orderBy, stortTypeName:sortName,stortTypeId:item.standardSort.standardSortName})
common.util.__template($("#template").html(),standardSort)
, function () {
common.util.__ajax({
url: '/erpproduct/standard/update',
url: '/erpproduct/standardSort/update',
data: (function () {
var input = $('#standardName').val();
var input = $('#standardSortName').val();
if (input === '' || $.trim(input) === '')return "参数名称不能为空";
return {
id: item.id,
standardName: $("#standardName").val(),
standardSortName: $("#standardSortName").val(),
orderBy: $("#orderBy").val(),
standardSortId:$("#stortTypeId").val()
sortId: $("#sortId").val()
};
})()
}, function () {
... ...