调整结算模块
This commit is contained in:
+25
-26
@@ -42,13 +42,6 @@
|
||||
</section-card>
|
||||
|
||||
<el-button-group>
|
||||
<el-button
|
||||
v-if="permission.region_add"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="addCountry"
|
||||
>新增国家
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permission.region_add"
|
||||
type="primary"
|
||||
@@ -181,19 +174,17 @@ export default {
|
||||
treeLoad: (node, resolve) => {
|
||||
const parentCode = node.level === 0 ? ROOT_PARENT_CODE : node.data.id;
|
||||
getLazyTree(parentCode, this.searchForm).then(res => {
|
||||
resolve(
|
||||
res.data.data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
leaf: !item.hasChildren,
|
||||
};
|
||||
})
|
||||
);
|
||||
const treeData = this.normalizeTreeData(res.data.data);
|
||||
if (node.level === 0) {
|
||||
this.setDefaultExpandedKeys(treeData);
|
||||
}
|
||||
resolve(treeData);
|
||||
});
|
||||
},
|
||||
addBtn: false,
|
||||
menu: false,
|
||||
defaultExpandAll: false,
|
||||
defaultExpandedKeys: [],
|
||||
size: 'default',
|
||||
props: {
|
||||
labelText: '标题',
|
||||
@@ -260,6 +251,7 @@ export default {
|
||||
prop: 'regionLevel',
|
||||
type: 'radio',
|
||||
dicUrl: '/blade-system/dict/dictionary?code=region',
|
||||
dicFormatter: list => list.filter(item => Number(item.dictKey) !== 0),
|
||||
props: {
|
||||
label: 'dictValue',
|
||||
value: 'dictKey',
|
||||
@@ -436,24 +428,31 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
normalizeTreeData(data) {
|
||||
return data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
leaf: !item.hasChildren,
|
||||
};
|
||||
});
|
||||
},
|
||||
setDefaultExpandedKeys(treeData) {
|
||||
const valueKey = this.treeOption.props.value;
|
||||
this.treeOption.defaultExpandedKeys = treeData
|
||||
.filter(item => item.hasChildren)
|
||||
.map(item => item[valueKey]);
|
||||
},
|
||||
initTree() {
|
||||
this.treeData = [];
|
||||
getLazyTree(this.topCode, this.searchForm).then(res => {
|
||||
this.treeData = res.data.data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
leaf: !item.hasChildren,
|
||||
};
|
||||
const treeData = this.normalizeTreeData(res.data.data);
|
||||
this.treeData = treeData;
|
||||
this.$nextTick(() => {
|
||||
this.setDefaultExpandedKeys(treeData);
|
||||
});
|
||||
});
|
||||
},
|
||||
hasSearchCriteria() {
|
||||
return Object.values(this.searchForm).some(
|
||||
value => value !== '' && value !== undefined && value !== null
|
||||
);
|
||||
},
|
||||
handleSearch() {
|
||||
this.treeOption.defaultExpandAll = this.hasSearchCriteria();
|
||||
this.initTree();
|
||||
this.regionForm = {};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user