Authored by lore-w

Merge branch 'develop' of git.dev.yoho.cn:platform/yohobuy-portal-fe into develop

Conflicts:
	server/interface/product.js
... ... @@ -10,4 +10,10 @@ require('./js/supplier/index');
require('./js/supplier/edit');
require('./js/supplier/info');
require('./js/brand/edit');
require('./js/brand/index');
require('./js/product/add');
require('./js/product/index');
module.exports = demo;
\ No newline at end of file
... ...
... ... @@ -5,7 +5,7 @@ exports.init = function() {
var e=new edit("#basicForm");
// e.on("validate",function(){
// });
e.init();
$("#save_brand").click(function(){
e.submit($("#basicForm").attr("action"),function(option){
option.success=function(res){
... ...
var $=require('jquery');
var edit=require('../common/edit');
exports.init = function() {
var selector=$("#basicForm");
$("panel-title",selector).html("修改品牌");
selector.attr("action","/brand/action/update");
edit.init(selector);
$("#save_brand").click(function(){
if(edit.validate(selector)){
edit.submit(selector,function(data){
console.log(data);
});
}else{
console.log("yanzhengshibai");
}
return false;
});
}
\ No newline at end of file
... ... @@ -4,7 +4,8 @@ var $=require('jquery');
var urlObj={
'supplier':'/supplier/supplier/getSupplierListByIdName',
'brand':'/brand/getBrandNames'
'brand':'/brand/getBrandNames',
'managerName':'/supplier/storeadmin/managerName'
};
var dropDown=function(option){
... ...
... ... @@ -253,7 +253,8 @@ edit.prototype={
return false;
}
var data={};
$("input:text",that.el)
$("input:text",that.el)//number
.add("input[type=number]",that.el)
.add("input:hidden",that.el)
.add("select",that.el)
.add("textarea",that.el)
... ... @@ -285,7 +286,6 @@ edit.prototype={
if (__self.registerEvent[key]&&__self.registerEvent[key].length > 0) {
for (_e in __self.registerEvent[key]) {
var a=__self.registerEvent[key][_e](o);
console.log(a);
if(callback){
callback(a);
}
... ...
... ... @@ -3,98 +3,41 @@
*/
'use strict';
var $ = require('jquery'),
Handlebars = require('yoho.handlebars');
Handlebars = require('yoho.handlebars'),
grid=require('../common/grid'),
dropDown = require('../common/dropDown');
require('../util/select2');
require('yoho.bootstrap')
exports.init = function() {
//下拉框
$('.select2-offscreen').select2();
new dropDown({el: '#filter-dep'});
/**
* 优惠码列表显示
* @param: data(优惠码json数据)
*/
function listShow(data,iscount) {
if(!iscount){
var a={0: 0, 1: 0, 2: 0, 3:0, 4: 0, all: 0};
$.each(data,function(index,item){
a[item.status]++;
a["all"]++;
})
___tabShow(a);
}
var tpl = Handlebars.compile($('#list-tpl').html());
$('tbody').html(tpl({
data: data
}));
//审核状态及操作按钮显示
$('tbody').find('tr').each(function() {
var $state = $(this).find('.state-title'),
$operate = $(this).find('.operate'),
cState = $state.text();
statusToText($state, cState);
switch (cState) {
case '0':
$operate.addClass('wait');
break;
case '1':
$operate.addClass('success');
break;
case '2':
$operate.addClass('back');
break;
default:
break;
}
});
}
/**
* 优惠码列表显示
* @param: data(请求json数据), callback(成功后执行的函数)
*/
function listOperate(data, callback) {
if (data.code === 200) {
callback();
} else {
$('#apply-alert .am-modal-hd').text('设置失败!');
$('#apply-alert').modal({
relatedTarget: this
});
}
}
/**
* 状态数据转换为中文显示
* @param: $element(转换的节点), status(转换的状态字符串)
*/
function statusToText($element, status) {
function statusConvert(status) {
switch (status) {
case '0':
$element.text('待审核');
case 0:
return '待审核';
break;
case '1':
$element.text('审核通过');
case 1:
return '审核通过';
break;
case '2':
$element.text('驳回');
case 2:
return '驳回';
break;
case '3':
$element.text('过期');
case 3:
return '过期';
break;
case '4':
$element.text('作废');
case 4:
return '作废';
break;
default:
$element.text('全部');
return '全部';
break;
}
}
... ... @@ -105,8 +48,6 @@ exports.init = function() {
*/
function tabShow(param, indexStatus) {
var param = param || {};
$.ajax({
type: 'POST',
dataType: 'json',
... ... @@ -120,16 +61,15 @@ exports.init = function() {
}));
$('.list-tabs').find('li').each(function() {
var status = $(this).data('status') + '';
var status = $(this).data('status');
statusToText($(this).find('span'), status);
$(this).find('span').text(statusConvert(status));
if (status === 'all') {
$(this).addClass('active').siblings().removeClass('active');
}
});
//console.log(index);
if (indexStatus === undefined) {
$('.list-tabs').find('[data-status="all"]').addClass('active').siblings().removeClass('active');
} else {
... ... @@ -139,149 +79,84 @@ exports.init = function() {
})
}
function ___tabShow(data){
var tpl = Handlebars.compile($('#tab-tpl').html());
//{0: "56", 1: "28", 2: "1", 4: "14", all: "99"}
$('.list-tabs ul').html(tpl({
data: data
}));
$('.list-tabs').find('li').each(function() {
var status = $(this).data('status') + '';
statusToText($(this).find('span'), status);
if (status === 'all') {
$(this).addClass('active').siblings().removeClass('active');
}
});
//console.log(index);
// if (indexStatus === undefined) {
// $('.list-tabs').find('[data-status="all"]').addClass('active').siblings().removeClass('active');
// } else {
// $('.list-tabs').find('[data-status="' + indexStatus + '"]').addClass('active').siblings().removeClass('active');
// }
}
tabShow();
//tab卡切换列表事件
$('.list-tabs').on('click', 'li', function() {
var status = $(this).data('status'),
filterDep = $('#filter-dep').val(),
filterId = $('#filter-id').val(),
filterName = $('#filter-name').val();
var param = {
status: status,
batchNo: filterId,
name: filterName,
reqDepartment: filterDep,
offset: 0
};
$(this).addClass('active').siblings().removeClass('active');
if (status === 'all') {
delete param.status;
}
if (filterDep === '全部') {
delete param.reqDepartment;
}
$.ajax({
type: 'POST',
dataType: 'json',
url: '/getPromotion',
data: param,
success: function(res) {
var param = {
reqDepartment: filterDep
};
if (filterDep === '全部') {
delete param.reqDepartment;
}
listShow(res.data.data,true);
}
});
});
//获取优惠码列表
$.ajax({
type: 'POST',
dataType: 'json',
url: '/getPromotion',
data: {
offset: 0
},
success: function(res) {
listShow(res.data.data);
}
g.reload();
});
//筛选事件
$('#filter-btn').on('click', function() {
var filterId = $('#filter-id').val(),
filterName = $('#filter-name').val(),
filterDep = $('#filter-dep').val(),
filterStatus = $('.list-tabs').find('.active').data('status'),
tabStatus = $('.list-tabs').find('.active').data('status'),
param = null,
tabParam = null;
//console.log(tabIndex);
param = {
status: filterStatus,
batchNo: filterId,
name: filterName,
reqDepartment: filterDep
}
tabParam = {
batchNo: filterId,
name: filterName,
reqDepartment: filterDep
}
if (filterStatus === 'all') {
delete param.status;
}
var btnAuthority = JSON.parse($("#btnAuthority").val());
if (filterDep === '全部') {
delete param.reqDepartment;
delete tabParam.reqDepartment;
}
var g=new grid({
el: '#basicTable',
size: 10,
parms:function(){
//筛选列表显示
$.ajax({
type: 'POST',
dataType: 'json',
url: '/getPromotion',
data: param,
success: function(res) {
if (res.code === 200) {
listShow(res.data.data);
} else {
$('#apply-alert .am-modal-hd').text('请输入正确的查询条件!');
$('#apply-alert').modal({
relatedTarget: this
});
return {
batchNo: $.trim($('#filter-id').val()) ||"",
status: parseInt($('.list-tabs').find('.active').data('status')) ||"",
name: $.trim($('#filter-name').val()) ||"",
reqDepartment:$.trim($('#filter-dep').val()) ||""
};
},
columns:[
{display:"批次号", name:"batchNo", render: function(item) {
return '<a href="/coupon/info/' + item.id + '">' + item.batchNo + '</a>';
}},
{display:"基本信息",name:"name", render: function(item) {
return '<p>名称:' + item.name + '</p><p>次数' + item.limitTimes + '</p><p>部门:' + item.reqDepartment + '</p>';
}},
{display: '使用期限', name: "name", render: function(item) {
return '<p>' + item.limitDateFrom + '</p><p>' + item.limitDateTo + '</p>'
}},
{display: '优惠码说明', name: "describe"},
{display: '申请人', name: "staff"},
{display: '状态', name: "status", render: function(item) {
var html = statusConvert(item.status);
if (item.reason) {
html += '<p style="color:red;">(' + item.reason + ')</p>';
}
}
})
//筛选tab显示
tabShow(tabParam, tabStatus);
return html;
}},
{display:"操作",name:"operate",render:function(items){
console.log(this);
var HtmArr=[];
if(btnAuthority.look){
HtmArr.push('<a href="/coupon/info/'+ items.id+'" class="btn btn-info btn-xs">查看详情</a>');
}
if(items.status == 0){
HtmArr.push('<a class="btn btn-primary btn-xs apply-success" data-id="'+ items.id+'" href="javascript:;">通过</a>');
HtmArr.push('<a class="btn btn-warning btn-xs apply-back" data-id="'+ items.id+'" href="javascript:;">驳回</a>');
HtmArr.push('<a class="btn btn-danger btn-xs apply-cancel" data-id="'+ items.id+'" href="javascript:;">作废</a>');
}
if(items.status == 1){
HtmArr.push('<a class="btn btn-danger btn-xs apply-cancel" data-id="'+ items.id+'" href="javascript:;">作废</a>');
}
if(items.status == 2){
HtmArr.push('<a class="btn btn-info btn-xs apply-modify" data-id="'+ items.id+'" href="/coupon/update/'+ items.id+'">修改</a>');
}
return HtmArr.join('');
}}
]
})
g.init($("#gridurl").val());
$("#filter-btn").click(function(){
tabShow({
batchNo: $.trim($('#filter-id').val()),
name: $.trim($('#filter-name').val()),
reqDepartment:$.trim($('#filter-dep').val())
}, parseInt($('.list-tabs').find('.active').data('status')))
g.reload();
});
//作废事件
$('.coupon-list-table').on('click', '.apply-cancel', function() {
$('#basicTable').on('click', '.apply-cancel', function() {
var that = this,
applyId = $(this).parents('.operate').data('id');
applyId = $(this).data('id');
$('#cancel-modal').modal();
$('#cancel-modal').on('click', '.btn-primary', function() {
... ... @@ -302,14 +177,8 @@ exports.init = function() {
reason: reason
},
success: function(data) {
listOperate(data, function() {
var $operate = $(that).parents('.operate');
$operate.attr('class', 'operate');
$operate.siblings('.state').find('.state-title').text('作废');
$operate.siblings('.state').find('.state-reason').text(reason);
window.location.reload();
});
$('#cancel-modal').modal('hide');
g.reload();
}
})
});
... ... @@ -317,11 +186,11 @@ exports.init = function() {
//通过事件
$('.coupon-list-table').on('click', '.apply-success', function() {
$('#basicTable').on('click', '.apply-success', function() {
var that = this,
$listBtn,
applyId = $(this).parents('.operate').data('id'),
applyState = $(this).parents('.operate').data('state');
applyId = $(this).data('id'),
applyState = $(this).data('state');
$('#success-modal').modal();
$('#success-modal').on('click', '.btn-primary', function() {
... ... @@ -334,13 +203,8 @@ exports.init = function() {
status: 1 //审核通过
},
success: function(data) {
listOperate(data, function() {
var $operate = $(that).parents('.operate');
$operate.removeClass('wait').addClass('success');
$operate.siblings('.state').find('.state-title').text('审核通过');
window.location.reload();
});
$('#success-modal').modal('hide');
g.reload();
}
})
});
... ... @@ -379,11 +243,9 @@ exports.init = function() {
});
//驳回事件
$('.coupon-list-table').on('click', '.apply-back', function() {
$('#basicTable').on('click', '.apply-back', function() {
var that = this,
applyId = $(this).parents('.operate').data('id');
console.log(11);
applyId = $(this).data('id');
$('#back-modal').modal();
$('#back-modal').on('click', '.btn-primary', function() {
... ... @@ -402,14 +264,8 @@ exports.init = function() {
reason: reason
},
success: function(data) {
listOperate(data, function() {
var $operate = $(that).parents('.operate');
$operate.attr('class', 'operate back');
$operate.siblings('.state').find('.state-title').text('驳回');
$operate.siblings('.state').find('.state-reason').text(reason);
window.location.reload();
});
$('#back-modal').modal('hide');
g.reload();
}
})
})
... ...
'use strict';
var $ = require('jquery'),
Handlebars = require('yoho.handlebars');
var dropDown=require('../common/dropDown');
var grid=require('../common/grid');
require('../util/jquery.gritter');
exports.init=function(){
new dropDown({el:"#store-name"});
new dropDown({el:"#store-name",ajax:"brand"});
new dropDown({el:"#identity-type"});
new dropDown({el:"#manager-name"});
function __ajax(options,callback){
$.ajax({
type: 'POST',
url: options.url,
dataType: 'json',
data:options.data||{},
success: function(res) {
res=res.data;
if (res.code === 200) {
$.gritter.add({
title: options.msg||"提交成功",
class_name: 'growl-success',
sticky: false,
time: '1000',
after_open: function() {
callback&&callback();
}
});
} else {
$.gritter.add({
title: '提交失败',
class_name: 'growl-danger',
sticky: false,
time: '1000'
});
}
}
});
}
if($('#storelsit').length>0){
$('#store-name option:selected').val($('#shopsId').text());
$('#identity-type option:selected').val($('#identity').text());
$('#manager-name option:selected').val($('#adminPid').text());
}
$('#identity-type').on('change',function(){
$.ajax({
url: '/supplier/storeadmin/managerName',
dataType: "json",
type: 'POST',
data: {
identity: $('#identity-type option:selected').val()
},
success: function(data) {
$.each(data.data.data,function(index){
console.log(data.data.data[index].truename);
$('#manager-name').append("<option value='"+data.data.data[index].pid+"'>"+data.data.data[index].truename+"</option>");
})
}
})
})
$('#amdinAdd').on('click',function(){
var that = this,
shopsId = $('#store-name').val(),
identityType = $('#identity-type').val(),
managerName = $('#manager-name').val();
__ajax({
url: "/supplier/storeadmin/addguanxi",
data:{
shopsId:shopsId,
adminPid:managerName,
identity:identityType
}
},function(){
g.reload();
});
})
}
\ No newline at end of file
... ...
... ... @@ -18,30 +18,13 @@ exports.init=function(){
{display:"更新时间",name:"updateTime"},
{display:"操作",name:"",render:function(item){
return '<a href="/supplier/storeadmin/adminEdit/'+item.id+'" class="btn btn-info btn-xs">编辑</a><button type="button" data-id="'+item.id+'" class="delete btn btn-danger btn-xs">删除</button>'
return '<a href="/supplier/store/adminupdate/'+item.id+'" class="btn btn-info btn-xs">编辑</a><button type="button" data-id="'+item.id+'" class="delete btn btn-danger btn-xs">删除</button>'
}}
]
})
console.log($('#url').val());
g.init($('#url').val());
// var otherUrl=$('#otherUrl').val().split(',');
// console.log(otherUrl);
// $.each(otherUrl,function(){
// $('#otherUrlValue').append('<p>'+this+'</p>')
// })
// var websiteUrl=$('#websiteUrl').val().split(',');
// $.each(websiteUrl,function(){
// $('#websiteUrlValue').append('<p>'+this+'</p>')
// })
// var shopAddress=$('#shopAddress').val().split(',');
// $.each(shopAddress,function(){
// $('#shopAddressValue').append('<p>'+this+'</p>')
// });
function __ajax(options,callback){
$.ajax({
type: 'POST',
... ...
//商家管理
'use strict';
var $ = require('jquery'),
Handlebars = require('yoho.handlebars');
var dropDown=require('../common/dropDown');
require('../util/jquery.gritter');
var grid=require('../common/grid');
exports.init=function(){
new dropDown({el:"#status"});
new dropDown({el:"#store-type"});
new dropDown({el:"#store-model"});
new dropDown({el:"#brand-name",ajax:"brand"});
new dropDown({el:"#supplier-name",ajax:"supplier"});
var g=new grid({
el:'#storeadmin_Tabel',
parms:function(){
var supplierid=$('#supplier-name').val(),
brandId = $('#brand-name').val();
return {
"supplierId":supplierid,
"brandId":brandId,
"checkStatus":200,
"checkStatusArr":"200"
};
},
columns:[
{display:"店铺ID",name:"shopsId"},
{display:"店铺名称",name:"shopName"},
{display:"包含品牌",name:"shopRelationList",render:function(item){
var str='';
$.each(item.shopRelationList,function (index,a) {
str+='<p>'+a.brandName+'</p>';
})
return str;
}},
{display:"创建时间",name:"createTime"},
{display:"更新时间",name:"updateTime"},
{display:"状态",name:"status",render:function(item){
return item.status+'';
}},
{display:"操作",name:"",render:function(item){
return '<a href="/supplier/store/info/'+item.shopsId+'" class="btn btn-info btn-xs">查看</a>'
}}
]
})
console.log($('#url').val());
g.init($('#url').val());
}
... ...
... ... @@ -16,11 +16,14 @@ exports.init=function(){
var g=new grid({
el:'#storeadmin_Tabel',
parms:function(){
var supplierid=$('#supplier-name').val(),
brandId = $('#brand-name').val();
checkStatus = $('#status').val();
return {
"supplierId":0,
"brandId":0,
"supplierId":supplierid,
"brandId":brandId,
"operationStatus":2,
"checkStatus":200,
"checkStatus":checkStatus,
"checkStatusArr":"300,200,900"
};
},
... ... @@ -38,15 +41,69 @@ exports.init=function(){
{display:"更新时间",name:"updateTime"},
{display:"状态",name:"status"},
{display:"操作",name:"",render:function(item){
return '<a href="/supplier/store/info/'+item.shopsId+'" class="btn btn-info btn-xs">查看</a>'
+'<a href="/supplier/store/info/'+item.shopsId+'" class="btn btn-success btn-xs">编辑</a>'
+'<a href="/supplier/store/info/'+item.shopsId+'" class="btn btn-danger btn-xs">关店</a>'
var pushAll =[]
pushAll.push('<a href="/supplier/store/info/'+item.shopsId+'" class="btn btn-info btn-xs">查看</a>');
pushAll.push('<a href="/supplier/store/update/'+item.shopsId+'" class="btn btn-success btn-xs">编辑</a>');
pushAll.push('<input type="hidden" value="'+item.status+'" />');
if(item.status == 0){
pushAll.push('<button data-status="'+item.status+'" data-shopsid="'+item.shopsId+'" class="shopsstatus btn btn-warning btn-xs">开店</button>');
}else{
pushAll.push('<button data-status="'+item.status+'" data-shopsid="'+item.shopsId+'" class="shopsstatus btn btn-danger btn-xs">关店</button>');
}
return pushAll.join('');
}}
]
})
console.log($('#url').val());
g.init($('#url').val());
function __ajax(options,callback){
$.ajax({
type: 'POST',
url: options.url,
dataType: 'json',
data:options.data||{},
success: function(res) {
res=res.data;
if (res.code === 200) {
$.gritter.add({
title: options.msg||"提交成功",
class_name: 'growl-success',
sticky: false,
time: '1000',
after_open: function() {
callback&&callback();
}
});
} else {
$.gritter.add({
title: '提交失败',
class_name: 'growl-danger',
sticky: false,
time: '1000'
});
}
}
});
}
//提交操作
$(document).on('click', '.shopsstatus', function() {
var that = this,
url;
if($(that).data('status')==1){
url = "/supplier/store/closeShops";
}else{
url = "/supplier/store/openShops";
}
__ajax({
url: url,
data:{shopsId:$(that).data("shopsid")}
},function(){
g.reload();
});
});
}
... ...
//商家管理
'use strict';
var $ = require('jquery'),
Handlebars = require('yoho.handlebars');
var dropDown=require('../common/dropDown');
require('../util/jquery.gritter');
var grid=require('../common/grid');
exports.init=function(){
var g=new grid({
el:'#storeadmin_Tabel',
columns:[
{display:"ID",name:"shopsId"},
{display:"店铺名称",name:"shopName"},
{display:"店铺管理员",name:"adminName"},
{display:"创建时间",name:"createTime"},
{display:"更新时间",name:"updateTime"},
{display:"操作",name:"",render:function(item){
return '<a href="/supplier/store/adminAdd/'+item.shopsId+'" class="btn btn-info btn-xs">编辑</a><button type="button" data-id="'+item.shopsId+'" class="delete btn btn-danger btn-xs">删除</button>'
}}
]
})
g.init($('#url').val());
if($('#otherUrl').val().split(',').length>1){
var otherUrl=$('#otherUrl').val().split(',');
console.log(otherUrl);
$.each(otherUrl,function(){
$('#otherUrlValue').append('<p>'+this+'</p>')
})
}
if($('#websiteUrl').val().split(',').length>1){
var websiteUrl=$('#websiteUrl').val().split(',');
$.each(websiteUrl,function(){
$('#websiteUrlValue').append('<p>'+this+'</p>')
})
}
if($('#shopAddress').val().split(',').length>1){
var shopAddress=$('#shopAddress').val().split(',');
$.each(shopAddress,function(){
$('#shopAddressValue').append('<p>'+this+'</p>')
})
}
}
... ...
... ... @@ -16,11 +16,14 @@ exports.init=function(){
var g=new grid({
el:'#storeadmin_Tabel',
parms:function(){
var supplierid=$('#supplier-name').val(),
brandId = $('#brand-name').val();
checkStatus = $('#status').val();
return {
"supplierId":0,
"brandId":0,
"supplierId":supplierid,
"brandId":brandId,
"operationStatus":1,
"checkStatus":200,
"checkStatus":checkStatus,
"checkStatusArr":"100,200,900"
};
},
... ...
//商家管理
'use strict';
var $ = require('jquery'),
Handlebars = require('yoho.handlebars');
Handlebars = require('yoho.handlebars');
var dropDown=require('../common/dropDown');
var dropDown = require('../common/dropDown');
require('../util/jquery.gritter');
var grid=require('../common/grid');
var edit=require('../common/edit');
var grid = require('../common/grid');
var edit = require('../common/edit');
exports.init=function(){
$('.urlAdd').on('click',function(){
var type = $(this).data('type'),
inputAdd = '';
switch(type)
{
case 0:
inputAdd = '<input type="text" name="homepage" class="form-control" style="margin-top:15px;" placeholder="官方网址">';
break;
case 1:
inputAdd = '<input type="text" name="homeurl" class="form-control" style="margin-top:15px;" placeholder="其他平台网址">';
break;
case 2:
inputAdd = '<input type="text" name="homeaddresslist" class="form-control" style="margin-top:15px;" placeholder="代表实体店">';
break;
}
$('.Add').eq(type).append(inputAdd);
});
new dropDown({el:"#store-type"});
new dropDown({el:"#store-model"});
new dropDown({el:"#brand-name",ajax:"brand"});
$('#addBrand').on('click',function(){
var storeModel = $('#store-model').val();
if(storeModel==1&&$('#updateBrand tbody tr').length<1){
$('#savebrand .checkbox').each(function(){
if($(this).prop('checked')){
var check = $(this).closest('tr').html();
var brand=check.split('<td>')[check.split('<td>').length-2];
var supplier=check.split('<td>')[check.split('<td>').length-1];
var table = '<tr><td>'+brand+'<td>'+supplier+'<td><button type="button" class="btn btn-danger btn-xs">删除</button></td></tr>'
$('#updateBrand tbody').append(table);
}
})
}else{
$('#savebrand .checkbox').each(function(){
if($(this).prop('checked')){
var check = $(this).closest('tr').html();
var brand=check.split('<td>')[check.split('<td>').length-2];
var supplier=check.split('<td>')[check.split('<td>').length-1];
var table = '<tr><td>'+brand+'<td>'+supplier+'<td><button type="button" class="btn btn-danger btn-xs">删除</button></td></tr>'
$('#updateBrand tbody').append(table);
}
})
}
});
var e=new edit("#storeForm");
e.on("validate",function(){
});
var submit=function(callback){
e.submit('/store/add',function(option){
option.success=function(res){
console.log(res.data.code);
if(res.data.code=="200"){
// location.href="/supplier/store/index";
}else{
e.$tip("提交失败");
}
return false;
},
option.error=function(res){
e.$tip("提交失败");
}
callback&&callback(option.data);
});
}
exports.init = function() {
$('.urlAdd').on('click',
function() {
var type = $(this).data('type'),
inputAdd = '';
switch (type) {
case 0:
inputAdd = '<input type="text" name="homepage" class="form-control" style="margin-bottom:15px;" placeholder="官方网址">';
break;
case 1:
inputAdd = '<input type="text" name="homeurl" class="form-control" style="margin-bottom:15px;" placeholder="其他平台网址">';
break;
case 2:
inputAdd = '<input type="text" name="homeaddresslist" class="form-control" style="margin-bottom:15px;" placeholder="代表实体店">';
break;
}
$('.Add').eq(type).append(inputAdd);
});
new dropDown({
el: "#store-type"
});
new dropDown({
el: "#store-model"
});
new dropDown({
el: "#brand-name",
ajax: "brand"
});
$('#addBrand').on('click',function() {
var storeModel = $('#shopsType').val();
if (storeModel == 1 || $('#updateBrand tbody tr').length < 1) {
$('#savebrand .checkbox').each(function() {
if ($(this).prop('checked')) {
var check = $(this).closest('tr').html();
var brand = check.split('<td>')[check.split('<td>').length - 2];
var supplier = check.split('<td>')[check.split('<td>').length - 1];
var table = '<tr><td>' + brand + '<td>' + supplier + '<td><button type="button" class="btn btn-danger btn-xs">删除</button></td></tr>';
$('#updateBrand tbody').append(table);
}
})
} else {
$('#savebrand .checkbox').each(function() {
if ($(this).prop('checked')) {
var check = $(this).closest('tr').html();
var brand = check.split('<td>')[check.split('<td>').length - 2];
var supplier = check.split('<td>')[check.split('<td>').length - 1];
var table = '<tr><td>' + brand + '<td>' + supplier + '<td><button type="button" class="btn btn-danger btn-xs">删除</button></td></tr>';
$('#updateBrand tbody').append(table);
}
})
}
});
var e = new edit("#storeForm");
e.on("validate",
function() {});
if ($('#shopsId').val() > 0) {
var submit = function(callback) {
e.submit('/store/update',
function(option) {
option.success = function(res) {
if (res.data.code == "200") {
// location.href="/supplier/store/index";
} else {
e.$tip("提交失败");
}
return false;
},
option.error = function(res) {
e.$tip("提交失败");
}
callback && callback(option.data);
});
}
$("#btn1").click(function(){
var homepage=$("input[name='homepage']");
var hplist=[];
homepage.each(function(index){
hplist.push(homepage[index].value);
})
var homeurl=$("input[name='homeurl']");
var homeurlist=[];
homeurl.each(function(index){
homeurlist.push(homepage[index].value);
})
var homeaddress=$("input[name='homeaddresslist']");
var homeaddresslist=[];
homeaddress.each(function(index){
homeaddresslist.push(homeaddress[index].value);
})
submit(function(data){
data.websiteUrl=hplist.toString();
data.otherUrl=homeurlist.toString();
data.shopAddress=homeaddresslist.toString();
data.onCheck=1;
});
return false;
});
} else {
var submit = function(callback) {
e.submit('/store/add',
function(option) {
option.success = function(res) {
if (res.data.code == "200") {
// location.href="/supplier/store/index";
} else {
e.$tip("提交失败");
}
return false;
},
option.error = function(res) {
e.$tip("提交失败");
}
callback && callback(option.data);
});
}
}
$(".check").click(function() {
var shopsId = $('#shopsId').val();
var onCheck = $(this).data('oncheck');
var homepage = $("input[name='homepage']");
var hplist = [];
homepage.each(function(index) {
hplist.push(homepage[index].value);
});
var homeurl = $("input[name='homeurl']");
var homeurlist = [];
homeurl.each(function(index) {
homeurlist.push(homepage[index].value);
});
var homeaddress = $("input[name='homeaddresslist']");
var homeaddresslist = [];
homeaddress.each(function(index) {
homeaddresslist.push(homeaddress[index].value);
});
var updateBrand =$('#updateBrand tbody tr');
var shopRelation=[];
shopRelation.push('[')
$.each(updateBrand,function (index) {
shopRelation.push('{')
shopRelation.push('"agreementEndTime":'+$('#updateBrand tbody tr').eq(index).find('td').eq(1).find('.agreementendtime').val()+',');
shopRelation.push('"brandId":'+$('#updateBrand tbody tr').eq(index).find('td').eq(1).find('.brandid').val()+',');
shopRelation.push('"supplierId":'+$('#updateBrand tbody tr').eq(index).find('td').eq(1).find('.supplierid').val());
console.log(index,updateBrand.length-1);
if(index==updateBrand.length-1){
shopRelation.push('}')
}else{
shopRelation.push('},')
}
});
shopRelation.push(']')
console.log(shopRelation.join(''));
submit(function(data) {
data.websiteUrl = hplist.toString();
data.otherUrl = homeurlist.toString();
data.shopAddress = homeaddresslist.toString();
data.onCheck = onCheck;
data.shopsId = shopsId;
data.shopRelation = shopRelation.join('');
});
return false;
});
$(function() {
if ($('#otherUrl').val().split(',').length > 1) {
var homepage = $('#otherUrl').val().split(',');
$.each(homepage,
function() {
$('#homepage').append('<input value="' + this + '" type="text" name="homepage" class="form-control" style="margin-buttom:15px;">')
})
}
if ($('#websiteUrl').val().split(',').length > 1) {
var websiteUrl = $('#websiteUrl').val().split(',');
$.each(websiteUrl,
function() {
$('#homeurl').append('<input value="' + this + '" type="text" name="homeurl" class="form-control" style="margin-buttom:15px;">')
})
}
if ($('#shopAddress').val().split(',').length > 1) {
var shopAddress = $('#shopAddress').val().split(',');
$.each(shopAddress,
function() {
$('#homeaddress').append('<input value="' + this + '" type="text" name="homeaddresslist" class="form-control" style="margin-buttom:15px;">')
})
}
});
$('#brand-name').on('change',function() {
$.ajax({
url: '/supplier/storeadmin/supplierlist',
dataType: "json",
type: 'POST',
data: {
brandId: $('#brand-name').val()
},
success: function(data) {
var savebrandlist = [];
var brandselelt = $('#brand-name').find("option:selected").text();
$.each(data.data.data,function(index) {
savebrandlist.push('<tr>');
savebrandlist.push('<td><input class="checkbox" type="checkbox"></td>');
savebrandlist.push('<td>' + brandselelt + '</td>');
savebrandlist.push('<td>' + data.data.data[index].supplierName);
savebrandlist.push('<input type="hidden" class="agreementendtime" value="'+data.data.data[index].agreementEndTime+'">');
savebrandlist.push('<input type="hidden" class="brandid" value="'+data.data.data[index].brandId+'">');
savebrandlist.push('<input type="hidden" class="supplierid" value="'+data.data.data[index].supplierId+'">');
savebrandlist.push('</td>');
savebrandlist.push('</tr>')
});
$('#savebrand tbody').html(savebrandlist.join(''));
}
})
})
}
\ No newline at end of file
... ...
... ... @@ -30,7 +30,7 @@ var app = yo( {
cookie: { secure: false , maxAge: 3600000 }//session cookie失效时间1小时
},
seStore:config.redis,
port:30011,
port:30012,
beforeMid:function(app,mids) {//使用handlebars-layouts
require('handlebars-layouts').register(mids.hbs.handlebars);
},
... ...
... ... @@ -4,7 +4,7 @@
*/
//接口主域
exports.domain = 'http://localhost:30011';
exports.domain = 'http://localhost:30012';
//路由配置
exports.res =
[{
... ...
//接口主域
var env = process.env.NODE_ENV || 'development';
// exports.domain = 'http://192.168.102.205:18025';
var domain = {
development: 'http://192.168.102.215:8080/platform',
test: 'http://192.168.102.205:18025/yoho-adminportal-web',
preview: 'http://192.168.81.13:8189/yoho-admin-portal',
production: 'http://192.168.81.6:8189/yoho-admin-portal'
};
exports.domain = domain[env];
exports.domain = require('../config/common.js').domain;
//路由配置
... ...
/**
* 路由接口映射
* @author h1bomb
*/
//模块环境适配
// var common = require('../util/common');
// //配置主域
// var config = require('../config/common');
//接口主域
var env = process.env.NODE_ENV || 'development';
// exports.domain = 'http://192.168.102.205:18025';
var domain = {
development: 'http://172.16.6.240:8080/platform',
test: 'http://192.168.102.205:18025/yoho-adminportal-web',
preview: 'http://192.168.81.13:8189/yoho-admin-portal',
production: 'http://192.168.81.6:8189/yoho-admin-portal'
};
exports.domain = domain[env];
exports.domain = require('../config/common.js').domain;
//路由配置
exports.res = [
{//添加优惠卷页面
route: '/coupon/add',
{
route: '/coupon/index',
method: 'GET',
view: 'pages/coupon/edit',
view: 'pages/coupon/index',
src: '/coupon/index',
noApi: true,
data: {
action:"/coupon/action/add",
type:"add",
data:{
limitTimes: "0",
reqDepartment: "零售运营部/平台运营",
userSourceLimit: "1",
userTypeLimit: "1",
staff: "admin",
status: "0"
}
},
src:'/coupon/edit'
bottons:'{"look":true}',
gridurl:'/getPromotion'
}
},
{//添加优惠卷页面
route: '/coupon/update/:id',
method: 'GET',
view: 'pages/coupon/edit',
url: '/promotioncode/getPromotionCode',
isJsonRaw:true,
data:{
action:"/coupon/action/update",
type:"update"
},
src:'/coupon/edit',
params:[
{name:"id",type:"String"}
]
},
{//展示优惠卷详情
route: '/coupon/info/:id',
route: '/coupon/add',
method: 'GET',
view: 'pages/coupon/edit',
url: '/promotioncode/getPromotionCode',
isJsonRaw:true,
src:'/coupon/edit',
data:{
type:"info"
noApi: true,
data: {
limitTimes: "0",
reqDepartment: "零售运营部/平台运营",
userSourceLimit: "1",
userTypeLimit: "1",
staff: "admin",
status: "0"
}
},
{
route: '/checkPromotionCode',
route: '/coupon/action/add',
method: 'POST',
url: '/promotioncode/checkPromotionCode',
url: '/promotioncode/addPromotionCode',
isJsonRaw: true,
params: [
{
name: 'name',
type: 'String'
},
{
name: 'limitTimes',
type: 'String'
},
{
name: 'code',
type: 'String'
},
{
name: 'describe',
type: 'String'
},
{
name: 'promotionInfo',
type: 'String'
},
{
name: 'userSourceLimit',
type: 'String'
},
{
name: 'userTypeLimit',
type: 'String'
},
{
name: 'creatorId',
type: 'String'
},
{
name: 'limitDateFrom',
type: 'String'
},
{
name: 'limitDateTo',
type: 'String'
},
{
name: 'createTime',
type: 'String'
},
{
name: 'reqDepartment',
type: 'String'
},
{
name: 'status',
type: 'String'
},
{
name: 'staff',
type: 'String'
}
]
},
{
route: '/coupon/action/add',
route: '/checkPromotionCode',
method: 'POST',
url: '/promotioncode/addPromotionCode',
url: '/promotioncode/checkPromotionCode',
isJsonRaw: true,
params: [
{name: 'name',type: 'String'},
{name: 'limitTimes',type: 'String'},
{name: 'code',type: 'String'},
{name: 'describe',type: 'String'},
{name: 'promotionInfo',type: 'String'},
{name: 'userSourceLimit',type: 'String'},
{name: 'userTypeLimit',type: 'String'},
{name: 'creatorId',type: 'String'},
{name: 'limitDateFrom',type: 'String'},
{name: 'limitDateTo',type: 'String'},
{name: 'createTime',type: 'String'},
{name: 'reqDepartment',type: 'String'},
{name: 'status',type: 'String'},
{name: 'staff',type: 'String'}
{
name: 'code',
type: 'String'
}
]
},
{//添加优惠卷页面
route: '/coupon/update/:id',
method: 'GET',
view: 'pages/coupon/edit',
url: '/promotioncode/getPromotionCode'
},
{
route: '/coupon/action/update',
method: 'POST',
url: '/promotioncode/updatePromotionCode',
isJsonRaw: true,
params: [
{name: 'id',type: 'String'},
{name: 'name',type: 'String'},
{name: 'limitTimes',type: 'String'},
{name: 'code',type: 'String'},
{name: 'describe',type: 'String'},
{name: 'promotionInfo',type: 'String'},
{name: 'userSourceLimit',type: 'String'},
{name: 'userTypeLimit',type: 'String'},
{name: 'creatorId',type: 'String'},
{name: 'limitDateFrom',type: 'String'},
{name: 'limitDateTo',type: 'String'},
{name: 'createTime',type: 'String'},
{name: 'reqDepartment',type: 'String'},
{name: 'status',type: 'String'}
{
name: 'id',
type: 'String'
},
{
name: 'name',
type: 'String'
},
{
name: 'limitTimes',
type: 'String'
},
{
name: 'code',
type: 'String'
},
{
name: 'describe',
type: 'String'
},
{
name: 'promotionInfo',
type: 'String'
},
{
name: 'userSourceLimit',
type: 'String'
},
{
name: 'userTypeLimit',
type: 'String'
},
{
name: 'creatorId',
type: 'String'
},
{
name: 'limitDateFrom',
type: 'String'
},
{
name: 'limitDateTo',
type: 'String'
},
{
name: 'createTime',
type: 'String'
},
{
name: 'reqDepartment',
type: 'String'
},
{
name: 'status',
type: 'String'
}
]
}
},
{//展示优惠卷详情
route: '/coupon/info/:id',
method: 'GET',
view: 'pages/coupon',
url: '/promotioncode/getPromotionCode'
},
{
route: '/getPromotionCode',
method: 'POST',
url: '/promotioncode/getPromotionCode',
isJsonRaw: true,
params: [{
name: 'id',
type: 'String'
}]
},
{
route: '/getPromotion',
method: 'POST',
url: '/promotioncode/getPromotionCodeList',
isJsonRaw: true,
params: [{
name: 'status',
type: 'Number'
}, {
name: 'page',
type: 'Number'
}, {
name: 'size',
type: 'Number'
}, {
name: 'batchNo',
type: 'Number'
}, {
name: 'name',
type: 'String'
}, {
name: 'reqDepartment',
type: 'String'
}]
},{
route: '/auditPromotion',
method: 'POST',
url: '/promotioncode/auditPromotionCode',
isJsonRaw: true,
params: [{
name: 'id',
type: 'Number'
}, {
name: 'status',
type: 'Number'
}, {
name: 'reason',
type: 'String'
}]
}, {
route: '/sendPromotion',
method: 'POST',
url: '/promotioncode/getPromotionCodeSendList',
isJsonRaw: true,
params: [
{
name: 'auditTime',
type: 'String'
}
]
},
{
route: '/auditPromotion',
method: 'POST',
url: '/promotioncode/auditPromotionCode',
isJsonRaw: true,
params: [{
name: 'id',
type: 'Number'
}, {
name: 'status',
type: 'Number'
}, {
name: 'reason',
type: 'String'
}]
}, {
route: '/sendPromotion',
method: 'POST',
url: '/promotioncode/getPromotionCodeSendList',
isJsonRaw: true,
params: [
{
name: 'auditTime',
type: 'String'
}
]
}, {
route: '/getCodeCount',
method: 'POST',
url: '/promotioncode/getPromotionCodeCountByStatus',
isJsonRaw: true,
params: [
{
name: 'reqDepartment',
type: 'String'
},
{
name: 'name',
type: 'String'
},
{
name: 'batchNo',
type: 'Number'
}
]
}
]
... ...
//接口主域
var env = process.env.NODE_ENV || 'development';
// exports.domain = 'http://192.168.102.205:18025';
var domain = {
development: 'http://localhost:30011',
test: 'http://192.168.102.205:18025/yoho-adminportal-web',
preview: 'http://192.168.81.13:8189/yoho-admin-portal',
production: 'http://192.168.81.6:8189/yoho-admin-portal'
};
exports.domain = domain[env];
exports.domain = require('../config/common.js').domain;
//路由配置
exports.res = [
... ...
... ... @@ -4,8 +4,8 @@ var env = process.env.NODE_ENV || 'development';
var domain = {
// development:'http://localhost:30011',
// development:'http://172.16.6.236:8080',
development:'http://172.16.6.246:8081/platform',
// development:'http://172.16.6.246:8081/platform',
development:'http://192.168.102.215:8080/platform',
test:'http://192.168.102.205:18025/yoho-adminportal-web',
preview:'http://192.168.81.13:8189/yoho-admin-portal',
production:'http://192.168.81.6:8189/yoho-admin-portal'
... ... @@ -29,7 +29,7 @@ exports.res = [{
// 创建店铺页面数据获取
route: '/supplier/store/indexPage',
method: 'POST',
url:"/platform/ShopsRest/getShopList",
url:"/ShopsRest/getShopList",
isJsonRaw:true,
params:[
{name: 'supplierId', type: 'Number'},
... ... @@ -55,7 +55,7 @@ exports.res = [{
// 店铺信息页面数据获取
route: '/supplier/store/examinePage',
method: 'POST',
url:"/platform/ShopsRest/getShopList",
url:"/ShopsRest/getShopList",
isJsonRaw:true,
params:[
{name: 'supplierId', type: 'Number'},
... ... @@ -68,11 +68,36 @@ exports.res = [{
],
src:'/store/examine'
},{
// 店铺信息页面渲染
// 店铺审核页面
route: '/supplier/check/index',
method: 'GET',
view: 'pages/store/check',
noApi:true,
data: {
gridurl:'/supplier/store/checkPage'
},
src:'/store/check',
},{
// 店铺审核页面数据获取
route: '/supplier/store/checkPage',
method: 'POST',
url:"/ShopsRest/getShopList",
isJsonRaw:true,
params:[
{name: 'supplierId', type: 'Number'},
{name: 'brandId', type: 'Number'},
{name: 'checkStatus', type: 'Number'},
{name: 'checkStatusArr', type: 'String'},
{name: 'size', type: 'Number'},
{name: 'page', type: 'Number'}
],
src:'/store/check'
},{
// 店铺详细信息页面渲染
route: '/supplier/store/info/:shopsId',
method: 'GET',
view: 'pages/store/info',
url:"/platform/ShopsRest/getShopDetailById",
url:"/ShopsRest/getShopDetailById",
isJsonRaw:true,
params:[{
name:'shopsId',
... ... @@ -81,16 +106,37 @@ exports.res = [{
src:'/store/index'
},{
// 修改店铺页面渲染
route: '/supplier/store/update/:id',
route: '/supplier/store/update/:shopsId',
method: 'GET',
view: 'pages/store/update',
url:"/interface/store/info",
url:"/ShopsRest/getShopDetailById",
isJsonRaw:true,
params:[{
name:'id',
name:'shopsId',
type:'String'
}],
src:'/store/index'
src:'/store/info'
},{
// 修改店铺页面提交
route: '/store/update',
method: 'POST',
url: '/ShopsRest/updateShops',
isJsonRaw: true,
params:[
{name:"shopsId",type:"Number"},
{name:"shopName",type:"String"},
{name:"shopDomain",type:"String"},
{name:"shopNature",type:"String"},
{name:"createPid",type:"Number"},
{name:"shopsType",type:"Number"},
{name:"shopLogo",type:"String"},
{name:"shopIntro",type:"String"},
{name:"websiteUrl",type:"String"},
{name:"otherUrl",type:"String"},
{name:"shopAddress",type:"String"},
{name:"onCheck",type:"Number"},
{name:"shopRelation",type:"String"}
]
},{
// 新增店铺页面渲染
route: '/supplier/store/add',
... ... @@ -103,10 +149,10 @@ exports.res = [{
data:{},
add:true
}
}, {// 新增店铺
}, {// 新增店铺数据
route: '/store/add',
method: 'POST',
url: '/platform/ShopsRest/addShops',
url: '/ShopsRest/addShops',
isJsonRaw: true,
params:[
{name:"shopName",type:"String"},
... ... @@ -143,6 +189,24 @@ exports.res = [{
{name: 'size', type: 'Number'}
]
},{
// 关店
route: '/supplier/store/closeShops',
method: 'POST',
url:"/ShopsRest/closeShops",
isJsonRaw:true,
params:[
{name:"shopsId",type:"Number"}
]
},{
// 开店
route: '/supplier/store/openShops',
method: 'POST',
url:"/ShopsRest/openShops",
isJsonRaw:true,
params:[
{name:"shopsId",type:"Number"}
]
},{
// 移除店铺管理员关系列表
route: '/supplier/storeadmin/delete',
method: 'POST',
... ... @@ -155,19 +219,50 @@ exports.res = [{
// 店铺管理员关系新增
route: '/supplier/storeadmin/adminAdd',
method: 'GET',
view: 'pages/store/adminAdd',
view: 'pages/store/adminedit',
src:'/store/adminedit'
},{
// 店铺管理员关系新增
route: '/supplier/storeadmin/addguanxi',
method: 'POST',
url:"/ShopsAdminRest/addAdminRelation",
isJsonRaw:true,
params:[
{name:"shopsId",type:"Number"},
{name:"adminPid",type:"Number"},
{name:"identity",type:"Number"}
]
},{
//修改
route: '/supplier/storeadmin/adminEdit/:id',
// 修改店铺页面渲染
route: '/supplier/store/adminupdate/:id',
method: 'GET',
view: 'pages/store/adminAdd',
view: 'pages/store/adminedit',
url:"/ShopsAdminRest/getAdminRelationDetailById",
isJsonRaw:true,
params:[{
name:'id',
type:'String'
}],
src:'/store/adminedit'
},{
// 根据身份选择管理员
route: '/supplier/storeadmin/managerName',
method: 'POST',
url:"/ShopsAdminRest/getUsersByIdentity",
isJsonRaw:true,
url:'/ShopsAdminRest/getAdminRelationDetailById',
src:'/store/index',
src:'/store/adminedit',
params:[
{name:"id",type:"Number"}
{name:"identity",type:"Number"}
]
}
]
\ No newline at end of file
},{
// 根据品牌选择供应商
route: '/supplier/storeadmin/supplierlist',
method: 'POST',
url:"/supplier/supplier/selectSupplierByBrandId",
isJsonRaw:true,
params:[
{name:"brandId",type:"Number"}
]
}]
\ No newline at end of file
... ...
exports.domain = require('../config/common.js').domain;
//"http://172.16.6.220:8080/yohobuy-platform-web";
exports.domain =require('../config/common.js').domain;
//路由配置
exports.res = [{
... ...
... ... @@ -22,14 +22,14 @@
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
<a href="/supplier/update" class="btn btn-success"><i class="fa fa-plus"></i> 添加供应商</a>
<a href="/coupon/add" class="btn btn-success"><i class="fa fa-plus"></i> 添加优惠码</a>
</div>
<div class="panel-body">
<div class="row">
<input id="filter-id" class="form-control panel-input" type="text" placeholder="请输入批次号">
<input id="filter-name" class="form-control panel-input" type="text" placeholder="请输入名称">
<select id="filter-dep" name="filter-dep" tabindex="-1" title="" class="select2-offscreen brandBtn-group">
<option value="全部">全部</option>
<option value="">全部</option>
<option value="商品部">商品部</option>
<option value="市场部">市场部</option>
<option value="会员部">会员部</option>
... ... @@ -51,22 +51,7 @@
</ul>
</div>
<div class="dataTables_length" id="basicTable_length">
<table id="basicTable" class="table table-striped table-bordered responsive dataTable no-footer coupon-list-table" role="grid" aria-describedby="basicTable_info">
<thead class="">
<tr role="row">
<th>批次号</th>
<th>基本信息</th>
<th>使用期限</th>
<th>优惠码说明</th>
<th>申请人</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div class="dataTables_length" id="basicTable">
</div>
<nav>
<ul id="pagination" class="pagination pagination-lg" data-page="{{pagination}}"></ul>
... ... @@ -75,6 +60,9 @@
</div>
</div>
<input type="hidden" id="btnAuthority" value="{{bottons}}">
<input type="hidden" id="gridurl" value="{{gridurl}}">
<div class="modal fade" id="cancel-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
... ... @@ -163,38 +151,6 @@
</div>
</div>
<script id="list-tpl" type="x-tmpl-handlebars">
\{{# data}}
<tr>
<td class="id"><a href="/couponinfo/\{{id}}">\{{batchNo}}</a></td>
<td class="info">
<p>名称:\{{name}}</p>
<p>次数:\{{limitTimes}}</p>
<p>部门:\{{reqDepartment}}</p>
</td>
<td class="time">
<p>\{{limitDateFrom}}</p>
<p>\{{limitDateTo}}</p>
</td>
<td class="describe">
<p>\{{describe}}</p>
</td>
<td class="staff">\{{staff}}</td>
<td class="state">
<p class="state-title">\{{status}}</p>
<p class="state-reason">\{{reason}}</p>
</td>
<td class="operate" data-state="\{{status}}" data-id="\{{id}}">
<a class="btn btn-info btn-xs apply-detail" href="/couponinfo/\{{id}}">查看详情</a>
<a class="btn btn-primary btn-xs apply-success" href="javascript:;">通过</a>
<a class="btn btn-warning btn-xs apply-back" href="javascript:;">驳回</a>
<a class="btn btn-danger btn-xs apply-cancel" href="javascript:;">作废</a>
<a class="btn btn-info btn-xs apply-modify" href="/couponupdate/\{{id}}">修改</a>
</td>
</tr>
\{{/ data}}
</script>
<script id="send-tpl" type="x-tmpl-handlebars">
\{{# data}}
... ...
... ... @@ -19,7 +19,13 @@
</div>
</div>
{{#data}}
<ul id="storelsit" style="display: none;">
<li id="shopsId">{{ shopsId}}</li>
<li id="adminPid">{{ adminPid}}</li>
<li id="identity">{{ identity}}</li>
</ul>
{{/data}}
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
... ... @@ -34,13 +40,13 @@
<div style="margin-top: 20px;">
<span class="col-sm-1 control-label">管理员筛选 *</span>
<select name="store-type" id="identity-type" style="width: 280px;" tabindex="-1" title="" class="select2-offscreen brandBtn-group brandBtn-group-lg"><option value="-1" selected="selected">请选择身份</option>
<!-- <option value="1" data-valid="">品牌公司</option>
<option value="1" data-valid="">品牌公司</option>
<option value="2" data-valid="">品牌经销商</option>
<option value="3" data-valid="">品牌代运营商</option>
<option value="4" data-valid="">有货品牌经理</option>
<option value="5" data-valid="">有货店铺运营</option>
<option value="6" data-valid="">有货商品运营</option>
<option value="7" data-valid="">有货平台运营</option> -->
<option value="7" data-valid="">有货平台运营</option>
</select>
<select name="time-sort" id="manager-name" tabindex="-1" title="" class="select2-offscreen brandBtn-group">
<option value="-1">选择管理员</option>
... ...
... ... @@ -43,8 +43,14 @@
</div>
</div>
</div>
<input type="hidden" id="url" value="/supplier/store/checkPage">
<div class="panel panel-primary-head">
{{> store/list}}
<div id="basicTable_wrapper" class="dataTables_wrapper no-footer">
<div class="dataTables_length" id="storeadmin_Tabel"></div>
<nav>
<ul id="pagination" class="pagination pagination-lg" data-page="{{pagination}}"></ul>
</nav>
</div>
</div>
</div>
... ...
... ... @@ -45,7 +45,6 @@
{{/ supplierName}}
</select>
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="javascript:;" class="btn btn-info">全部</a>
</div>
</div>
</div>
... ...
... ... @@ -46,7 +46,6 @@
{{/ supplierName}}
</select>
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="javascript:;" class="btn btn-info">全部</a>
</div>
</div>
<input type="hidden" id="url" value="/supplier/store/indexPage">
... ...
... ... @@ -19,7 +19,9 @@
</div>
</div>
{{#data}}
<form id="storeForm" role="form" class="form-horizontal form-bordered" method="post" action="{{action}}">
<input type="hidden" id="shopsId" value="{{ shopsId}}">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
... ... @@ -64,8 +66,9 @@
</div>
<div class="col-sm-9">
<div id="homepage" class="input-group Add col-sm-6" style="float: left;">
<input type="text" name="homepage" class="form-control" placeholder="官方网址">
</div>
<input id="otherUrl" type="hidden" value="{{ otherUrl}}">
<button type="button" data-type="0" class="btn btn-info urlAdd" style="margin-left: 8px;">新增</button>
</div>
</div>
... ... @@ -75,8 +78,9 @@
</div>
<div class="col-sm-9">
<div id="homeurl"class="input-group Add col-sm-6 col-sm-6" style="float: left;">
<input type="text" name="homeurl" class="form-control" placeholder="其他平台网址">
</div>
<input id="websiteUrl" type="hidden" value="{{ websiteUrl}}">
<button type="button" data-type="1" class="btn btn-info urlAdd" style="margin-left: 8px;">新增</button>
</div>
</div>
... ... @@ -86,8 +90,8 @@
</div>
<div class="col-sm-9">
<div id="homeaddress" class="input-group Add col-sm-6" style="float: left;">
<input type="text" name="homeaddresslist"class="form-control" placeholder="代表实体店">
</div>
<input id="shopAddress" type="hidden" value="{{ shopAddress}}">
<button type="button" data-type="2" class="btn btn-info urlAdd" style="margin-left: 8px;">新增</button>
</div>
</div>
... ... @@ -149,8 +153,8 @@
</div>
</div>
<button type="button" id="btn1" class="btn btn-success">提交审核</button>
<button type="button" class="btn btn-info">暂存</button>
<button type="button" data-oncheck='1' class="check btn btn-success">提交审核</button>
<button type="button" data-oncheck='2' class="check btn btn-info">暂存</button>
<button onclick="history.go(-1);" type="button" class="btn btn-danger">取消</button>
</div>
</div>
... ... @@ -158,6 +162,7 @@
</div>
</div>
</form>
{{/data}}
<div class="modal fade" id="modal-id">
<div class="modal-dialog">
<div class="modal-content" id="saveBrand">
... ...
... ... @@ -30,7 +30,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">成立日期 <span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" id="foundTime" jsaction="date" placeholder="成立日期" class="form-control" required value="{{foundTime}}">
<input type="text" id="foundTime" jsaction="date" placeholder="成立日期" class="form-control" readonly required value="{{foundTime}}">
</div>
</div>
... ...