...
|
...
|
@@ -4,20 +4,10 @@ var $ = require('jquery'), |
|
|
|
|
|
window.batchOperateShelve = [];
|
|
|
|
|
|
$("#add-btn").hide();
|
|
|
var tabTree = new common.tabTree("#sortTree");
|
|
|
tabTree.init();
|
|
|
|
|
|
new common.dropDown({
|
|
|
el: '#stortTypeId',
|
|
|
ajax: 'queryStortType',
|
|
|
hash: true,
|
|
|
params:function(){
|
|
|
return {sortId: smallSortId};
|
|
|
}
|
|
|
});
|
|
|
|
|
|
var smallSortId=tabTree.selected[2] ? tabTree.selected[2].id : "";
|
|
|
|
|
|
var g = new common.grid({
|
|
|
el: "#basicTable",
|
|
|
usepagesize:true,
|
...
|
...
|
@@ -34,6 +24,7 @@ var g = new common.grid({ |
|
|
}, {
|
|
|
display: '参数类别',
|
|
|
render: function(item) {
|
|
|
console.log(item);
|
|
|
return item.standardSort.standardSortName;
|
|
|
}
|
|
|
}, {
|
...
|
...
|
@@ -69,6 +60,10 @@ g.init("/erpproduct/prodcutparm/list"); |
|
|
//筛选
|
|
|
$("#filter-btn").click(function () {
|
|
|
g.reload(1);
|
|
|
var smallSortId=tabTree.selected[2] ? tabTree.selected[2].id : "";
|
|
|
if(smallSortId>0){
|
|
|
$("#add-btn").show();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//删除
|
...
|
...
|
@@ -97,9 +92,10 @@ $(document).on('click', '.edit-class-btn', function () { |
|
|
sortName=sortName+tabTree.selected[2].sortName;
|
|
|
}
|
|
|
common.dialog.confirm("修改参数",
|
|
|
common.util.__template($("#template").html(),
|
|
|
common.util.__template2($("#template").html(),
|
|
|
{id: item.id, standardName: item.standardName,
|
|
|
orderBy:item.orderBy, stortTypeName:sortName,stortTypeId:item.standardSort.standardSortName})
|
|
|
orderBy:item.orderBy, stortTypeName:sortName,standardSortName:item.standardSort.standardSortName
|
|
|
,standardSortId:item.standardSortId})
|
|
|
, function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/erpproduct/standard/update',
|
...
|
...
|
@@ -117,9 +113,100 @@ $(document).on('click', '.edit-class-btn', function () { |
|
|
g.reload();
|
|
|
});
|
|
|
});
|
|
|
new common.dropDown({
|
|
|
el: '#stortTypeId',
|
|
|
ajax: 'queryStortType',
|
|
|
hash: true,
|
|
|
params:function(){
|
|
|
return {sortId: smallSortId};
|
|
|
}
|
|
|
});
|
|
|
$('#stortTypeName').attr("disabled", true);
|
|
|
});
|
|
|
|
|
|
$(document).on('click', '#add-btn', function () {
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
var sortName="";
|
|
|
if(tabTree.selected[0]){
|
|
|
sortName=sortName+tabTree.selected[0].sortName+"/";
|
|
|
}
|
|
|
if(tabTree.selected[1]){
|
|
|
sortName=sortName+tabTree.selected[1].sortName+"/";
|
|
|
}
|
|
|
if(tabTree.selected[2]){
|
|
|
sortName=sortName+tabTree.selected[2].sortName;
|
|
|
}
|
|
|
var smallSortId=tabTree.selected[2] ? tabTree.selected[2].id : "";
|
|
|
common.dialog.confirm("新增参数",
|
|
|
common.util.__template2($("#template").html(),
|
|
|
{standardName: common.util.__input("standardName"),
|
|
|
orderBy: common.util.__input("orderBy"), stortId:smallSortId,stortTypeName:sortName
|
|
|
,standardSortId:common.util.__input("standardSortId")})
|
|
|
, function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/erpproduct/standard/add',
|
|
|
data: (function () {
|
|
|
var input = $('#standardName').val();
|
|
|
if (input === '' || $.trim(input) === '')return "参数名称不能为空";
|
|
|
return {
|
|
|
stortId:smallSortId,
|
|
|
standardName: $("#standardName").val(),
|
|
|
orderBy: $("#orderBy").val(),
|
|
|
standardSortId:$("#stortTypeId").val()
|
|
|
};
|
|
|
})()
|
|
|
}, function () {
|
|
|
g.reload();
|
|
|
});
|
|
|
});
|
|
|
new common.dropDown({
|
|
|
el: '#stortTypeId',
|
|
|
ajax: 'queryStortType',
|
|
|
hash: true,
|
|
|
params:function(){
|
|
|
return {sortId: smallSortId};
|
|
|
}
|
|
|
});
|
|
|
$('#stortTypeName').attr("disabled", true);
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/*$("#add-btn").click(function(){
|
|
|
attributeOp("新建", '/erpproduct/standard/add', {"orderBy":0});
|
|
|
$('#stortTypeName').attr("disabled", true);
|
|
|
});*/
|
|
|
|
|
|
function attributeOp(prefix, url, item) {
|
|
|
|
|
|
var a = new common.edit(".confirm",BUCKET);
|
|
|
common.dialog.confirm(prefix + "产品参数", common.util.__template2($("#template").html(), item), function () {
|
|
|
|
|
|
return a.submit(url, function (option) {
|
|
|
option.data.categoryId = item.categoryId;
|
|
|
option.data.attributeId = item.attributeId;
|
|
|
option.data.shopsId = common.util.__input("shopsId");
|
|
|
option.success = function (res) {
|
|
|
res = res;
|
|
|
if (res.code == "200") {
|
|
|
a.$tip("提交成功", function () {
|
|
|
g.reload();
|
|
|
}, 'growl-success');
|
|
|
} else {
|
|
|
a.$tip(res.message);
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
option.error = function (res) {
|
|
|
a.$tip(res.message);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
a.init();
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
...
|
...
|
|