You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<template> <el-tree :data="patientRegister.customerOrgTreeAll" :props="customerOrg.treeprops" @node-click="treeclick" ></el-tree></template><script>import { mapState } from "vuex";import { getapi, postapi, putapi, deletapi } from "@/api/api";import { tcdate } from "../../utlis/proFunc";export default { components: {}, data() { return {}; }, //<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
computed: { ...mapState(["dict", "customerOrg", "patientRegister"]), }, //创建组件后
created() {},
//挂载组件完成
mounted() { //获取体检单位列表树信息
this.getCustomerOrgTree(); },
methods: { //获取体检单位列表树信息
getCustomerOrgTree() { getapi("/api/app/customer-org/by-code-all").then((res) => { //customerOrgTree = res.data;
console.log("res.data", res.data); this.patientRegister.customerOrgTreeAll = res.data; //tcdate(this.patientRegister.customerOrgTreeAll)
}); },
//获取体检单位父级ID api/app/customer-org/parent/[CustomerOrgld
getCustomerOrgParentId(customerOrgld) { if (customerOrgld == this.dict.personOrgId) { this.patientRegister.query.CustomerOrgParentId = this.dict.personOrgId; return; } getapi(`/api/app/customer-org/parent/${customerOrgld}`).then((res) => { console.log("res.data", res.data); if (res.code == 1) { this.patientRegister.query.CustomerOrgParentId = res.data; } }); },
//点击树节点
treeclick(data) { this.patientRegister.query.customerOrgId = data.id; this.getCustomerOrgParentId(data.id); this.patientRegister.query.times++; //用于触发查询条件
}, },};</script><style></style>
|