|
|
|
@ -1,12 +1,15 @@ |
|
|
|
<template> |
|
|
|
<div style="display: flex;"> |
|
|
|
<div v-if="useCusOrg" style="width: 258px;height:520px;border: 1px solid #EEE;"> |
|
|
|
<div style="margin:2px 2px 2px 2px;"> |
|
|
|
<div style="margin:2px 2px 2px 2px;display: flex;"> |
|
|
|
<el-checkbox style="margin-top: 6px;" v-model="isOnlyCus" true-label="Y" false-label="N" size="small"> |
|
|
|
仅单位 |
|
|
|
</el-checkbox> |
|
|
|
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" /> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<el-tree style="overflow: scroll;width: 200px;height:480px;" :data="patientRegister.customerOrgTreeAll" |
|
|
|
:props="treeprops" @node-click="handleNode" :filter-node-method="filterNode" |
|
|
|
:props="treeprops" node-key="id" @node-click="handleNode" :filter-node-method="filterNode" |
|
|
|
ref="customerOrgTree"> |
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
<div> |
|
|
|
@ -114,6 +117,7 @@ export default { |
|
|
|
props: ["useCustomerOrg", "initDateType", "isUnit"], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
isOnlyCus: 'Y', |
|
|
|
filterText: '', |
|
|
|
preNodeId: '', //上一次点击树节点 |
|
|
|
curNodeId: '', //本次点击树节点 |
|
|
|
@ -169,17 +173,28 @@ export default { |
|
|
|
methods: { |
|
|
|
|
|
|
|
//树过滤 |
|
|
|
filterNode(value, data) { |
|
|
|
//console.log(value,data) |
|
|
|
filterNode(value, data,node) { |
|
|
|
if (!value) return true; |
|
|
|
return data['displayName'].indexOf(value) !== -1 || data['simpleCode'].indexOf(value.toUpperCase()) !== -1; |
|
|
|
}, |
|
|
|
//树过滤 |
|
|
|
filterParentNode(value) { |
|
|
|
// console.log(value, data) |
|
|
|
// if (!value) return true; |
|
|
|
// return data['displayName'].indexOf(value) > -1 || data['simpleCode'].indexOf(value.toUpperCase()) > -1 || data['shortName'].indexOf(value) > -1 || data['customerOrgCode'].indexOf(value) > -1; |
|
|
|
console.log(this.patientRegister.customerOrgs) |
|
|
|
this.patientRegister.customerOrgTreeAll = this.patientRegister.customerOrgs.filter(e => { |
|
|
|
console.log(e) |
|
|
|
return e.label.indexOf(value) > -1 || e.simpleCode.indexOf(value.toUpperCase()) > -1 || e.shortName.indexOf(value) > -1 |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
//获取体检单位列表树信息 |
|
|
|
getCustomerOrgTree() { |
|
|
|
getapi("/api/app/customerorg/getbycodeall").then((res) => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.patientRegister.customerOrgTreeAll = reMadeOrgTree(deepCopy(res.data)); |
|
|
|
this.patientRegister.customerOrgs = deepCopy(this.patientRegister.customerOrgTreeAll) |
|
|
|
//tcdate(this.patientRegister.customerOrgTreeAll) |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -447,8 +462,21 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
"filterText"(newVal, oldVal) { |
|
|
|
this.$refs['customerOrgTree'].filter(newVal); |
|
|
|
"filterText"(newVal, oldVal) { |
|
|
|
if (newVal != oldVal) { |
|
|
|
if (this.isOnlyCus == 'N') { |
|
|
|
this.$refs['customerOrgTree'].filter(newVal); |
|
|
|
} else { |
|
|
|
this.filterParentNode(newVal) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
"isOnlyCus"(newVal, oldVal) { |
|
|
|
if (newVal == 'N') { |
|
|
|
this.$refs['customerOrgTree'].filter(this.filterText); |
|
|
|
} else { |
|
|
|
this.filterParentNode(this.filterText) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
|