|
@@ -32,23 +32,23 @@
|
|
|
>新增</el-button>
|
|
>新增</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
- <el-table :data="dataList" border row-key="categoryId" style="width: 100%;">
|
|
|
|
|
|
|
+ <el-table :data="dataList" border row-key="categoryID" style="width: 100%;" @row-click="handleRelated">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="shopName"
|
|
prop="shopName"
|
|
|
header-align="center"
|
|
header-align="center"
|
|
|
- treeKey="categoryId"
|
|
|
|
|
|
|
+ treeKey="categoryID"
|
|
|
label="店铺名称"
|
|
label="店铺名称"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="categoryName"
|
|
prop="categoryName"
|
|
|
header-align="center"
|
|
header-align="center"
|
|
|
- treeKey="categoryId"
|
|
|
|
|
|
|
+ treeKey="categoryID"
|
|
|
width="150"
|
|
width="150"
|
|
|
label="分类名称"
|
|
label="分类名称"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
- <el-table-column prop="pic" header-align="center" align="center" label="图片">
|
|
|
|
|
|
|
+ <el-table-column prop="icon" header-align="center" align="center" label="图片">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <img :src="resourcesUrl + scope.row.pic " />
|
|
|
|
|
|
|
+ <img :src="resourcesUrl + scope.row.icon " />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="status" header-align="center" align="center" label="状态">
|
|
<el-table-column prop="status" header-align="center" align="center" label="状态">
|
|
@@ -58,22 +58,22 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="seq" header-align="center" align="center" label="排序号"></el-table-column>
|
|
<el-table-column prop="seq" header-align="center" align="center" label="排序号"></el-table-column>
|
|
|
- <el-table-column fixed="right" header-align="center" align="center" label="操作">
|
|
|
|
|
|
|
+ <!-- <el-table-column fixed="right" header-align="center" align="center" label="操作">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="isAuth('prod:category:update')"
|
|
v-if="isAuth('prod:category:update')"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
size="small"
|
|
size="small"
|
|
|
- @click="addOrUpdateHandle(scope.row.categoryId)"
|
|
|
|
|
|
|
+ @click="addOrUpdateHandle(scope.row.categoryID)"
|
|
|
>修改</el-button>
|
|
>修改</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="isAuth('prod:category:delete')"
|
|
v-if="isAuth('prod:category:delete')"
|
|
|
type="danger"
|
|
type="danger"
|
|
|
size="small"
|
|
size="small"
|
|
|
- @click="deleteHandle(scope.row.categoryId)"
|
|
|
|
|
|
|
+ @click="deleteHandle(scope.row.categoryID)"
|
|
|
>删除</el-button>
|
|
>删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
|
|
|
|
+ </el-table-column> -->
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<el-pagination
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
@@ -87,16 +87,21 @@
|
|
|
|
|
|
|
|
<!-- 弹窗, 新增 / 修改 -->
|
|
<!-- 弹窗, 新增 / 修改 -->
|
|
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 关联商品 -->
|
|
|
|
|
+ <relate-goods v-if="relatedVisible" ref="related" @close="relatedVisible = false"></relate-goods>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import AddOrUpdate from './category-add-or-update'
|
|
import AddOrUpdate from './category-add-or-update'
|
|
|
import { treeDataTranslate } from '@/utils'
|
|
import { treeDataTranslate } from '@/utils'
|
|
|
|
|
+import relateGoods from './relateGoods';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ relatedVisible:true,
|
|
|
options: [],
|
|
options: [],
|
|
|
total:0,
|
|
total:0,
|
|
|
searchForm:{shopId:undefined,current:1,size:10},
|
|
searchForm:{shopId:undefined,current:1,size:10},
|
|
@@ -108,13 +113,19 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
|
- AddOrUpdate
|
|
|
|
|
|
|
+ AddOrUpdate,
|
|
|
|
|
+ relateGoods
|
|
|
},
|
|
},
|
|
|
created () {
|
|
created () {
|
|
|
|
|
+
|
|
|
this.getDataList()
|
|
this.getDataList()
|
|
|
this.getShopByName()
|
|
this.getShopByName()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleRelated(row){
|
|
|
|
|
+ this.relatedVisible = true;
|
|
|
|
|
+ this.$refs.related.open(row.categoryID)
|
|
|
|
|
+ },
|
|
|
handleSearch(){
|
|
handleSearch(){
|
|
|
this.searchForm.current = 1;
|
|
this.searchForm.current = 1;
|
|
|
this.getDataList();
|
|
this.getDataList();
|
|
@@ -148,14 +159,18 @@ export default {
|
|
|
this.dataListLoading = true
|
|
this.dataListLoading = true
|
|
|
this.searchForm.shopId = this.searchForm.shopId || undefined;
|
|
this.searchForm.shopId = this.searchForm.shopId || undefined;
|
|
|
this.$http({
|
|
this.$http({
|
|
|
- url: this.$http.adornUrl('/prod/category/listCategory'),
|
|
|
|
|
- method: 'get',
|
|
|
|
|
- params: this.$http.adornParams({
|
|
|
|
|
- maxGrade: 2,
|
|
|
|
|
- ...this.searchForm
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // url: this.$http.adornUrl('/prod/category/listCategory'),
|
|
|
|
|
+ url: this.$http.adornUrl('/prod/category/listCategoryNew'),
|
|
|
|
|
+ method: 'post',
|
|
|
|
|
+ // params: this.$http.adornParams({
|
|
|
|
|
+ // maxGrade: 2,
|
|
|
|
|
+ // ...this.searchForm
|
|
|
|
|
+ // })
|
|
|
|
|
+ data: this.$http.adornData(
|
|
|
|
|
+ this.searchForm
|
|
|
|
|
+ )
|
|
|
}).then(({ data }) => {
|
|
}).then(({ data }) => {
|
|
|
- // this.dataList = treeDataTranslate(data, 'categoryId', 'parentId')
|
|
|
|
|
|
|
+ // this.dataList = treeDataTranslate(data, 'categoryID', 'parentId')
|
|
|
this.dataList = data.records
|
|
this.dataList = data.records
|
|
|
this.total = data.total;
|
|
this.total = data.total;
|
|
|
this.dataListLoading = false
|
|
this.dataListLoading = false
|