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.

89 lines
2.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <el-tree :data="customerOrg.customerOrgTree" :props="customerOrg.treeprops" @node-click="treeclick"></el-tree>
  3. </template>
  4. <script>
  5. import { mapState } from 'vuex'
  6. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  7. import { tcdate } from '../../utlis/proFunc'
  8. export default {
  9. components: {},
  10. data() {
  11. return {};
  12. },
  13. //<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
  14. computed:{
  15. ...mapState(['patientRegister']),
  16. },
  17. //创建组件后
  18. created() {},
  19. //挂载组件完成
  20. mounted() {
  21. //获取体检单位列表树信息
  22. this.getCustomerOrgTree();
  23. },
  24. methods: {
  25. //获取体检单位列表树信息
  26. getCustomerOrgTree(){
  27. //let customerOrgTree = []
  28. // [
  29. // {
  30. // displayName: "个人体检", //
  31. // id: "00000000-0000-0000-0000-000000000000", //
  32. // //treeChildren: [],
  33. // },
  34. // {
  35. // displayName: "组件式", //
  36. // id: "10000000-0000-0000-0000-000000000000", //
  37. // //treeChildren: [],
  38. // },
  39. // ];
  40. //console.log('getCustomerOrgTree start')
  41. // api/app/organization-units/organization-unit-by-is-peis // api/app/customer-org/by-code-all
  42. getapi("/api/app/customer-org/by-code-all").then(
  43. (res) => {
  44. //customerOrgTree = res.data;
  45. console.log('res.data',res.data)
  46. this.patientRegister.customerOrgTree =[{displayName: "个人体检", id: "00000000-0000-0000-0000-000000000000"},...res.data]
  47. tcdate(this.customerOrg.customerOrgTree)
  48. }
  49. );
  50. },
  51. //获取体检次数列表
  52. getCustomerOrgRegisterList(){
  53. getapi("/api/app/customer-org-register/in_filter").then(
  54. (res) => {
  55. //console.log('res.data',res.data)
  56. this.setData({ key: 'customerOrg.customerOrgRegisterList', value: res.data})
  57. }
  58. );
  59. },
  60. //获取体检次数列表
  61. getCustomerOrgRegisterList(){
  62. getapi("/api/app/customer-org-register/in_filter").then(
  63. (res) => {
  64. //console.log('res.data',res.data)
  65. this.setData({ key: 'customerOrg.customerOrgRegisterList', value: res.data})
  66. }
  67. );
  68. },
  69. //点击树节点
  70. treeclick(data) {
  71. //this.$message.success(data.id + " 查询单位详情、体检次数、联系人等信息 " + data.displayName);// api/app/customer-org/3a0c0439-a5ca-8a63-b2b9-e0eb24cb58b1
  72. //getapi(`/api/app/customer-org/3a0c0439-a5ca-8a63-b2b9-e0eb24cb58b1`).then((res) => {
  73. getapi(`/api/app/customer-org/${data.id}`).then((res) => {
  74. //console.log("res.data", res.data);
  75. this.setData({ key: 'customerOrg.customerOrgRd', value: res.data})
  76. });
  77. },
  78. },
  79. };
  80. </script>
  81. <style>
  82. </style>