Authored by weiqingting

基础商品bug修改

@@ -25,6 +25,8 @@ console.log(RESPONSEDATA); @@ -25,6 +25,8 @@ console.log(RESPONSEDATA);
25 25
26 26
27 27
  28 +
  29 +
28 /*审核*/ 30 /*审核*/
29 31
30 $("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA)); 32 $("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA));
@@ -32,11 +34,17 @@ $("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA @@ -32,11 +34,17 @@ $("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA
32 /*商品名称*/ 34 /*商品名称*/
33 var Bll={ 35 var Bll={
34 validateSort:function(){ 36 validateSort:function(){
  37 + var id=false;
35 var select=tabTree.getAddress(); 38 var select=tabTree.getAddress();
36 - if(select.length>2&&select[select.length-1]&&select[select.length-1].id){  
37 - return select[select.length-1].id; 39 + if(select.length>2){
  40 + if(select[2]&&select[2].id){
  41 + id=select[2].id;
  42 + }
  43 + if(select[3]&&select[3].id){
  44 + id=select[3].id;
  45 + }
38 } 46 }
39 - return false; 47 + return id;
40 }, 48 },
41 productNameArr:['','',''], 49 productNameArr:['','',''],
42 setProductName:function(){ 50 setProductName:function(){
@@ -60,6 +68,20 @@ var SORTDATA={ @@ -60,6 +68,20 @@ var SORTDATA={
60 if(data.length>2){ 68 if(data.length>2){
61 Bll.productNameArr[2]=data[data.length-1].sortName; 69 Bll.productNameArr[2]=data[data.length-1].sortName;
62 Bll.setProductName(); 70 Bll.setProductName();
  71 + /*查出非销售属性*/
  72 + var sorid=Bll.validateSort();
  73 + if(sorid){
  74 + common.util.__ajax({
  75 + url:'/base/goods/queryAllProductAttr',
  76 + data:{
  77 + categoryId:454,
  78 + displayPosition:1
  79 + }
  80 + },function(res){
  81 + console.log(res);
  82 + },true);
  83 + }
  84 +
63 } 85 }
64 } 86 }
65 }; 87 };
@@ -90,7 +112,7 @@ var ENUM={ @@ -90,7 +112,7 @@ var ENUM={
90 /*下拉选择*/ 112 /*下拉选择*/
91 new common.dropDown({el:"#brandId",ajax:"queryBrand"}); 113 new common.dropDown({el:"#brandId",ajax:"queryBrand"});
92 114
93 -new common.dropDown({el:"#shopId",ajax:"queryShopPass",param:function(){ 115 +new common.dropDown({el:"#shopId",ajax:"sortbybrand",param:function(){
94 return {brandId:$("#brandId").val()} 116 return {brandId:$("#brandId").val()}
95 }}); 117 }});
96 118
@@ -99,6 +121,46 @@ new common.dropDown({el:"#supplierId",ajax:"querySupplier"}); @@ -99,6 +121,46 @@ new common.dropDown({el:"#supplierId",ajax:"querySupplier"});
99 var e=new common.edit("#basicInfo"); 121 var e=new common.edit("#basicInfo");
100 e.init(); 122 e.init();
101 123
  124 +
  125 +
  126 +//attributeTable
  127 +
  128 +var ag=new common.grid({
  129 + el:"#attributeTable",
  130 + columns:[
  131 + {display:"名称",name:"attributeName"},
  132 + {display:"属性",render:function(item){
  133 + item.required=item.isMust=="Y"?"required":"";
  134 + item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
  135 + return {name:elem}
  136 + });
  137 + // item.attributeValues={name:};
  138 + return common.util.__template2($("#template3").html(),item);
  139 + }},
  140 + {display:"备注",name:"remark"}
  141 + ]
  142 +});
  143 +ag.init([{
  144 +attributeId: 15,
  145 +attributeName: "防风外套属性",
  146 +attributeType: 2,
  147 +attributeValues: "11,22",
  148 +belong: 1,
  149 +categoryId: 454,
  150 +createTime: 1453951139,
  151 +displayPosition: 1,
  152 +inputType: "checkbox",
  153 +isAllowAlias: "Y",
  154 +isColor: "N",
  155 +isMust: "Y",
  156 +isSearch: "Y",
  157 +maxValueLen: 50,
  158 +orderBy: 0,
  159 +remark: "备注",
  160 +saleType: 0,
  161 +state: 0
  162 +}]);
  163 +
102 //baseTable 164 //baseTable
103 165
104 var g=new common.grid({ 166 var g=new common.grid({
@@ -137,7 +199,7 @@ var g=new common.grid({ @@ -137,7 +199,7 @@ var g=new common.grid({
137 if(sort){ 199 if(sort){
138 new common.dropDown({ 200 new common.dropDown({
139 el: ".btn-sort-chima", 201 el: ".btn-sort-chima",
140 - ajax: "sortsize", 202 + ajax: "sortsize2",
141 params: { 203 params: {
142 "sortId" : sort 204 "sortId" : sort
143 } 205 }
@@ -15,7 +15,9 @@ var urlObj = { @@ -15,7 +15,9 @@ var urlObj = {
15 'maxSort': '/goods/query/maxSort',//查询一级类目列表接口 15 'maxSort': '/goods/query/maxSort',//查询一级类目列表接口
16 'shopsRest': '/ShopsRest/getShopsByName', // 店铺列表 16 'shopsRest': '/ShopsRest/getShopsByName', // 店铺列表
17 'xiangouID': '/limit/xiangouID/selectActivityListForSelect', //限购ID 17 'xiangouID': '/limit/xiangouID/selectActivityListForSelect', //限购ID
18 - 18 + 'sortsize2':'/erpproduct/sortsize/ajax/querySizeListBySortId',//尺码
  19 + 'sortbybrand':'/goods/query/queryShopsByBrandId',
  20 +
19 'sortlist': '/product/class/queryAllProductSortList', 21 'sortlist': '/product/class/queryAllProductSortList',
20 'productPool': '/runManage/subjectManage/queryBaseProductPoolListByName', 22 'productPool': '/runManage/subjectManage/queryBaseProductPoolListByName',
21 'firstCategory': '/operations/helpcategory/getCategoryListByPid', 23 'firstCategory': '/operations/helpcategory/getCategoryListByPid',
@@ -117,7 +117,7 @@ tabTree.prototype= { @@ -117,7 +117,7 @@ tabTree.prototype= {
117 for (var i = g.active_count + 1; i < p.datas.length; i++) { 117 for (var i = g.active_count + 1; i < p.datas.length; i++) {
118 $("span", g.dom["chooseArea"]).eq(i).html(p.columns[i].text) 118 $("span", g.dom["chooseArea"]).eq(i).html(p.columns[i].text)
119 } 119 }
120 - if (g.active_count + 1 <= p.datas.length - 1) { 120 + if (g.active_count + 1 <= 3) {
121 g.active_count++; 121 g.active_count++;
122 var _next = g.active_count; 122 var _next = g.active_count;
123 if (_data.item) { 123 if (_data.item) {
@@ -128,7 +128,7 @@ tabTree.prototype= { @@ -128,7 +128,7 @@ tabTree.prototype= {
128 g.active_count++; 128 g.active_count++;
129 _next = g.active_count 129 _next = g.active_count
130 } 130 }
131 - if (g.active_count <= p.datas.length - 1) { 131 + if (g.active_count <= 3) {
132 g.getData(g._getParam(_next)) 132 g.getData(g._getParam(_next))
133 } else { 133 } else {
134 g.active_count = 0; 134 g.active_count = 0;
1 exports.domain =require('../config/common.js').domain; 1 exports.domain =require('../config/common.js').domain;
2 - 2 +// exports.domain = "http://172.16.6.240:8088/platform";
3 exports.res = [ 3 exports.res = [
4 {//基础商品列表 4 {//基础商品列表
5 route:'/supplier/baseproduct/index', 5 route:'/supplier/baseproduct/index',
@@ -267,5 +267,14 @@ exports.res = [ @@ -267,5 +267,14 @@ exports.res = [
267 {name:'productSknList',type:'String'}, 267 {name:'productSknList',type:'String'},
268 {name:'rejectReason',type:"String"} 268 {name:'rejectReason',type:"String"}
269 ] 269 ]
  270 + },{
  271 + route:'/base/goods/queryAllProductAttr',
  272 + method:'POST',
  273 + url:'/product/queryAllProductAttr',
  274 + params:[
  275 + {name:'categoryId',type:'Number'},
  276 + // 1:基础商品-非销售属性 2:网销信息-上架后补全信息 3:网销信息-商品参数
  277 + {name:'displayPosition',type:'Number'}
  278 + ]
270 } 279 }
271 ]; 280 ];
@@ -45,6 +45,15 @@ exports.res = [ @@ -45,6 +45,15 @@ exports.res = [
45 45
46 ] 46 ]
47 }, 47 },
  48 + {
  49 + route:'/erpproduct/sortsize/ajax/querySizeListBySortId4Html',
  50 + method:'POST',
  51 + url:'/product/querySizeListBySortId4Html',
  52 + params:[
  53 + {name:"idName",type:"String"},
  54 + {name:"sortId",type:"Number"}
  55 + ]
  56 + },
48 {//尺码模糊查询【验证通过】 57 {//尺码模糊查询【验证通过】
49 route:'/erpproduct/sortsize/ajax/automatic', 58 route:'/erpproduct/sortsize/ajax/automatic',
50 method:'POST', 59 method:'POST',
@@ -99,7 +108,16 @@ exports.res = [ @@ -99,7 +108,16 @@ exports.res = [
99 name: 'idName', 108 name: 'idName',
100 type: 'String' 109 type: 'String'
101 }] 110 }]
102 - },{//模糊查询 111 + },{//根据品牌查询店铺
  112 + route:'/goods/query/queryShopsByBrandId',
  113 + method:'POST',
  114 + url:'/ShopsRest/queryShopsByBrandId',
  115 + params: [{
  116 + name: 'idName',
  117 + type: 'String'
  118 + },{name:'brandId',type:'Number'}]
  119 + },
  120 + {//模糊查询
103 route:'/limit/xiangouID/selectActivityListForSelect', 121 route:'/limit/xiangouID/selectActivityListForSelect',
104 method:'POST', 122 method:'POST',
105 url:'/DrawlineActivityRest/selectActivityListForSelect', 123 url:'/DrawlineActivityRest/selectActivityListForSelect',
@@ -29,6 +29,14 @@ @@ -29,6 +29,14 @@
29 <div class="panel-body" id="basicInfo"> 29 <div class="panel-body" id="basicInfo">
30 30
31 </div> 31 </div>
  32 + <div class="panel-heading">
  33 + <h4 class="panel-title">非销售属性</h4>
  34 + </div>
  35 + <div class="panel-body">
  36 + <div class="row">
  37 + <div id="attributeTable"></div>
  38 + </div>
  39 + </div>
32 40
33 <div class="panel-heading"> 41 <div class="panel-heading">
34 <h4 class="panel-title">销售属性</h4> 42 <h4 class="panel-title">销售属性</h4>
@@ -269,7 +277,7 @@ @@ -269,7 +277,7 @@
269 <input type="radio" name="isAdvance" value="Y"></label> 277 <input type="radio" name="isAdvance" value="Y"></label>
270 <label class="radio-inline"> 278 <label class="radio-inline">
271 <input type="radio" name="isAdvance" value="N"></label> 279 <input type="radio" name="isAdvance" value="N"></label>
272 - <input type="hidden" id="isAdvance" value="[[isAdvance]]" for="radio" /> 280 + <input type="hidden" id="isAdvance" value="[[isAdvance||'N']]" for="radio" />
273 </div> 281 </div>
274 [[/if]] 282 [[/if]]
275 </div> 283 </div>
@@ -334,4 +342,39 @@ @@ -334,4 +342,39 @@
334 </div> 342 </div>
335 343
336 </div> 344 </div>
  345 +</script>
  346 +
  347 +<script type="text/template" id="template3">
  348 +<div class="form-group">
  349 +[[if inputType=='checkbox']]
  350 + [[each attributeValues as item index ]]
  351 +<label class="radio-inline">
  352 + <input type="checkbox" name="attr_[[__index]]" value="[[item.name]]">[[item.name]]</label>
  353 + [[/each]]
  354 + <input type="hidden" id="attr_[[__index]]" [[required]] for="checkbox"/>
  355 +[[/if]]
  356 +
  357 +[[if inputType=='radio']]
  358 +[[each attributeValues as item index ]]
  359 +<label class="radio-inline">
  360 + <input type="radio" name="attr_[[__index]]" value="">[[item.name]]</label>
  361 +[[/each]]
  362 +<input type="hidden" id="attr_[[__index]]" [[required]] for="checkbox"/>
  363 +[[/if]]
  364 +
  365 +[[if inputType=='select']]
  366 +<select class="form-control" [[required]]>
  367 +[[each attributeValues as item index ]]
  368 + <option>[[item.name]]</option>
  369 +[[/each]]
  370 +</select>
  371 +[[/if]]
  372 +
  373 +[[if inputType=='text']]
  374 +<input type="text" class="form-control" [[required]] maxlength='[[maxValueLen]]'/>
  375 +[[/if]]
  376 +[[if inputType=='textarea']]
  377 +<textarea class="form-control" [[required]] maxlength='[[maxValueLen]]'></textarea>
  378 +[[/if]]
  379 +</div>
337 </script> 380 </script>