diff --git a/src/views/EquipmentLedger/index.vue b/src/views/EquipmentLedger/index.vue index 61c8a419..6eff1710 100644 --- a/src/views/EquipmentLedger/index.vue +++ b/src/views/EquipmentLedger/index.vue @@ -1000,6 +1000,7 @@ export default { async getDeptTreeSelect() { const res = await deptTreeSelect() this.propertyUnitList = this.filterTree(res.data) + console.log('🚀 ~ this.propertyUnitList:', this.propertyUnitList) }, filterTree(nodes) { return nodes @@ -1669,14 +1670,14 @@ export default { await this.getDeptTreeSelect().catch(() => {}) const params = this.$route.query this.queryParams.propertyUnitId = params?.deptId || '' - if (params && params.parentId) { - this.queryParams.propertyUnitIds.push(Number(params.parentId)) - if (params.deptId) { - this.queryParams.propertyUnitIds.push(Number(params.deptId)) - } - } else if (params && params.deptId) { - this.queryParams.propertyUnitIds.push(Number(params.deptId)) + const ids = [] + if (params?.parentId) { + ids.push(params.parentId) } + if (params?.deptId) { + ids.push(params.deptId) + } + this.queryParams.propertyUnitIds = [...ids.map(Number)] this.getProvinceList() this.getFirstLevel() this.getManufacturerSelectList()