|
|
|
@ -20,7 +20,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { xzTree } from "@/api/yingji/keyEnterprise.js";
|
|
|
|
|
import { mapState } from "vuex";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
@ -38,7 +37,7 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.xzList();
|
|
|
|
|
this.treeList();
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapState({
|
|
|
|
@ -53,28 +52,27 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
xzList() {
|
|
|
|
|
// xzTree().then((res) => {
|
|
|
|
|
if (this.dept.parentId == 0 || this.dept.leader == "admin") {
|
|
|
|
|
let treeData = JSON.parse(localStorage.getItem("TREE_DATA"))
|
|
|
|
|
treeList() {
|
|
|
|
|
if (this.dept.parentId == 0 || this.dept.leader == "admin") {
|
|
|
|
|
let treeData = JSON.parse(localStorage.getItem("TREE_DATA"));
|
|
|
|
|
// console.log(treeData);
|
|
|
|
|
treeData.forEach((value, index) => {
|
|
|
|
|
this.compartment.push({
|
|
|
|
|
value: value.subdistrict,
|
|
|
|
|
label: value.institutionName,
|
|
|
|
|
children: [],
|
|
|
|
|
});
|
|
|
|
|
if (value.children.length > 0) {
|
|
|
|
|
value.children.forEach((value1, index1) => {
|
|
|
|
|
this.compartment[index].children.push({
|
|
|
|
|
value: value1.subdistrict,
|
|
|
|
|
label: value1.institutionName,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.compartment.push({
|
|
|
|
|
value: value.districtCode,
|
|
|
|
|
label: value.district,
|
|
|
|
|
children: [],
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.$emit("quhuadizhi", this.compartment);
|
|
|
|
|
// });
|
|
|
|
|
if (value.children.length > 0) {
|
|
|
|
|
value.children.forEach((value1, index1) => {
|
|
|
|
|
this.compartment[index].children.push({
|
|
|
|
|
value: value1.countyCode,
|
|
|
|
|
label: value1.county,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.$emit("quhuadizhi", this.compartment);
|
|
|
|
|
},
|
|
|
|
|
getData(e) {
|
|
|
|
|
if (!this.none) {
|
|
|
|
|