Authored by lijian

no message

... ... @@ -13,11 +13,13 @@ module.exports=function(app) {
app.post("/erpproduct/standard/update","productparm_update");
/*添加*/
app.post("/erpproduct/standard/add","productparm_add");
/* /!*添加*!/
app.post("/erpproduct/standardSort/add","productparm_add");
/*修改*/
/!*修改*!/
app.post("/erpproduct/standardSort/update","productparm_update");
*/
/*商品参数类别*/
app.get("/erpproduct/standardSort/index","baserule.standardSort.Index",function(){
this.$extend={
... ...
... ... @@ -10,15 +10,13 @@ module.exports={
},
add:{
title:'增加',
url: '/brandSeries/add',
url: '/standard/addStandard',
params:[
{name: 'seriesName', type: 'String'},
{name: 'shopsId', type: 'Number'},
{name: 'brandId', type: 'Number'},
{name: 'type', type: 'Number'},
{name: 'orderBy', type: 'Number'},
{name: 'seriesBanner', type: 'String'}
]
{name: 'standardName', type: 'String'},
{name: 'standardSortId', type: 'Number'},
{name: 'sortId', type: 'Number'},
{name: 'orderBy', type: 'Number'}
]
},
update:{
title:'修改',
... ...
... ... @@ -9,6 +9,8 @@
</div>
<div class="panel-col">
<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%;">
... ... @@ -33,8 +35,8 @@
<div class="form-group">
<label for="stortTypeName" class="col-sm-3 control-label">分类</label>
<div class="col-md-6">
<input type="hidden" name="" value="{id}" id="id" class="form-control" value="" required="required" pattern="" title="">
<input type="text" name="" value="{stortTypeName}" id="stortTypeName" class="form-control" value="" required="required" pattern="" title="" maxlength="20">
<input type="hidden" name="" value="[[id]]" id="id" class="form-control" value="" required="required" pattern="" title="">
<input type="text" name="" value="[[stortTypeName]]" id="stortTypeName" class="form-control" value="" required="required" pattern="" title="" maxlength="20">
</div>
</div>
... ... @@ -43,8 +45,8 @@
参数类别
</label>
<div class="col-md-6">
<select name="stortTypeId" id="stortTypeId" value="[[stortTypeId]]" tabindex="-1" required="required" title="" class="form-control height40">
<option value="[[id||'-1']]">[[standardSortName||"请选择参数类别"]]</option>
<select name="stortTypeId" id="stortTypeId" value="[[id]]" tabindex="-1" required="required" title="" class="form-control height40">
<option value="[[id||'-1']]">[[standardSortName||"请选择参数"]]</option>
</select>
</div>
</div>
... ... @@ -52,7 +54,7 @@
<div class="form-group">
<label for="standardName" class="col-sm-3 control-label">参数名称</label>
<div class="col-md-6">
<input type="text" name="" value="{standardName}" id="standardName" class="form-control" value="" required="required" pattern="" title="" maxlength="20">
<input type="text" name="" value="[[standardName]]" id="standardName" class="form-control" value="" required="required" pattern="" title="" maxlength="20">
</div>
</div>
... ... @@ -61,38 +63,11 @@
排序
</label>
<div class="col-md-6">
<input id="orderBy" value="{orderBy}" class="form-control width300" type="text" required="required" placeholder="排序" maxlength="20">
<input id="orderBy" value="[[orderBy]]" class="form-control width300" type="text" required="required" placeholder="排序" maxlength="20">
</div>
</div>
</script>
<script type="text/template" id="onshelve-template">
<form class="shelve-form form-horizontal form-bordered">
<div class="panel panel-default">
<div class="panel-body nopadding">
<div class="form-group">
<div class="col-sm-3 height40">预上架时间:</div>
<div class="col-sm-6"><input id="shelveTime" class="form-control" jsaction="time" type="text" placeholder="预上架时间" readonly>
<span class="red">预上架请填写上架时间</span>
</div>
</div>
<div class="form-group">
<a class="btn btn-info" data-type="2" href="javascript:;">上架上新</a>
<a class="btn btn-info" data-type="1" href="javascript:;">上架不上新</a>
</div>
<div class="form-group">
<div class="col-sm-2 height40">预售时间:</div>
<div class="col-sm-4"><input id="advanceBeginTime" class="form-control" jsaction="time:end:advanceEndTime" type="text" placeholder="预售开始时间" readonly></div>
<div class="col-sm-4"><input id="advanceEndTime" class="form-control" jsaction="time:start:advanceBeginTime" type="text" placeholder="预售结束时间" readonly></div>
<div class="col-sm-1"><a class="btn btn-info" data-type="5" href="javascript:;">确定</a></div>
</div>
</div>
</div>
</form>
</script>
<%include '../../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
... ... @@ -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();
}
... ...