|
|
|
@ -2,15 +2,16 @@ |
|
|
|
<div style="display: flex;"> |
|
|
|
<div v-if="useCusOrg" style="width: 258px;height:520px;border: 1px solid #EEE;"> |
|
|
|
<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-key="id" @node-click="handleNode" :filter-node-method="filterNode" |
|
|
|
ref="customerOrgTree"> |
|
|
|
<el-tree style="overflow: scroll;width: 200px;height:480px;" :data="customerOrgTreeSeo" :props="treeprops" |
|
|
|
node-key="id" @node-click="handleNode" ref="customerOrgTree"> |
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
<div> |
|
|
|
<span class="treeicons"> |
|
|
|
@ -92,8 +93,8 @@ |
|
|
|
<el-radio label="creationTime">登记</el-radio> |
|
|
|
<el-radio label="medicalStartDate">体检</el-radio> |
|
|
|
<el-radio label="checkDate">检查</el-radio> |
|
|
|
<el-radio label="summaryDate">{{summary_check_doctor_alias[0]||'总检'}}</el-radio> |
|
|
|
<el-radio label="sumCheckDate">{{summary_check_doctor_alias[1]||'审核'}}</el-radio> |
|
|
|
<el-radio label="summaryDate">{{ summary_check_doctor_alias[0] || '总检' }}</el-radio> |
|
|
|
<el-radio label="sumCheckDate">{{ summary_check_doctor_alias[1] || '审核' }}</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 5px;"> |
|
|
|
@ -114,6 +115,8 @@ import { mapState } from "vuex"; |
|
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
import { arrayExistObj, deepCopy, reMadeOrgTree } from "../../utlis/proFunc"; |
|
|
|
import { getTreePids, getTreeAllChildIdsById } from "../../utlis/tree"; |
|
|
|
import { setDBCom, getDBCom } from "../../utlis/indexedDB"; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: {}, |
|
|
|
props: ["useCustomerOrg", "initDateType", "isUnit"], |
|
|
|
@ -147,6 +150,9 @@ export default { |
|
|
|
}, //树形组件的数据结构 |
|
|
|
|
|
|
|
summary_check_doctor_alias: ["总检", "审核"], |
|
|
|
customerOrgTreeSeo: [], //所有 |
|
|
|
customerOrgTreeAll: [], //有处理 |
|
|
|
orgDatasQuery: [], //未处理 |
|
|
|
}; |
|
|
|
}, |
|
|
|
//<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree> |
|
|
|
@ -185,31 +191,54 @@ export default { |
|
|
|
methods: { |
|
|
|
|
|
|
|
//树过滤 |
|
|
|
filterNode(value, data,node) { |
|
|
|
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 |
|
|
|
}) |
|
|
|
|
|
|
|
//console.log(this.patientRegister.customerOrgs) |
|
|
|
if(value){ |
|
|
|
let org = this.customerOrgTreeAll.filter(e => { |
|
|
|
return e.label.indexOf(value) > -1 || e.simpleCode.indexOf(value.toUpperCase()) > -1 |
|
|
|
}) |
|
|
|
this.customerOrgTreeSeo = org.slice(0,100) |
|
|
|
}else{ |
|
|
|
this.customerOrgTreeSeo = this.customerOrgTreeAll.slice(0,100) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//获取体检单位列表树信息 |
|
|
|
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) |
|
|
|
} |
|
|
|
}); |
|
|
|
getDBCom('orgDatasQuery') |
|
|
|
.then(localData => { |
|
|
|
let now = Date.now() |
|
|
|
// 24小时 = 86400000 毫秒 |
|
|
|
if (localData?.createdat && now - 43200000 < localData.createdat) { |
|
|
|
this.orgDatasQuery = localData.data |
|
|
|
// console.log('this.orgDatas.length',this.orgDatas.length) |
|
|
|
if (this.orgDatasQuery.length > 0) { |
|
|
|
let treeData = reMadeOrgTree(deepCopy(this.orgDatasQuery)); |
|
|
|
this.customerOrgTreeAll = treeData; |
|
|
|
this.customerOrgTreeSeo = treeData.slice(0, 100) |
|
|
|
} |
|
|
|
} else { |
|
|
|
getapi("/api/app/customerorg/getbycodeall").then((res) => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.orgDatasQuery = res.data |
|
|
|
let treeData = reMadeOrgTree(deepCopy(this.orgDatasQuery)); |
|
|
|
this.customerOrgTreeAll = treeData; |
|
|
|
this.customerOrgTreeSeo = treeData.slice(0, 100) |
|
|
|
setDBCom('orgDatasQuery', res.data) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//获取体检单位父级ID api/app/customer-org/parent/[CustomerOrgld |
|
|
|
@ -226,13 +255,6 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//点击树节点 |
|
|
|
treeclick(data) { |
|
|
|
this.patientRegister.query.customerOrgId = data.id; |
|
|
|
this.getCustomerOrgParentId(data.id); |
|
|
|
this.patientRegister.query.times++; //用于触发查询条件 |
|
|
|
}, |
|
|
|
|
|
|
|
//树控件--伪双击事件 |
|
|
|
handleNode(data, node, prop) { |
|
|
|
// console.log(data, node, prop); |
|
|
|
@ -480,22 +502,22 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
"filterText"(newVal, oldVal) { |
|
|
|
"filterText"(newVal, oldVal) { |
|
|
|
if (newVal != oldVal) { |
|
|
|
if (this.isOnlyCus == 'N') { |
|
|
|
this.$refs['customerOrgTree'].filter(newVal); |
|
|
|
} else { |
|
|
|
// 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) |
|
|
|
} |
|
|
|
} |
|
|
|
// "isOnlyCus"(newVal, oldVal) { |
|
|
|
// if (newVal == 'N') { |
|
|
|
// this.$refs['customerOrgTree'].filter(this.filterText); |
|
|
|
// } else { |
|
|
|
// this.filterParentNode(this.filterText) |
|
|
|
// } |
|
|
|
// } |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|