Showing
18 changed files
with
107 additions
and
81 deletions
@@ -179,7 +179,6 @@ if(!param){ | @@ -179,7 +179,6 @@ if(!param){ | ||
179 | } | 179 | } |
180 | 180 | ||
181 | 181 | ||
182 | - | ||
183 | var g=new common.grid({ | 182 | var g=new common.grid({ |
184 | el:"#basicTable", | 183 | el:"#basicTable", |
185 | columns:[ | 184 | columns:[ |
@@ -204,7 +203,7 @@ var g=new common.grid({ | @@ -204,7 +203,7 @@ var g=new common.grid({ | ||
204 | g.__gsm[item.__index]=item.goodsSizeList.length; | 203 | g.__gsm[item.__index]=item.goodsSizeList.length; |
205 | } | 204 | } |
206 | var html=[]; | 205 | var html=[]; |
207 | - html.push("<div class='form-group'><div class='col-sm-11 red'><input type=text value='"+item.modelCode+"' data-index="+item.__index+" class='modelCode form-control' placeholder='款型编码' /></div></div>"); | 206 | + html.push("<div class='form-group'><div class='col-sm-11 red'><input type=text value='"+item.factoryCode+"' data-index="+item.__index+" class='modelCode form-control' placeholder='款型编码' /></div></div>"); |
208 | html.push('<div class="rows" id="rows__'+item.__index+'">'); | 207 | html.push('<div class="rows" id="rows__'+item.__index+'">'); |
209 | item.goodsSizeList=item.goodsSizeList||[$.extend({},ENUM.goodsSizeList)]; | 208 | item.goodsSizeList=item.goodsSizeList||[$.extend({},ENUM.goodsSizeList)]; |
210 | var ISXIANGO=(common.util.__input("isAdvance")=="Y"&&+RESPONSEDATA.isAuditing==200)?true:false; | 209 | var ISXIANGO=(common.util.__input("isAdvance")=="Y"&&+RESPONSEDATA.isAuditing==200)?true:false; |
@@ -278,7 +277,7 @@ $(document).on("click",".sortadd",function(){ | @@ -278,7 +277,7 @@ $(document).on("click",".sortadd",function(){ | ||
278 | var goodsSizeList=$.extend({},ENUM.goodsSizeList); | 277 | var goodsSizeList=$.extend({},ENUM.goodsSizeList); |
279 | goodsSizeList.salePrice=$("#salesPriceStr").val(); | 278 | goodsSizeList.salePrice=$("#salesPriceStr").val(); |
280 | g.__rows.push({ | 279 | g.__rows.push({ |
281 | - "modelCode": "", | 280 | + "factoryCode": "", |
282 | "goodsColorImage": "", | 281 | "goodsColorImage": "", |
283 | goodsName: $(this).text(), | 282 | goodsName: $(this).text(), |
284 | colorId: (+$(this).data("id")), | 283 | colorId: (+$(this).data("id")), |
@@ -340,7 +339,7 @@ $(document).on("click",".sortdelete",function(){ | @@ -340,7 +339,7 @@ $(document).on("click",".sortdelete",function(){ | ||
340 | }); | 339 | }); |
341 | $(document).on("change",".modelCode",function(){ | 340 | $(document).on("change",".modelCode",function(){ |
342 | var item=g.__rows[$(this).data("index")]; | 341 | var item=g.__rows[$(this).data("index")]; |
343 | - item.modelCode=$(this).val(); | 342 | + item.factoryCode=$(this).val(); |
344 | }); | 343 | }); |
345 | $(document).on("click",".btn-sort-add",function(){ | 344 | $(document).on("click",".btn-sort-add",function(){ |
346 | var item=g.__rows[$(this).data("index")]; | 345 | var item=g.__rows[$(this).data("index")]; |
@@ -374,7 +373,7 @@ $(document).on("change",".btn-sort-tiaoma",function(){ | @@ -374,7 +373,7 @@ $(document).on("change",".btn-sort-tiaoma",function(){ | ||
374 | var _index=$(this).data("index"); | 373 | var _index=$(this).data("index"); |
375 | var _eq=$(this).data("eq"); | 374 | var _eq=$(this).data("eq"); |
376 | var item=g.__rows[_index].goodsSizeList[_eq]; | 375 | var item=g.__rows[_index].goodsSizeList[_eq]; |
377 | - item.barCode=$(this).val(); | 376 | + item.factoryCode=$(this).val(); |
378 | }); | 377 | }); |
379 | $(document).on("change",".btn-sort-kebu",function(){ | 378 | $(document).on("change",".btn-sort-kebu",function(){ |
380 | var _index=$(this).data("index"); | 379 | var _index=$(this).data("index"); |
@@ -454,35 +453,35 @@ e.on("validate",function(){ | @@ -454,35 +453,35 @@ e.on("validate",function(){ | ||
454 | } | 453 | } |
455 | 454 | ||
456 | //RESPONSEDATA.productSkn | 455 | //RESPONSEDATA.productSkn |
457 | - console.log("item1.barCode",item1.barCode) | 456 | + console.log("item1.factoryCode",item1.factoryCode) |
458 | map[gname+"_"+item1.sizeId]=""; | 457 | map[gname+"_"+item1.sizeId]=""; |
459 | //修改 | 458 | //修改 |
460 | if(RESPONSEDATA.productSkn){ | 459 | if(RESPONSEDATA.productSkn){ |
461 | if(index1>g.__gsm[index]-1){ | 460 | if(index1>g.__gsm[index]-1){ |
462 | //大于原来的计算 | 461 | //大于原来的计算 |
463 | - if(map2.hasOwnProperty(item1.barCode)){ | 462 | + if(map2.hasOwnProperty(item1.factoryCode)){ |
464 | _count1++; | 463 | _count1++; |
465 | } | 464 | } |
466 | - map2[item1.barCode]=""; | ||
467 | - console.log("大于原来的计算",item1.barCode+":"+_count1); | 465 | + map2[item1.factoryCode]=""; |
466 | + console.log("大于原来的计算",item1.factoryCode+":"+_count1); | ||
468 | }else{ | 467 | }else{ |
469 | //小于原来,并且有值 | 468 | //小于原来,并且有值 |
470 | - if(item1.barCode){ | ||
471 | - if(map2.hasOwnProperty(item1.barCode)){ | 469 | + if(item1.factoryCode){ |
470 | + if(map2.hasOwnProperty(item1.factoryCode)){ | ||
472 | _count1++; | 471 | _count1++; |
473 | } | 472 | } |
474 | - map2[item1.barCode]=""; | 473 | + map2[item1.factoryCode]=""; |
475 | console.log("小于原来,并且有值",_count1); | 474 | console.log("小于原来,并且有值",_count1); |
476 | } | 475 | } |
477 | console.log("没值",_count1); | 476 | console.log("没值",_count1); |
478 | } | 477 | } |
479 | }else{ | 478 | }else{ |
480 | //添加时候计算 | 479 | //添加时候计算 |
481 | - if(item1.barCode){ | ||
482 | - if(map2.hasOwnProperty(item1.barCode)){ | 480 | + if(item1.factoryCode){ |
481 | + if(map2.hasOwnProperty(item1.factoryCode)){ | ||
483 | _count1++; | 482 | _count1++; |
484 | } | 483 | } |
485 | - map2[item1.barCode]=""; | 484 | + map2[item1.factoryCode]=""; |
486 | } | 485 | } |
487 | console.log("添加时候计算",_count1); | 486 | console.log("添加时候计算",_count1); |
488 | } | 487 | } |
@@ -490,7 +489,7 @@ e.on("validate",function(){ | @@ -490,7 +489,7 @@ e.on("validate",function(){ | ||
490 | if(g.__gsm[index]&&index1<g.__gsm[index]){ | 489 | if(g.__gsm[index]&&index1<g.__gsm[index]){ |
491 | return; | 490 | return; |
492 | } | 491 | } |
493 | - map3.push(item1.barCode); | 492 | + map3.push(item1.factoryCode); |
494 | }); | 493 | }); |
495 | }); | 494 | }); |
496 | } | 495 | } |
@@ -8,6 +8,8 @@ var _= require('lodash'); | @@ -8,6 +8,8 @@ var _= require('lodash'); | ||
8 | var ipaddr = require('ipaddr.js'); | 8 | var ipaddr = require('ipaddr.js'); |
9 | var options=require('../staticConfig.js').staticDir; | 9 | var options=require('../staticConfig.js').staticDir; |
10 | 10 | ||
11 | +var author=require("../stub/service/auth"); | ||
12 | + | ||
11 | /** | 13 | /** |
12 | * 不需要权限校验配置 | 14 | * 不需要权限校验配置 |
13 | */ | 15 | */ |
@@ -45,14 +47,7 @@ module.exports = function(req, res, next) { | @@ -45,14 +47,7 @@ module.exports = function(req, res, next) { | ||
45 | //方法名称 | 47 | //方法名称 |
46 | var method = req.method; | 48 | var method = req.method; |
47 | 49 | ||
48 | - | ||
49 | - //访问路由路径 | ||
50 | - var path = req.route?req.route.path:''; | ||
51 | - if(req.session.user&&!checkPath(req.path,req)) { | ||
52 | - res.status(403); | ||
53 | - res.render('error/error_nolayout',{message:NO_AUTH,layout:false,cssfile:CSS_FILE}); | ||
54 | - return; | ||
55 | - } | 50 | + function nextRedirect(method,path){ |
56 | //进行白名单验证和session验证 | 51 | //进行白名单验证和session验证 |
57 | if(guestAccessList[method+":"+path]||req.session.user) { | 52 | if(guestAccessList[method+":"+path]||req.session.user) { |
58 | //判断是否已存在appendData | 53 | //判断是否已存在appendData |
@@ -76,6 +71,38 @@ module.exports = function(req, res, next) { | @@ -76,6 +71,38 @@ module.exports = function(req, res, next) { | ||
76 | //如果是登陆界面不加载布局 | 71 | //如果是登陆界面不加载布局 |
77 | res.render('pages/login',{layout:false,cssfile:CSS_FILE,path:STATIC_PATH}); | 72 | res.render('pages/login',{layout:false,cssfile:CSS_FILE,path:STATIC_PATH}); |
78 | } | 73 | } |
74 | + } | ||
75 | + | ||
76 | + function filterOriginalUrl(path){ | ||
77 | + if(!/\.\w+/.test(path)){ | ||
78 | + return path.replace(/\?.+/,''); | ||
79 | + } | ||
80 | + return ""; | ||
81 | + } | ||
82 | + //访问路由路径 | ||
83 | + var path = req.route?req.route.path:filterOriginalUrl(req.originalUrl); | ||
84 | + if(req.session.user) { | ||
85 | + if(guestAccessList[method+":"+path]){ | ||
86 | + nextRedirect(method,path); | ||
87 | + return; | ||
88 | + } | ||
89 | + /*判断权限*/ | ||
90 | + if(path&&req.session.user.allRight[path]){ | ||
91 | + author.validateAuthor(req.session.user.auth.pid,req.session.user.auth.role_id,path,function(data){ | ||
92 | + if(data.code!=200){ | ||
93 | + res.status(403); | ||
94 | + res.render('error/error_nolayout',{message:NO_AUTH,layout:false,cssfile:CSS_FILE}); | ||
95 | + return; | ||
96 | + } | ||
97 | + nextRedirect(method,path); | ||
98 | + }); | ||
99 | + }else{ | ||
100 | + nextRedirect(method,path); | ||
101 | + } | ||
102 | + }else{ | ||
103 | + nextRedirect(method,path); | ||
104 | + } | ||
105 | + | ||
79 | } | 106 | } |
80 | 107 | ||
81 | /** | 108 | /** |
@@ -58,7 +58,7 @@ exports.callLogin = function(user, password, res) { | @@ -58,7 +58,7 @@ exports.callLogin = function(user, password, res) { | ||
58 | var userInfo = { | 58 | var userInfo = { |
59 | auth: userData, | 59 | auth: userData, |
60 | menu: data.menu, | 60 | menu: data.menu, |
61 | - noRight: data.noRight | 61 | + allRight: data.allRight |
62 | } | 62 | } |
63 | //获取店铺信息 | 63 | //获取店铺信息 |
64 | _getShopList(userData.pid, function(err, data) { | 64 | _getShopList(userData.pid, function(err, data) { |
@@ -106,10 +106,9 @@ function _callGetMenu(pid,roleid, callback) { | @@ -106,10 +106,9 @@ function _callGetMenu(pid,roleid, callback) { | ||
106 | if(ret.data) { | 106 | if(ret.data) { |
107 | menuData = _makeMenu(ret.data); | 107 | menuData = _makeMenu(ret.data); |
108 | } | 108 | } |
109 | - _getAllMenu(function(ret) { | ||
110 | - menuData.noRight = filterRight(ret, menuData); | ||
111 | - delete menuData.right; | ||
112 | - callback(null, menuData); | 109 | + _getAllRight(function(ret){ |
110 | + menuData.allRight = ret; | ||
111 | + callback(null,menuData); | ||
113 | }); | 112 | }); |
114 | 113 | ||
115 | } | 114 | } |
@@ -227,3 +226,45 @@ function _makeMenu (data) { | @@ -227,3 +226,45 @@ function _makeMenu (data) { | ||
227 | right:right | 226 | right:right |
228 | }; | 227 | }; |
229 | } | 228 | } |
229 | + | ||
230 | + | ||
231 | +/** | ||
232 | +* 验证权限 | ||
233 | +*/ | ||
234 | +exports.validateAuthor=function(pid,roleid,path,callback){ | ||
235 | + var options = { | ||
236 | + url:oldService.isUsedMenuAuth, | ||
237 | + form:'['+pid+','+roleid+', "'+path+'", "", "", '+WEBSITE+']' | ||
238 | + } | ||
239 | + console.log(options); | ||
240 | + util.httpCall(options,function(err,ret){ | ||
241 | + if(err) { | ||
242 | + callback({}); | ||
243 | + } else { | ||
244 | + callback(ret.data); | ||
245 | + } | ||
246 | + }); | ||
247 | +} | ||
248 | + | ||
249 | +function _getAllRight(callback){ | ||
250 | + var options = { | ||
251 | + url:oldService.allRight, | ||
252 | + form:'[false]' | ||
253 | + } | ||
254 | + console.log(options); | ||
255 | + util.httpCall(options,function(err,ret){ | ||
256 | + if(err) { | ||
257 | + callback({}); | ||
258 | + } else { | ||
259 | + var map={}; | ||
260 | + ret.data.forEach(function(data){ | ||
261 | + console.log(data); | ||
262 | + if(data.platform_id==WEBSITE){ | ||
263 | + map[data.path]=true; | ||
264 | + } | ||
265 | + | ||
266 | + }); | ||
267 | + callback(map); | ||
268 | + } | ||
269 | + }); | ||
270 | +} |
@@ -16,5 +16,7 @@ module.exports = { | @@ -16,5 +16,7 @@ module.exports = { | ||
16 | getResourceByPid: oldSerDomain + '/service/account/v1/Profile/getMenuByPid', | 16 | getResourceByPid: oldSerDomain + '/service/account/v1/Profile/getMenuByPid', |
17 | getAllResByWebsite: oldSerDomain + '/service/setting/v1/menu/getAllMenu', | 17 | getAllResByWebsite: oldSerDomain + '/service/setting/v1/menu/getAllMenu', |
18 | getShopList: domain+'/ShopsRest/queryShopsByAdminPid', | 18 | getShopList: domain+'/ShopsRest/queryShopsByAdminPid', |
19 | - changeShops:'http://shops.yohobuy.com/index/ajaxshop' | 19 | + changeShops:'http://shops.yohobuy.com/index/ajaxshop', |
20 | + isUsedMenuAuth:oldSerDomain + '/service/account/v1/profile/authPath', | ||
21 | + allRight:oldSerDomain+'/service/setting/v1/action/getAllAction' | ||
20 | }; | 22 | }; |
@@ -7,9 +7,8 @@ | @@ -7,9 +7,8 @@ | ||
7 | <ul class="breadcrumb"> | 7 | <ul class="breadcrumb"> |
8 | <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li> | 8 | <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li> |
9 | <li><a href="#" onclick="javascript:history.go(-1);">商品</a></li> | 9 | <li><a href="#" onclick="javascript:history.go(-1);">商品</a></li> |
10 | - <li>基础商品</li> | 10 | + <li>{{pageTitle}}</li> |
11 | </ul> | 11 | </ul> |
12 | - <h4>{{pageTitle}}</h4> | ||
13 | </div> | 12 | </div> |
14 | </div><!-- media --> | 13 | </div><!-- media --> |
15 | </div> | 14 | </div> |
@@ -84,7 +83,7 @@ | @@ -84,7 +83,7 @@ | ||
84 | <input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required match="numbers" type="text"></input> | 83 | <input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required match="numbers" type="text"></input> |
85 | </div> | 84 | </div> |
86 | <div class="col-sm-2"> | 85 | <div class="col-sm-2"> |
87 | - <input class="form-control btn-sort-tiaoma" value="[[item.barCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input> | 86 | + <input class="form-control btn-sort-tiaoma" value="[[item.factoryCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input> |
88 | </div> | 87 | </div> |
89 | <div class="col-sm-2"> | 88 | <div class="col-sm-2"> |
90 | <select class="form-control btn-sort-kebu" value="[[item.isSuppled||'N']]" data-index=[[index]] data-eq=[[__index]]> | 89 | <select class="form-control btn-sort-kebu" value="[[item.isSuppled||'N']]" data-index=[[index]] data-eq=[[__index]]> |
@@ -121,6 +120,7 @@ | @@ -121,6 +120,7 @@ | ||
121 | </select> | 120 | </select> |
122 | </div> | 121 | </div> |
123 | 122 | ||
123 | + | ||
124 | <label class="col-sm-1 control-label">JIT供应商</label> | 124 | <label class="col-sm-1 control-label">JIT供应商</label> |
125 | <div class="col-sm-2"> | 125 | <div class="col-sm-2"> |
126 | <select id="supplierId" class="form-control"> | 126 | <select id="supplierId" class="form-control"> |
@@ -9,9 +9,8 @@ | @@ -9,9 +9,8 @@ | ||
9 | <li><a href="#">商品管理</a></li> | 9 | <li><a href="#">商品管理</a></li> |
10 | 10 | ||
11 | 11 | ||
12 | - <li>基础商品</li> | 12 | + <li>查看详情</li> |
13 | </ul> | 13 | </ul> |
14 | - <h4>查看详情</h4> | ||
15 | </div> | 14 | </div> |
16 | </div> | 15 | </div> |
17 | </div> | 16 | </div> |
@@ -129,8 +128,8 @@ | @@ -129,8 +128,8 @@ | ||
129 | <span>[[_item.sizeName]]</span> | 128 | <span>[[_item.sizeName]]</span> |
130 | </th> | 129 | </th> |
131 | <th>[[_item.salePrice]]</th> | 130 | <th>[[_item.salePrice]]</th> |
132 | - <th>[[item.modelCode]]</th> | ||
133 | - <th>[[_item.barCode]]</th> | 131 | + <th>[[item.factoryCode]]</th> |
132 | + <th>[[_item.factoryCode]]</th> | ||
134 | <th>[[item.factoryGoodsName]]</th> | 133 | <th>[[item.factoryGoodsName]]</th> |
135 | [[if _item.isSuppled=="Y"]] | 134 | [[if _item.isSuppled=="Y"]] |
136 | <th>是</th> | 135 | <th>是</th> |
@@ -9,12 +9,6 @@ | @@ -9,12 +9,6 @@ | ||
9 | <li><a href="">店铺管理员关系管理</a></li> | 9 | <li><a href="">店铺管理员关系管理</a></li> |
10 | <li>列表</li> | 10 | <li>列表</li> |
11 | </ul> | 11 | </ul> |
12 | - | ||
13 | - <div> | ||
14 | - <div style="width: 30%;float: left;"> | ||
15 | - <h4>店铺管理员关系列表</h4> | ||
16 | - </div> | ||
17 | - </div> | ||
18 | </div> | 12 | </div> |
19 | </div> | 13 | </div> |
20 | </div> | 14 | </div> |
@@ -9,12 +9,6 @@ | @@ -9,12 +9,6 @@ | ||
9 | <li><a href="">店铺管理</a></li> | 9 | <li><a href="">店铺管理</a></li> |
10 | <li>{{pageTitel}}</li> | 10 | <li>{{pageTitel}}</li> |
11 | </ul> | 11 | </ul> |
12 | - | ||
13 | - <div> | ||
14 | - <div style="width: 30%;float: left;"> | ||
15 | - <h4>{{pageTitel}}</h4> | ||
16 | - </div> | ||
17 | - </div> | ||
18 | </div> | 12 | </div> |
19 | </div> | 13 | </div> |
20 | </div> | 14 | </div> |
@@ -10,12 +10,6 @@ | @@ -10,12 +10,6 @@ | ||
10 | <li><a href="">{{level1title}}</a></li> | 10 | <li><a href="">{{level1title}}</a></li> |
11 | <li>{{level2title}}</li> | 11 | <li>{{level2title}}</li> |
12 | </ul> | 12 | </ul> |
13 | - | ||
14 | - <div> | ||
15 | - <div style="width: 30%;float: left;"> | ||
16 | - <h4>{{level3title}}</h4> | ||
17 | - </div> | ||
18 | - </div> | ||
19 | </div> | 13 | </div> |
20 | {{/pagetitle}} | 14 | {{/pagetitle}} |
21 | </div> | 15 | </div> |
@@ -9,12 +9,6 @@ | @@ -9,12 +9,6 @@ | ||
9 | <li><a href="">店铺管理</a></li> | 9 | <li><a href="">店铺管理</a></li> |
10 | <li>店铺详情</li> | 10 | <li>店铺详情</li> |
11 | </ul> | 11 | </ul> |
12 | - | ||
13 | - <div> | ||
14 | - <div style="width: 30%;float: left;"> | ||
15 | - <h4>店铺详情</h4> | ||
16 | - </div> | ||
17 | - </div> | ||
18 | </div> | 12 | </div> |
19 | </div> | 13 | </div> |
20 | </div> | 14 | </div> |
@@ -7,17 +7,9 @@ | @@ -7,17 +7,9 @@ | ||
7 | 7 | ||
8 | <div class="pageheader"> | 8 | <div class="pageheader"> |
9 | <div class="media"> | 9 | <div class="media"> |
10 | - <div class="pageicon pull-left"> | ||
11 | - <i class="fa fa-th-list"></i> | ||
12 | - </div> | ||
13 | <div class="media-body" style="display: block;"> | 10 | <div class="media-body" style="display: block;"> |
14 | - <ul class="breadcrumb"> | ||
15 | - <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li> | ||
16 | - <li><a href="">店铺管理</a></li> | ||
17 | - <li>店铺装修管理</li> | ||
18 | - </ul> | ||
19 | 11 | ||
20 | - <div> | 12 | + <div class="panel-body"> |
21 | <div class="col-sm-3"> | 13 | <div class="col-sm-3"> |
22 | <h4>选择模板</h4> | 14 | <h4>选择模板</h4> |
23 | </div> | 15 | </div> |
-
Please register or login to post a comment