Authored by dongjunjie

tj

... ... @@ -15,18 +15,18 @@
</div>
<div class="panel-body">
<div class="showCategory">
<div v-show="shopId > 0" class="showCategory">
<div class="addCategory">
<a class="btn btn-success addBtn"><i class="fa fa-plus"></i> 新增销售类目</a>
<span class="addTips">
当前店铺共有:<b>{{grid.url}}</b>条销售类目,<em>最多可以添加20条</em>
当前店铺共有:<b>{{categoryNum}}</b>条销售类目,<em>最多可以添加20条</em>
</span>
</div>
<div class="categoryList">
<com-grid :columns="grid.columns" :url="grid.url"></com-grid>
<com-grid :columns="grid.columns" :url="grid.url" :pageAble="false"></com-grid>
</div>
</div>
<h1 class="initCategory">请先选择相关店铺!</h1>
<h1 v-show="shopId < 0" class="initCategory">请先选择相关店铺!</h1>
</div>
</div>
</div>
... ... @@ -48,8 +48,9 @@
shopId: -1,
shopName: '--',
selectUrl: '/ShopsRest/selectCheckPassShopsByName',
categoryNum: 0,
grid: {
url: '2',
url: '/shops/shopsCategoryList',
columns: [
{display: '类目ID', name: 'id'},
{display: '类目名称', name: 'name'},
... ... @@ -75,12 +76,19 @@
ready(){
},
watch: {},
methods: {},
methods: {
getCategoryList(){
this.$broadcast('grid-reload',{shop_id:this.shopId});
}
},
events: {
completeSelect(data){
this.shopId = data.id;
this.shopName = data.text;
this.getCategoryList();
},
completeGrid(data){
this.categoryNum = data.length;
}
}
}
... ... @@ -113,10 +121,6 @@
margin-top: 20px
}
.showCategory {
display1: none
}
.addCategory {
margin-bottom: 20px;
}
... ...
<template>
<com-pageheader :module-name="'店铺管理'" :page-name="'店铺销售类目管理'"></com-pageheader>
<div class="contentpanel">
<div class="panel">
<div class="chooseShop">
<div class="shopSelect">
<com-selection :url="selectUrl" :placeholder="'请选择店铺'"></com-selection>
</div>
<div class="shopInfo">
<span>店铺ID:<b>{{showShopId}}</b></span>
<span>店铺名称:<b>{{showShopName}}</b></span>
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body">
</div>
</div>
</div>
</template>
<script>
import pageheader from '../../../../components/pageheader/index';
import selection from '../../../../components/selection/index';
export default{
}
</script>
... ...
... ... @@ -38,7 +38,7 @@ module.exports = function (app){
});
//店铺列表(公共)
app.post("","");
app.post("/shops/shopsCategoryList","shopCategory_shopsCategoryList");
}
... ...
module.exports={
namespace:"shopCategory",
apis:{
shopsCategoryList:{
title:"店铺销售类目列表",
url:"/shops/shopsCategoryList",
params:[
{name:"shop_id",type:"Number"}
]
}
}
}
... ...
... ... @@ -101,7 +101,7 @@
me.data = res.data.list;
me.rowsTotal = res.data.totalPage;
me.page = res.data.page;
me.$dispatch('complete', res.data);
me.$dispatch('completeGrid', res.data);
},function (response) {
me.rowsTotal=0;
me.page=0;
... ...
... ... @@ -24,7 +24,8 @@
props: {
url: {type: String, default: ""},
options: {type: Array, default: []},
placeholder: {type: String, default: "请选择"}
placeholder: {type: String, default: "请选择"},
disabled:{type: boolean, default: false}
},
data() {
return {
... ...