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

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