Authored by lijian

产品参数管理

... ... @@ -32,6 +32,14 @@ module.exports={
params:[
{name: 'id', type: 'Number'}
]
}
},
//给前台页面查询用的
listForSelect:{
title:'查询产品参数列表',
url: '/standardSort/getAllStandardSortBySortIdForSelect',
params: [
{name: 'sortId', type: 'Number'}
]
},
}
}
\ No newline at end of file
... ...
... ... @@ -7,16 +7,12 @@
<div class="panel-col2">
<div id="sortTree"></div>
</div>
<div class="panel-col">
<div class="panel-col2">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="add-btn" href="javascript:;" class="btn btn-info">新增</a>
<a id="standardType-btn" href="/goods/netsale/batch" class="btn btn-primary large">参数类别管理</a>
</div>
<div class="panel-col2" style="width:40%;">
<a id="export-btn" href="javascript:;" class="btn btn-primary large">导出</a>
<a id="import-btn" href="/goods/netsale/batch" class="btn btn-primary large">批量( 排序、款型系列、上下架 )</a>
</div>
</div>
</div>
</div>
... ...
... ... @@ -10,7 +10,7 @@ module.exports=function(app) {
/**/
app.post("/product/querySizeAttributesByName","select_querySizeAttributesByName");
app.post("/standardSort/getAllStandardSortBySortId","select_getAllStandardSortBySortId");
app.post("/standardSort/getAllStandardSortBySortIdForSelect","select_getAllStandardSortBySortIdForSelect");
app.post("/product/querySizeListBySortId4Html","select_querySizeListBySortId4Html");
... ...
... ... @@ -25,9 +25,9 @@ module.exports={
{name: "shopsId", type: "Number"}
]
},
getAllStandardSortBySortId:{
getAllStandardSortBySortIdForSelect:{
title:'',
url: "/standardSort/getAllStandardSortBySortId",
url: "/standardSort/getAllStandardSortBySortIdForSelect",
params: [
{name: "sortId", type: "Number"}
]
... ...
... ... @@ -20,7 +20,7 @@ var urlObj = {
'sortbybrand': '/ShopsRest/queryShopsByBrandId',
'getjitSup': '/AgreementRest/getJitSupplierByBrandId',
// 'getsort':'/goods/query/querySortBySmallSort',
'queryStortType':'/standardSort/getAllStandardSortBySortId', // 查询产品参数类型,
'queryStortType':'/standardSort/getAllStandardSortBySortIdForSelect', // 查询产品参数类型,
'sortlist': '/product/class/queryAllProductSortList',//no select
'sortSubList': '/product/class/queryProductSortList',
'productPool': '/runManage/subjectManage/queryBaseProductPoolListByName',
... ... @@ -61,7 +61,7 @@ var urlObj = {
'queryProdSizeListForSel':"/productSize/queryProdSizeListForSel"
};
var minimumResultsForSearch = ["sortbybrand", "getjitSup", "sortsize2", "querySupplier","sortsize3"];
var minimumResultsForSearch = ["sortbybrand", "getjitSup", "sortsize2", "querySupplier","sortsize3","queryStortType"];
var dropDown = function(option) {
new dropDown.prototype.init(option);
... ...
... ... @@ -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();
}
});
... ...