|
|
@@ -2,7 +2,8 @@
|
|
|
<el-dialog :title="title" :visible.sync="visible" v-if="visible" :before-close="handleClose"
|
|
|
:close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="75%">
|
|
|
<el-card shadow="never">
|
|
|
- <ProductSearch @search="reload" />
|
|
|
+ <ProductSearch @search="reload" ref="searchRef" />
|
|
|
+
|
|
|
<ele-split-layout width="244px" allow-collapse :right-style="{ overflow: 'hidden' }">
|
|
|
<div class="ele-border-lighter split-layout-right-content">
|
|
|
<AssetTree ref="assetTreeRef" :id="categoryLevelId" @handleNodeClick="handleNodeClick" />
|
|
|
@@ -123,7 +124,9 @@ export default {
|
|
|
title: null,
|
|
|
categoryLevelId: null,
|
|
|
radio: null,
|
|
|
- idx: null
|
|
|
+ idx: null,
|
|
|
+
|
|
|
+ isCategory: true
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -137,17 +140,21 @@ export default {
|
|
|
...where,
|
|
|
pageNum: page,
|
|
|
size: limit,
|
|
|
- categoryLevelId: this.categoryLevelId,
|
|
|
+ categoryLevelId: this.isCategory ? this.categoryLevelId : null,
|
|
|
|
|
|
});
|
|
|
},
|
|
|
handleNodeClick(data) {
|
|
|
+ this.isCategory = true
|
|
|
this.categoryLevelId = data.id;
|
|
|
- this.reload();
|
|
|
+ this.$refs.table.reload({ pageNum: 1, where: {} });
|
|
|
+ this.$refs.searchRef.reset2()
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
/* 刷新表格 */
|
|
|
reload(where) {
|
|
|
- this.categoryLevelId = null
|
|
|
+ this.isCategory = false
|
|
|
this.$refs.table.reload({ pageNum: 1, where: where });
|
|
|
},
|
|
|
open(item, title, categoryLevelId, idx) {
|
|
|
@@ -155,13 +162,13 @@ export default {
|
|
|
this.title = title
|
|
|
this.categoryLevelId = categoryLevelId
|
|
|
this.idx = idx
|
|
|
-
|
|
|
+
|
|
|
this.current = {
|
|
|
- id: item.categoryId,
|
|
|
- name: item.categoryName,
|
|
|
- code: item.categoryCode
|
|
|
- }
|
|
|
- this.radio = item.categoryId
|
|
|
+ id: item.categoryId,
|
|
|
+ name: item.categoryName,
|
|
|
+ code: item.categoryCode
|
|
|
+ }
|
|
|
+ this.radio = item.categoryId
|
|
|
|
|
|
}
|
|
|
this.visible = true
|