Authored by weiqingting

样式修改 去掉标题 权限修改 基础商品修改

... ... @@ -179,7 +179,6 @@ if(!param){
}
var g=new common.grid({
el:"#basicTable",
columns:[
... ... @@ -204,7 +203,7 @@ var g=new common.grid({
g.__gsm[item.__index]=item.goodsSizeList.length;
}
var html=[];
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>");
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>");
html.push('<div class="rows" id="rows__'+item.__index+'">');
item.goodsSizeList=item.goodsSizeList||[$.extend({},ENUM.goodsSizeList)];
var ISXIANGO=(common.util.__input("isAdvance")=="Y"&&+RESPONSEDATA.isAuditing==200)?true:false;
... ... @@ -278,7 +277,7 @@ $(document).on("click",".sortadd",function(){
var goodsSizeList=$.extend({},ENUM.goodsSizeList);
goodsSizeList.salePrice=$("#salesPriceStr").val();
g.__rows.push({
"modelCode": "",
"factoryCode": "",
"goodsColorImage": "",
goodsName: $(this).text(),
colorId: (+$(this).data("id")),
... ... @@ -340,7 +339,7 @@ $(document).on("click",".sortdelete",function(){
});
$(document).on("change",".modelCode",function(){
var item=g.__rows[$(this).data("index")];
item.modelCode=$(this).val();
item.factoryCode=$(this).val();
});
$(document).on("click",".btn-sort-add",function(){
var item=g.__rows[$(this).data("index")];
... ... @@ -374,7 +373,7 @@ $(document).on("change",".btn-sort-tiaoma",function(){
var _index=$(this).data("index");
var _eq=$(this).data("eq");
var item=g.__rows[_index].goodsSizeList[_eq];
item.barCode=$(this).val();
item.factoryCode=$(this).val();
});
$(document).on("change",".btn-sort-kebu",function(){
var _index=$(this).data("index");
... ... @@ -454,35 +453,35 @@ e.on("validate",function(){
}
//RESPONSEDATA.productSkn
console.log("item1.barCode",item1.barCode)
console.log("item1.factoryCode",item1.factoryCode)
map[gname+"_"+item1.sizeId]="";
//修改
if(RESPONSEDATA.productSkn){
if(index1>g.__gsm[index]-1){
//大于原来的计算
if(map2.hasOwnProperty(item1.barCode)){
if(map2.hasOwnProperty(item1.factoryCode)){
_count1++;
}
map2[item1.barCode]="";
console.log("大于原来的计算",item1.barCode+":"+_count1);
map2[item1.factoryCode]="";
console.log("大于原来的计算",item1.factoryCode+":"+_count1);
}else{
//小于原来,并且有值
if(item1.barCode){
if(map2.hasOwnProperty(item1.barCode)){
if(item1.factoryCode){
if(map2.hasOwnProperty(item1.factoryCode)){
_count1++;
}
map2[item1.barCode]="";
map2[item1.factoryCode]="";
console.log("小于原来,并且有值",_count1);
}
console.log("没值",_count1);
}
}else{
//添加时候计算
if(item1.barCode){
if(map2.hasOwnProperty(item1.barCode)){
if(item1.factoryCode){
if(map2.hasOwnProperty(item1.factoryCode)){
_count1++;
}
map2[item1.barCode]="";
map2[item1.factoryCode]="";
}
console.log("添加时候计算",_count1);
}
... ... @@ -490,7 +489,7 @@ e.on("validate",function(){
if(g.__gsm[index]&&index1<g.__gsm[index]){
return;
}
map3.push(item1.barCode);
map3.push(item1.factoryCode);
});
});
}
... ...
... ... @@ -8,6 +8,8 @@ var _= require('lodash');
var ipaddr = require('ipaddr.js');
var options=require('../staticConfig.js').staticDir;
var author=require("../stub/service/auth");
/**
* 不需要权限校验配置
*/
... ... @@ -45,37 +47,62 @@ module.exports = function(req, res, next) {
//方法名称
var method = req.method;
//访问路由路径
var path = req.route?req.route.path:'';
if(req.session.user&&!checkPath(req.path,req)) {
res.status(403);
res.render('error/error_nolayout',{message:NO_AUTH,layout:false,cssfile:CSS_FILE});
return;
}
//进行白名单验证和session验证
if(guestAccessList[method+":"+path]||req.session.user) {
//判断是否已存在appendData
if(!res.appendData) {
res.appendData = _.cloneDeep(req.session.user);
function nextRedirect(method,path){
//进行白名单验证和session验证
if(guestAccessList[method+":"+path]||req.session.user) {
//判断是否已存在appendData
if(!res.appendData) {
res.appendData = _.cloneDeep(req.session.user);
} else {
res.appendData = _.merge({},res.appendData,req.session.user);
}
//添加当前菜单激活
addActiveMenu(req,res);
//添加管理员信息到http头
if(req.session.user) {
appendAdminInfo(req,req.session.user.auth);
}
next();
} else {
res.appendData = _.merge({},res.appendData,req.session.user);
req.app.logger.log('info',"CurentView:Login");
//如果是登陆界面不加载布局
res.render('pages/login',{layout:false,cssfile:CSS_FILE,path:STATIC_PATH});
}
}
//添加当前菜单激活
addActiveMenu(req,res);
//添加管理员信息到http头
if(req.session.user) {
appendAdminInfo(req,req.session.user.auth);
function filterOriginalUrl(path){
if(!/\.\w+/.test(path)){
return path.replace(/\?.+/,'');
}
return "";
}
//访问路由路径
var path = req.route?req.route.path:filterOriginalUrl(req.originalUrl);
if(req.session.user) {
if(guestAccessList[method+":"+path]){
nextRedirect(method,path);
return;
}
next();
} else {
req.app.logger.log('info',"CurentView:Login");
//如果是登陆界面不加载布局
res.render('pages/login',{layout:false,cssfile:CSS_FILE,path:STATIC_PATH});
/*判断权限*/
if(path&&req.session.user.allRight[path]){
author.validateAuthor(req.session.user.auth.pid,req.session.user.auth.role_id,path,function(data){
if(data.code!=200){
res.status(403);
res.render('error/error_nolayout',{message:NO_AUTH,layout:false,cssfile:CSS_FILE});
return;
}
nextRedirect(method,path);
});
}else{
nextRedirect(method,path);
}
}else{
nextRedirect(method,path);
}
}
/**
... ...
... ... @@ -58,7 +58,7 @@ exports.callLogin = function(user, password, res) {
var userInfo = {
auth: userData,
menu: data.menu,
noRight: data.noRight
allRight: data.allRight
}
//获取店铺信息
_getShopList(userData.pid, function(err, data) {
... ... @@ -106,11 +106,10 @@ function _callGetMenu(pid,roleid, callback) {
if(ret.data) {
menuData = _makeMenu(ret.data);
}
_getAllMenu(function(ret) {
menuData.noRight = filterRight(ret, menuData);
delete menuData.right;
callback(null, menuData);
});
_getAllRight(function(ret){
menuData.allRight = ret;
callback(null,menuData);
});
}
});
... ... @@ -226,4 +225,46 @@ function _makeMenu (data) {
menu:menu,
right:right
};
}
\ No newline at end of file
}
/**
* 验证权限
*/
exports.validateAuthor=function(pid,roleid,path,callback){
var options = {
url:oldService.isUsedMenuAuth,
form:'['+pid+','+roleid+', "'+path+'", "", "", '+WEBSITE+']'
}
console.log(options);
util.httpCall(options,function(err,ret){
if(err) {
callback({});
} else {
callback(ret.data);
}
});
}
function _getAllRight(callback){
var options = {
url:oldService.allRight,
form:'[false]'
}
console.log(options);
util.httpCall(options,function(err,ret){
if(err) {
callback({});
} else {
var map={};
ret.data.forEach(function(data){
console.log(data);
if(data.platform_id==WEBSITE){
map[data.path]=true;
}
});
callback(map);
}
});
}
\ No newline at end of file
... ...
... ... @@ -16,5 +16,7 @@ module.exports = {
getResourceByPid: oldSerDomain + '/service/account/v1/Profile/getMenuByPid',
getAllResByWebsite: oldSerDomain + '/service/setting/v1/menu/getAllMenu',
getShopList: domain+'/ShopsRest/queryShopsByAdminPid',
changeShops:'http://shops.yohobuy.com/index/ajaxshop'
changeShops:'http://shops.yohobuy.com/index/ajaxshop',
isUsedMenuAuth:oldSerDomain + '/service/account/v1/profile/authPath',
allRight:oldSerDomain+'/service/setting/v1/action/getAllAction'
};
\ No newline at end of file
... ...
... ... @@ -12,7 +12,6 @@
{{^ secondTitle}}{{pageTitle}}{{/ secondTitle}}
</li>
</ul>
<h4>{{pageTitle}}</h4>
</div>
</div>
</div>
... ...
... ... @@ -12,7 +12,6 @@
{{^ secondTitle}}{{pageTitle}}{{/ secondTitle}}
</li>
</ul>
<h4>{{pageTitle}}</h4>
</div>
</div>
</div>
... ...
... ... @@ -7,9 +7,8 @@
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="#" onclick="javascript:history.go(-1);">商品</a></li>
<li>基础商品</li>
<li>{{pageTitle}}</li>
</ul>
<h4>{{pageTitle}}</h4>
</div>
</div><!-- media -->
</div>
... ... @@ -84,7 +83,7 @@
<input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required match="numbers" type="text"></input>
</div>
<div class="col-sm-2">
<input class="form-control btn-sort-tiaoma" value="[[item.barCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
<input class="form-control btn-sort-tiaoma" value="[[item.factoryCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
</div>
<div class="col-sm-2">
<select class="form-control btn-sort-kebu" value="[[item.isSuppled||'N']]" data-index=[[index]] data-eq=[[__index]]>
... ... @@ -120,7 +119,8 @@
<option value="[[brandId||'-1']]">[[brandName||'品牌']]</option>
</select>
</div>
<label class="col-sm-1 control-label">JIT供应商</label>
<div class="col-sm-2">
<select id="supplierId" class="form-control">
... ...
... ... @@ -9,7 +9,6 @@
<li><a href="">商品管理</a></li>
<li>基本商品</li>
</ul>
<h6>基础商品</h6>
</div>
</div>
</div>
... ...
... ... @@ -9,9 +9,8 @@
<li><a href="#">商品管理</a></li>
<li>基础商品</li>
<li>查看详情</li>
</ul>
<h4>查看详情</h4>
</div>
</div>
</div>
... ... @@ -129,8 +128,8 @@
<span>[[_item.sizeName]]</span>
</th>
<th>[[_item.salePrice]]</th>
<th>[[item.modelCode]]</th>
<th>[[_item.barCode]]</th>
<th>[[item.factoryCode]]</th>
<th>[[_item.factoryCode]]</th>
<th>[[item.factoryGoodsName]]</th>
[[if _item.isSuppled=="Y"]]
<th></th>
... ...
... ... @@ -9,9 +9,8 @@
<li><a href="#">商品管理</a></li>
<li>{{subtitle}}</li>
<li>{{maintitle}}</li>
</ul>
<h6>{{maintitle}}</h6>
</div>
</div>
</div>
... ...
... ... @@ -10,7 +10,6 @@
<li>商品内容管理</li>
</ul>
<h6>商品内容管理</h6>
</div>
</div>
</div>
... ...
... ... @@ -14,11 +14,6 @@
</li>
</ul>
<div>
<div style="float: left;">
<h6>{{pageTitle}}</h6>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -9,12 +9,6 @@
<li><a href="">店铺管理员关系管理</a></li>
<li>列表</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>店铺管理员关系列表</h4>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -9,12 +9,6 @@
<li><a href="">店铺管理</a></li>
<li>{{pageTitel}}</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>{{pageTitel}}</h4>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -10,12 +10,6 @@
<li><a href="">{{level1title}}</a></li>
<li>{{level2title}}</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>{{level3title}}</h4>
</div>
</div>
</div>
{{/pagetitle}}
</div>
... ...
... ... @@ -9,12 +9,6 @@
<li><a href="">店铺管理</a></li>
<li>店铺详情</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>店铺详情</h4>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -7,17 +7,9 @@
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body" style="display: block;">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">店铺管理</a></li>
<li>店铺装修管理</li>
</ul>
<div>
<div class="panel-body">
<div class="col-sm-3">
<h4>选择模板</h4>
</div>
... ...