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.

85 lines
2.6 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
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <div style="margin:2px 2px 2px 2px;">
  4. <el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" />
  5. </div>
  6. <div :style="'overflow: scroll;height:' +(window.pageHeight < 600 ? 430 : window.pageHeight - 170) + 'px;'">
  7. <el-tree :data="patientRegister.customerOrgTreeAll" :props="customerOrg.treeprops"
  8. node-key="id" :filter-node-method="filterNode"
  9. @node-click="treeclick" highlight-current ref="customerOrgTree"/>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. import { mapState } from "vuex";
  15. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  16. import { tcdate } from "../../utlis/proFunc";
  17. export default {
  18. components: {},
  19. data() {
  20. return {
  21. filterText:'',
  22. };
  23. },
  24. //<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
  25. computed: {
  26. ...mapState(["window","dict", "customerOrg", "patientRegister"]),
  27. },
  28. //创建组件后
  29. created() {},
  30. //挂载组件完成
  31. mounted() {
  32. //获取体检单位列表树信息
  33. this.getCustomerOrgTree();
  34. },
  35. methods: {
  36. //获取体检单位列表树信息
  37. getCustomerOrgTree() {
  38. getapi("/api/app/customerorg/getbycodeall").then((res) => {
  39. // console.log("res.data", res.data);
  40. if(res.code != -1) this.patientRegister.customerOrgTreeAll = res.data;
  41. //tcdate(this.patientRegister.customerOrgTreeAll)
  42. });
  43. },
  44. //获取体检单位父级ID api/app/customer-org/parent/[CustomerOrgld
  45. // getCustomerOrgParentId(customerOrgld) {
  46. // if (customerOrgld == this.dict.personOrgId) {
  47. // this.patientRegister.query.CustomerOrgParentId = this.dict.personOrgId;
  48. // return;
  49. // }
  50. // getapi(`/api/app/customer-org/parent/${customerOrgld}`).then((res) => {
  51. // // console.log("res.data", res.data);
  52. // if (res.code == 1) {
  53. // this.patientRegister.query.CustomerOrgParentId = res.data;
  54. // }
  55. // });
  56. // },
  57. //树过滤
  58. filterNode(value, data) {
  59. //console.log(value,data)
  60. if (!value) return true;
  61. return data['displayName'].indexOf(value) !== -1 || data['simpleCode'].indexOf(value.toUpperCase()) !== -1;
  62. },
  63. //点击树节点
  64. treeclick(data) {
  65. this.patientRegister.query.customerOrgId = data.id;
  66. //获取体检单位父级ID
  67. // this.getCustomerOrgParentId(data.id);
  68. // this.patientRegister.query.times++; //用于触发查询条件
  69. },
  70. },
  71. watch: {
  72. "filterText"(newVal,oldVal){
  73. this.$refs['customerOrgTree'].filter(newVal);
  74. }
  75. },
  76. };
  77. </script>
  78. <style></style>