Authored by weiqingting

基础商品bug修改

... ... @@ -25,6 +25,8 @@ console.log(RESPONSEDATA);
/*审核*/
$("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA));
... ... @@ -32,11 +34,17 @@ $("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA
/*商品名称*/
var Bll={
validateSort:function(){
var id=false;
var select=tabTree.getAddress();
if(select.length>2&&select[select.length-1]&&select[select.length-1].id){
return select[select.length-1].id;
if(select.length>2){
if(select[2]&&select[2].id){
id=select[2].id;
}
if(select[3]&&select[3].id){
id=select[3].id;
}
}
return false;
return id;
},
productNameArr:['','',''],
setProductName:function(){
... ... @@ -60,6 +68,20 @@ var SORTDATA={
if(data.length>2){
Bll.productNameArr[2]=data[data.length-1].sortName;
Bll.setProductName();
/*查出非销售属性*/
var sorid=Bll.validateSort();
if(sorid){
common.util.__ajax({
url:'/base/goods/queryAllProductAttr',
data:{
categoryId:454,
displayPosition:1
}
},function(res){
console.log(res);
},true);
}
}
}
};
... ... @@ -90,7 +112,7 @@ var ENUM={
/*下拉选择*/
new common.dropDown({el:"#brandId",ajax:"queryBrand"});
new common.dropDown({el:"#shopId",ajax:"queryShopPass",param:function(){
new common.dropDown({el:"#shopId",ajax:"sortbybrand",param:function(){
return {brandId:$("#brandId").val()}
}});
... ... @@ -99,6 +121,46 @@ new common.dropDown({el:"#supplierId",ajax:"querySupplier"});
var e=new common.edit("#basicInfo");
e.init();
//attributeTable
var ag=new common.grid({
el:"#attributeTable",
columns:[
{display:"名称",name:"attributeName"},
{display:"属性",render:function(item){
item.required=item.isMust=="Y"?"required":"";
item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
return {name:elem}
});
// item.attributeValues={name:};
return common.util.__template2($("#template3").html(),item);
}},
{display:"备注",name:"remark"}
]
});
ag.init([{
attributeId: 15,
attributeName: "防风外套属性",
attributeType: 2,
attributeValues: "11,22",
belong: 1,
categoryId: 454,
createTime: 1453951139,
displayPosition: 1,
inputType: "checkbox",
isAllowAlias: "Y",
isColor: "N",
isMust: "Y",
isSearch: "Y",
maxValueLen: 50,
orderBy: 0,
remark: "备注",
saleType: 0,
state: 0
}]);
//baseTable
var g=new common.grid({
... ... @@ -137,7 +199,7 @@ var g=new common.grid({
if(sort){
new common.dropDown({
el: ".btn-sort-chima",
ajax: "sortsize",
ajax: "sortsize2",
params: {
"sortId" : sort
}
... ...
... ... @@ -15,7 +15,9 @@ var urlObj = {
'maxSort': '/goods/query/maxSort',//查询一级类目列表接口
'shopsRest': '/ShopsRest/getShopsByName', // 店铺列表
'xiangouID': '/limit/xiangouID/selectActivityListForSelect', //限购ID
'sortsize2':'/erpproduct/sortsize/ajax/querySizeListBySortId',//尺码
'sortbybrand':'/goods/query/queryShopsByBrandId',
'sortlist': '/product/class/queryAllProductSortList',
'productPool': '/runManage/subjectManage/queryBaseProductPoolListByName',
'firstCategory': '/operations/helpcategory/getCategoryListByPid',
... ...
... ... @@ -117,7 +117,7 @@ tabTree.prototype= {
for (var i = g.active_count + 1; i < p.datas.length; i++) {
$("span", g.dom["chooseArea"]).eq(i).html(p.columns[i].text)
}
if (g.active_count + 1 <= p.datas.length - 1) {
if (g.active_count + 1 <= 3) {
g.active_count++;
var _next = g.active_count;
if (_data.item) {
... ... @@ -128,7 +128,7 @@ tabTree.prototype= {
g.active_count++;
_next = g.active_count
}
if (g.active_count <= p.datas.length - 1) {
if (g.active_count <= 3) {
g.getData(g._getParam(_next))
} else {
g.active_count = 0;
... ...
exports.domain =require('../config/common.js').domain;
// exports.domain = "http://172.16.6.240:8088/platform";
exports.res = [
{//基础商品列表
route:'/supplier/baseproduct/index',
... ... @@ -267,5 +267,14 @@ exports.res = [
{name:'productSknList',type:'String'},
{name:'rejectReason',type:"String"}
]
},{
route:'/base/goods/queryAllProductAttr',
method:'POST',
url:'/product/queryAllProductAttr',
params:[
{name:'categoryId',type:'Number'},
// 1:基础商品-非销售属性 2:网销信息-上架后补全信息 3:网销信息-商品参数
{name:'displayPosition',type:'Number'}
]
}
];
\ No newline at end of file
... ...
... ... @@ -45,6 +45,15 @@ exports.res = [
]
},
{
route:'/erpproduct/sortsize/ajax/querySizeListBySortId4Html',
method:'POST',
url:'/product/querySizeListBySortId4Html',
params:[
{name:"idName",type:"String"},
{name:"sortId",type:"Number"}
]
},
{//尺码模糊查询【验证通过】
route:'/erpproduct/sortsize/ajax/automatic',
method:'POST',
... ... @@ -99,7 +108,16 @@ exports.res = [
name: 'idName',
type: 'String'
}]
},{//模糊查询
},{//根据品牌查询店铺
route:'/goods/query/queryShopsByBrandId',
method:'POST',
url:'/ShopsRest/queryShopsByBrandId',
params: [{
name: 'idName',
type: 'String'
},{name:'brandId',type:'Number'}]
},
{//模糊查询
route:'/limit/xiangouID/selectActivityListForSelect',
method:'POST',
url:'/DrawlineActivityRest/selectActivityListForSelect',
... ...
... ... @@ -29,6 +29,14 @@
<div class="panel-body" id="basicInfo">
</div>
<div class="panel-heading">
<h4 class="panel-title">非销售属性</h4>
</div>
<div class="panel-body">
<div class="row">
<div id="attributeTable"></div>
</div>
</div>
<div class="panel-heading">
<h4 class="panel-title">销售属性</h4>
... ... @@ -269,7 +277,7 @@
<input type="radio" name="isAdvance" value="Y"></label>
<label class="radio-inline">
<input type="radio" name="isAdvance" value="N"></label>
<input type="hidden" id="isAdvance" value="[[isAdvance]]" for="radio" />
<input type="hidden" id="isAdvance" value="[[isAdvance||'N']]" for="radio" />
</div>
[[/if]]
</div>
... ... @@ -334,4 +342,39 @@
</div>
</div>
</script>
<script type="text/template" id="template3">
<div class="form-group">
[[if inputType=='checkbox']]
[[each attributeValues as item index ]]
<label class="radio-inline">
<input type="checkbox" name="attr_[[__index]]" value="[[item.name]]">[[item.name]]</label>
[[/each]]
<input type="hidden" id="attr_[[__index]]" [[required]] for="checkbox"/>
[[/if]]
[[if inputType=='radio']]
[[each attributeValues as item index ]]
<label class="radio-inline">
<input type="radio" name="attr_[[__index]]" value="">[[item.name]]</label>
[[/each]]
<input type="hidden" id="attr_[[__index]]" [[required]] for="checkbox"/>
[[/if]]
[[if inputType=='select']]
<select class="form-control" [[required]]>
[[each attributeValues as item index ]]
<option>[[item.name]]</option>
[[/each]]
</select>
[[/if]]
[[if inputType=='text']]
<input type="text" class="form-control" [[required]] maxlength='[[maxValueLen]]'/>
[[/if]]
[[if inputType=='textarea']]
<textarea class="form-control" [[required]] maxlength='[[maxValueLen]]'></textarea>
[[/if]]
</div>
</script>
\ No newline at end of file
... ...