|
|
|
@ -4,8 +4,9 @@ |
|
|
|
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" /> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<el-tree :style="'overflow: scroll;height:' + (window.pageHeight < 600 ? 465 : window.pageHeight - 135) + 'px;width:200px;'" |
|
|
|
:data="patientRegister.customerOrgTreeAll" :props="treeprops" node-key="id" |
|
|
|
<el-tree |
|
|
|
:style="'overflow: scroll;height:' + (window.pageHeight < 600 ? 465 : window.pageHeight - 135) + 'px;width:200px;'" |
|
|
|
:data="patientRegister.customerOrgTreeAll" :props="treeprops" node-key="id" @node-contextmenu="nodeContextmenu" |
|
|
|
:filter-node-method="filterNode" @node-click="treeclick" highlight-current ref="customerOrgTree"> |
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
<div> |
|
|
|
@ -28,7 +29,7 @@ |
|
|
|
<script> |
|
|
|
import { mapState } from "vuex"; |
|
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
import { tcdate,deepCopy,reMadeOrgTree } from "../../utlis/proFunc"; |
|
|
|
import { tcdate, deepCopy, reMadeOrgTree } from "../../utlis/proFunc"; |
|
|
|
export default { |
|
|
|
components: {}, |
|
|
|
data() { |
|
|
|
@ -42,14 +43,14 @@ export default { |
|
|
|
}, //树形组件的数据结构 |
|
|
|
LocalConfig: { |
|
|
|
patientRegister: { |
|
|
|
dispCustomerOrgCode:'N', // 人员登记列表--单位树是否显示 customerOrgCode |
|
|
|
dispCustomerOrgCode: 'N', // 人员登记列表--单位树是否显示 customerOrgCode |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
//<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree> |
|
|
|
computed: { |
|
|
|
...mapState(["window", "dict","dataTransOpts","customerOrg", "patientRegister"]), |
|
|
|
...mapState(["window", "dict", "dataTransOpts", "customerOrg", "patientRegister"]), |
|
|
|
}, |
|
|
|
//创建组件后 |
|
|
|
created() { |
|
|
|
@ -74,8 +75,8 @@ export default { |
|
|
|
getCustomerOrgTree() { |
|
|
|
getapi("/api/app/customerorg/getbycodeall").then((res) => { |
|
|
|
// console.log("res.data", res.data); |
|
|
|
if (res.code > -1){ |
|
|
|
this.patientRegister.customerOrgTreeAll = reMadeOrgTree(deepCopy(res.data),this.LocalConfig.patientRegister.dispCustomerOrgCode); |
|
|
|
if (res.code > -1) { |
|
|
|
this.patientRegister.customerOrgTreeAll = reMadeOrgTree(deepCopy(res.data), this.LocalConfig.patientRegister.dispCustomerOrgCode); |
|
|
|
// tcdate(this.patientRegister.customerOrgTreeAll) |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -95,13 +96,59 @@ export default { |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
|
|
|
|
// 节点右击事件 |
|
|
|
nodeContextmenu(event, data, node, ids) { |
|
|
|
// console.log('event,data,node,ids', event, data, node, ids) |
|
|
|
if (data.id == this.dict.personOrgId) return |
|
|
|
|
|
|
|
let items = [ |
|
|
|
{ |
|
|
|
label: "置顶", |
|
|
|
onClick: () => { |
|
|
|
this.treeSort(data, 1); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "置底", |
|
|
|
onClick: () => { |
|
|
|
this.treeSort(data, 2); |
|
|
|
}, |
|
|
|
} |
|
|
|
] //菜单项 |
|
|
|
this.$contextmenu({ |
|
|
|
items, |
|
|
|
event, |
|
|
|
//x: event.clientX, |
|
|
|
//y: event.clientY, |
|
|
|
customClass: "custom-class", |
|
|
|
zIndex: 3, |
|
|
|
minWidth: 80, |
|
|
|
}); |
|
|
|
return false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 树节点排序 |
|
|
|
treeSort(data, sortType) { |
|
|
|
// if (data.parentId) { |
|
|
|
// this.$message.warning({ showClose: true, message: "请选择一级单位" }) |
|
|
|
// return |
|
|
|
// } |
|
|
|
// console.log('data,sortType',data,sortType) |
|
|
|
putapi(`/api/app/customerorg/updatemanysort?id=${data.id}&SortType=${sortType}`).then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.getCustomerOrgTree() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//树过滤 |
|
|
|
filterNode(value, data) { |
|
|
|
//console.log(value,data) |
|
|
|
if (!value) return true; |
|
|
|
return data['displayName'].indexOf(value) > -1 || data['simpleCode'].indexOf(value.toUpperCase()) > -1 |
|
|
|
|| data['shortName'].indexOf(value.toUpperCase()) > -1 || data['customerOrgCode'].indexOf(value.toUpperCase()) > -1 |
|
|
|
; |
|
|
|
|| data['shortName'].indexOf(value.toUpperCase()) > -1 || data['customerOrgCode'].indexOf(value.toUpperCase()) > -1 |
|
|
|
; |
|
|
|
}, |
|
|
|
|
|
|
|
//点击树节点 |
|
|
|
@ -130,7 +177,8 @@ export default { |
|
|
|
font-size: 20px; |
|
|
|
margin-right: 5px; |
|
|
|
} |
|
|
|
:deep .el-tree-node>.el-tree-node__children{ |
|
|
|
|
|
|
|
:deep .el-tree-node>.el-tree-node__children { |
|
|
|
overflow: visible; |
|
|
|
} |
|
|
|
</style> |