Authored by weiqingting

修改店铺

... ... @@ -285,7 +285,7 @@ edit.prototype={
}
};
callback&&callback(options);
//$.ajax(options);
$.ajax(options);
return false;
},
__listen:function(key,o,callback){
... ...
... ... @@ -17,7 +17,6 @@ var ENUM={
var t = new common.tab({
el:"#basicTab",
click:function(){
alert();
g.reload();
},
columns:[
... ...
... ... @@ -31,6 +31,22 @@ $('.leftpanel .nav .parent>a').click(function() {
return false;
});
var me={
setUrl:function(value){
var Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = "url" + "="+ escape (value) + ";expires=" + exp.toGMTString();
},
getUrl:function(){
var arr,reg=new RegExp("(^| )url=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
};
window.me=me;
$(".leftpanel .nav .children a").each(function(){
var attr=$(this).attr("href");
... ... @@ -38,5 +54,8 @@ $(".leftpanel .nav .children a").each(function(){
$(this).parents(".children").show();
$(this).parent("li").addClass("active");
$(this).parents(".parent").addClass("parent-focus");
window.me.setUrl(window.location.pathname);
}
});
\ No newline at end of file
});
... ...
... ... @@ -294,9 +294,14 @@ e.on("render",function(){
var value=$(this).val()?$(this).val():'[]';
var data=JSON.parse(value);
$.each(data,function(i,item){
Bll.addInput(name,label,item);
});
if(data.length>0){
$.each(data,function(i,item){
Bll.addInput(name,label,item);
});
}else{
Bll.addInput(name,label);
}
});
(!!~$("#shopsType").val())?$("#modalId").prop("disabled",false):$("#modalId").prop("disabled",true);
... ... @@ -405,8 +410,8 @@ var submit=function(callback){
res=res.data;
if(res.code=="200"){
e.$tip('提交成功',function(){
// location.href="/supplier/store/index";
history.go(-1);
location.href=window.me.getUrl();
//window.history.go(-1);
},'growl-success');
}else{
e.$tip(res.message);
... ...
... ... @@ -2,6 +2,35 @@ var $=require('jquery');
var edit=require('../common/edit');
var e=new edit("#basicForm");
e.on("validate",function(){
var contactPhone=$.trim($("#contactPhone").val());
if(contactPhone){
if(!(/^1\d{10}$/.test(contactPhone))){
return "请输入正确的公司联系电话";
}
}
//phone
var phone=$.trim($("#phone").val());
if(phone){
if(!(/^1\d{10}$/.test(phone))){
return "请输入正确的联系人电话";
}
}
if(!phone&&!contactPhone){
return "请在公司联系电话,联系人电话至少填一个";
}
return true;
});
e.on("validate",function(){
var num=$.trim($("#phone").val());
if(num){
if(!(/^1\d{10}$/.test(num))){
return "请输入正确的联系人电话";
}
}
//phone
return true;
});
e.init();
var submit=function(callback,config){
e.submit($("#basicForm").attr("action"),function(option){
... ... @@ -9,7 +38,8 @@ var edit=require('../common/edit');
res=res.data;
if(res.code=="200"){
e.$tip(config.msg||"提交成功",function(){
location.href="/supplier/supplier/index";
location.href=window.me.getUrl();
},'growl-success');
}else{
e.$tip(res.message);
... ... @@ -27,15 +57,13 @@ var edit=require('../common/edit');
$("#btnTemporary").click(function(){
submit(function(data){
data.status=100;
},{msg:"添加成功"});
},{msg:"暂存成功"});
return false;
});
$("#btnReview").click(function(){
//到审核表
submit(function(data){
if(data.status==100){
data.operations=2;
}
data.operations?data.operations:data.operations=1;
data.status=200;
},{msg:"提交成功"});
return false;
... ...
... ... @@ -37,21 +37,20 @@ var $ = require('jquery'),
//提交操作
$(document).on('click', '.btn-submit', function() {
Bll.toast("确定要审核通过吗?",function(){
return Bll.model({status:300});
return Bll.model({status:300,operations:2});
});
});
//提交驳回
$(document).on('click', '.btn-return', function() {
Bll.toast("确定要驳回审核吗?",function(){
return Bll.model({status:900});
return Bll.model({status:900,operations:1});
});
});
//冻结操作
$(document).on('click', '.btn-freeze', function() {
Bll.toast("确定要冻结审核吗?",function(){
return Bll.model({isFreeze:"Y"});
return Bll.model({isFreeze:"Y",operations:3});
});
});
... ... @@ -59,7 +58,7 @@ var $ = require('jquery'),
$(document).on('click', '.btn-recovery', function() {
var that = this;
Bll.toast("确定要解冻审核吗?",function(){
return Bll.model({isFreeze:"N"});
return Bll.model({isFreeze:"N",operations:4});
});
});
... ...
... ... @@ -10,6 +10,11 @@ exports.res = [{
gridurl:'/supplier/store/indexPage',
authority:'{"btn":false,"info":false,"create":true,"operationStatus":1,"checkStatusArr":"100,200,900"}',
add:true,
pagetitle:{
level1title:"店铺管理",
level2title:"创建店铺管理",
level3title:"创建店铺列表"
},
dropCheckStatus:true
},
src:'/store/index'
... ... @@ -22,7 +27,12 @@ exports.res = [{
data: {
gridurl:'/supplier/store/index',
authority:'{"btn":true,"operationStatus":2,"checkStatusArr":"200,300,900"}', //300,200,900
dropCheckStatus:true
dropCheckStatus:true,
pagetitle:{
level1title:"店铺管理",
level2title:"创建店铺管理",
level3title:"店铺审核列表"
}
},
src:'/store/index',
},{
... ... @@ -33,8 +43,12 @@ exports.res = [{
noApi:true,
data: {
gridurl:'/supplier/store/checkPage',
authority:'{"btn":false,"info":true,"operationStatus":0,"checkStatusArr":"200"}'
authority:'{"btn":false,"info":true,"operationStatus":0,"checkStatusArr":"200"}',
pagetitle:{
level1title:"店铺管理",
level2title:"创建店铺管理",
level3title:"店铺信息列表"
}
},
src:'/store/index',
},{
... ...
... ... @@ -167,7 +167,7 @@
<option value="-1">选择品牌</option>
</select>
</div>
<div class="form-group" style="height: 600px">
<div class="form-group" style="height: 400px">
<div id="baseTable"></div>
</div>
</div>
... ...
... ... @@ -3,19 +3,21 @@
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
{{#pagetitle}}
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">创建店铺</a></li>
<li>创建店铺管理</li>
<li><a href="">{{level1title}}</a></li>
<li>{{level2title}}</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>店铺创建列表</h4>
<h4>{{level3title}}</h4>
</div>
</div>
</div>
{{/pagetitle}}
</div>
</div>
... ...
... ... @@ -23,7 +23,7 @@
<div class="row">
<div class="col-md-offset-1 col-xs-10 col-sm-10 col-md-10 col-lg-10">
<div class="page-header">
<h4>查看供应商信息</h4>
<h4>查看店铺信息</h4>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">店铺名称:</div>
... ... @@ -31,7 +31,7 @@
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">店铺性质:</div>
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">店铺类型: </div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
<input type="hidden" id="shopNature" value="{{shopNature}}" />
</div>
... ...