|
@@ -43,8 +43,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #slot-cp-class="{scope}">
|
|
<template #slot-cp-class="{scope}">
|
|
|
- <el-select size="mini" v-model="getCpClass" placeholder="请选分类" style="width:150px;margin-right:10px;">
|
|
|
|
|
- <el-option v-for="item in cpClassData" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
|
|
|
|
|
+ <el-select size="mini" v-model="currentCpClassId" placeholder="请选分类" style="width:150px;margin-right:10px;" @change="getCpClass">
|
|
|
|
|
+ <el-option v-for="item in cpClassData" :key="item.value" :label="item.name" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -87,7 +87,7 @@ export default {
|
|
|
value: '选项5',
|
|
value: '选项5',
|
|
|
label: '北京烤鸭'
|
|
label: '北京烤鸭'
|
|
|
}],
|
|
}],
|
|
|
- getCpClass: '',
|
|
|
|
|
|
|
+ currentCpClassId:'',
|
|
|
app: null,
|
|
app: null,
|
|
|
sortLink: '',
|
|
sortLink: '',
|
|
|
operateData: {},
|
|
operateData: {},
|
|
@@ -112,9 +112,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getCpClass(e){
|
|
|
|
|
+ this.currentCpClassId = e
|
|
|
|
|
+ this.app.refresh({classStyle:this.classStyle,classId:this.currentCpClassId})
|
|
|
|
|
+ },
|
|
|
changeClassify(e){
|
|
changeClassify(e){
|
|
|
this.classStyle = e
|
|
this.classStyle = e
|
|
|
- this.app.refresh({ classStyle:this.classStyle })
|
|
|
|
|
|
|
+ this.app.refresh({ classStyle:this.classStyle,classId:this.currentCpClassId })
|
|
|
},
|
|
},
|
|
|
cancelDel(id) {
|
|
cancelDel(id) {
|
|
|
this.$refs[`popover-` + id].doClose();
|
|
this.$refs[`popover-` + id].doClose();
|
|
@@ -123,7 +127,7 @@ export default {
|
|
|
this.$service.itemCatRelate.delRelate({ itemId: item.id }).then(res => {
|
|
this.$service.itemCatRelate.delRelate({ itemId: item.id }).then(res => {
|
|
|
this.$message.success('删除成功');
|
|
this.$message.success('删除成功');
|
|
|
this.$refs[`popover-` + item.id].doClose();
|
|
this.$refs[`popover-` + item.id].doClose();
|
|
|
- this.app.refresh({ classStyle:this.classStyle })
|
|
|
|
|
|
|
+ this.app.refresh({ classStyle:this.classStyle,classId:this.currentCpClassId })
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
onLoad({ ctx, app }) {
|
|
onLoad({ ctx, app }) {
|
|
@@ -202,7 +206,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
.set('dict', {
|
|
.set('dict', {
|
|
|
search: {
|
|
search: {
|
|
|
- keyWord: 'name'
|
|
|
|
|
|
|
+ keyWord: 'search'
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.set('search', {
|
|
.set('search', {
|
|
@@ -215,10 +219,12 @@ export default {
|
|
|
['flex1', 'pagination'],
|
|
['flex1', 'pagination'],
|
|
|
])
|
|
])
|
|
|
.done();
|
|
.done();
|
|
|
- app.refresh({ classStyle:this.classStyle })
|
|
|
|
|
- },
|
|
|
|
|
- exeRefresh(params) {
|
|
|
|
|
- this.app.refresh(params);
|
|
|
|
|
|
|
+ app.refresh({ classStyle:this.classStyle,classId:this.currentCpClassId })
|
|
|
|
|
+
|
|
|
|
|
+ this.$service.cpClass.getMenu().then(res=>{
|
|
|
|
|
+ this.cpClassData = res.list ? res.list : []
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
showSort(e) {
|
|
showSort(e) {
|
|
|
this.sort.status = true;
|
|
this.sort.status = true;
|
|
@@ -231,7 +237,7 @@ export default {
|
|
|
this.$service.goods .sort({ inTurn: d.inTurn, id: d.id, })
|
|
this.$service.goods .sort({ inTurn: d.inTurn, id: d.id, })
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
this.$message.success('修改成功')
|
|
this.$message.success('修改成功')
|
|
|
- this.exeRefresh({classStyle:this.classStyle})
|
|
|
|
|
|
|
+ this.app.refresh({classStyle:this.classStyle,classId:this.currentCpClassId})
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
this.$message.error(err)
|
|
this.$message.error(err)
|