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.

64 lines
1.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <el-tree
  3. :data="patientRegister.customerOrgTreeAll"
  4. :props="customerOrg.treeprops"
  5. @node-click="treeclick"
  6. ></el-tree>
  7. </template>
  8. <script>
  9. import { mapState } from "vuex";
  10. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  11. import { tcdate } from "../../utlis/proFunc";
  12. export default {
  13. components: {},
  14. data() {
  15. return {};
  16. },
  17. //<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
  18. computed: {
  19. ...mapState(["dict", "customerOrg", "patientRegister"]),
  20. },
  21. //创建组件后
  22. created() {},
  23. //挂载组件完成
  24. mounted() {
  25. //获取体检单位列表树信息
  26. this.getCustomerOrgTree();
  27. },
  28. methods: {
  29. //获取体检单位列表树信息
  30. getCustomerOrgTree() {
  31. getapi("/api/app/customer-org/by-code-all").then((res) => {
  32. //customerOrgTree = res.data;
  33. console.log("res.data", res.data);
  34. this.patientRegister.customerOrgTreeAll = res.data;
  35. //tcdate(this.patientRegister.customerOrgTreeAll)
  36. });
  37. },
  38. //获取体检单位父级ID api/app/customer-org/parent/[CustomerOrgld
  39. getCustomerOrgParentId(customerOrgld) {
  40. if (customerOrgld == this.dict.personOrgId) {
  41. this.patientRegister.query.CustomerOrgParentId = this.dict.personOrgId;
  42. return;
  43. }
  44. getapi(`/api/app/customer-org/parent/${customerOrgld}`).then((res) => {
  45. console.log("res.data", res.data);
  46. if (res.code == 1) {
  47. this.patientRegister.query.CustomerOrgParentId = res.data;
  48. }
  49. });
  50. },
  51. //点击树节点
  52. treeclick(data) {
  53. this.patientRegister.query.customerOrgId = data.id;
  54. this.getCustomerOrgParentId(data.id);
  55. this.patientRegister.query.times++; //用于触发查询条件
  56. },
  57. },
  58. };
  59. </script>
  60. <style></style>