...
|
...
|
@@ -5,6 +5,8 @@ var $ = require('jquery'), |
|
|
window.batchOperateShelve = [];
|
|
|
|
|
|
$("#add-btn").hide();
|
|
|
$("#standardType-btn").hide();
|
|
|
|
|
|
var tabTree = new common.tabTree("#sortTree");
|
|
|
tabTree.init();
|
|
|
|
...
|
...
|
@@ -15,7 +17,6 @@ var g = new common.grid({ |
|
|
return {
|
|
|
sortId: tabTree.selected[2] ? tabTree.selected[2].id : "",
|
|
|
sortName: tabTree.selected[2] ? tabTree.selected[2].sortName : ""
|
|
|
|
|
|
};
|
|
|
},
|
|
|
columns: [ {
|
...
|
...
|
@@ -24,7 +25,6 @@ var g = new common.grid({ |
|
|
}, {
|
|
|
display: '参数类别',
|
|
|
render: function(item) {
|
|
|
console.log(item);
|
|
|
return item.standardSort.standardSortName;
|
|
|
}
|
|
|
}, {
|
...
|
...
|
@@ -35,9 +35,11 @@ var g = new common.grid({ |
|
|
render: function(item) {
|
|
|
var parmList= item.parameterMakeList;
|
|
|
var parm=[];
|
|
|
for (var j = 0; j < parmList.length; j++) {
|
|
|
if(parmList[j].parameterValue!=null){
|
|
|
parm.push(parmList[j].parameterValue);
|
|
|
if(parmList!=null){
|
|
|
for (var j = 0; j < parmList.length; j++) {
|
|
|
if(parmList[j].parameterValue!=null){
|
|
|
parm.push(parmList[j].parameterValue);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return parm.join('<br/>');
|
...
|
...
|
@@ -63,6 +65,7 @@ $("#filter-btn").click(function () { |
|
|
var smallSortId=tabTree.selected[2] ? tabTree.selected[2].id : "";
|
|
|
if(smallSortId>0){
|
|
|
$("#add-btn").show();
|
|
|
$("#standardType-btn").show();
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -91,17 +94,28 @@ $(document).on('click', '.edit-class-btn', function () { |
|
|
if(tabTree.selected[2]){
|
|
|
sortName=sortName+tabTree.selected[2].sortName;
|
|
|
}
|
|
|
common.dialog.confirm("修改参数",
|
|
|
var smallSortId =tabTree.selected[2] ? tabTree.selected[2].id : "";
|
|
|
common.dialog.confirm("修改参数",
|
|
|
common.util.__template2($("#template").html(),
|
|
|
{id: item.id, standardName: item.standardName,
|
|
|
orderBy:item.orderBy, stortTypeName:sortName,standardSortName:item.standardSort.standardSortName
|
|
|
,standardSortId:item.standardSortId})
|
|
|
, function () {
|
|
|
common.util.__ajax({
|
|
|
var input = $('#standardName').val();
|
|
|
if (input === '' || $.trim(input) === '')
|
|
|
{
|
|
|
common.util.__tip("参数名称不能为空", "warning");
|
|
|
return false;
|
|
|
}
|
|
|
var stortTypeId = $('#stortTypeId').val();
|
|
|
if (stortTypeId === '' || $.trim(stortTypeId) === ''||stortTypeId<1)
|
|
|
{
|
|
|
common.util.__tip("参数类别不能为空", "warning");
|
|
|
return false;
|
|
|
}
|
|
|
common.util.__ajax2({
|
|
|
url: '/erpproduct/standard/update',
|
|
|
data: (function () {
|
|
|
var input = $('#standardName').val();
|
|
|
if (input === '' || $.trim(input) === '')return "参数名称不能为空";
|
|
|
return {
|
|
|
id: item.id,
|
|
|
standardName: $("#standardName").val(),
|
...
|
...
|
@@ -121,6 +135,7 @@ $(document).on('click', '.edit-class-btn', function () { |
|
|
return {sortId: smallSortId};
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('#stortTypeName').attr("disabled", true);
|
|
|
});
|
|
|
|
...
|
...
|
@@ -147,9 +162,19 @@ $(document).on('click', '#add-btn', function () { |
|
|
url: '/erpproduct/standard/add',
|
|
|
data: (function () {
|
|
|
var input = $('#standardName').val();
|
|
|
if (input === '' || $.trim(input) === '')return "参数名称不能为空";
|
|
|
if (input === '' || $.trim(input) === '')
|
|
|
{
|
|
|
common.util.__tip("参数名称不能为空", "warning");
|
|
|
return;
|
|
|
}
|
|
|
var stortTypeId = $('#stortTypeId').val();
|
|
|
if (stortTypeId === '' || $.trim(stortTypeId) === ''||stortTypeId<1)
|
|
|
{
|
|
|
common.util.__tip("参数类别不能为空", "warning");
|
|
|
return;
|
|
|
}
|
|
|
return {
|
|
|
stortId:smallSortId,
|
|
|
sortId:smallSortId,
|
|
|
standardName: $("#standardName").val(),
|
|
|
orderBy: $("#orderBy").val(),
|
|
|
standardSortId:$("#stortTypeId").val()
|
...
|
...
|
@@ -167,46 +192,9 @@ $(document).on('click', '#add-btn', 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();
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
...
|
...
|
|