Authored by weiqingting

物理类目管理

... ... @@ -3,218 +3,290 @@
*@author: chenglong
*/
var $ = require('jquery');
var edit = require('../common/edit');
var Handlebars = require('yoho.handlebars');
var dropDown = require('../common/dropDown');
var selectOption =
'{{# data}}' +
'<option value="{{id}}" {{# select}}selected{{/ select}}>{{sortName}}</option>' +
'{{/ data}}';
var optionStr = Handlebars.compile(selectOption);
function getAllSort(callback, selectId) {
$.ajax({
url: '/product/class/queryAllProductSortList',
type: 'POST',
dataType: 'json'
}).then(function (d) {
var firstSort = [],
data = d.data.data,
sortLen = data.length,
i;
var resData;
for (i = 0; i < sortLen; i++) {
if (!data[i].child) {
if (data[i].id === selectId) {
data[i].select = true;
}
firstSort.push(data[i]);
}
}
// var $ = require('jquery');
// var edit = require('../common/edit');
// var Handlebars = require('yoho.handlebars');
// var dropDown = require('../common/dropDown');
callback(firstSort);
});
}
function getChildSort(id, callback, selectId) {
$.ajax({
url: '/product/class/queryProductSortList',
type: 'POST',
dataType: 'json',
data: {
param: id
}
}).then(function (d) {
var data = d.data.data;
var dataLen = data.length;
var i;
for (i = 0; i < dataLen; i++) {
// var selectOption =
// '{{# data}}' +
// '<option value="{{id}}" {{# select}}selected{{/ select}}>{{sortName}}</option>' +
// '{{/ data}}';
if (data[i].id === selectId) {
data[i].select = true;
}
}
callback(data);
});
}
// var optionStr = Handlebars.compile(selectOption);
var $editInput = $('#editId');
var editLevel = $editInput.attr('level');
var toNum = 1;
// function getAllSort(callback, selectId) {
// $.ajax({
// url: '/product/class/queryAllProductSortList',
// type: 'POST',
// dataType: 'json'
// }).then(function (d) {
function createLevelOneOption(selectedId, callback) {
getAllSort(function (data) {
// var firstSort = [],
// data = d.data.data,
// sortLen = data.length,
// i;
// var resData;
// for (i = 0; i < sortLen; i++) {
// if (!data[i].child) {
// if (data[i].id === selectId) {
// data[i].select = true;
// }
// firstSort.push(data[i]);
// }
// }
// callback(firstSort);
// });
// }
// function getChildSort(id, callback, selectId) {
// $.ajax({
// url: '/product/class/queryProductSortList',
// type: 'POST',
// dataType: 'json',
// data: {
// param: id
// }
// }).then(function (d) {
// var data = d.data.data;
// var dataLen = data.length;
// var i;
// for (i = 0; i < dataLen; i++) {
// if (data[i].id === selectId) {
// data[i].select = true;
// }
// }
// callback(data);
// });
// }
// var $editInput = $('#editId');
// var editLevel = $editInput.attr('level');
// var toNum = 1;
// function createLevelOneOption(selectedId, callback) {
// getAllSort(function (data) {
$('#parentSortId').after(optionStr({
data: data
}));
// $('#parentSortId').after(optionStr({
// data: data
// }));
new dropDown({
el:'#firstSortId'
});
if (callback) {
callback();
}
}, selectedId*toNum);
}
function createLevelTwoOption(parentId, selectedId) {
getChildSort(parentId*toNum, function (data) {
$('#secondSortId').find('option:first').after(optionStr({
data: data
}));
new dropDown({
el:'#secondSortId'
});
}, selectedId*toNum);
}
// new dropDown({
// el:'#firstSortId'
// });
// if (callback) {
// callback();
// }
// }, selectedId*toNum);
// }
// function createLevelTwoOption(parentId, selectedId) {
// getChildSort(parentId*toNum, function (data) {
// $('#secondSortId').find('option:first').after(optionStr({
// data: data
// }));
// new dropDown({
// el:'#secondSortId'
// });
// }, selectedId*toNum);
// }
console.log(editLevel);
// 编辑
if (editLevel) {
switch (editLevel) {
case "1":
createLevelOneOption($editInput.val(), function () {
getChildSort($editInput.val()*toNum, function (data) {
$('#secondSortId').find('option:first').after(optionStr({
data: data
}));
});
});
new dropDown({
el:'#secondSortId'
});
break;
case "2":
createLevelOneOption($editInput.attr('pid'), function () {
createLevelTwoOption($editInput.attr('pid'), $editInput.val());
});
break;
default :
break;
}
// console.log(editLevel);
// // 编辑
// if (editLevel) {
// switch (editLevel) {
// case "1":
// createLevelOneOption($editInput.val(), function () {
// getChildSort($editInput.val()*toNum, function (data) {
// $('#secondSortId').find('option:first').after(optionStr({
// data: data
// }));
// });
// });
// new dropDown({
// el:'#secondSortId'
// });
// break;
// case "2":
// createLevelOneOption($editInput.attr('pid'), function () {
// createLevelTwoOption($editInput.attr('pid'), $editInput.val());
// });
// break;
// default :
// break;
// }
// } else {
// // 添加
// getAllSort(function (data) {
// $('#parentSortId').after(optionStr({
// data: data
// }));
// });
// // 选择一\二级菜单时渲染二
// $('.level-select').change(function () {
// var id = $(this).val()*toNum;
// getChildSort(id, function (data) {
// $('#childSortId').after(optionStr({
// data: data
// }));
// });
// });
// new dropDown({
// el:'#firstSortId'
// });
// new dropDown({
// el:'#secondSortId'
// });
// }
// // 添加品类表单验证
// var newClassVerification = new edit("#new-class-form");
// newClassVerification.init();
// $(".new-class-btn").click(function(){
// var id = $(this).attr('data-id');
// var postUrl;
// var $this = $(this);
// var pid = $('#secondSortId').val();
// var ppid = $('#firstSortId').val();
// if (ppid*toNum) {
// $('#parentId').val(ppid);
// }
// if (pid*toNum) {
// $('#parentId').val(pid);
// }
// if (!!id) {
// postUrl = '/product/sort/update'
// } else {
// postUrl = $("#new-class-form").attr("action");
// }
// newClassVerification.submit(postUrl, function(option,that) {
// option.beforeSend = function () {
// $this.attr('disabled', 'disabled');
// };
// option.success=function(res){
// console.log(res);
} else {
// 添加
getAllSort(function (data) {
$('#parentSortId').after(optionStr({
data: data
}));
});
// if (res.data.code === 200) {
// 选择一\二级菜单时渲染二
$('.level-select').change(function () {
// newClassVerification.$tip('提交成功');
// $this.removeAttr('disabled');
var id = $(this).val()*toNum;
// setTimeout(function () {
// window.location.href = '/erpproduct/sort/index';
// }, 1000);
// }
// };
// option.error=function(res){
getChildSort(id, function (data) {
// console.log('error');
// }
// });
// return false;
// });
$('#childSortId').after(optionStr({
data: data
}));
var $ = require('jquery');
var common=require('../common/common');
});
});
var e=new common.edit("#new-class-form");
new dropDown({
el:'#firstSortId'
});
new dropDown({
el:'#secondSortId'
var BLL={
fillselect:function(items,selectedid){
var HtmlArr=["<option value='-1'>请选择</option>"];
$.each(items,function(index,item){
var selected=(item.id==selectedid)?"selected":"";
var optionHtml=common.util.__template("<option value='{value}' {selected} >{name}</option>",{value:item.id,name:item.sortName,selected:selected});
HtmlArr.push(optionHtml);
});
return HtmlArr.join('');
},
select2:function(){
var __id=$("#firstSortId").val();
var el="#secondSortId";
if(__id){
common.util.__ajax({url:'/product/class/queryProductSortList',data:{param: __id}},function(res){
$(el).html(BLL.fillselect(res.data,$(el).data("value")));
},true);
}else{
$(el).html(BLL.fillselect([]));
}
}
}
// 添加品类表单验证
var newClassVerification = new edit("#new-class-form");
newClassVerification.init();
$(".new-class-btn").click(function(){
var id = $(this).attr('data-id');
var postUrl;
var $this = $(this);
var pid = $('#secondSortId').val();
var ppid = $('#firstSortId').val();
e.on("render",function(){
common.util.__ajax({url:'/product/class/queryAllProductSortList'},function(res){
var el="#firstSortId";
$(el).html(BLL.fillselect(res.data,$(el).data("value")));
new common.dropDown({el:el});
BLL.select2();
},true);
});
e.on("bind",function(){
$("#firstSortId").change(function(){
BLL.select2();
});
});
if (ppid*toNum) {
$('#parentId').val(ppid);
}
if (pid*toNum) {
$('#parentId').val(pid);
}
e.init();
if (!!id) {
postUrl = '/product/sort/update'
} else {
postUrl = $("#new-class-form").attr("action");
$(document).on("click",".btn-success",function(){
e.submit($("#new-class-form").attr("action"),function(option){
var _arr=["firstSortId","secondSortId"];
for(var i in _arr){
if(!option.data[_arr[i]]){
delete option.data[_arr[i]];
}
}
newClassVerification.submit(postUrl, function(option,that) {
option.beforeSend = function () {
$this.attr('disabled', 'disabled');
};
option.success=function(res){
console.log(res);
if (res.data.code === 200) {
newClassVerification.$tip('提交成功');
$this.removeAttr('disabled');
setTimeout(function () {
window.location.href = '/erpproduct/sort/index';
}, 1000);
}
};
option.error=function(res){
console.log('error');
option.success=function(res){
res=res.data;
if(res.code=="200"){
e.$tip('提交成功',function(){
location.href="/erpproduct/sort/index";
},'growl-success');
}else{
e.$tip(res.message);
}
});
return false;
return false;
}
option.error=function(res){
e.$tip("提交失败");
};
});
});
... ...
... ... @@ -31,9 +31,9 @@ var $ = require('jquery'),
});
// sortmenu.init(function(){
// g.init('/erpproduct/sortsize/ajax/index');
// });
sortmenu.init(function(){
g.init('/erpproduct/sortsize/ajax/index');
});
var _model=JSON.parse($("#model").val());
... ...
... ... @@ -333,7 +333,7 @@ e.on("bind",function(){
//item.supplierId
var i=0;
$.each(g2.__rows,function(index1,item1){
if(item1.supplierId==item.supplierId){
if(item1.brandId==item.brandId){
i++;
}
});
... ... @@ -356,26 +356,36 @@ e.on("bind",function(){
});
$("#updateBrand").on("click",".delete",function(){
delete g2.__rows[$(this).data("index")];
console.log(g2.__rows);
g2.__rows.splice($(this).data("index"),1);
console.log(g2.__rows);
g2.reload();
});
});
var _arr={
websiteUrl:"[]",
otherUrl:"[]",
shopAddress:"[]"
};
var urlRegx="[a-zA-z]+://[^s]*";
var _regx={
websiteUrl:urlRegx,
otherUrl:urlRegx
};
e.on("validate",function(){
if(+$("#shopNature").val()==-1){
return "请选择店铺类型";
}
});
e.init();
var submit=function(callback){
var _arr={
e.on("validate",function(){
_arr={
websiteUrl:[],
otherUrl:[],
shopAddress:[]
};
var urlRegx="[a-zA-z]+://[^s]*";
var _regx={
websiteUrl:urlRegx,
otherUrl:urlRegx
};
var _count=0;
for(var key in _arr){
$("#"+key+"-list").find("input:text").each(function(){
... ... @@ -395,14 +405,24 @@ var submit=function(callback){
_arr[key]=JSON.stringify(_arr[key]);
}
if(_count>0){
common.util.__tip("网址输入错误");
return;
return "网址输入错误";
}
});
e.on("validate",function(){
_arr.shopRelation=JSON.stringify(g2.rows);
if(!_arr.shopRelation){
common.util.__tip("请选择关联品牌:");
return;
return "请选择关联品牌";
}
});
e.init();
var submit=function(callback){
e.submit($("#storeForm").attr("action"),function(option){
option.data=$.extend({},option.data,_arr);
console.log(option.data);
... ... @@ -410,8 +430,7 @@ var submit=function(callback){
res=res.data;
if(res.code=="200"){
e.$tip('提交成功',function(){
location.href=window.me.getUrl();
//window.history.go(-1);
location.href="/supplier/store/index";
},'growl-success');
}else{
e.$tip(res.message);
... ...
... ... @@ -66,7 +66,9 @@ var ENUM={// 审核状态;100 暂存 200 待审核 300 审核通过 900 驳
}
if(authority.btn){
HtmArr.push('<a href="/supplier/store/update/'+item.shopsId+'" href="javascript:void(0);" class="btn btn-success btn-xs">编辑</a>');
if(+item.checkStatus!=200){
HtmArr.push('<a href="/supplier/store/update/'+item.shopsId+'" href="javascript:void(0);" class="btn btn-success btn-xs">编辑</a>');
}
if(+item.status){
// 1开启 0 关闭
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class="closeshops btn btn-success btn-xs">开店</a>');
... ...
... ... @@ -3,6 +3,7 @@ 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))){
... ... @@ -38,8 +39,11 @@ var edit=require('../common/edit');
res=res.data;
if(res.code=="200"){
e.$tip(config.msg||"提交成功",function(){
location.href=window.me.getUrl();
if(+option.data.operations==1){
location.href="/supplier/supplier/index";
}else{
location.href="/supplier/supplier/managelist";
}
},'growl-success');
}else{
e.$tip(res.message);
... ...
... ... @@ -43,10 +43,9 @@ var $ = require('jquery'),
//提交驳回
$(document).on('click', '.btn-return', function() {
Bll.toast("确定要驳回审核吗?",function(){
return Bll.model({status:900,operations:1});
return Bll.model({status:900});
});
});
//冻结操作
$(document).on('click', '.btn-freeze', function() {
Bll.toast("确定要冻结审核吗?",function(){
... ...
ul{margin-top:0}.admin-icon-yellow{color:#ffbe40}.admin-header{font-size:1.4rem;margin-bottom:0}.admin-header-list a:hover :after{content:none}.admin-main{background:#f3f3f3}.admin-menu{position:fixed;z-index:10;bottom:30px;right:20px}.admin-sidebar{width:260px;min-height:100%;float:left;border-right:1px solid #cecece}.admin-sidebar-list{margin-bottom:0}.admin-sidebar-list li a{color:#5c5c5c;padding-left:24px}.admin-sidebar-list li:first-child{border-top:none}.admin-sidebar-sub{margin-top:0;margin-bottom:0;box-shadow:0 16px 8px -15px #e2e2e2 inset;background:#ececec;padding-left:24px}.admin-sidebar-sub li:first-child{border-top:1px solid #dedede}.admin-sidebar-panel{margin:10px}.admin-content{width:auto;overflow:hidden;height:100%;background:#fff}.admin-content-list{border:1px solid #e9ecf1;margin-top:0}.admin-content-list li{border:1px solid #e9ecf1;border-width:0 1px;margin-left:-1px}.admin-content-list li:first-child{border-left:none}.admin-content-list li:last-child{border-right:none}.admin-content-table a{color:#535353}.admin-content-file{margin-bottom:0;color:#666}.admin-content-file p{margin:0 0 5px 0;font-size:1.4rem}.admin-content-file li{padding:10px 0}.admin-content-file li:first-child{border-top:none}.admin-content-file li:last-child{border-bottom:none}.admin-content-file li .am-progress{margin-bottom:4px}.admin-content-file li .am-progress-bar{line-height:14px}.admin-content-task{margin-bottom:0}.admin-content-task li{padding:5px 0;border-color:#eee}.admin-content-task li:first-child{border-top:none}.admin-content-task li:last-child{border-bottom:none}.admin-task-meta{font-size:1.2rem;color:#999}.admin-task-bd{font-size:1.4rem;margin-bottom:5px}.admin-content-comment{margin-bottom:0}.admin-content-comment .am-comment-bd{font-size:1.4rem}.admin-content-pagination{margin-bottom:0}.admin-content-pagination li a{padding:4px 8px}@media only screen and (min-width: 641px){.admin-sidebar{display:block;position:static;background:none}.admin-offcanvas-bar{position:static;width:auto;background:none;-webkit-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.admin-offcanvas-bar:after{content:none}}@media only screen and (max-width: 640px){.admin-sidebar{width:inherit}.admin-offcanvas-bar{background:#f3f3f3}.admin-offcanvas-bar:after{background:#BABABA}.admin-sidebar-list a:hover,.admin-sidebar-list a:active{-webkit-transition:background-color .3s ease;transition:background-color .3s ease;background:#E4E4E4}.admin-content-list li{padding:10px;border-width:1px 0;margin-top:-1px}.admin-content-list li:first-child{border-top:none}.admin-content-list li:last-child{border-bottom:none}.admin-form-text{text-align:left !important}}.user-info{margin-bottom:15px}.user-info .am-progress{margin-bottom:4px}.user-info p{margin:5px}.user-info-order{font-size:1.4rem}.error-log .am-pre-scrollable{max-height:40rem}.table-main{font-size:1.4rem;padding:.5rem}.table-main button{background:#fff}.table-check{width:30px}.table-id{width:50px}@media only screen and (max-width: 640px){.table-select{margin-top:10px;margin-left:5px}}.gallery-list li{padding:10px}.gallery-list a{color:#666}.gallery-list a:hover{color:#3bb4f2}.gallery-title{margin-top:6px;font-size:1.4rem}.gallery-desc{font-size:1.2rem;margin-top:4px}.page-404{background:#fff;border:none;width:200px;margin:0 auto}.fixed-layout,.fixed-layout body{height:100%;overflow:hidden}.fixed-layout .admin-header{position:fixed;top:0;left:0;right:0;z-index:1500}.fixed-layout .admin-main{position:relative;height:100%;padding-top:51px}.fixed-layout .admin-content,.fixed-layout .admin-sidebar{height:100%;overflow-x:hidden;overflow-y:scroll}.fixed-layout .admin-sidebar.am-active{z-index:1600}input[type=file]{display:block;opacity:0;height:60px;width:100px;position:absolute;z-index:99}.form-horizontal .form-group{margin-left:0px;margin-right:0px}.datepicker{display:none;position:absolute;padding:4px;margin-top:1px;direction:ltr}.datepicker.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;list-style:none;background-color:#fff;border:1px solid rgba(0,0,0,0.2);border-radius:5px;box-shadow:0 5px 10px rgba(0,0,0,0.2);background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;color:#333;font-size:13px;line-height:18px}.datepicker.dropdown-menu th{padding:4px 5px}.datepicker.dropdown-menu td{padding:4px 5px}.datepicker table{border:0;margin:0;width:auto}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer}.datepicker td{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;background:#fff;cursor:pointer}.datepicker td.active.day,.datepicker td.active.year{background:#2ba6cb}.datepicker td.old,.datepicker td.new{color:#999}.datepicker td span.active{background:#2ba6cb}.datepicker td.day.disabled{color:#ccc}.datepicker th{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;background:#fff;cursor:pointer}.datepicker th.active.day,.datepicker th.active.year{background:#2ba6cb}.datepicker th.date-switch{width:145px}.datepicker th span.active{background:#2ba6cb}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.datepicker.days div.datepicker-days{display:block}.datepicker.months div.datepicker-months{display:block}.datepicker.years div.datepicker-years{display:block}.datepicker thead tr:first-child th{cursor:pointer}.datepicker thead tr:first-child th.cw{cursor:default;background-color:transparent}.datepicker tfoot tr:first-child th{cursor:pointer}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0}.datepicker-dropdown:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:1px solid rgba(0,0,0,0.2);position:absolute;top:-7px;left:6px}.datepicker-dropdown:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.datepicker>div,.datepicker-dropdown::before,.datepicker-dropdown::after{display:none}.datepicker-close{position:absolute;top:-30px;right:0;width:15px;height:30px;padding:0;display:none}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.panel-default .panel-heading{border-top:1px solid #e7e7e7}.red{color:red;font-family:bold}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:0 !important}.show-grid{padding:10px}.brandBtn-group{width:150px;float:left;margin-right:8px}.brandBtn-group-lg{width:280px}.contentpanel td a{margin:0 3px}.mainwrapper .toggle-table tr{cursor:pointer}.mainwrapper .toggle-table tr.level1 td:nth-of-type(1){text-indent:2px}.mainwrapper .toggle-table tr.level2 td:nth-of-type(1){text-indent:15px}.mainwrapper .toggle-table tr.level3 td:nth-of-type(1){text-indent:30px}.pattrscroll{background:#F7F7F7}.pattrscroll ul{padding-left:0}.pattrscroll li{cursor:pointer}.mainwrapper .list-group-item.level1{text-indent:2px}.mainwrapper .list-group-item.level2{text-indent:15px}.mainwrapper .list-group-item.level3{text-indent:30px}.attr-item-active{background:#428bca;color:#fff}.pannel-scroll{height:500px;overflow-y:scroll;overflow-x:hidden}.attr-select{display:block;height:40px;line-height:40px;border:1px solid #ccc;border-radius:3px}#limit-table-box table{vertical-align:middle}#limit-table-box table th,#limit-table-box table td{text-align:center;vertical-align:middle}#limit-table-box table div.checkbox label{height:13px}#limit-table-box table .cover-img{width:100px}#limit-table-box table .width50{width:50px;text-align:center}.height40{height:40px;line-height:40px}.edit-cover-img{width:100px;margin:0 15px;float:left}.quota-text,.quota-img,.quota-video{width:300px;margin-bottom:15px}.quota-text img,.quota-img img,.quota-video img{width:100%}#text-editor{width:100%;max-width:100%;min-width:100%;height:300px;max-height:300px;min-height:300px}.product-detail input[type="text"]{width:100px}.main-table{-display:none}.bulk-import{display:none}#upload-input{display:inline-block;position:static;opacity:1;width:auto;height:auto}.excel-model{display:inline-block;width:110px;height:48px;line-height:48px;padding:0 0 0 50px;margin:0 200px;background:url(../images/excel.png) no-repeat left center}.panel-input{display:inline-block;width:100%}.panel-col,.panel-col2{float:left;width:150px;margin:0 10px}.panel-col2{width:280px}
ul{margin-top:0}.admin-icon-yellow{color:#ffbe40}.admin-header{font-size:1.4rem;margin-bottom:0}.admin-header-list a:hover :after{content:none}.admin-main{background:#f3f3f3}.admin-menu{position:fixed;z-index:10;bottom:30px;right:20px}.admin-sidebar{width:260px;min-height:100%;float:left;border-right:1px solid #cecece}.admin-sidebar-list{margin-bottom:0}.admin-sidebar-list li a{color:#5c5c5c;padding-left:24px}.admin-sidebar-list li:first-child{border-top:none}.admin-sidebar-sub{margin-top:0;margin-bottom:0;box-shadow:0 16px 8px -15px #e2e2e2 inset;background:#ececec;padding-left:24px}.admin-sidebar-sub li:first-child{border-top:1px solid #dedede}.admin-sidebar-panel{margin:10px}.admin-content{width:auto;overflow:hidden;height:100%;background:#fff}.admin-content-list{border:1px solid #e9ecf1;margin-top:0}.admin-content-list li{border:1px solid #e9ecf1;border-width:0 1px;margin-left:-1px}.admin-content-list li:first-child{border-left:none}.admin-content-list li:last-child{border-right:none}.admin-content-table a{color:#535353}.admin-content-file{margin-bottom:0;color:#666}.admin-content-file p{margin:0 0 5px 0;font-size:1.4rem}.admin-content-file li{padding:10px 0}.admin-content-file li:first-child{border-top:none}.admin-content-file li:last-child{border-bottom:none}.admin-content-file li .am-progress{margin-bottom:4px}.admin-content-file li .am-progress-bar{line-height:14px}.admin-content-task{margin-bottom:0}.admin-content-task li{padding:5px 0;border-color:#eee}.admin-content-task li:first-child{border-top:none}.admin-content-task li:last-child{border-bottom:none}.admin-task-meta{font-size:1.2rem;color:#999}.admin-task-bd{font-size:1.4rem;margin-bottom:5px}.admin-content-comment{margin-bottom:0}.admin-content-comment .am-comment-bd{font-size:1.4rem}.admin-content-pagination{margin-bottom:0}.admin-content-pagination li a{padding:4px 8px}@media only screen and (min-width: 641px){.admin-sidebar{display:block;position:static;background:none}.admin-offcanvas-bar{position:static;width:auto;background:none;-webkit-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.admin-offcanvas-bar:after{content:none}}@media only screen and (max-width: 640px){.admin-sidebar{width:inherit}.admin-offcanvas-bar{background:#f3f3f3}.admin-offcanvas-bar:after{background:#BABABA}.admin-sidebar-list a:hover,.admin-sidebar-list a:active{-webkit-transition:background-color 0.3s ease;transition:background-color 0.3s ease;background:#E4E4E4}.admin-content-list li{padding:10px;border-width:1px 0;margin-top:-1px}.admin-content-list li:first-child{border-top:none}.admin-content-list li:last-child{border-bottom:none}.admin-form-text{text-align:left !important}}.user-info{margin-bottom:15px}.user-info .am-progress{margin-bottom:4px}.user-info p{margin:5px}.user-info-order{font-size:1.4rem}.error-log .am-pre-scrollable{max-height:40rem}.table-main{font-size:1.4rem;padding:.5rem}.table-main button{background:#fff}.table-check{width:30px}.table-id{width:50px}@media only screen and (max-width: 640px){.table-select{margin-top:10px;margin-left:5px}}.gallery-list li{padding:10px}.gallery-list a{color:#666}.gallery-list a:hover{color:#3bb4f2}.gallery-title{margin-top:6px;font-size:1.4rem}.gallery-desc{font-size:1.2rem;margin-top:4px}.page-404{background:#fff;border:none;width:200px;margin:0 auto}.fixed-layout,.fixed-layout body{height:100%;overflow:hidden}.fixed-layout .admin-header{position:fixed;top:0;left:0;right:0;z-index:1500}.fixed-layout .admin-main{position:relative;height:100%;padding-top:51px}.fixed-layout .admin-content,.fixed-layout .admin-sidebar{height:100%;overflow-x:hidden;overflow-y:scroll}.fixed-layout .admin-sidebar.am-active{z-index:1600}input[type=file]{display:block;opacity:0;height:60px;width:100px;position:absolute;z-index:99}.form-horizontal .form-group{margin-left:0px;margin-right:0px}.datepicker{display:none;position:absolute;padding:4px;margin-top:1px;direction:ltr}.datepicker.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;list-style:none;background-color:#fff;border:1px solid rgba(0,0,0,0.2);border-radius:5px;box-shadow:0 5px 10px rgba(0,0,0,0.2);background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;color:#333;font-size:13px;line-height:18px}.datepicker.dropdown-menu th{padding:4px 5px}.datepicker.dropdown-menu td{padding:4px 5px}.datepicker table{border:0;margin:0;width:auto}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer}.datepicker td{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;background:#fff;cursor:pointer}.datepicker td.active.day,.datepicker td.active.year{background:#2ba6cb}.datepicker td.old,.datepicker td.new{color:#999}.datepicker td span.active{background:#2ba6cb}.datepicker td.day.disabled{color:#ccc}.datepicker th{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;background:#fff;cursor:pointer}.datepicker th.active.day,.datepicker th.active.year{background:#2ba6cb}.datepicker th.date-switch{width:145px}.datepicker th span.active{background:#2ba6cb}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.datepicker.days div.datepicker-days{display:block}.datepicker.months div.datepicker-months{display:block}.datepicker.years div.datepicker-years{display:block}.datepicker thead tr:first-child th{cursor:pointer}.datepicker thead tr:first-child th.cw{cursor:default;background-color:transparent}.datepicker tfoot tr:first-child th{cursor:pointer}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0}.datepicker-dropdown:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:1px solid rgba(0,0,0,0.2);position:absolute;top:-7px;left:6px}.datepicker-dropdown:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.datepicker>div,.datepicker-dropdown::before,.datepicker-dropdown::after{display:none}.datepicker-close{position:absolute;top:-30px;right:0;width:15px;height:30px;padding:0;display:none}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.panel-default .panel-heading{border-top:1px solid #e7e7e7}.red{color:red;font-family:bold}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:0 !important}.show-grid{padding:10px}.brandBtn-group{width:150px;float:left;margin-right:8px}.brandBtn-group-lg{width:280px}.contentpanel td a{margin:0 3px}.mainwrapper .toggle-table tr{cursor:pointer}.mainwrapper .toggle-table tr.level1 td:nth-of-type(1){text-indent:2px}.mainwrapper .toggle-table tr.level2 td:nth-of-type(1){text-indent:15px}.mainwrapper .toggle-table tr.level3 td:nth-of-type(1){text-indent:30px}.pattrscroll{background:#F7F7F7}.pattrscroll ul{padding-left:0}.pattrscroll li{cursor:pointer}.mainwrapper .list-group-item.level1{text-indent:2px}.mainwrapper .list-group-item.level2{text-indent:15px}.mainwrapper .list-group-item.level3{text-indent:30px}.attr-item-active{background:#428bca;color:#fff}.pannel-scroll{height:500px;overflow-y:scroll;overflow-x:hidden}.attr-select{display:block;height:40px;line-height:40px;border:1px solid #ccc;border-radius:3px}#limit-table-box table{vertical-align:middle}#limit-table-box table th,#limit-table-box table td{text-align:center;vertical-align:middle}#limit-table-box table div.checkbox label{height:13px}#limit-table-box table .cover-img{width:100px}#limit-table-box table .width50{width:50px;text-align:center}.height40{height:40px;line-height:40px}.edit-cover-img{width:100px;margin:0 15px;float:left}.quota-text,.quota-img,.quota-video{width:300px;margin-bottom:15px}.quota-text img,.quota-img img,.quota-video img{width:100%}#text-editor{width:100%;max-width:100%;min-width:100%;height:300px;max-height:300px;min-height:300px}.product-detail input[type="text"]{width:100px}.main-table{-display:none}.bulk-import{display:none}#upload-input{display:inline-block;position:static;opacity:1;width:auto;height:auto}.excel-model{display:inline-block;width:110px;height:48px;line-height:48px;padding:0 0 0 50px;margin:0 200px;background:url(../images/excel.png) no-repeat left center}.panel-input{display:inline-block;width:100%}.panel-col,.panel-col2{float:left;width:150px;margin:0 10px}.panel-col2{width:280px}
... ...
... ... @@ -31,33 +31,6 @@ exports.res = [
}
]
},{
//商品管理>【品类列表ajax更新】
route: '/product/sort/update',
method: 'POST',
url: '/product/updateProductSort',
isJsonRaw:true,
params: [
{
name: 'param',
type: 'Number'
},{
name: 'sortName',
type: 'String'
},{
name: 'sortInitials',
type: 'String'
},{
name:'parentId',
type: 'Number'
},{
name: 'orderBy',
type: 'Number'
},{
name: 'status',
type: 'Number'
}
]
},{
//商品管理>【添加品类】页面渲染
route: '/product/class/new',
method: 'GET',
... ... @@ -67,7 +40,9 @@ exports.res = [
data: {
data: {
status: 1
}
},
pagetitle:"添加品类",
action:"/product/sort/addProductSort"
}
},{
//商品管理>【添加品类】ajax请求接口
... ... @@ -77,18 +52,18 @@ exports.res = [
isJsonRaw:true,
params: [
{
name: 'param',
type: 'Number'
},{
name: 'sortName',
type: 'String'
},{
name: 'sortInitials',
type: 'String'
},{
name:'parentId',
name:'firstSortId',
type: 'Number'
},{
name:'secondSortId',
type:'Number'
},{
name: 'orderBy',
type: 'Number'
},{
... ... @@ -104,6 +79,10 @@ exports.res = [
url: '/product/getProductSort',
src: '/product/add',
isJsonRaw:true,
data:{
pagetitle:"修改品类",
action:"/product/sort/update"
},
params: [
{
name: 'param',
... ... @@ -111,6 +90,36 @@ exports.res = [
}
]
},{
//商品管理>【品类列表ajax更新】
route: '/product/sort/update',
method: 'POST',
url: '/product/updateProductSort',
isJsonRaw:true,
params: [
{
name: 'id',
type: 'Number'
},{
name: 'sortName',
type: 'String'
},{
name: 'sortInitials',
type: 'String'
},{
name:'firstSortId',
type: 'Number'
},{
name:'secondSortId',
type:'Number'
},{
name: 'orderBy',
type: 'Number'
},{
name: 'status',
type: 'Number'
}
]
},{
//商品管理>【产品属性】页面渲染
route: '/erpproduct/attribute/index',
method: 'GET',
... ...
... ... @@ -19,19 +19,19 @@ exports.res = [{
},
src:'/store/index'
},{
// 店铺审核管理页面
// 店铺信息管理页面
route: '/supplier/store/examine',
method: 'GET',
view: 'pages/store/index',
noApi:true,
data: {
gridurl:'/supplier/store/index',
gridurl:'/supplier/store/indexPage',
authority:'{"btn":true,"operationStatus":2,"checkStatusArr":"200,300,900"}', //300,200,900
dropCheckStatus:true,
pagetitle:{
level1title:"店铺管理",
level2title:"创建店铺管理",
level3title:"店铺审核列表"
level2title:"店铺信息管理",
level3title:"店铺信息列表"
}
},
src:'/store/index',
... ... @@ -42,12 +42,12 @@ exports.res = [{
view: 'pages/store/index',
noApi:true,
data: {
gridurl:'/supplier/store/checkPage',
gridurl:'/supplier/store/indexPage',
authority:'{"btn":false,"info":true,"operationStatus":0,"checkStatusArr":"200"}',
pagetitle:{
level1title:"店铺管理",
level2title:"创建店铺管理",
level3title:"店铺信息列表"
level2title:"店铺审核管理",
level3title:"店铺审核列表"
}
},
src:'/store/index',
... ...
... ... @@ -6,19 +6,19 @@ exports.uploadFile=function(req,res){
// TODO 代理上传
// 方法1
// if(req.is("multipart/form-data")){
// req.body.file=fs.createReadStream(req.files[req.body.filename].path);
// request.post({url:domain+'/fileupload/upload',formData:req.body},function optionalCallback(err, httpResponse, body){
// res.json(JSON.parse(body));
// });
// }else{
// res.json({code:"500",message:"请求类型错误"});
// }
res.json({
"code":200,
"data" : "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1444256491,538988776&fm=80",
"message":"success"
if(req.is("multipart/form-data")){
req.body.file=fs.createReadStream(req.files[req.body.filename].path);
request.post({url:domain+'/fileupload/upload',formData:req.body},function optionalCallback(err, httpResponse, body){
res.json(JSON.parse(body));
});
}else{
res.json({code:"500",message:"请求类型错误"});
}
// res.json({
// "code":200,
// "data" : "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1444256491,538988776&fm=80",
// "message":"success"
// });
//方法2
// req.pipe(request.post(domain+'/fileupload/upload'))
... ...
... ... @@ -22,12 +22,12 @@
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading noborder">
<h4 class="panel-title">添加品类</h4>
<h4 class="panel-title">{{pagetitle}}</h4>
</div>
<div class="panel-body nopadding">
<form id="new-class-form" class="form-horizontal form-bordered" method="post" action="/product/sort/addProductSort">
<form id="new-class-form" class="form-horizontal form-bordered" method="post" action="{{action}}">
<div class="form-group">
<label class="col-md-1 control-label">
物理类目<span class="red">*</span>
... ... @@ -54,8 +54,7 @@
</label>
<div class="col-md-5">
<select id="firstSortId" class="level-select width300" data-placeholder="">
<option id="parentSortId" value="0">请选择</option>
<select id="firstSortId" class="level-select width300" data-value="{{data.firstSortId}}">
</select>
</div>
</div>
... ... @@ -66,8 +65,7 @@
</label>
<div class="col-md-5">
<select id="secondSortId" class="level-select width300" data-placeholder="">
<option id="childSortId" value="0">请选择</option>
<select id="secondSortId" class="form-control level-select width300" data-value="{{data.secondSortId}}" >
</select>
</div>
</div>
... ... @@ -90,7 +88,7 @@
</label>
<div class="col-md-5">
<input id="orderBy" class="form-control" required value="{{data.orderBy}}" type="text" placeholder="">
<input id="orderBy" class="form-control" required value="{{data.orderBy}}" type="number" placeholder="">
</div>
</div>
... ... @@ -106,29 +104,30 @@
<input id="status" type="hidden" value="{{data.status}}" for="radio">
</div>
</div>
<input id="id" class="form-control" type="hidden" value="{{data.id}}">
<!--隐藏值-->
<div class="form-group hidden">
<label class="col-md-1 control-label">ID</label>
<!-- <div class="form-group hidden"> -->
<!-- <label class="col-md-1 control-label">ID</label>
<div class="col-md-5">
<input id="param" class="form-control" value="{{data.id}}" level="{{data.sortLevel}}" pid="{{data.parentId}}" type="text">
</div>
</div>
</div> -->
<!-- </div> -->
<div class="form-group hidden">
<label class="col-md-1 control-label">parentID</label>
<!-- <div class="form-group hidden"> -->
<!-- <label class="col-md-1 control-label">parentID</label>
<div class="col-md-5">
<input id="parentId" class="form-control" value="{{data.parentId}}" type="text">
</div>
</div>
</div> -->
<!-- </div> -->
</form>
</div>
<div class="panel-footer">
<button type="submit" class="btn btn-info btn-xs new-class-btn" data-id="{{data.id}}">保存</button>
<a href="/erpproduct/sort/index" class="btn btn-default btn-xs">取消</a>
<button type="submit" class="btn btn-success">保存</button>
<a href="/erpproduct/sort/index" class="btn btn-danger">取消</a>
</div>
</div>
</div>
... ...
... ... @@ -40,11 +40,11 @@
</div>
<div class="form-group">
<div class="col-sm-1 control-label">
<label>店铺类型:</label>
<label>店铺类型:<span class="red">*</span></label>
</div>
<div class="col-sm-9">
<select name="shopNature" id="shopNature" value='{{shopNature}}' class="form-control">
<option value="">店铺类型</option>
<select name="shopNature" id="shopNature" value='{{shopNature}}' required class="form-control">
<option value="-1">店铺类型</option>
<option value="1">旗舰店</option>
<option value="2">直营店</option>
</select>
... ... @@ -161,7 +161,7 @@
<script type="text/template" id="template">
<div class="row">
<div class="rows">
<div class="form-group">
<select name="brandname" id="brandname" style="width: 280px" tabindex="-1" class="select2-offscreen">
<option value="-1">选择品牌</option>
... ...
... ... @@ -42,7 +42,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="supplierCode" placeholder="营业执照号" class="form-control" required value="{{supplierCode}}">
<input type="number" id="supplierCode" placeholder="营业执照号" class="form-control" required value="{{supplierCode}}">
</div>
</div>
... ... @@ -90,7 +90,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">注册资本 <span class="red">*</span></label>
<div class="col-sm-8">
<input type="number" id="registeredCapital" placeholder="请填写注册资本" class="form-control" required value="{{registeredCapital}}" pattern="/^\d+$/">
<input type="text" id="registeredCapital" placeholder="请填写注册资本" class="form-control" required value="{{registeredCapital}}">
</div>
</div>
... ...