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.

114 lines
3.5 KiB

2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <el-tree
  3. :data="customerOrg.customerOrgTree"
  4. :props="customerOrg.treeprops"
  5. @node-click="treeclick"
  6. />
  7. </template>
  8. <script>
  9. import { mapState, mapMutations } 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(["customerOrg", "window"]),
  20. },
  21. //创建组件后
  22. created() {},
  23. //挂载组件完成
  24. mounted() {
  25. //获取体检单位列表树信息
  26. this.getCustomerOrgTree();
  27. },
  28. methods: {
  29. ...mapMutations(["setData"]),
  30. //获取体检单位列表树信息
  31. getCustomerOrgTree() {
  32. //let customerOrgTree = []
  33. // [
  34. // {
  35. // displayName: "个人体检", //
  36. // id: "00000000-0000-0000-0000-000000000000", //
  37. // //treeChildren: [],
  38. // },
  39. // {
  40. // displayName: "组件式", //
  41. // id: "10000000-0000-0000-0000-000000000000", //
  42. // //treeChildren: [],
  43. // },
  44. // ];
  45. //console.log('getCustomerOrgTree start')
  46. // api/app/organization-units/organization-unit-by-is-peis // api/app/customer-org/by-code-all
  47. getapi("/api/app/customer-org/by-code-all").then((res) => {
  48. //customerOrgTree = res.data;
  49. console.log("res.data", res.data);
  50. this.setData({ key: "customerOrg.customerOrgTree", value: res.data });
  51. tcdate(this.customerOrg.customerOrgTree);
  52. });
  53. },
  54. //获取单位基本信息
  55. getCustomerOrgRd(id) {
  56. getapi(`/api/app/customer-org/${id}`).then((res) => {
  57. //console.log("res.data", res.data);
  58. this.customerOrg.customerOrgRd = res.data;
  59. });
  60. },
  61. //获取体检次数列表
  62. getCustomerOrgRegisterList(customerOrgId) {
  63. getapi(
  64. `/api/app/customer-org-register/in-customer-org-id/${customerOrgId}`
  65. ).then((res) => {
  66. //console.log('res.data',res.data)
  67. this.customerOrg.customerOrgRegisterList = res.data;
  68. });
  69. },
  70. //获取联系人列表
  71. getContactPersonList(customerOrgId) {
  72. getapi(
  73. `/api/app/contact-person/in-customer-org-id/${customerOrgId}`
  74. ).then((res) => {
  75. //console.log('res.data',res.data)
  76. this.customerOrg.contactPersonList = res.data;
  77. if (res.data.length > 0) {
  78. this.getContactMethodList(res.data[0].id);
  79. } else {
  80. this.customerOrg.contactMethodList = [];
  81. }
  82. });
  83. },
  84. //获取联系方式列表
  85. //api/app/contact-method/in-contact-person-id?ContactPersonId=3a0c08ad-4304-138b-d9e6-a7338739dfc4' \
  86. getContactMethodList(ContactPersonId) {
  87. getapi("/api/app/contact-method/in-contact-person-id", {
  88. ContactPersonId,
  89. }).then((res) => {
  90. //console.log('res.data',res.data)
  91. this.customerOrg.contactMethodList = res.data;
  92. });
  93. },
  94. //点击树节点
  95. treeclick(data) {
  96. //this.$message.success(data.id + " 查询单位详情、体检次数、联系人等信息 " + data.displayName);// api/app/customer-org/3a0c0439-a5ca-8a63-b2b9-e0eb24cb58b1
  97. this.customerOrg.customerOrgId = data.id;
  98. this.getCustomerOrgRd(data.id);
  99. this.getCustomerOrgRegisterList(data.id);
  100. this.getContactPersonList(data.id);
  101. },
  102. },
  103. };
  104. </script>
  105. <style scoped>
  106. </style>